Patent Description:
As a technology that saves data storage space in a storage system, deduplication is quickly proliferating and has high market value. Inline deduplication removes redundancies from data before the data is written to a hard disk, to achieve data reduction. An advantage is that a number of write times of a hard disk can be reduced. However, for the inline deduplication, it needs to query whether a fingerprint table includes a fingerprint same as that of a data block. The fingerprint query can cause a large quantity of resource overheads and affect performance of the storage system. <CIT> describes a method for combining online deduplication and offline deduplication ratio according to the system load. <CIT> describes data storage technologies, and in particular, a data deduplication method that chooses a suitable deduplication manner (front-end or back-end) by comparing the first load information (front-end load) and the second load information (back-end load).

The present invention provides a data processing method in a storage system, to reduce resource overheads of the storage system and improve storage performance of the storage system.

The following describes technical solutions in embodiments of the present invention with reference to accompanying drawings.

First, a storage system applicable to the embodiments of the present invention is described.

As shown in <FIG>, the storage system in this embodiment of the present invention may be a storage array (for example, the Oceanstor®<NUM> series and the Oceanstor® Dorado® series of Huawei®). The storage array includes a storage controller <NUM> and a plurality of hard disks, and the hard disk includes a solid state drive (Solid State Disk, SSD), a disk, or the like. As shown in <FIG>, the storage controller <NUM> includes a central processing unit (Central Processing Unit, CPU) <NUM>, a memory <NUM>, and an interface <NUM>. The memory <NUM> stores a computer instruction. The CPU <NUM> executes the computer instruction in the memory <NUM> to perform management and data access operations on the storage system. In addition, the processor <NUM> may be a central processing unit (Central Processing Unit, CPU), or may be a field programmable gate array (Field Programmable Gate Array, FPGA), or other hardware may be used as a processor, or an FPGA or other hardware and a CPU together are used as a processor, and the processor communicates with the interface <NUM>. The memory <NUM> in the embodiments of the present invention may provide a memory for the CPU. The interface <NUM> may be a network interface card (Networking Interface Card, NIC), a host bus adapter (Host Bus Adapter, HBA), or the like.

In the storage array described in <FIG>, the controller <NUM> is configured to perform the data processing method in the embodiments of the present invention.

Further, the storage system in the embodiments of the present invention may also be a distributed storage system (for example, Fusionstorage® series of Huawei®). Fusionstorage® series of Huawei® is used as an example. For example, as shown in <FIG>, the distributed storage system includes a plurality of servers, such as a server <NUM>, a server <NUM>, a server <NUM>,. , and a server <NUM>. The servers communicate with each other over an infinite bandwidth (InfiniBand) or an Ethernet network. In actual application, a quantity of servers in the distributed storage system may be increased or decreased based on an actual requirement. This is not limited in this embodiment of the present invention. The server in the distributed storage system is also referred to as a storage node.

The server in the distributed storage system includes a structure shown in <FIG>. As shown in <FIG>, each server in the distributed storage system includes a central processing unit (Central Processing Unit, CPU) <NUM>, a memory <NUM>, an interface <NUM>, a hard disk <NUM>, a hard disk <NUM>, and a hard disk <NUM>. The memory <NUM> stores a computer instruction, and the CPU <NUM> executes the program instruction in the memory <NUM> to perform a corresponding operation. The interface <NUM> may be a hardware interface, for example, a network interface card (Network Interface Card, NIC) or a host bus adapter (Host Bus Adaptor, HBA), or may be a program interface module. The hard disk includes a solid state drive (Solid State Disk, SSD), a disk, or the like. In addition, the processor <NUM> may be a central processing unit (Central Processing Unit, CPU), or may be a field programmable gate array (Field Programmable Gate Array, FPGA), or other hardware may be used as a processor, or a combination of an FPGA (or other hardware) and a CPU is used as a processor. The memory <NUM> in the embodiments of the present invention may provide a memory for the CPU <NUM>. The interface <NUM> may be a network interface card (Networking Interface Card, NIC), or a host bus adapter (Host Bus Adaptor, HBA).

The storage system receives data and divides the data into data blocks. The data can be divided into data blocks with a fixed length or data blocks with variable lengths according to different division methods. A fingerprint of the data block (for example, a hash operation is performed on the data block, and a hash value obtained through the operation is used as the fingerprint of the data block) is obtained, and a deduplication operation is performed based on the fingerprint of the data block. Specifically, the deduplication includes: querying whether a fingerprint table includes a same fingerprint (which means that a data block represented by the fingerprint exists in the storage system), if the fingerprint table does not include the fingerprint (which means that a data block represented by the fingerprint does not exist in the storage system), allocating a storage address in the storage system and storing the data block at the storage address, adding a new fingerprint entry to the fingerprint table, that is, establishing mapping between the fingerprint and the storage address, and establishing metadata of the data block, that is, establishing mapping between a logical block address of the data block and the fingerprint. When the data block with the same fingerprint is written into the storage system again, the storage system only needs to establish mapping between a logical block address of the data block that is written again and the fingerprint in the fingerprint table, and does not need to store the data block that is written again. This avoids repeated storage of the same data block. A fingerprint entry of the fingerprint table is shown in <FIG>, and includes a fingerprint A and a storage address SD for storing data corresponding to the fingerprint. The fingerprint entry may further include a reference count, and the reference count is used to indicate a quantity of data blocks of the fingerprint that is pointed to. For example, when the storage system stores the data block for the first time, the reference count is <NUM>. When the storage system stores the data block for the second time, the reference count is updated to <NUM>.

In the storage system, to query the fingerprint table, the fingerprint table needs to be stored in a memory. To reduce memory usage of the fingerprint table, not all fingerprint tables are loaded in the memory. Therefore, in a deduplication process, the storage system queries and loads a corresponding fingerprint table based on a relationship between fingerprint distribution and the fingerprint table. The foregoing operation process may increase overheads of the storage system. For example, cross-network querying may increase network overheads. A fingerprint query process may also increase resource overheads in the storage system and increase load of the storage system. Resource overheads in this embodiment of the present invention include, for example, overheads of a processor and overheads of a memory. The increasing of overheads may affect performance of the storage system.

In this embodiment of the present invention, to reduce resource overheads of the storage system and improve storage performance of the storage system, whether to perform an inline deduplication operation or reduce a quantity of times of an inline deduplication operation is determined based on the load of the storage system. In this embodiment of the present invention, a load threshold may be set. The storage system calculates the fingerprint of the data block, and when the load of the storage system is less than the load threshold, the storage system queries the fingerprint table to perform the inline deduplication operation on the data block. A specific implementation process includes: querying whether the fingerprint table includes the fingerprint, and when the fingerprint table includes the fingerprint, skipping storing the data block, and establishing mapping between a logical address of the data block and the fingerprint in the fingerprint table; or when the fingerprint table does not include the fingerprint, storing the data block, adding a new fingerprint entry to the fingerprint table, and establishing mapping between a logical address of the data block and the fingerprint in the new fingerprint entry. The new fingerprint entry includes mapping between the fingerprint and a storage address for storing the data block.

When the load of the storage system is greater than the load threshold, the inline deduplication operation is not performed, the data block is directly stored, and mapping between a logical address and a storage address of the data block is established. A mapping entry between the fingerprint of the data block and the storage address of the data block is recorded in a log. The mapping entry includes mapping between the fingerprint of the data block and the storage address of the data block. In this embodiment of the present invention, the storage address is a location of the data block in the storage system. The logical address of the data block is an address that is accessed by a host, for example, a logical block address (Logical Block Address, LBA). In this embodiment of the present invention, the deduplication operation before the storage system stores the data block is referred to as an inline deduplication operation. The deduplication operation performed on the data block stored in the storage system is referred to as a post-deduplication operation.

In this embodiment of the present invention, whether to perform the inline deduplication operation is determined based on the load of the storage system. A specific procedure is shown in <FIG>.

Step <NUM>: Calculate a first fingerprint of a first data block.

Step <NUM>: When a storage system is under a first load, perform an inline deduplication operation on the first data block by querying a fingerprint table based on the first fingerprint.

Step <NUM>: Calculate a second fingerprint of a second data block.

Step <NUM>: When the storage system is under a second load, directly store the second data block without performing the inline deduplication operation.

Step <NUM>: Record a mapping entry between the second fingerprint and a first storage address of the second data block.

In this embodiment of the present invention, to prevent the fingerprint from being lost, when no inline deduplication operation is performed, a mapping entry between the fingerprint of the second data block and the first storage address is persistently stored in a log. In this embodiment of the present invention, the first load is less than the second load. For example, the second load is greater than a load threshold, and the first load is less than the load threshold. The mapping entry between the second fingerprint and the first storage address of the second data block includes mapping between the second fingerprint and the first storage address of the second data block.

Whether to perform the inline deduplication operation is determined based on the load of the storage system. This can reduce resource overheads of the inline deduplication, reduce the load of the storage system, and improve performance of the storage system.

In another implementation of this embodiment of the present invention, a plurality of load thresholds may be set, so that different operations are performed in different load ranges. For example, when the storage system is in a highest load range, the inline deduplication operation is not performed on all data blocks, but the data blocks are directly stored in the storage system. In one implementation, an inline deduplication function may be disabled. When the storage system is in a minimum load range, the inline deduplication operation is performed on all data blocks, and then a unique data block that is determined to be stored after the inline deduplication operation is performed, namely, a data block with unique content is stored. When the load of the storage system is between the maximum load and the minimum load, a quantity of times of the inline deduplication operation can be reduced. In specific implementation, for example, only one load threshold may be set, for example, <NUM>%. When the load is greater than <NUM>%, the storage system does not perform the inline deduplication operation on the data block. When the load is less than or equal to <NUM>%, the storage system performs the inline deduplication operation on the data block. In another implementation of this embodiment of the present invention, when there are a plurality of load thresholds, for example, <NUM>% and <NUM>%, loads may be divided into three load ranges. For example, if a load range <NUM> includes load that is greater than <NUM>%, the load range <NUM> is denoted as (<NUM>%-<NUM>%). If a load range <NUM> includes load that is greater than <NUM>% but not greater than <NUM>%, the load range <NUM> is denoted as (<NUM>%-<NUM>%]. If a load range <NUM> includes load that is not greater than <NUM>%, the load range <NUM> is denoted as (<NUM>-<NUM>%]. In this embodiment of the present invention, the load may also be represented in another form.

The load in this embodiment of the present invention may be specifically CPU usage, memory usage, network performance, or the like in the storage system, or may be one or more of these parameters. This is not limited in this embodiment of the present invention.

In this embodiment of the present invention, in the step <NUM>, the mapping entry between the second fingerprint and the first storage address of the second data block is recorded. A specific implementation may be persistently storing in a form of the log. This can prevent fingerprint information from being lost, to help perform the deduplication operation. In another implementation, storage may also be performed in a form of an index table.

In this embodiment of the present invention, whether to perform the inline deduplication operation on the data block is determined based on the load of the storage system. Therefore, there is a case in which a data block is directly stored without being performed the inline deduplication operation. To further save and release storage space, in this embodiment of the present invention, a post-deduplication operation is further performed on the data block. The post-deduplication operation is a deduplication operation performed on a data block that has been stored in the storage system. With reference to the embodiment shown in <FIG>, an embodiment of the present invention as shown in <FIG> includes the following steps.

Step <NUM>: Query, based on a second fingerprint, whether a first fingerprint entry in a fingerprint table includes the second fingerprint.

The first fingerprint entry includes mapping between the second fingerprint and a second storage address, and the second storage address stores a data block that has same content as the second data block.

Step <NUM>: When the fingerprint table includes the first fingerprint entry, establish mapping between a logical address of the second data block and the second fingerprint in the first fingerprint entry.

Step <NUM>: When the fingerprint table does not include the first fingerprint entry, add a second fingerprint entry to the fingerprint table, where the second fingerprint entry includes mapping between the second fingerprint and a third storage address, and the third storage address is used to store the second data block migrated by the storage system from the first storage address.

In another implementation, the second fingerprint entry includes mapping between the second fingerprint and the first storage address.

Step <NUM>: Establish mapping between the logical address of the second data block and the second fingerprint.

The second fingerprint in the mapping between the logical address of the second data block and the second fingerprint is the second fingerprint in the first fingerprint entry or the second fingerprint in the second fingerprint entry.

Further, the embodiment shown in <FIG> further includes: deleting the mapping entry between the second fingerprint and the first storage address. After deduplication is performed, the mapping entry that records the second fingerprint and the first storage address is deleted. In this embodiment of the present invention, the mapping entry between the second fingerprint and the first storage address is persistently recorded in a form of a log. In the log, there may be a plurality of mapping entries that all include the second fingerprint, but data blocks corresponding to all the second fingerprints are stored at different locations in the storage system. In other words, storage addresses in the plurality of mapping entries are different. In the log, if the plurality of mapping entries all include the second fingerprint, it indicates that an inline deduplication operation is not performed on a plurality of data blocks, and the plurality of data blocks are directly stored in the storage system. The mapping entry in the log may be clustered based on the fingerprint. To be specific, mapping entries with a same fingerprint are arranged together. In this way, data blocks that have same content and on which no inline deduplication operation is performed can be determined. Then, step <NUM> to step <NUM> are performed. There are a plurality of mapping entries with a same fingerprint, for example, the second fingerprint, and accordingly, there are a plurality of same data blocks. If all these data blocks each are a valid data block, mapping between a logical address of each of the data blocks and the second fingerprint in the fingerprint table is separately established. The valid data block is a data block that is not modified, or a data block whose mapping between a logical address of the data block and a storage address of the data block is valid before a post-deduplication operation is performed. Further, after the deduplication operation is performed, the plurality of mapping entries in the log are deleted. In another implementation of this embodiment of the present invention, before the post-deduplication operation is performed, the plurality of mapping entries in the log are deleted.

A plurality of mapping entries with a same fingerprint, for example, the second fingerprint, are recorded in the log. The storage addresses in the plurality of mapping entries are different. These storage addresses may be located on a plurality of storage nodes that use distributed storage. Data blocks at the storage addresses may be data blocks that are stored after being compressed. These data blocks may be compressed by using different compression algorithms. In other words, a compression rate and compression performance of a compression algorithm used by each data block varies.

The storage address in the fingerprint entry of the fingerprint table provided in this embodiment of the present invention is dedicated storage space allocated by the storage system, and is used to store a data block on which the deduplication operation (inline deduplication and post-deduplication) is performed. Therefore, for a data block that is directly stored and on which the inline deduplication operation is not performed, a corresponding fingerprint is not found in the fingerprint table after the post-deduplication operation is performed, and the data block needs to be migrated to storage space dedicated to store a data block on which the deduplication operation is performed. For example, in the step <NUM> in the embodiment shown in <FIG>, when the fingerprint table does not include the first fingerprint entry, a second fingerprint entry is added to the fingerprint table, where the second fingerprint entry includes mapping between the second fingerprint and a third storage address, and the third storage address is used to store the second data block migrated by the storage system from the first storage address.

In a scenario in which the plurality of mapping entries with the same fingerprint are recorded in the log, when it is determined that the same fingerprint is a new fingerprint in the storage system, one storage address is selected from a plurality of storage addresses in the plurality of mapping entries, a data block at the selected storage address is migrated to storage space, for example third storage space in the step <NUM>, dedicated to store a data block on which the deduplication operation is performed. A new fingerprint entry is established in the fingerprint table. For example, in step <NUM>, the fingerprint entry includes mapping between the second fingerprint and the third storage address. When a data block that needs to be migrated is selected from the plurality of data blocks with the same fingerprint, the to-be-migrated data block is selected based on factors such as whether the data block is compressed, a compression rate of the data block, a distance between the data block and storage space dedicated to store a data block on which the deduplication operation is performed. In other words, the to-be-migrated data block is a data block that needs to be reserved after the post-deduplication operation is performed. A compressed data block is preferentially used as a to-be-migrated data block than a decompressed data block. A data block that is compressed by using a compression algorithm with a high compression rate is preferentially used as a to-be-migrated data block than a data block that is compressed by using a compression algorithm with a low compression rate. A data block that has a short distance from migrating to storage space dedicated to store a data block on which the deduplication operation is performed is preferentially used as a to-be-migrated data block than a data block that has a long distance from migrating to storage space dedicated to store a data block on which the deduplication operation is performed. When the to-be-migrated data block is selected based on the at least two factors, priorities in descending order are as follows: a data block that has a short distance from migrating to storage space dedicated to store a data block on which the deduplication operation is performed and that is compressed by using a compression algorithm with a high compression rate, a data block that has a long distance from migrating to storage space dedicated to store a data block on which the deduplication operation is performed and that is compressed by using a compression algorithm with a high compression rate, a data block that has a short distance from migrating to storage space dedicated to store a data block on which the deduplication operation is performed and that is compressed by using a compression algorithm with a low compression rate, a data block that has a long distance from migrating to storage space dedicated to store a data block on which the deduplication operation is performed and that is compressed by using a compression algorithm with a low compression rate, a data block that has a short distance from migrating to storage space dedicated to store a data block on which the deduplication operation is performed and that is not compressed, and a data block that has a long distance from migrating to storage space dedicated to store a data block on which the deduplication operation is performed and that is not compressed. In this embodiment of the present invention, in a process of migrating the compressed data block, the data block does not need to be decompressed. In this embodiment of the present invention, the distance from migrating to the storage space dedicated to store the data block on which the deduplication operation is performed is a distance between a storage node on which a storage address of a current storage data block is located and a storage node on which the storage space dedicated to store a data block on which the deduplication operation is performed is located. For example, whether the data block needs to be migrated across a network (for example, whether the storage address of the current storage data block and the storage space dedicated to store the data block are on a same storage node) and a quantity of hops in the network. In this embodiment of this application, the data block migration policy can be used to reduce resource consumption of the storage system in a data migration process and to improve performance of the storage system.

A solution of selecting the to-be-migrated data block in this embodiment of the present invention may also be applied to a solution in which the log is not used. This is not limited in this embodiment of the present invention.

In this embodiment of the present invention, the post-deduplication operation may also be performed based on the load of the storage system. This improves performance of the storage system.

Based on the foregoing embodiment, an embodiment of the present invention provides a data processing device. The data processing device includes a calculation unit <NUM>, a deduplication unit <NUM>, a storage unit <NUM>, and a recording unit <NUM>, where the calculation unit <NUM> is configured to calculate a first fingerprint of a first data block; the inline deduplication unit <NUM> is configured to: when the storage system is under a first load, perform an inline deduplication operation on the first data block by querying a fingerprint table based on the first fingerprint, where the calculation unit <NUM> is further configured to calculate a second fingerprint of a second data block; the storage unit <NUM> is configured to: when the storage system is under a second load, directly store the second data block without performing the inline deduplication operation, where the first load is less than the second load; and the recording unit <NUM> is configured to record a mapping entry between the second fingerprint and a first storage address of the second data block, where the mapping entry is used to record mapping between the second fingerprint and the first storage address of the second data block.

Further, the data processing device shown in <FIG> further includes:.

Further, the data processing device further includes:
a deletion unit, configured to delete the mapping entry between the second fingerprint and the first storage address of the second data block.

Further, the recording unit <NUM> is specifically configured to record, in a log, the mapping entry between the second fingerprint and the first storage address of the second data block.

Further, the data processing device further includes:.

Further, the data processing device further includes a deletion unit, and the deletion unit is configured to delete the plurality of mapping entries.

Further, the processing device further includes a selection unit, and the selection unit is configured to select the first storage address from the storage addresses in the plurality of mapping entries according to a migration policy, and migrate the second data block at the first storage address to the third storage address.

The present invention provides a computer-readable storage medium. The computer-readable storage medium stores an instruction, and when a processor runs the instruction, the processor is configured to perform functions of the data processing device in the embodiments of the present invention.

The present invention provides a computer program product including an instruction. When a processor runs the instruction in the computer program product, the processor is configured to perform functions of the data processing device in the embodiments of the present invention.

For specific implementations of the data processing device, the computer-readable storage medium, and the computer program product provided in the embodiments of the present invention, refer to the foregoing descriptions in the embodiments of the present invention.

It may be understood that the memory mentioned in the embodiments of the present invention may be a volatile memory or a nonvolatile memory, or may include a volatile memory and a nonvolatile memory. The nonvolatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), or a flash memory. The volatile memory may be a random access memory (Random Access Memory, RAM), used as an external cache. Through example but not limitative description, many forms of RAMs may be used, for example, a static random access memory (Static RAM, SRAM), a dynamic random access memory (Dynamic RAM, DRAM), a synchronous dynamic random access memory (Synchronous DRAM, SDRAM), a double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), an enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), a synchlink dynamic random access memory (Synchlink DRAM, SLDRAM), and a direct rambus random access memory (Direct Rambus RAM, DR RAM).

It should be noted that when the processor is a general-purpose processor, a DSP, an ASIC, an FPGA, or another programmable logic device, discrete gate, transistor logic device, or discrete hardware component, the memory (storage module) may be integrated into the processor.

It should be noted that the memory described in this specification includes but is not limited to these and any memory of another proper type.

A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of the present invention, which is, however, covered by the appended claims.

In the several embodiments provided in the present invention, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, division into units is merely logical function division and may be other division in actual implementation.

Claim 1:
A data processing method in a distributed storage system, wherein the method comprises:
receiving data and dividing the received data into a plurality of data blocks, the plurality of data blocks comprising a first data block and a second data block;
calculating a first fingerprint of the first data block;
performing an inline deduplication operation on the first data block when the storage system is under a first load, by querying a fingerprint table based on the first fingerprint, wherein performing the inline deduplication operation specifically comprises:
loading the fingerprint table into a memory of the storage system based on a relationship between fingerprint distribution and the fingerprint table;
querying whether the fingerprint table includes a fingerprint that is the same as the fingerprint of the first data block;
storing the obtained data block and adding a new fingerprint entry to the fingerprint table when the fingerprint table does not include the same fingerprint of the first data block; and
do not store the obtained data block when the fingerprint table includes the same fingerprint; and calculating a second fingerprint of the second data block;
skipping performing an inline deduplication operation on the second data block when the storage system is under a second load, wherein the second load is higher than the first load, wherein the first load and the second load each comprise on of CPU usage, memory usage, and network performance; and
recording a mapping entry between the second fingerprint and a first storage address of the second data block;
storing the second data block; and
performing a post-deduplication operation on the stored second data block, the post-deduplication operation is initiated based on a load of the storage system.