Data processing method and device in storage system and storage system

By sending data chunking and metadata to the data storage node in the storage system, and sending the verification chunking and metadata to the verification storage node, parallel backup of metadata is realized, solving the problem of excessive write operation time and improving the writing efficiency of the storage system.

CN113544635BActive Publication Date: 2025-03-14HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201980092966.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-09
Publication Date
2025-03-14
Estimated Expiration
2039-09-09

AI Technical Summary

Technical Problem

In a storage system, the problem of writing operation time is mainly because the storage node needs to wait for the metadata backup to be successful before writing data to the storage device in chunks.

Method used

The data blocks and metadata are sent to the data storage node through the client, and the verification blocks and metadata are sent to the verification storage node, thereby realizing the backup of metadata on the verification storage node, reducing the time of writing operations.

Benefits of technology

This method improves the efficiency of saving metadata copy of data chunking and significantly reduces the time of write operations by processing data chunking and backing up metadata in parallel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113544635B_ABST
    Figure CN113544635B_ABST
Patent Text Reader

Abstract

A data processing method and a storage system in a storage system relate to the technical field of data storage. The client sends data blocks and metadata of the data blocks in a stripe to a data storage node, and sends the metadata of the data blocks and a check block to a check storage node, thereby backing up the metadata of the data blocks on the check storage node, thereby reducing the time of the write operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data storage, and in particular to a data processing method, device and storage medium in a storage system. Background Art

[0002] The target device in the storage system may use erasure coding (EC) technology to write the business data to be written in the form of stripes to the storage device on the corresponding storage node in the storage system.

[0003] The client writing data can be the following process: the storage system client divides the business data to be written into data blocks according to the size of the stripe unit in the stripe, and generates check blocks for the data blocks according to the EC algorithm. The client sends the data blocks and the metadata of the data blocks to the storage node that stores the data blocks, and the client sends the check blocks to the storage node that stores the check blocks. After the storage device receives the data blocks and the metadata of the data blocks, it backs up the metadata of the data blocks to the storage node that stores the metadata of the data blocks according to the backup strategy. When the metadata of the data blocks is successfully backed up to the storage node that stores the metadata of the data blocks, the storage node writes the data blocks to the corresponding storage device of the storage node according to the storage location indicated by the metadata, and returns a successful write response to the client.

[0004] In the above data writing process, the storage node needs to wait for the metadata backup to be successful before writing the data blocks to the storage device, which causes the write operation to take too long. Summary of the invention

[0005] The embodiments of the present application provide a data processing method in a storage system, a storage system, a computer device, and a storage medium to overcome the problem of long write operation time existing in the related art.

[0006] In a first aspect, the present application provides a data processing method in a storage system, wherein the storage system includes a client, a data storage node, and a verification storage node; the method includes:

[0007] The client sends the data blocks in the stripe and the metadata of the data blocks to the data storage node:

[0008] The client sends the check blocks in the stripe and the metadata of the data blocks to the check storage node; wherein the check blocks are generated based on the data blocks and the check algorithm in the stripe; a check block and a data block in the stripe are of the same size and equal to the size of the stripe unit in the stripe; the metadata of the data block includes a correspondence between a user access address of the data block and a stripe unit identifier in the stripe that stores the data block.

[0009] In the above implementation method, the client sends the data blocks and metadata of the data blocks in the stripe to the data storage node, and sends the metadata of the data blocks and the verification blocks to the verification storage node, so that the metadata of the data blocks is backed up on the verification storage node, thereby reducing the time of the write operation.

[0010] In a possible implementation, the metadata of the data block further includes a timestamp.

[0011] In a possible implementation, the client obtains the timestamp of the data block;

[0012] The timestamp of a new data block is determined according to the timestamp; wherein the new data block has the same user access address as the data block.

[0013] In a second aspect, the present application provides a data processing method in a storage system, wherein the storage system includes a client, a data storage node, a metadata storage node, and a verification storage node; the method includes:

[0014] The data storage node receives a write request sent by the client; the write request includes data blocks of a stripe of a storage device in the data storage node and metadata of the data blocks; wherein the check blocks of the stripe are stored on the storage device of the check storage node; the memory of the check storage node is also used to store the metadata of the data blocks and record the metadata write operation of the data blocks in a log; the check blocks are generated according to the data blocks and the check algorithm in the stripe; a check block and a data block in the stripe are of the same size and are equal to the size of the stripe unit in the stripe; the metadata of the data blocks includes the correspondence between the user access address of the data block and the stripe unit identifier storing the data block in the stripe;

[0015] The data storage node sends a write request response to the client; the write request response is used to indicate completion of the write request operation.

[0016] Based on the above implementation, since the metadata of the data block is written to the verification storage device by the client when writing the verification block to the verification storage device, the efficiency of storing the metadata copy of the data block is improved, thereby reducing the write operation time.

[0017] In a possible implementation, the method further includes: after the data storage node sends a write request response to the client, the data storage node stores the metadata of the data block in the metadata storage node.

[0018] In a possible implementation, the metadata of the data block further includes a timestamp; the method further includes:

[0019] The data storage node notifies the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block contains the same user access address as the data block; and the timestamp of the old data block is earlier than the timestamp of the metadata of the data block.

[0020] Based on the above possible implementation manner, the metadata of the old data blocks with the same user access address are eliminated from the memory of the verification storage node, thereby releasing the memory space of the verification storage node.

[0021] In a possible implementation, the method further includes:

[0022] When the data storage node recovers from the failure, the data storage node obtains the write operation of the metadata of the data block containing the user access address in the log from the verification storage node;

[0023] Determine the metadata of the data block with the latest timestamp from the write operation of the metadata of the data block of the user access address in the log;

[0024] The metadata of the data block with the latest timestamp is used as the metadata of the data block corresponding to the user access address.

[0025] Based on the possible implementation manner described above, the storage node selects the metadata of the data block with the latest timestamp from the metadata of the data blocks accessed by the same user as the metadata of the latest data block, thereby ensuring data consistency.

[0026] In a third aspect, the present application provides a data processing method in a storage system, wherein the storage system includes a client, a data storage node, a metadata storage node, and a verification storage node; the method includes:

[0027] The check storage node receives a write request sent by the client; the write request includes metadata of data blocks and check blocks of the stripe of the storage device written to the data storage node; wherein the check block is generated according to the data blocks and the check algorithm in the stripe; a check block and a data block in the stripe are of the same size and equal to the size of the stripe unit in the stripe; the metadata of the data block includes a correspondence between a user access address of the data block and an identifier of the stripe unit storing the data block in the stripe;

[0028] The verification storage node caches the data blocks in memory and records the write operation of the metadata of the data blocks in a log.

[0029] In a possible implementation, the metadata of the data block further includes a timestamp.

[0030] In a possible implementation, the method further includes:

[0031] The verification storage node receives a notification sent by the data storage node; the notification is used to instruct the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block contains the same user access address as the data block; the timestamp of the old data block is earlier than the timestamp of the metadata of the data block;

[0032] The verification storage node deletes the metadata of the old data block in the memory and the write operation of the metadata of the old data block recorded in the log according to the notification.

[0033] In a possible implementation, the method further includes:

[0034] The verification storage node receives a log acquisition request sent by the data storage node; the log acquisition request is used to obtain a write operation of metadata of a data block containing the user access address in the log from the verification storage node;

[0035] The check storage node sends a write operation of metadata of the data block containing the user access address to the data storage node.

[0036] In a fourth aspect, the present application provides a storage system, the storage system comprising a data storage node and a verification storage node;

[0037] The data storage node is used for:

[0038] Receive a first write request sent by the client; the first write request includes data blocks of a stripe of a storage device in the data storage node and metadata of the data blocks; the metadata of the data blocks includes a correspondence between a user access address of the data block and an identifier of a stripe unit storing the data block in the stripe;

[0039] Sending a write request response to the client; the write request response is used to indicate completion of the first write request;

[0040] The check storage node is used to receive a second write request sent by the client; the second write request includes metadata of the data block and a check block; wherein the check block is generated according to the data block and the check algorithm in the stripe; a check block and a data block in the stripe have the same size and are equal to the size of the stripe unit in the stripe;

[0041] The data blocks are cached in the memory of the verification storage node and the write operation of the metadata of the data blocks is recorded in the log.

[0042] In a possible implementation, the data storage node is further configured to store the metadata of the data block in the metadata storage node after sending a write request response to the client.

[0043] In a possible implementation, the metadata of the data block further includes a timestamp;

[0044] The data storage node is also used to notify the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block contains the same user access address as the data block; and the timestamp of the old data block is earlier than the timestamp of the metadata of the data block.

[0045] The verification storage node is further used to receive a notification sent by the data storage node, and delete the metadata of the old data block in the memory and the write operation of the metadata of the old data block recorded in the log according to the notification.

[0046] Based on the above possible implementation manner, the metadata of the old data blocks with the same user access address are eliminated from the memory of the verification storage node, thereby releasing the memory space of the verification storage node.

[0047] In a fifth aspect, the present application provides a client, comprising a processor and an interface, wherein the processor communicates with the interface, and the processor is used to execute operations performed in order to implement the operations performed in the first aspect or any one of the methods provided in the first aspect.

[0048] In a sixth aspect, the present application provides a data storage node, comprising a processor and an interface, the processor communicating with the interface, the processor being configured to execute operations performed in accordance with the second aspect or any one of the methods provided in the second aspect.

[0049] In a seventh aspect, the present application provides a verification storage node, which includes a processor and an interface, the processor communicating with the interface, and the processor being used to execute operations performed to implement the above-mentioned third aspect or any one of the methods provided in the third aspect.

[0050] In an eighth aspect, the present application provides a data processing device in a storage system, which is used to execute the data processing method in the storage system. Specifically, the data processing device in the storage system includes a module for executing the data processing method in the storage system provided in the first aspect or any optional manner of the first aspect.

[0051] In a ninth aspect, the present application provides a data processing device in a storage system, for executing the data processing method in the storage system. Specifically, the data processing device in the storage system includes a module for executing the data processing method in the storage system provided in the second aspect or any optional manner of the second aspect.

[0052] In a tenth aspect, the present application provides a data processing device in a storage system, which is used to execute the data processing method in the storage system. Specifically, the data processing device in the storage system includes a module for executing the data processing method in the storage system provided in the third aspect or any optional manner of the third aspect.

[0053] In an eleventh aspect, the present application provides a storage medium storing at least one instruction, which is loaded and executed by a processor to implement the operations performed by the first aspect or any method provided in the first aspect.

[0054] In a twelfth aspect, the present application provides a storage medium storing at least one instruction, which is loaded and executed by a processor to implement operations performed by the above-mentioned second aspect or any method provided in the second aspect.

[0055] In a thirteenth aspect, the present application provides a storage medium storing at least one instruction, which is loaded and executed by a processor to implement operations performed by the third aspect or any method provided in the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 is a schematic diagram of a storage system provided in an embodiment of the present application;

[0057] Figure 2 is a structural schematic diagram of a computer device provided in an embodiment of the present application;

[0058] Figure 3 is a flow chart of a data processing method in a storage system provided by an embodiment of the present application;

[0059] Figure 4 is a structural diagram of a data processing device in a storage system provided by an embodiment of the present application;

[0060] Figure 5 is a structural diagram of a data processing device in a storage system provided by an embodiment of the present application;

[0061] Figure 6 It is a structural diagram of a data processing device in a storage system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0063] Figure 1 is a schematic diagram of a storage system provided in an embodiment of the present application, see Figure 1 , the storage system includes a client 101, a management device 102 and a storage node 103. In order to ensure the redundancy of the storage system, the storage system can store the user's business data in the form of stripes. For a stripe, it can include N+M blocks, where there are N data blocks and M check blocks. The data blocks are used to store the user's business data (business data to be written), and the check blocks are used to store the check data of the business data, where N and M are positive integers greater than 0. Both the data blocks and the check blocks are called blocks.

[0064] The client 101 is responsible for writing and reading business data. The client can request the management device 102 to allocate a stripe. The stripe includes multiple stripe units, each of which is used to store a block. The multiple stripe units of the stripe form an erasure coding (EC) relationship. The multiple stripe units in a stripe are of the same size. Each stripe unit has a stripe unit identifier. The management device 102 records the corresponding relationship between the identifier of the stripe unit of a stripe and the storage device in the storage node 103 that provides the stripe unit storage space. The client 101 requests the management device 102 to allocate a stripe, and the management device 102 allocates a stripe to the client and provides the identifier of the stripe unit in the stripe. The client then divides the business data into data blocks according to the size of the stripe unit, and generates a check block for the data block according to the EC algorithm. The size of the data block and the check block are the same and equal to the size of the stripe unit. When a user sends business data to the client 101, it will carry the user access address corresponding to the business data. For example, it may be a logical block address (LBA) address. In other scenarios, it may also be other identifiers that can be recognized by the user, which is not limited in the embodiments of the present application. In the embodiments of the present application, the user refers to a device that writes business data or reads business data. The client 101 divides the business into data blocks, and each data block has a corresponding user access address. The client 101 records the correspondence between the user access address of the data block and the stripe unit identifier of the stripe unit storing the data block according to the stripe unit identifier of the stripe assigned by the management device 102, that is, records the metadata of the data block, wherein the metadata of the block is used to indicate the storage location of the block, and the metadata of the block may include the storage location of the stripe unit storing the block on the storage node 103. Further, in the embodiments of the present application, the storage system also includes a partition view, which is used to record the corresponding relationship between the stripe units of all stripes in a partition and the storage device of the storage node 103 that provides storage space for the stripe unit of the stripe. The specific implementation may be the correspondence between the stripe unit identifier and the storage device identifier. Therefore, after the management device 102 allocates the stripe, the client 101 can write the data block and the check block into the storage device corresponding to the corresponding stripe identifier according to the stripe identifier of the stripe.

[0065] The storage device in the embodiment of the present application may be a mechanical hard disk or a solid state hard disk. Among them, the business data may include block data, file data or object data, etc. The embodiment of the present application does not limit the specific content of the business data.

[0066] In the embodiment of the present application, the storage node 103 used to provide a storage device and store data blocks is called a data storage node, and the storage node 103 used to provide a storage device and store verification blocks is called a verification storage node.

[0067] In combination with the above description of each device in the storage system, an embodiment of the present application provides a data writing method, wherein the client 101 sends a stripe allocation request to the management device 102, and the stripe allocation request is used to indicate a request to allocate a stripe. Based on the stripe allocation request, the management device 102 returns stripe information to the client 101, and the stripe information carries an identifier of a stripe unit of the stripe. The client 101 receives the stripe information returned by the management device 102.

[0068] It should be noted that the client 101, the management device 102 and the storage node 103 can all be computer devices. Figure 2 2 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 200 may include relatively large differences due to different configurations or performances, and may include one or more processors 201 and interfaces 202, wherein the processor may be a central processing unit (CPU). The processor 201 is used to execute the methods provided by the corresponding devices for execution in each method embodiment. The interface 202 may be a network interface card or a host bus adapter, etc., which is not limited in the embodiment of the present application. The processor 201 communicates with the interface 202. Of course, the computer device 200 may also include a hard disk, such as a mechanical disk or a solid state drive (SSD), and the computer device 200 may also include other components for realizing the functions of the device, which will not be described in detail here.

[0069] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, which can be executed by a processor in a computer device to complete the data reconstruction method in the following embodiments. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0070] To illustrate the process of writing data to the storage system, see Figure 3 The flowchart of a data processing method in a storage system provided by an embodiment of the present application is shown, and the method flow includes the following steps 301-315.

[0071] 301. The client 101 sends a stripe allocation request to the management device 102. The stripe allocation request is used to indicate a request for stripe allocation.

[0072] The stripe is used to store the business data to be written. The client 101 can divide the business data to be written into data blocks based on the stripe allocated by the management device 102, and generate check blocks for the data blocks according to the EC algorithm. The client 101 writes the data blocks and the check blocks into the storage device of the storage node 103 corresponding to the stripe unit according to the partition view.

[0073] Since there are many clients in the storage system, the stripe allocation request may carry the device identification of the client 101, so that the management device 102 can return the stripe information to the client 101 corresponding to the device identification based on the device identification. The device identification of the client may be the Internet protocol address (IP) of the client 101 or the media access control (MAC) address of the client 101. The embodiment of the present application does not specifically limit the device identification.

[0074] In the N+M EC implementation, N and M in the embodiment of the present application can have multiple values, so that the storage system in the embodiment of the present application has multiple EC modes. Therefore, the client 101 can also carry EC mode information when requesting the management device 102 to allocate a stripe. The embodiment of the present application does not specifically limit the values ​​of M and N.

[0075] 302. The management device 102 allocates a stripe to the client 101 based on the received stripe allocation request, and returns stripe information to the client, where the stripe information includes a stripe unit identifier of the stripe.

[0076] The stripe unit identifier of the stripe is used to uniquely indicate the stripe units contained in the stripe. The stripe unit identifier can be a number randomly assigned to the stripe units of the stripe by the management device 102, or it can be a stripe unit identifier assigned to the stripe units of the stripe by the management device 102 based on a preset stripe unit identifier allocation rule. The stripe unit identifier can also be divided by other devices of the storage system, which is not limited in the embodiment of the present application. The embodiment of the present application also does not specifically limit the preset stripe unit identifier allocation rule, the allocation method of the stripe unit identifier, and the representation method of the stripe unit identifier.

[0077] 303. The client 101 obtains a stripe unit identifier from the received stripe information.

[0078] 304. The client 101 divides the business data to be written into data blocks, and generates check blocks for the data blocks according to the data blocks in the stripe and the EC algorithm.

[0079] As previously mentioned, the client 101 divides the business data to be written into data blocks of the stripe unit size according to the stripe unit size of the stripe, and generates check blocks for the data blocks according to the EC algorithm. The client 101 records the metadata of the data blocks, that is, the correspondence between the user access address of the data block and the stripe unit identifier of the stripe unit corresponding to the storage data block. In the embodiment of the present application, the stripe unit storing the data block is referred to as the data stripe unit, and the stripe unit storing the check block is referred to as the check stripe unit.

[0080] Among them, according to the business data to be written, the process of dividing the data into blocks can be any process of the following process 1 to process 3.

[0081] Process 1: When the size of the business data to be written is equal to the size of all data stripe units of the stripe, the client 101 may divide the business data to be written into data blocks according to the size of the blocks.

[0082] Process 2: When the size of the business data to be written is smaller than the size of all data stripe units on the stripe, the client 101 can divide the business data to be written into data blocks according to the size of the blocks, and the number of data blocks obtained by division is smaller than the number of data stripe units of the stripe. For missing data blocks, these data blocks can be filled with 0, or these data blocks can be left empty, which is not specifically limited in the embodiments of the present application.

[0083] Process 3: When the size of the business data to be written is larger than the size of all data stripe units on the stripe, the client 101 can divide the business data to be written into data blocks according to the size of the blocks. For the remaining business data to be written, the client 101 can execute step 301 so that the management device 102 reallocates the stripe.

[0084] 305. The client 101 adds a timestamp to the metadata of the data block, where the timestamp is used to indicate the time when the data block is written.

[0085] In the embodiment of the present invention, the timestamp is the timestamp of the data block, that is, the writing time of the data block. The time of writing the data block can be the time when the client 101 sends the data block to the storage device that provides storage space for the data stripe unit corresponding to the data block, or the time when the user writes data to the storage system. In specific implementation, the timestamp can be the number of the data block with the same user access address, or the version number, etc., which is assigned by the client, or it can be the specific storage system clock time, etc. The embodiment of the present application does not specifically limit the timestamp. For a certain data block, the user will modify the data block, that is, the user modifies the data block with the same user access address. Based on the timestamp, it can be determined which data block is the latest data block. The process of determining the latest block can be: the client obtains the timestamp of the data block; determines the new data block according to the timestamp of the data block; wherein the new data block has the same user access address as the data block.

[0086] 306. The client 101 sends the data blocks and metadata of the data blocks to the data storage device storing the data blocks, and sends the verification blocks and metadata of the data blocks to the verification storage device storing the verification blocks; wherein the metadata of the data blocks includes a timestamp.

[0087] Among them, in the storage system, the relationship between the stripe unit of the stripe and the storage device is implemented by a distributed algorithm. In one implementation, the stripe units at the same position of multiple stripes belonging to the same partition are located in the same storage device. For example, the first stripe units of stripe 1 and stripe 2 belonging to the same partition are both located in the same storage device, that is, the storage space is provided by the same storage device. Therefore, after the data block of the storage address accessed by the same user is modified, the modified data block is located in a different stripe of the same partition, but is still located in the same storage device as the data block before the modification.

[0088] Exemplarily, if the stripe contains 5 stripe units, there are 3 data stripe units and 2 check stripe units. For example, data stripe unit 1, data stripe unit 2, data stripe unit 3, check stripe unit 1 and check stripe unit 2. According to the relationship between the stripe units and the storage devices in the stripe, for example, according to the correspondence between the stripe unit identifier and the storage device identifier, the corresponding blocks are sent to the corresponding storage devices. For example, data block 1 is stored in data stripe unit 1, data block 2 is stored in data stripe unit 2, data block 3 is stored in data stripe unit 3, check block 1 is stored in check stripe unit 1, and check block 2 is stored in check stripe unit 2. Data stripe unit 1 corresponds to data storage device 1, data stripe unit 2 corresponds to data storage device 2, data stripe unit 3 corresponds to data storage device 3, check stripe unit 1 corresponds to check storage device 1, and check stripe unit 2 corresponds to check storage device 2. Because the storage device is located in the storage node, when the client 101 sends the corresponding blocks to the storage device, the blocks must first be sent to the storage node where the storage device is located.

[0089] Client 101 sends data block 1 and metadata of data block 1 to data storage device 1 on data storage node 1, client 101 sends data block 2 and metadata of data block 2 to data storage device 2 on data storage device 2, client 101 sends data block 3 and metadata of data block 3 to data storage device 3 on data storage device 3, client 101 sends verification block 1 and metadata of data block 1, metadata of data block 2 and metadata of data block 3 to verification storage device 1 on verification storage node 4, and client 101 sends verification block 2 and metadata of data block 1, metadata of data block 2 and metadata of data block 3 to verification storage device 2 on verification storage device 5.

[0090] 307. The data storage device receives the data blocks and metadata of the data blocks sent by the client 101, and the verification storage device receives the verification blocks and metadata of the data blocks sent by the client.

[0091] The data storage device 1 on the data storage node 1 receives the data block 1 and the metadata of the data block 1 sent by the client 101, the data storage device 2 on the data storage device 2 receives the data block 2 and the metadata of the data block 2 sent by the client 101, the data storage device 3 on the data storage device 3 receives the data block 3 and the metadata of the data block 3 sent by the client 101, the verification storage device 1 on the verification storage node 4 receives the verification block 1 and the metadata of the data block 1, the metadata of the data block 2 and the metadata of the data block 3 sent by the client 101, and the verification storage device 2 on the verification storage device 5 receives the verification block 2 and the metadata of the data block 1, the metadata of the data block 2 and the metadata of the data block 3 sent by the client 101.

[0092] In an embodiment of the present application, the metadata of the data blocks can be backed up on the verification storage device. In addition to being stored on the corresponding data storage device, the metadata of the data blocks is also stored on the verification storage device, thereby completing the write operation, thereby reducing the write operation time. On the other hand, there are multiple copies of the metadata of the data blocks, thereby providing the reliability of the metadata of the data blocks. Furthermore, since the metadata of the data blocks is written to the verification storage device together with the verification block by the client 101 when writing the verification block to the verification storage device, the efficiency of preserving the metadata copies of the data blocks is improved, thereby reducing the time of the write operation.

[0093] 308. The data storage node writes the metadata of the data block into the memory and writes the metadata of the data block into the record log, and writes the data block into the data storage device on the data storage node; the verification storage node writes the metadata of the data block into the memory and writes the metadata of the data block into the record log, and writes the verification block into the verification storage device on the verification storage node.

[0094] The memory of the data storage node stores metadata and logs of the data blocks of the data storage device distributed on the data storage node, and the logs are used to record the metadata write operations of the data blocks. The memory of the verification storage node stores metadata and logs of the data blocks, and the logs are used to record the metadata write operations of the data blocks. As mentioned above, data blocks with the same user access address have different versions due to modifications. That is, there will be data blocks with the same user access address located on the data storage device of the same data storage node, and the memory of the data storage node will store metadata and logs of the data blocks with the same user access address. According to the timestamp in the metadata of the data block, it can be determined which data block's metadata is the metadata of the new data block. Similarly, the memory of the verification storage node will also store metadata and logs of multiple data blocks with the same user access address.

[0095] 309. The data storage node backs up the metadata of the data blocks to the metadata storage node, and deletes the metadata of the data blocks in the memory of the data storage node and the metadata write operation of the data blocks in the log.

[0096] In the embodiment of the present application, the data storage node backs up the metadata of the data block to the metadata storage node. One implementation method is to send the metadata of the data block to the metadata storage node, and the metadata storage node does not need to write the metadata of the data block to the metadata storage device on the metadata storage node. Another implementation method is that the data storage node backs up the metadata of the data block to the metadata storage node, which is to send the metadata of the data block to the metadata storage node, and the metadata storage node needs to write the metadata of the data block to the metadata storage device on the metadata storage node. Step 309 implements multi-copy storage of the metadata of the data block to improve the reliability of the metadata of the data block. At the same time, the memory space of the data storage node can be released in time. In the embodiment of the present application, the storage node that stores the metadata of the data block is called a metadata storage node. The storage device that stores the metadata of the data block in the metadata storage node is called a metadata storage device. In the embodiment of the present application, the number of metadata storage nodes is not limited.

[0097] 310. The data storage node notifies the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log, wherein the old data block has the same user access address as the data block, and the timestamp in the metadata of the old data block is earlier than the timestamp in the metadata of the data block.

[0098] When the data storage node backs up the metadata of the new data block to the metadata storage node, because the metadata of the new data block has been stored in the metadata storage node, the metadata of the old data block with the same user access address and the timestamp in the memory of the verification storage node that is earlier than the timestamp of the metadata of the data block can be deleted, and the metadata write operation of the old data block recorded in the log can be deleted at the same time. That is, the metadata of the old data block with the same user access address is eliminated from the memory of the verification storage node, thereby releasing the memory space of the verification storage node.

[0099] Before a data storage node stores the metadata of a data block, if the timestamp on the metadata of the data block is greater than the timestamp of the target metadata, indicating that the data block is the latest block, the storage node can directly write the metadata of the data block into the memory without waiting for the metadata of the data block to be written to the storage device, thereby reducing the time of the write operation. Among them, the target metadata is the metadata of all data blocks in the data storage node that have the same user access as the data block.

[0100] In an embodiment of the present application, when a data storage node fails, resulting in the loss of metadata of a data block, a log of the write operation of the data block in the memory of the verification storage node can be obtained. For example, the write operation of the data block can be obtained from the logs of multiple verification storage nodes, thereby preventing the metadata of the data block from being lost or inconsistent due to an error in a certain verification storage node. In a specific implementation, the data storage node can send a log acquisition request to the verification storage node, and the verification storage node sends a write operation of the metadata of the data block containing the user access address to the data storage node according to the log acquisition request. In a specific implementation, the verification storage node can send all logs to the data storage node; in another implementation, the data storage node can carry the user access address in the log acquisition request, and the verification storage node obtains the metadata write operation of the data block containing the user access address according to the user access address. The data storage node selects the metadata of the data block with the latest timestamp from the metadata of the data blocks with the same user access as the metadata of the latest data block, thereby ensuring data consistency. In one implementation, the latest timestamp can be the largest timestamp. When the client restarts and loses the timestamp of the latest data block, the client can query the data storage node for the latest timestamp of the data block with the same user access address, and the data storage node returns the latest timestamp of the data block with the same user access address to the client. Based on the latest timestamp, the client starts to assign timestamps to the metadata of the data block with the same user access address.

[0101] The method provided in the embodiment of the present application sends the data blocks and metadata of the data blocks in the stripe to the data storage node, and sends the metadata of the data blocks and the verification blocks to the verification storage node through the client. The data storage node or the verification storage node does not need to wait for the metadata backup to be successful, and can directly store the received blocks in the storage device, thereby reducing the time of the write operation.

[0102] In some implementations, the client may send data blocks and metadata of the data blocks to the data storage node, and send metadata of the data blocks and check blocks to the check storage node, and the data storage node and the check storage node store the received blocks and metadata. Here, an embodiment of the present application provides a data processing method in a storage system, the storage system includes a client, a data storage node and a check storage node; the method includes:

[0103] The client sends the data blocks in the stripe and the metadata of the data blocks to the data storage node:

[0104] The client sends the check blocks in the stripe and the metadata of the data blocks to the check storage node; wherein the check blocks are generated based on the data blocks and the check algorithm in the stripe; a check block and a data block in the stripe have the same size and are equal to the size of the stripe unit in the stripe; the metadata of the data block includes the correspondence between the user access address of the data block and the stripe unit identifier storing the data block in the stripe.

[0105] Optionally, the metadata of the data block also includes a timestamp.

[0106] Optionally, the method further comprises:

[0107] The client obtains the timestamp of the data block;

[0108] The timestamp of a new data block is determined according to the timestamp; wherein the new data block has the same user access address as the data block.

[0109] The present application provides a method for processing data in a storage system, wherein the storage system includes a client, a data storage node, a metadata storage node, and a verification storage node; the method includes:

[0110] The data storage node receives a write request sent by the client; the write request includes data blocks of a stripe of a storage device in the data storage node and metadata of the data blocks; wherein the check blocks of the stripe are stored on the storage device of the check storage node; the memory of the check storage node is also used to store the metadata of the data blocks and record the metadata write operation of the data blocks in a log; the check blocks are generated according to the data blocks and the check algorithm in the stripe; a check block and a data block in the stripe are of the same size and are equal to the size of the stripe unit in the stripe; the metadata of the data blocks includes the correspondence between the user access address of the data block and the stripe unit identifier storing the data block in the stripe;

[0111] The data storage node sends a write request response to the client; the write request response is used to indicate completion of the write request operation.

[0112] Optionally, the method further includes: after the data storage node sends a write request response to the client, the data storage node stores the metadata of the data block in the metadata storage node.

[0113] Optionally, the metadata of the data block further includes a timestamp; the method further includes:

[0114] The data storage node notifies the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block contains the same user access address as the data block; and the timestamp of the old data block is earlier than the timestamp of the metadata of the data block.

[0115] Optionally, the method further comprises:

[0116] When the data storage node recovers from the failure, the data storage node obtains the write operation of the metadata of the data block containing the user access address in the log from the verification storage node;

[0117] Determine the metadata of the data block with the latest timestamp from the write operation of the metadata of the data block of the user access address in the log;

[0118] The metadata of the data block with the latest timestamp is used as the metadata of the data block corresponding to the user access address.

[0119] The present application provides a method for processing data in a storage system, wherein the storage system includes a client, a data storage node, a metadata storage node, and a verification storage node; the method includes:

[0120] The check storage node receives a write request sent by the client; the write request includes metadata of data blocks and check blocks of the stripe of the storage device written to the data storage node; wherein the check block is generated according to the data blocks and the check algorithm in the stripe; a check block and a data block in the stripe are of the same size and equal to the size of the stripe unit in the stripe; the metadata of the data block includes a correspondence between a user access address of the data block and an identifier of the stripe unit storing the data block in the stripe;

[0121] The verification storage node caches the data blocks in memory and records the write operation of the metadata of the data blocks in a log.

[0122] Optionally, the metadata of the data block also includes a timestamp.

[0123] Optionally, the method further comprises:

[0124] The verification storage node receives a notification sent by the data storage node; the notification is used to instruct the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block contains the same user access address as the data block; the timestamp of the old data block is earlier than the timestamp of the metadata of the data block;

[0125] The verification storage node deletes the metadata of the old data block in the memory and the write operation of the metadata of the old data block recorded in the log according to the notification.

[0126] Optionally, the method further comprises:

[0127] The verification storage node receives a log acquisition request sent by the data storage node; the log acquisition request is used to obtain a write operation of metadata of a data block containing the user access address in the log from the verification storage node;

[0128] The check storage node sends a write operation of metadata of the data block containing the user access address to the data storage node.

[0129] In order to further implement the above method, an embodiment of the present application also provides a storage system, wherein the storage system includes a data storage node and a verification storage node;

[0130] The data storage node is used for:

[0131] Receive a first write request sent by the client; the first write request includes data blocks of a stripe of a storage device in the data storage node and metadata of the data blocks; the metadata of the data blocks includes a correspondence between a user access address of the data block and an identifier of a stripe unit storing the data block in the stripe;

[0132] Sending a write request response to the client; the write request response is used to indicate completion of the first write request;

[0133] The check storage node is used to receive a second write request sent by the client; the second write request includes metadata of the data block and a check block; wherein the check block is generated according to the data block and the check algorithm in the stripe; a check block and a data block in the stripe have the same size and are equal to the size of the stripe unit in the stripe;

[0134] The data blocks are cached in the memory of the verification storage node and the write operation of the metadata of the data blocks is recorded in the log.

[0135] Optionally, the data storage node is further configured to store the metadata of the data block in the metadata storage node after sending a write request response to the client.

[0136] Optionally, the metadata of the data block also includes a timestamp;

[0137] The data storage node is also used to notify the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block contains the same user access address as the data block; and the timestamp of the old data block is earlier than the timestamp of the metadata of the data block.

[0138] The verification storage node is further used to receive a notification sent by the data storage node, and delete the metadata of the old data block in the memory and the write operation of the metadata of the old data block recorded in the log according to the notification.

[0139] Figure 4 1 is a schematic diagram of the structure of a data processing device in a storage system provided in an embodiment of the present application, wherein the storage system comprises the device, a data storage node and a verification storage node; the device comprises:

[0140] A first sending module 401 is used to send the data blocks in the stripe and the metadata of the data blocks to the data storage node;

[0141] The second sending module 402 is used to send the check blocks in the stripe and the metadata of the data blocks to the check storage node; wherein the check blocks are generated based on the data blocks and the check algorithm in the stripe; a check block and a data block in the stripe are the same size and equal to the size of the stripe unit in the stripe; the metadata of the data block includes the correspondence between the user access address of the data block and the stripe unit identifier storing the data block in the stripe.

[0142] Optionally, the metadata of the data block also includes a timestamp.

[0143] Optionally, the device further comprises:

[0144] An acquisition module, used for acquiring the timestamp of the data block;

[0145] A determination module is used to determine the timestamp of a new data block according to the timestamp; wherein the new data block has the same user access address as the data block.

[0146] Figure 51 is a schematic diagram of the structure of a data processing device in a storage system provided in an embodiment of the present application, wherein the storage system includes a client, the device, a metadata storage node, and a verification storage node; the device includes:

[0147] A receiving module 501 is used to receive a write request sent by the client; the write request includes data blocks of the stripe of the storage device in the data storage node and metadata of the data blocks; wherein the check blocks of the stripe are stored on the storage device of the check storage node; the memory of the check storage node is also used to store the metadata of the data blocks and record the metadata write operation of the data blocks in a log; the check blocks are generated according to the data blocks and the check algorithm in the stripe; a check block and a data block in the stripe are of the same size and equal to the size of the stripe unit in the stripe; the metadata of the data blocks includes the correspondence between the user access address of the data block and the stripe unit identifier storing the data block in the stripe;

[0148] The sending module 502 is used to send a write request response to the client; the write request response is used to indicate the completion of the write request operation.

[0149] Optionally, the device further comprises:

[0150] The storage module is used to store the metadata of the data block to the metadata storage node after the sending module sends a write request response to the client.

[0151] Optionally, the metadata of the data block further includes a timestamp; and the device further includes:

[0152] The notification module is used to execute the above step 310.

[0153] Optionally, the device further comprises:

[0154] an acquisition module, configured to, when the device recovers from a failure, cause the data storage node to acquire, from the verification storage node, a write operation of the metadata of the data block containing the user access address in the log;

[0155] A determination module, configured to determine the metadata of the data block with the latest timestamp from the write operation of the metadata of the data block of the user access address in the log;

[0156] The determination module is further configured to use the metadata of the data block with the latest timestamp as the metadata of the data block corresponding to the user access address.

[0157] Figure 61 is a schematic diagram of the structure of a data processing device in a storage system provided in an embodiment of the present application, wherein the storage system includes a client, a data storage node, a metadata storage node and the device; the device includes:

[0158] A receiving module 601 is used to receive a write request sent by the client; the write request includes metadata of a data block and a check block of a stripe of a storage device in the data storage node; wherein the check block is generated according to the data block and a check algorithm in the stripe; a check block and a data block in the stripe are of the same size and equal to the size of a stripe unit in the stripe; the metadata of the data block includes a correspondence between a user access address of the data block and an identifier of a stripe unit storing the data block in the stripe;

[0159] The cache module 602 is used to cache the data blocks in the memory and record the write operation of the metadata of the data blocks in the log.

[0160] Optionally, the metadata of the data block also includes a timestamp.

[0161] Optionally, the device further comprises: a deletion module;

[0162] The receiving module 601 is further used to receive a notification sent by the data storage node; the notification is used to instruct the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block contains the same user access address as the data block; the timestamp of the old data block is earlier than the timestamp of the metadata of the data block;

[0163] The deletion module is used to delete the metadata of the old data block in the memory and the write operation of the metadata of the old data block recorded in the log according to the notification.

[0164] Optionally, the device further comprises: a sending module;

[0165] The receiving module 601 is further used to receive a log acquisition request sent by the data storage node; the log acquisition request is used to obtain the write operation of the metadata of the data block containing the user access address in the log from the verification storage node;

[0166] The sending module is used to send a write operation of the metadata of the data block containing the user access address to the data storage node.

[0167] An embodiment of the present application also provides a storage medium, which stores at least one instruction, which is loaded and executed by a processor to implement operations performed by the above-mentioned client, data storage node or verification storage node when executing the data processing method in the above-mentioned storage system.

[0168] The modules in each device in the embodiments of the present application may be implemented as hardware components or software modules, or a combination of the two, which is not limited in the embodiments of the present application.

Claims

1. A data processing method in a storage system, characterized in that: The storage system includes a client, a data storage node, a metadata storage node and a verification storage node, and the method includes: The data storage node receives a write request sent by the client; the write request includes data blocks of a stripe of a storage device in the data storage node and metadata of the data blocks; wherein the check blocks of the stripe are stored on the storage device of the check storage node; the memory of the check storage node is also used to store the metadata of the data blocks and record the metadata write operation of the data blocks in a log; the check blocks are generated according to the data blocks and the check algorithm in the stripe; a check block and a data block in the stripe are of the same size and are equal to the size of the stripe unit in the stripe; the metadata of the data blocks includes the correspondence between the user access address of the data block and the stripe unit identifier storing the data block in the stripe; The data storage node sends a write request response to the client; the write request response is used to indicate completion of the write request operation.

2. The method according to claim 1, characterized in that The method further includes: after the data storage node sends a write request response to the client, the data storage node stores the metadata of the data block in the metadata storage node.

3. The method according to claim 2, characterized in that The metadata of the data block also includes a timestamp; the method further includes: The data storage node notifies the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block contains the same user access address as the data block; and the timestamp of the old data block is earlier than the timestamp of the metadata of the data block.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When the data storage node recovers from the failure, the data storage node obtains the write operation of the metadata of the data block containing the user access address in the log from the verification storage node; Determine the metadata of the data block with the latest timestamp from the write operation of the metadata of the data block of the user access address in the log; The metadata of the data block with the latest timestamp is used as the metadata of the data block corresponding to the user access address.

5. A data processing method in a storage system, characterized in that: The storage system comprises a client, a data storage node, a metadata storage node and a verification storage node; the method comprises: The check storage node receives a write request sent by the client; the write request includes metadata of data blocks and check blocks of the stripe of the storage device written to the data storage node; wherein the check block is generated according to the data blocks and the check algorithm in the stripe; a check block and a data block in the stripe are of the same size and equal to the size of the stripe unit in the stripe; the metadata of the data block includes a correspondence between a user access address of the data block and an identifier of the stripe unit storing the data block in the stripe; The verification storage node caches the metadata of the data block in a memory and records the write operation of the metadata of the data block in a log.

6. The method according to claim 5 is characterized in that The metadata of the data block also includes a timestamp.

7. The method according to claim 6, characterized in that The method further comprises: The verification storage node receives a notification sent by the data storage node; the notification is used to instruct the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block contains the same user access address as the data block; the timestamp of the old data block is earlier than the timestamp of the metadata of the data block; The verification storage node deletes the metadata of the old data block in the memory and the write operation of the metadata of the old data block recorded in the log according to the notification.

8. The method according to claim 5, characterized in that The method further comprises: The verification storage node receives a log acquisition request sent by the data storage node; the log acquisition request is used to obtain a write operation of metadata of a data block containing the user access address in the log from the verification storage node; The check storage node sends a write operation of metadata of the data block containing the user access address to the data storage node.

9. A storage system, characterized in that: The storage system comprises a client, a data storage node and a verification storage node, wherein the data storage node is used to: Receive a first write request sent by the client; the first write request includes data blocks of a stripe of a storage device in the data storage node and metadata of the data blocks; the metadata of the data blocks includes a correspondence between a user access address of the data block and an identifier of a stripe unit storing the data block in the stripe; Sending a write request response to the client; the write request response is used to indicate completion of the first write request; The verification storage node is used for: Receive a second write request sent by the client; the second write request includes metadata of the data block and a check block; wherein the check block is generated according to the data block and a check algorithm in the stripe; a check block and a data block in the stripe have the same size and are equal to the size of a stripe unit in the stripe; The metadata of the data block is cached in the memory of the verification storage node and the write operation of the metadata of the data block is recorded in the log.

10. The storage system according to claim 9, characterized in that: The data storage node is further configured to store the metadata of the data block in a metadata storage node after sending a write request response to the client.

11. The storage system according to claim 10, characterized in that: The metadata of the data block also includes a timestamp; The data storage node is further used to notify the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block and the data block contain the same user access address; the timestamp of the old data block is earlier than the timestamp of the metadata of the data block; The verification storage node is further used to receive a notification sent by the data storage node, and delete the metadata of the old data block in the memory and the write operation of the metadata of the old data block recorded in the log according to the notification.

12. A data storage node, characterized in that: The data storage node comprises a processor and an interface, the processor communicates with the interface, and the processor is configured to execute to implement the method according to any one of claims 1 to 4.

13. A verification storage node, characterized in that: The verification storage node comprises a processor and an interface, the processor communicates with the interface, and the processor is configured to execute to implement the method according to any one of claims 5 to 8.

14. A data processing device in a storage system, characterized in that: The storage system comprises a client, the device, a metadata storage node and a verification storage node, and the device comprises: A receiving module, used for receiving a write request sent by the client; the write request includes data blocks of the stripe of the storage device in the data storage node and metadata of the data blocks; wherein the check blocks of the stripe are stored on the storage device of the check storage node; the memory of the check storage node is also used for storing the metadata of the data blocks and recording the metadata write operation of the data blocks in a log; the check blocks are generated according to the data blocks and the check algorithm in the stripe; a check block and a data block in the stripe are of the same size and equal to the size of the stripe unit in the stripe; the metadata of the data blocks includes the correspondence between the user access address of the data block and the stripe unit identifier storing the data block in the stripe; The sending module is used to send a write request response to the client; the write request response is used to indicate the completion of the write request operation.

15. The device according to claim 14, characterized in that The device also includes: The storage module is used to store the metadata of the data block to the metadata storage node after the sending module sends a write request response to the client.

16. The device according to claim 15, characterized in that The metadata of the data block also includes a timestamp; the device also includes: A notification module is used to notify the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block and the data block contain the same user access address; and the timestamp of the old data block is earlier than the timestamp of the metadata of the data block.

17. The device according to any one of claims 14 to 16, characterized in that The device also includes: an acquisition module, configured to, when the device recovers from a failure, cause the data storage node to acquire, from the verification storage node, a write operation of the metadata of the data block containing the user access address in the log; A determination module, configured to determine the metadata of the data block with the latest timestamp from the write operation of the metadata of the data block of the user access address in the log; The determination module is further configured to use the metadata of the data block with the latest timestamp as the metadata of the data block corresponding to the user access address.

18. A data processing device in a storage system, characterized in that: The storage system comprises a client, a data storage node, a metadata storage node and the device, wherein the device comprises: A receiving module, configured to receive a write request sent by the client; the write request includes metadata of a data block and a check block of a stripe of a storage device in the data storage node; wherein the check block is generated based on the data block and a check algorithm in the stripe; a check block and a data block in the stripe are of the same size and equal to the size of a stripe unit in the stripe; the metadata of the data block includes a correspondence between a user access address of the data block and an identifier of a stripe unit storing the data block in the stripe; The cache module is used to cache the metadata of the data block in the memory and record the write operation of the metadata of the data block in the log.

19. The device according to claim 18 is characterized in that The metadata of the data block also includes a timestamp.

20. The device according to claim 19, characterized in that The device also includes: a deletion module; The receiving module is further used to receive a notification sent by the data storage node; the notification is used to instruct the verification storage node to delete the metadata of the old data block in the memory of the verification storage node and the write operation of the metadata of the old data block recorded in the log; wherein the old data block contains the same user access address as the data block; the timestamp of the old data block is earlier than the timestamp of the metadata of the data block; The deletion module is used to delete the metadata of the old data block in the memory and the write operation of the metadata of the old data block recorded in the log according to the notification.

21. The device according to claim 18, characterized in that The device also includes: a sending module; The receiving module is further used to receive a log acquisition request sent by the data storage node; the log acquisition request is used to obtain a write operation of the metadata of the data block containing the user access address in the log from the verification storage node; The sending module is used to send a write operation of the metadata of the data block containing the user access address to the data storage node.

22. A storage medium, characterized in that: The storage medium stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method according to any one of claims 1 to 4.

23. A storage medium, characterized in that: The storage medium stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method according to any one of claims 5 to 8.

Citation Information

Patent Citations

  • Metadata storage method, system and storage medium in distributed storage system

    CN109144406A