Data processing method, device, program product and medium in append write mode

By applying for internal object numbers in the access layer and performing erasure encoding calculations, the sharded data is directly pushed to the erasure layer, solving the problem of resource occupation and low processing efficiency caused by multiple data forwarding in the append write mode, and achieving more efficient data processing.

CN119739346APending Publication Date: 2025-04-01INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202412000476.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In distributed storage, in the append write mode, the data needs to be forwarded multiple times, resulting in increased network bandwidth, CPU and memory resource usage, and low processing efficiency.

Method used

After the access layer receives the write request, it applies for the internal object number to the additional write layer, and performs the erasure encoding calculation locally on the access layer, and pushes the encoded shard data directly to the erasure layer to avoid data forwarding.

Benefits of technology

It reduces the network forwarding bandwidth of the storage cluster during the band alignment writing process in the erasure scenario, reduces system resource consumption, and improves processing performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739346A_ABST
    Figure CN119739346A_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method, device, program product and medium in an append write mode, relates to the technical field of data storage, and is used to optimize the data processing performance in the append write mode. In view of the problem caused by multiple data forwarding when processing data in the append write mode, a data processing method in the append write mode is provided, which optimizes the stripe-aligned data write request. After receiving the stripe-aligned write request, the access layer applies to the append write layer for an internal object number to determine the members where the data needs to be written to each shard in the erasure layer. Furthermore, the access layer can directly perform erasure coding calculations on the data segment to be written, and write the encoded data of each shard directly into the erasure layer without the need for forwarding by the append write layer. It can be seen that the method can reduce the network forwarding bandwidth of the storage cluster during the stripe-aligned write process in the erasure scenario, reduce system resource consumption, and improve the processing performance of stripe alignment requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a data processing method, device, program product and medium in an append write mode. Background Art

[0002] In the application scenario where distributed storage uses erasure correction for fault tolerance protection, in order to avoid the write amplification problem caused by erasure correction, the input and output (IO) write request is usually processed in combination with the append write method. After receiving the write request, the access layer of the distributed storage will forward the request to the append write layer, and the append write layer will perform log writing to ensure data security. After completion, the data and operations are aggregated. After aggregation, the data part is written to the erasure correction layer in a stripe-aligned manner, and the operation and metadata part are processed in this layer and saved in the metadata record. Similarly, when the access layer receives a read request, it also needs to forward the request to the append write layer to obtain the latest metadata information, so as to determine the specific location of the data to be read from the erasure correction layer based on the metadata information, and then initiate a read request for multiple data fragments to the erasure correction layer. After the request is responded to the append write layer, the data is combined and the client request is responded.

[0003] It can be seen that in this request processing method, the request data is forwarded multiple times in the access layer, append write layer, and erasure layer, and finally the data is stored on the disk in each shard. This multiple forwarding method will lead to a large amount of network bandwidth, central processing unit (CPU) and memory resources, as well as increased request processing latency, and low processing efficiency.

[0004] Therefore, technicians in this field are in urgent need of a data processing method in an append write mode to solve a series of problems caused by multiple data forwarding in the current append write mode. Summary of the invention

[0005] The purpose of the present invention is to provide a data processing method, device, program product and medium in an append write mode, so as to solve a series of problems caused by multiple data forwarding in the current append write mode.

[0006] In order to solve the above technical problems, the present invention provides a data processing method in an append write mode, which is applied to a distributed storage cluster, wherein the distributed storage cluster includes: an access layer, an append write layer and an erasure layer; and is applied to the access layer side, including:

[0007] When receiving a stripe-aligned write request, applying to the additional write layer for an internal object number for storing the data segment to be written;

[0008] Performing erasure coding calculation on the data segment to be written to obtain corresponding data of each fragment;

[0009] The corresponding shard data are pushed to the members of the corresponding placement group in the erasure correction layer according to the internal object number, so as to implement data placement on the disk.

[0010] In a possible embodiment, pushing the encoded shard data to the members of the corresponding placement group in the erasure correction layer according to the internal object number to implement data placement on the disk includes:

[0011] Determine, according to the internal object number, the placement group and the group members in the placement group corresponding to when the to-be-written data segment is written into the erasure correction layer;

[0012] Perform erasure coding calculation on the data segment to be written, and map each of the shard data obtained by coding to each corresponding member in the group;

[0013] Pushing each of the shard data to the corresponding member in the group;

[0014] After receiving a successful data push response from each of the group members, a metadata update and data storage request is initiated to the primary member of each of the group members;

[0015] The metadata to be updated further includes: forward relationship information; the forward relationship information indicates the corresponding relationship between the data segment to be written and each of the fragmented data obtained after erasure coding calculation.

[0016] In a possible embodiment, when the member in the group fails to write data, the method further includes:

[0017] Initiate a write request to the primary member;

[0018] The write request carries the data segment to be written and the internal object number, so that the primary member can complete the erasure writing of the data segment to be written according to the internal object number.

[0019] In a possible embodiment, before performing erasure coding calculation on the data segment to be written, the method further includes:

[0020] Determine whether all members in the group corresponding to the data segment to be written can write data;

[0021] If yes, proceed to the step of performing erasure coding calculation on the data segment to be written;

[0022] If not, determining the member in the group in which data cannot be written to be in an unwritable state;

[0023] When the group member is in the unwritable state, it is determined that the group member fails to write data.

[0024] In a possible embodiment, if there is a member in the group that does not return the data push success response, the method further includes:

[0025] Determining the member in the group as being in a push failure state;

[0026] When the group member is in the push failure state, it is determined that the group member fails to write data.

[0027] In a possible embodiment, after initiating a metadata update and data write request to the primary member, the method further includes:

[0028] If no successful response to data being written to disk is received, it is determined that the member in the group has failed to write data.

[0029] In a possible embodiment, after the data is written to the disk, the method further includes:

[0030] Sending a metadata submission request to the append write layer so that the append write layer writes the submitted metadata into a log or updates the corresponding metadata in the log;

[0031] The submitted metadata also includes: the positive relationship information.

[0032] In a possible embodiment, the method further includes:

[0033] After receiving the read request, forward relationship information and a buffer data acquisition request are sent to the additional write layer;

[0034] According to the data segment to be read and the buffer data returned by the append write layer, determining whether it is still necessary to read data from the erasure correction layer;

[0035] If necessary, read the target data from the erasure correction layer through the forward relationship information; wherein the target data is: data still missing in the data segment to be read based on the acquired buffer data;

[0036] The buffered data and the target data are combined, and response data is constructed and returned according to the data format required by the read request.

[0037] In a possible embodiment, reading target data from the erasure correction layer by using the forward relationship information includes:

[0038] If the target data needs to be subjected to erasure decoding calculation, the target data to be read is aggregated according to stripes;

[0039] Determine, according to the forward relationship information, each of the data fragments required for stripe-aligned reading of the target data;

[0040] Reading corresponding shard data from each shard corresponding to the erasure correction layer;

[0041] Perform erasure decoding calculation on the read slice data to obtain the target data for stripe-aligned reading.

[0042] In a possible embodiment, before reading the target data from the erasure correction layer by using the forward relationship information, the method further includes:

[0043] Determine, according to the forward relationship information, position information of each of the shard data corresponding to the target data in the erasure correction layer;

[0044] According to the location information, determining whether each of the sliced ​​data is a data slice or a check slice;

[0045] If the data slice is missing, it is determined that erasure decoding calculation is required for the target data.

[0046] In a possible embodiment, the method further includes:

[0047] When any request is received, the request is scheduled based on the granularity of the object operated by the request;

[0048] Among them, different requests for different objects are executed concurrently, and different requests for the same object are processed in order according to the sequence of request time.

[0049] In a possible embodiment, the request time is the system time when the request is received;

[0050] Then, performing order-preserving processing on the request includes:

[0051] When receiving the request, adding the request to the end of the request queue;

[0052] Among them, the request that is ranked first in the request queue blocks the request that is ranked later, and when the request at the head of the request queue is executed, the execution action of the next request is triggered.

[0053] In a possible embodiment, when the request is a stripe-aligned write request, performing order-preserving processing on the request includes:

[0054] Directly trigger the stripe-aligned write request to write data to the erasure correction layer; and add the stripe-aligned write request to initiate metadata update and data write request to the primary member to the end of the request queue.

[0055] In order to solve the above technical problems, the present invention also provides a data processing method in an append write mode, which is applied to a distributed storage cluster, wherein the distributed storage cluster includes: an access layer, an append write layer and an erasure layer; and applied to the append write layer side, including:

[0056] After receiving the internal object number acquisition request sent by the access layer, an internal object number application transaction is initiated; wherein the internal object number acquisition request is initiated by the access layer after receiving the stripe alignment write request;

[0057] Obtain the internal object number applied for when the internal object number transaction succeeds;

[0058] The internal object number is returned to the access layer; wherein, after receiving the internal object number, the access layer: performs erasure coding calculation on the data segment to be written to obtain corresponding shard data; and pushes the corresponding shard data to the group members of the corresponding placement group in the erasure layer according to the internal object number, so as to realize data placement on disk.

[0059] In a possible embodiment, it further includes:

[0060] When receiving the metadata submission request sent by the access layer, determining whether the log contains corresponding metadata;

[0061] If not, writing the metadata into the log;

[0062] If yes, the corresponding metadata in the log will be updated;

[0063] In a possible embodiment, it further includes:

[0064] When receiving the forward relationship information and the buffer data acquisition request sent by the access layer, matching the corresponding buffer data from the memory according to the data segment to be read;

[0065] Acquire the buffered data that hits the memory, and use the data portion that does not hit in the data segment to be read as target data;

[0066] Acquire positive relationship information corresponding to the target data from the log;

[0067] The forward relationship information corresponding to the hit buffer data and the target data is returned to the access layer as a response result.

[0068] In order to solve the above technical problems, the present invention also provides a data processing method in an append write mode, which is applied to a distributed storage cluster, wherein the distributed storage cluster includes: an access layer, an append write layer and an erasure layer; and applied to the erasure layer side, including:

[0069] After each member in the group receives the shard data pushed by the access layer, a corresponding task number is generated to identify the shard data, and the shard data is stored in the memory; wherein the shard data is obtained by the access layer performing erasure coding calculation on the data segment to be written after receiving the stripe-aligned write request; each of the shard data is pushed by the access layer to the corresponding members in the corresponding placement group based on the internal object number requested from the additional write layer;

[0070] If the master member among the members in the group receives the metadata update request sent by the access layer, a write transaction carrying the task number but not carrying data is generated, and the write transaction is sent to each member in the group;

[0071] When each member in the group receives the write transaction, it updates the corresponding shard data stored in the memory into the write transaction according to the task number, and executes the write transaction.

[0072] In a possible embodiment, after the slice data is stored in the memory, the method further includes:

[0073] Return the current member version information to the access layer;

[0074] When the primary member receives the metadata update request sent by the access layer, the method further includes:

[0075] According to the member version information carried in the metadata update request, checking whether the shard data corresponding to the metadata update request is retained in the memory;

[0076] If not retained, an exception message is returned.

[0077] In order to solve the above technical problems, the present invention also provides a data processing method in an append write mode, which is applied to a distributed storage cluster, wherein the distributed storage cluster includes: an access layer, an append write layer and an erasure layer; the method includes:

[0078] When the access layer receives the stripe-aligned write request, it applies to the additional write layer for an internal object number for storing the data segment to be written;

[0079] The additional write layer initiates an internal object number application transaction, and returns the internal object number obtained by the application to the access layer;

[0080] The access layer pushes the corresponding shard data to the members in the corresponding placement group in the erasure layer according to the internal object number;

[0081] Each member in the group in the erasure correction layer stores the received shard data on disk.

[0082] In order to solve the above technical problem, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the data processing method in the append write mode as described above when executed by a processor.

[0083] In order to solve the above technical problems, the present invention further provides a data processing device in an append write mode, comprising:

[0084] Memory for storing computer programs;

[0085] A processor is used to implement the steps of the data processing method in the append write mode as described above when executing the computer program.

[0086] To solve the above technical problem, the present invention also provides a non-volatile storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method in the append write mode as described above are implemented.

[0087] The present invention provides a data processing method in an append write mode, which is optimized for stripe-aligned data write requests. After receiving the write request and the data segment to be written at the access layer, the internal object number for storing the data segment to be written is applied to the append write layer, so that the data segment to be written is written to the erasure layer in the form of stripe alignment at the access layer, and each member where each shard in the erasure layer is located needs to be written. Furthermore, the access layer can directly perform erasure coding calculations on the data segment to be written, and write the encoded data of each shard (original data slice and verification data slice) directly into the erasure layer without the need for forwarding by the append write layer. It can be seen that this method can reduce the network forwarding bandwidth of the storage cluster during the stripe alignment write process in the erasure scenario, thereby reducing the system resource consumption of the storage cluster and improving the processing performance of stripe alignment requests.

[0088] The data processing device, program product and non-volatile storage medium in the additional write mode provided by the present invention correspond to the above method and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0089] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0090] Figure 1 A schematic diagram of a common data processing flow in append write mode;

[0091] Figure 2 A flowchart of a data processing method in an append write mode applied to an access layer side provided by an embodiment of the present invention;

[0092] Figure 3 A flowchart of a stripe alignment write request processing method provided by an embodiment of the present invention;

[0093] Figure 4 A flowchart of a read request processing method provided by an embodiment of the present invention;

[0094] Figure 5 A flowchart of a method for requesting scheduling and preserving order provided by an embodiment of the present invention;

[0095] Figure 6 A flowchart of a data processing method in an additional write mode applied to an additional write layer side provided by an embodiment of the present invention;

[0096] Figure 7 A flowchart of a data processing method in an append write mode applied to an erasure correction layer side provided by an embodiment of the present invention;

[0097] Figure 8 A structural diagram of a data processing device in an append write mode provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0098] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0099] The core of the present invention is to provide a data processing method, device, program product and medium in an append write mode.

[0100] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0101] In scenarios where distributed storage clusters use erasure codes (EC) for fault tolerance protection, in order to avoid the write amplification problem caused by erasure, an append write method is usually used to process input and output (IO) write requests. Figure 1 As shown, the distributed storage cluster includes an access layer, an append write layer, and an erasure layer. Among them, the access layer is also the protocol layer of the distributed storage cluster, which is used to convert requests sent from outside the distributed storage cluster into a protocol format recognizable inside the distributed storage cluster. The append write layer is based on a storage pool and cache implementation specifically used to store metadata that are pre-applied in the distributed storage cluster. It is used to manage the metadata of data stored in the distributed storage cluster, and to provide a cache for small IO aggregation for the append write mode. The erasure layer is a storage pool used to store data in the distributed storage cluster. When using the EC method for fault tolerance protection, the data stored in the erasure layer exists in the form of EC data.

[0102] When processing stripe-aligned write IO requests, after receiving the request, the access layer of the distributed storage cluster usually forwards the request with the data to be written to the append write layer; after the append write layer calculates the object to be written in the erasure layer, the append write layer forwards the request to the erasure layer; then the erasure layer performs erasure coding of the data to be written and writes each shard obtained by coding to the disk (stored as EC data); after the IO data is written to the disk, the metadata is updated through the append write layer; finally, the request is responded to after the metadata update is completed. The same is true when processing stripe-aligned read IO requests. After receiving the request, the distributed storage access layer will also forward the request to the append write layer. The latest metadata information is obtained in the append write layer, and the specific location where the data needs to be read from the erasure layer is determined based on the metadata information, and then a read request for multiple data fragments is initiated to the erasure layer. After the request is responded to the append write layer, the data is combined and the client's request is responded to.

[0103] Based on the above, it is not difficult to see that this data processing method will cause the request data to be forwarded multiple times between the access layer, append write layer and erasure layer in the distributed storage cluster, which will bring about a large amount of network bandwidth, central processing unit (CPU) and memory and other resources occupation, as well as increase in request processing delay and other problems. At the same time, this data processing method that requires multiple forwardings also has the problem of low data processing efficiency, which is not conducive to more timely response to customer requests, thus affecting the user experience.

[0104] To solve the above problems, the present invention provides a data processing method in an append write mode. However, it should be noted that the method involves the access layer, the append write layer and the erasure layer in the distributed storage cluster, and the method relies on the interaction between the three. Therefore, when the method is described in detail in the following embodiments, it is also described from the three sides of the access layer, the append write layer and the erasure layer.

[0105] 1. This method is applied to the access layer side:

[0106] The access layer is also the side where the present method has made the most improvements. Therefore, the present method is first described from the access layer. Specifically, the present invention provides a data processing method in the append write mode applied to the access layer side. Figure 2 As shown, including:

[0107] S1-W1: When a stripe-aligned write request is received, the append write layer is requested to obtain an internal object number for storing the data segment to be written.

[0108] S1-W2: Perform erasure coding calculation on the data segment to be written to obtain the corresponding data of each shard.

[0109] S1-W3: Push the encoded shard data to the members of the corresponding placement group in the erasure layer according to the internal object number to achieve data storage.

[0110] The "S1" in the above step name indicates that this step is applied to the access layer side, and "W" indicates that this step is a step in the write request processing flow. Figure 1 It is not difficult to see that the erasure layer uses placement groups (PGs, also known as placement groups) to store all the shard data obtained after erasure coding of a data segment to be written. A placement group includes a certain number of members (that is, the members in the group mentioned above), each member corresponds to an entity's object storage device (OSD), but an entity's object storage device may be used as a member by multiple placement groups. Object storage devices are storage devices that deploy object storage services, and multiple storage nodes implemented by storage devices together constitute a distributed storage cluster. In addition, the number of members included in a placement group is related to the erasure ratio of the erasure coding calculation. For example, when the erasure ratio is 4:2, that is, when an erasure coding calculation of a data segment to be written is converted into 4 data slices and 2 check slices, a placement group contains at least 4+2=6 members to ensure distributed storage of all shard data corresponding to the data segment to be written.

[0111] For step S1-W1, when a client or other external device sends a write request to the distributed storage cluster, the access layer serves as the entrance to the distributed storage cluster, and the external protocol request first reaches the access layer, and then the access layer interacts with other parts of the distributed storage cluster. At this time, since the append write layer is actually responsible for data writing in the relevant technology, the append write layer can obtain the internal object number used to implement the writing of the data segment to be written in the erasure layer in a stripe-aligned manner by initiating an internal object number application transaction. The internal object number can determine the member where the object is written to each shard of the erasure layer, so in step S1-W1, if a stripe-aligned write request is received, the access layer applies to the append write layer to obtain the internal object number.

[0112] After that, when the access layer obtains the internal object number, it can calculate the write position of the data segment to be written into the internal object of the erasure layer locally. That is, at this time, the access layer does not need to forward the request and data to the append write layer, and can write the data segment to be written into the erasure layer by itself.

[0113] Specifically, it corresponds to step S1-W2 and step S1-W3. Step S1-W2 converts the data segment to be written into shard data stored in an erasure form by performing erasure coding calculation on the data segment to be written. It is easy to know that erasure code (EC) is a common data protection method. The erasure coding process divides the original data block of size Z into K parts, that is, K data slices of size Z / K are obtained. Then, M erasure slices are calculated based on the erasure code algorithm based on these K data slices, and the size of the erasure slices is also Z / K. In this way, K+M erasure coding calculations are implemented. That is, in this method, the erasure coding calculations of the data segment to be written can be completed without forwarding the data segment to be written to the additional write layer. Compared with the write processing scheme in the related art, it avoids the full writing of redundant data segments to be written at one time.

[0114] Step S1-W3 stores the encoded sliced ​​data (i.e., K data slices and M check slices) in the corresponding placement group members in the erasure layer in a stripe-aligned manner, thereby completing a data write. As can be seen from the above, for this stripe-aligned writing method, the access layer can calculate the write position of each data slice by applying for the internal object number obtained from the additional write layer, thereby accurately writing the data. It is particularly important to note that in step S1-W3, the access layer directly writes the data slices to the corresponding members in the placement group corresponding to the erasure layer. In the related art, after the additional write layer determines the write position of the data segment to be written in the erasure layer (placement group and its members), it also needs to send all the data segments to be written to the master member of the corresponding placement group in the erasure layer, and the master member performs erasure coding calculations and then forwards each data slice to the corresponding other members in the placement group to complete the data placement.

[0115] That is, when this method writes data to the erasure correction layer, the data flow is: access layer → (each data shard is directly written to the corresponding group member) → erasure correction layer.

[0116] In the related art, when writing data to the erasure correction layer, the data flow is: access layer → (data segment to be written) → primary member in the erasure correction layer (the primary member performs erasure coding calculations on the data segment to be written to obtain each data fragment) → other group members in the erasure correction layer.

[0117] It is not difficult to see from the above that, compared with the data writing scheme provided in the related art, this method avoids at least one full write of the data segment to be written in the stage of writing data to the erasure correction layer. That is, considering the entire data writing process, this embodiment can avoid one full write of the data segment to be written to the additional write layer and one full write of the data segment to be written to the erasure correction layer, thus avoiding two full writes of the data segment to be written.

[0118] In summary, the data writing method provided in this embodiment has the following process flow: Figure 3 As shown. When the stripe-aligned write request reaches the access layer, there is no need to forward it to the additional write layer. The access layer applies for an internal object number from the additional write layer, performs erasure coding calculations locally in the access layer, and writes the coding results to the erasure layer. Based on this, the data processing method in the append write mode provided by the present invention is for stripe-aligned write requests. Data is written directly from the access layer to the erasure layer, and does not involve data forwarding from the access layer to the additional write layer, and from the additional write layer to the erasure layer. This reduces the network forwarding bandwidth of the storage cluster during the stripe-aligned write process in the erasure scenario, can reduce system resource consumption of the storage cluster, and thereby improve the processing performance of stripe-aligned write requests.

[0119] Furthermore, for the above steps S1-W3, this embodiment also provides a possible specific implementation scheme, and the above steps S1-W3 specifically include:

[0120] S1-W31: Determine the placement groups and members within the placement group corresponding to the data segment to be written into the erasure correction layer according to the internal object number.

[0121] S1-W32: Perform erasure coding calculation on the data segment to be written, and map the encoded fragment data to the corresponding group members respectively.

[0122] S1-W33: Push each shard data to the corresponding group members.

[0123] S1-W34: After receiving a successful data push response from each group member, initiate a metadata update and data storage request to the primary member of each group member.

[0124] The metadata to be updated also includes: forward relationship information. The forward relationship information indicates the corresponding relationship between the data segment to be written and the data of each shard obtained after erasure coding calculation. The master member is also the member who undertakes key tasks in a placement group. It is generally responsible for controlling and managing other members in the placement group so that the members in the placement group can cooperate with each other to complete tasks such as data storage.

[0125] like Figure 3 As shown, after the access layer obtains the internal object number, it can determine the members of the corresponding placement group in the erasure layer to write the data segment to be written according to the internal object number. Then, the access layer performs erasure coding on the data segment to be written, and pushes the encoded data fragments to the corresponding members. When these group members receive the data fragments pushed by the access layer and write the data to the disk, the data writing to the erasure layer is completed. Then it is necessary to update the metadata of the data written this time to complete the processing flow of a write request.

[0126] It should be noted that when business data (such as IO data, i.e. the data segment to be written as mentioned above) is written to the erasure layer and stored in the erasure layer in the form of erasure data (i.e. the data of each fragment obtained by encoding the data segment to be written), the same data is stored as two different objects at the business end and the storage end. Therefore, in this embodiment, the correspondence between different objects of the same data at the business end and the storage end is expressed by forward relationship information. Based on the forward relationship information, it is possible to quickly determine the object at the other end based on the object at either the business end or the storage end, thereby facilitating subsequent data reading and other processing operations. At the same time, this embodiment also provides a prerequisite for subsequent embodiments to further optimize the reading process flow when reading this part of data written in a stripe-aligned manner.

[0127] However, before explaining the data read request processing flow, the present embodiment also provides a further implementation plan for the stripe-aligned write request processing flow. It is not difficult to see from the above that although the stripe-aligned write request processing flow provided by the above embodiment is mainly implemented by the access layer, it also involves the interaction between the access layer and the append write layer, and the access layer and the erasure layer. Therefore, if the above interaction fails due to some problem, it will affect the processing of the write request. Among them, whether each group member in the erasure layer completes the transaction of pushing data to disk directly affects whether the write request can be processed normally. Based on this, the present embodiment provides a possible implementation plan. When a group member fails to write data, the method also includes:

[0128] S1-W41: Initiates a write request to the primary member.

[0129] The write request carries the data segment to be written and the forward relationship information, so that the primary member can complete the erasure writing of the data segment to be written according to the forward relationship information.

[0130] First of all, it should be noted that the erasure layer is a storage layer in a distributed storage cluster that is configured to store data in an erasure form. It is applicable to the management method of the storage layer of a distributed storage cluster, that is, the management scheme of managing other members in the cluster through the primary member. The primary member in this embodiment also acts as a manager and is responsible for managing other members in the erasure layer.

[0131] Furthermore, when the data pushed by the access layer to each member in the group (possibly including the primary member) fails to be written to the member in the group, the access layer can re-initiate a new write request to the primary member, that is, a write request carrying all the data segments to be written and the internal object number. This allows the primary member to perform erasure coding calculations on the data segments to be written through the internal object number, and distribute them to the corresponding other members in the group to complete the data writing. That is, this embodiment provides a master forwarding write mechanism. When the access layer fails to write data to each member in the group in the erasure layer, the primary member re-performs the data writing process that was performed in the access layer, in an attempt to solve the problem of group member writing failure when the access layer writes data to the erasure layer, thereby improving the reliability of data writing.

[0132] It should be noted that the above embodiment does not limit the specific reasons for the failure of group members to write data. Based on the above embodiment, it is not difficult to see that there are many links from the access layer receiving the stripe alignment write request to the group members completing the data writing. Problems in any of these links may cause the group members to fail to write data. Specifically, this embodiment provides a possible scenario in which a group member fails to write data. Before step S1-W2, this method also includes:

[0133] S1-W42: Determine whether all members in the group corresponding to the data segment to be written can write data; if so, go to step S1-W2; if not, go to step S1-W43.

[0134] S1-W43: determining the group member in which data cannot be written as a non-writable state;

[0135] When a member in the group is in a non-writable state, it is determined that the member in the group has failed to write data.

[0136] That is, before the access layer pushes data to the erasure layer, this embodiment first determines whether each member in the erasure layer that needs to write data supports data writing. If not, the data writing to the members in the group will inevitably fail, which will trigger the main forwarding write mechanism provided by the above embodiment. It is particularly important to note that this method places the step of determining whether the members in the group support writing before the erasure coding. That is, if there are members in the group that do not support writing, it is necessary to trigger the main forwarding write mechanism, and the main member will re-perform the erasure coding and data forwarding write of the data segment to be written. At this time, if the access layer has already performed the erasure coding calculation, it will lead to resource waste and reduced efficiency. Therefore, this embodiment determines whether each member in the group supports data writing before the access layer performs erasure coding. If not, the access layer does not need to perform the erasure coding calculation, and directly triggers the main forwarding write mechanism to further improve the data writing efficiency and reduce unnecessary waste of computing resources.

[0137] In addition, as an alternative implementation scheme, if it is found that the member does not support writing after the erasure coding calculation is performed at the access layer, the main forwarding write mechanism needs to be triggered. Then the write request sent to the primary member through the access layer no longer carries the data segment to be written, but the encoded data of each shard, so the step of the primary member performing erasure coding can be omitted. However, this will lead to the problem of write amplification (that is, as in the above example, the amount of data carried in the write request changes from a data block of size Z to multiple shards of data with a total size of Z*(K+M) / K), so in actual applications, the solution provided by this embodiment is better. By judging whether the members in the group support writing before performing erasure coding at the access layer, the problem of write amplification in the main forwarding write mechanism can be effectively avoided.

[0138] On the other hand, this embodiment also provides a possible scenario in which a member in a group fails to write data. If a member in the group does not return a successful response to the data push, the method further includes:

[0139] S1-W44: The members in the group are determined to be in a push failure state.

[0140] When a member in the group is in a push failure state, it is determined that the member in the group has failed to write data.

[0141] From the above, it can be seen that in order to write the data segment to the erasure layer in the form of erasure correction, the access layer needs to push the shard data to the corresponding group members in the erasure layer. In actual applications, when a group member receives data pushed by the other party, it generally needs to return a response to inform the group members whether the pushed data has been received. If a group member fails to receive the data pushed by the access layer successfully, the group member cannot write the data, which will cause data writing failure.

[0142] On the other hand, this embodiment also provides another possible scenario in which a member in the group fails to write data. After step S1-W34, the method further includes:

[0143] S1-W45: If no successful response to data being written to disk is received, it is determined that the data writing by the group member has failed.

[0144] It can be seen from the above embodiments that after the access layer pushes the corresponding shard data to the group members, the group members are also required to write the received data to the disk for the transaction to be considered as the completion of a data write. After each group member in the erasure layer executes the disk write transaction, the transaction will return a response result, indicating whether the data was successfully written to the disk or not. Each group member in the erasure layer can return this response result to the access layer, so that the access layer knows whether each group member has successfully written the data. If there is a group member that fails to write data, the main forwarding write mechanism provided in the above embodiments is triggered.

[0145] On the other hand, this embodiment also provides a metadata update solution after data writing is completed. After the data is written to the disk, the method further includes:

[0146] S1-W5: Send a metadata submission request to the append write layer so that the append write layer can write the submitted metadata into the log or update the corresponding metadata in the log.

[0147] The submitted metadata also includes: forward relationship information.

[0148] It has been explained in the above embodiments that a write request processing scheme provided by the above embodiments of the present invention is only for optimizing the processing of stripe-aligned write requests, and the original request processing flow of the append write mode can still be adopted for other write requests. The stripe-aligned write request processing scheme provided by the present invention does not affect other write request processing schemes in the append write mode, and can be implemented compatibly. In this regard, it is considered that in actual applications of distributed storage clusters, not only data write requests are processed, but also other requests such as data read requests. Therefore, after completing the stripe-aligned data writing directly to the erasure layer through the access layer, this embodiment also submits a metadata submission request for the write data to the append write layer to ensure the synchronization of the metadata in the append write layer, and then ensure that the subsequent append write layer can process correctly when processing other requests.

[0149] It should be noted that the metadata submitted by the access layer to the append write layer in this embodiment also includes the forward relationship information mentioned in the above embodiment. It can be seen from the above embodiment that the forward relationship information indicates the corresponding relationship between the same data represented by different objects at the business end and the storage end. Therefore, based on the forward relationship information, the storage objects in the erasure layer can be easily and quickly determined according to the business objects. That is, when the access layer processes a data read request, it can be determined according to the forward relationship information which data objects stored in the erasure layer are the target objects for this read.

[0150] Based on this, this embodiment also provides a solution for processing a read request, and the method further includes:

[0151] S1-R1: When a read request is received, forward relationship information and a request to obtain buffered data are sent to the append write layer.

[0152] S1-R2: Based on the data segment to be read and the buffered data returned by the append write layer, determine whether it is necessary to read data from the erasure correction layer; if necessary, go to step S1-R3.

[0153] S1-R3: Read target data from the erasure layer through forward relation information.

[0154] The target data is the data that is still missing in the data segment to be read based on the acquired buffer data.

[0155] S1-R4: Combine the buffered data and the target data, construct the response data according to the data format required by the read request, and return it.

[0156] It should be noted that “R” in the name of each of the above steps indicates that this step is a step in the data read request processing flow provided by the embodiment of the present invention.

[0157] In addition, although the No branch of step S1-R2 is not clearly explained above, it is not difficult to understand that if the data segment to be read this time can be read from the buffered data in the additional write layer memory (that is, the small block IO in the additional write layer that has not yet been aggregated and written to the erasure layer in the additional write mode), then there is no need to read data from the erasure layer, and all the buffered data hit in the additional write layer memory is returned as the response result, that is, the data read request is processed. Since this scenario does not involve the reading of data in the erasure layer, it does not involve multiple forwardings of data between the access layer, the additional write layer, and the erasure layer, and the above-mentioned optimization requirements do not exist, so this embodiment will not be repeated in detail about this scenario later.

[0158] In particular, for the branch of step S1-R2, that is, the trigger branch of step S1-R3, data needs to be read from the erasure layer. As can be seen from the above, in the related technology, the append write layer locates the data object that needs to be read in the erasure layer based on the metadata therein, and after the append write layer reads the corresponding data by initiating a read request to the erasure layer, the read data is combined and returned to the access layer, and finally the access layer returns it to the client to complete the processing of a read request. At this time, there are multiple data forwardings, which need to be optimized.

[0159] Therefore, in this embodiment, based on the forward relationship information obtained when processing the stripe alignment write request in the above embodiment, the access layer is enabled to directly read the target data from the erasure layer. Specifically, the forward relationship information is submitted to the additional write layer as metadata when processing the stripe alignment write request, so it can also be obtained from the additional write layer when the access layer processes the read request. The access layer can directly determine that the data segment to be read corresponds to those data objects (shard data) stored in the erasure layer based on the forward relationship information, and then directly send a read request for the specified shard data to the corresponding member in the erasure layer. After combining the shard data returned by each member, the target data is obtained, and then the target data and the buffered data of the additional write layer are combined to obtain the response result of this read request. In the read request processing flow provided in this embodiment, for the target data stored in the erasure layer, the access layer can read directly from the erasure layer without forwarding through the additional write layer, thereby reducing the network forwarding bandwidth.

[0160] Based on this embodiment, combined with the write request processing flow provided in the above embodiments, this method can effectively reduce the amount of network forwarding bandwidth during stripe-aligned read and write processes in erasure scenarios, thereby improving the processing performance of stripe-aligned read and write requests.

[0161] In addition, for the target data read from the erasure correction layer, this embodiment also provides a further implementation scheme, and the above steps S1-R3 specifically include:

[0162] S1-R31: If the target data needs to be subjected to erasure decoding calculation, the target data to be read is aggregated according to stripes.

[0163] S1-R32: According to the forward relationship information, determine the data shards required for stripe-aligned reading of the target data.

[0164] S1-R33: Read the corresponding shard data from each shard corresponding to the erasure layer.

[0165] S1-R34: Perform erasure decoding calculation on the read shard data to obtain the target data for stripe-aligned reading.

[0166] Specifically, if it is determined that the target data read by the erasure correction layer needs to be erasure-corrected and decoded, this embodiment provides a corresponding processing flow: first, the information of the fragments to be read (that is, the data segments composed of the fragment data obtained after the original data containing the target data is erasure-corrected and encoded) is aggregated according to the stripe to obtain the fragment information of the stripe-aligned read. After that, the information of each fragment required to read the stripe-aligned fragment is calculated, and then a read request for each fragment in the corresponding erasure correction layer is constructed, and the request is sent to the corresponding fragment of the erasure correction layer to read the data. After the fragment returns the read data, the erasure-corrected and decoded calculation is performed on the read fragment data to obtain the stripe-aligned data segment. Then, the original data segment is extracted from the data segment of the stripe-aligned read, the data fragment reading is completed, and the response data organization process is entered.

[0167] From the above, it can be seen that in this embodiment, when decoding calculation is required for the total data read from the erasure layer, the data segments to be read are aggregated according to stripes, so that only one data read request is required for one stripe, which can improve data reading efficiency and improve the data reading performance of the distributed storage cluster.

[0168] Further, regarding how to determine whether erasure decoding calculation is required when reading target data in the above embodiment, this embodiment provides a possible implementation scheme. Before steps S1-R3, the method further includes:

[0169] S1-R51: According to the forward relationship information, determine the location information of each shard data corresponding to the target data in the erasure layer.

[0170] S1-R52: According to the location information, determine whether each shard data is a data shard or a check shard.

[0171] S1-R53: If there is a missing data slice, it is determined that the target data needs to be erasure decoding calculated.

[0172] According to the principle of erasure code technology, erasure codes can use check pieces to restore data pieces. At this time, it is necessary to perform erasure decoding calculations on the remaining sliced ​​data. That is, if all the data pieces corresponding to the target data exist, the target data can be directly read through the data pieces, and there is no need to restore the data pieces, that is, there is no need to perform erasure decoding calculations. However, if the data piece corresponding to the target data is missing, it is necessary to restore the data piece according to the corresponding check piece, so it is necessary to perform erasure decoding calculations. Based on this principle, in this embodiment, the position information of each sliced ​​data to be read in the erasure layer is determined based on the forward relationship, and based on the position information, it can be determined whether each sliced ​​data is a check piece or a data piece. Then, based on the erasure ratio of K+M and the number of data pieces read, it is determined whether the data piece is lost. If there is a loss, it is necessary to restore the data piece through the check piece, that is, it is necessary to perform erasure decoding calculations. The judgment scheme provided in this embodiment is simple to implement. Before actually reading the shard data, it can be determined whether the shard data is a data slice or a check slice based on the position of the shard data, and then it can be determined whether erasure decoding calculation is required, thereby improving the efficiency of the entire data reading processing flow.

[0173] From the above embodiments, it can be seen that the present invention has so far provided a processing flow for stripe-aligned write requests and a processing flow for read requests, and the method steps are mainly implemented by the access layer. In practical applications, in order to simplify the difficulty of implementation, improve the deployment efficiency, etc., the above-mentioned data reading and writing method can be implemented based on the idea of ​​modularization. Specifically, in a possible embodiment, the above-mentioned write request processing flow and read request processing flow can be respectively implemented by two functional modules. That is, a write request processing submodule and a read request processing submodule are provided in the access layer. The write request processing submodule is used to execute the steps S1-W1~S1-W5 and their subdivided steps provided in the above embodiments. The write processing flow chart of its execution method is shown as follows: Figure 3 The read request processing submodule is used to execute the steps S1-R1 to S1-R5 and their subdivided steps provided in the above embodiment. The read processing flow chart of its execution method is shown in FIG. Figure 4 shown.

[0174] Furthermore, this embodiment also provides another possible embodiment, the method further includes:

[0175] S1-K: When any request is received, the request is scheduled based on the granularity of the object the request operates on.

[0176] Different requests for different objects are executed concurrently, and different requests for the same object are processed in order of request time. The "K" in the step name indicates that this step is a step in the order-preserving process provided by the embodiment of the present invention.

[0177] It is easy to know that the present invention provides a data processing method, so the request mentioned in the embodiment is also a request for operating with data as the object. Since the same request and different requests may involve different data objects, this embodiment uses the object (data object) operated by the request as the granularity for scheduling, and performs operations on different objects in parallel, thereby achieving the purpose of improving data processing efficiency. However, for the same object, in order to ensure data consistency, the object needs to be processed in sequence according to the order of the request. That is, for different requests for the same object, the order is maintained according to the order of the request time, and the request with an earlier request time is processed first, and the request with a later request time is processed later.

[0178] It should also be noted that the above request time can be the time when the request is generated, or the time when the request reaches the access layer (or distributed storage cluster), and this embodiment does not limit this. However, in a possible embodiment, the system time when the access layer receives the request is used as the request time of the request, and an order-preserving processing flow is provided:

[0179] When a request is received, it is added to the end of the request queue.

[0180] Among them, the requests that are ranked higher in the request queue block the requests that are ranked lower. When the request at the head of the request queue is executed, the execution action of the next request is triggered.

[0181] That is, whenever a new request reaches the access layer, this request is added to the end of the request queue. If the request queue is originally empty, the request is directly triggered for execution. However, if there are already other requests in the original request queue, the request is blocked and needs to wait for the top requests in the queue to be executed before it can be triggered for execution. Correspondingly, the request queue only executes the request at the head of the queue each time. When the request is executed, the next request after this request reaches the head of the request queue and is triggered for execution. Based on this principle, continuous backward traversal is performed to achieve the order-preserving scheduling execution of each request in the request queue, ensuring the consistency of data processing.

[0182] Furthermore, for the stripe-aligned write request in the above embodiment, this embodiment also provides a special order-preserving mechanism. When the request received in the above step S1-K is a stripe-aligned write request, the order-preserving processing of the request includes:

[0183] Directly trigger the stripe-aligned write request to write data to the erasure layer, and add the stripe-aligned write request to initiate metadata update and data write request to the primary member to the end of the request queue.

[0184] That is, Figure 5As shown, for the stripe alignment write request, only the metadata update operation in the request is kept in order. For the data write operation of the stripe alignment write request, the request is executed as soon as it enters the access layer. It should be noted that, as for the specific processing flow of the stripe alignment write request provided in the above embodiment, the above-mentioned directly executed data write process is only that the access layer pushes the corresponding data to the corresponding member in the erasure layer. It is necessary to wait until each member completes the transaction of pushing data to the disk before the data is considered to be truly written to the erasure layer. In one of the above embodiments, the member transaction of the stripe alignment write request is triggered by the access layer sending a metadata update and data disk request to the primary member. That is, when this embodiment only keeps the order of the metadata update operation in the request, the order of data being stored in the disk to the erasure layer can still be maintained to ensure data consistency. However, the advantage of this embodiment is that this embodiment can realize the more time-consuming process in the data write processing in advance by writing the data from the access layer to each member in the erasure layer (temporarily stored in the memory) in advance, and when the order is kept scheduled to the metadata update operation, each member can directly store the data temporarily stored in the memory to the disk, which brings higher data writing efficiency.

[0185] In addition, similar to the above-mentioned write request processing module and read request processing module, the order-preserving scheduling method provided in the above-mentioned embodiment can also be implemented by a separate functional module deployed in the access layer, namely, the order-preserving processing module. Figure 5 shown.

[0186] 2. This method is applied to the additional write layer side:

[0187] As can be seen from the above, in this method, the additional write layer mainly plays a role in the management of internal object numbers and metadata. However, it should also be noted that for other requests other than the stripe alignment write request and read request targeted by this method, the additional write layer also processes the request in the same way as in the related art, which will not be repeated in this embodiment.

[0188] For the application of the additional write layer in this method, this embodiment provides a corresponding implementation scheme. Figure 6 As shown, applied to the append write layer, the method includes:

[0189] S2-W1: After receiving the internal object number acquisition request sent by the access layer, an internal object number application transaction is initiated.

[0190] The internal object number acquisition request is initiated by the access layer after receiving the stripe-aligned write request.

[0191] S2-W2: Get the internal object number when the transaction succeeds.

[0192] S2-W3: Returns the internal object number to the access layer.

[0193] After receiving the internal object number, the access layer executes steps S1-W2 and S1-W3. "S2" in the above step number indicates that this step corresponds to the step executed by the additional write layer.

[0194] It is not difficult to see from the above that the process provided by this embodiment is the specific process of the method that the additional write layer provides the internal object number to the access layer when processing a stripe alignment write request. Based on the above-mentioned embodiment on the access layer side, it can be known that after the access layer obtains the internal object number returned by the additional write layer, it can determine the location information of the data segment to be written in the stripe alignment write request locally in the access layer, thereby enabling the access layer to write data directly to the erasure layer. Without going through the additional write layer, the network forwarding bandwidth of the storage cluster in the stripe alignment write process in the erasure scenario is reduced, thereby reducing the system resource consumption of the storage cluster and improving the processing performance of stripe alignment requests.

[0195] Furthermore, in one of the embodiments of the access layer, after completing the writing of the stripe alignment data, the access layer also needs to update the metadata to the additional write layer, so as to ensure the consistency of the data when the additional write layer processes other operations later. Based on this, this embodiment provides an adaptive metadata management solution in the additional write layer, and the method also includes:

[0196] S2-W41: When receiving a metadata submission request sent by the access layer, determine whether the log contains the corresponding metadata; if not, go to step S2-W42; if so, go to step S2-W43.

[0197] S2-W42: Write metadata to the log.

[0198] S2-W43: The corresponding metadata in the log will be updated.

[0199] It is not difficult to understand that the metadata in this embodiment is as described in the above access layer embodiment, and also includes forward relationship information to facilitate subsequent read request processing optimization.

[0200] Correspondingly, based on the positive relationship information in the metadata, this embodiment also provides an additional write layer response process for processing a read request from the additional write layer. The above method also includes:

[0201] S2-R1: When receiving the forward relationship information and buffer data acquisition request sent by the access layer, the corresponding buffer data is matched from the memory according to the data segment to be read.

[0202] S2-R2: Get the hit buffer data in the memory and use the missed data part in the data segment to be read as the target data.

[0203] S2-R3: Obtain the positive relationship information corresponding to the target data from the log.

[0204] S2-R4: Return the positive relationship information corresponding to the hit buffer data and the target data to the access layer as a response result.

[0205] First of all, it is easy to know that when the distributed storage cluster works in the append write mode, the write of small block IO is cached in the memory of the append write layer and written to the erasure layer in the append write mode. Therefore, when the access layer receives a read request, there may be three situations: 1) All the data segments to be read are located in the erasure layer; 2) Part of the data segments to be read are located in the erasure layer and part of them are located in the memory of the append write layer (that is, this part of the data has not yet been written to the erasure layer); 3) All the data segments to be read are located in the memory of the append write layer.

[0206] When the data to be read is located in the additional write layer, it is directly matched from the memory of the additional write layer, and the hit buffer data can be obtained by reading. When the data to be read is located in the erasure layer, if the data is written to the erasure layer based on stripe alignment, then based on the processing flow of the stripe alignment write request provided in the above embodiment, the metadata of this data stored in the additional write layer also includes forward relationship information. It can be seen from the above embodiment that the forward relationship information indicates the correspondence between the IO object of the business end (such as the access layer) and the erasure object in the erasure layer. Therefore, when the additional write layer returns the forward relationship information to the access layer, the access layer can directly read the required target data from the erasure layer without forwarding through the additional write layer, thereby achieving the purpose of reducing the network forwarding bandwidth. Combining the above-mentioned processing flow of the stripe alignment write request, this method can reduce the network forwarding bandwidth of the distributed storage cluster during the stripe alignment read and write process in the erasure scenario, thereby reducing the system resource consumption of the storage cluster and improving the processing performance of the stripe alignment read and write request.

[0207] 3. This method is applied to the erasure layer side:

[0208] On the other hand, this method is also applied in the erasure layer. Specifically, it is applied to the erasure layer, such as Figure 7 As shown, the method includes:

[0209] S3-W1: After receiving the shard data pushed by the access layer, each member in the group generates a corresponding task number to identify the shard data and saves the shard data in the memory.

[0210] The shard data is obtained by the access layer after receiving the stripe-aligned write request, by performing erasure coding calculation on the data segment to be written. Each shard data is pushed by the access layer to each member in the corresponding placement group based on the internal object number requested from the append write layer.

[0211] S3-W2: If the primary member receives a metadata update request sent by the access layer, it generates a write transaction that carries a task number but no data, and sends the write transaction to each member in the group.

[0212] S3-W3: When each member in the group receives a write transaction, it updates the corresponding shard data stored in the memory to the write transaction according to the task number and executes the write transaction.

[0213] The “S3” in the above step number indicates that this step corresponds to the step executed by the erasure correction layer.

[0214] Based on an embodiment of the access layer side described above, it can be known that after the access layer pushes the encoded shard data to each member in the corresponding placement group in the erasure layer, each member in the group first temporarily stores the received shard data in the memory. After the access layer sends a metadata update request to the primary member (order preservation), the transaction of the shard data is then written to the disk. Specifically, in this method, the erasure layer manages the shard data with a task number to indicate which stripe alignment write request the shard data temporarily stored in the memory corresponds to. When the primary member receives the metadata update request sent by the access layer (without carrying the data segment to be written), the primary member can generate a corresponding write transaction (carrying the task number but not carrying the shard data) and send it to the corresponding member in the group, so that each member in the group can retrieve the corresponding data from the memory according to the received task number and write the transaction to the disk. That is, for the data to be written, there is still only one data write from the access layer to each member in the erasure layer, which greatly reduces the number of data forwarding times, thereby achieving the purpose of reducing the network forwarding bandwidth.

[0215] In addition, further considering that the above embodiment also proposes a scheme for scheduling requests based on the granularity of the operation object, different operations on different objects can be executed concurrently. Therefore, in the erasure layer, there may be multiple shard data corresponding to different stripe alignment write requests in the memory at the same time. Therefore, this embodiment uses the task number to manage the shard data in the memory, and uniquely determines the correspondence between the shard data in the memory and the write request based on the task number, thereby ensuring the correct placement of the data on the disk.

[0216] Furthermore, for the shard data stored in the memory, this embodiment also provides another management solution. After the above method saves the shard data in the memory in step S3-W1, the method further includes:

[0217] S3-W41: Return the current member version information to the access layer.

[0218] And in step S3-W42: when the primary member receives the metadata update request sent by the access layer, the method further includes:

[0219] S3-W42: Based on the member version information carried in the metadata update request, check whether the shard data corresponding to the metadata update request is retained in the memory.

[0220] S3-W43: If not reserved, return exception information.

[0221] That is, this embodiment provides a detection mechanism for checking whether the shard data corresponding to the stripe alignment write request is retained in the memory based on the member version information. When the primary member receives the corresponding metadata update request, it can determine whether the corresponding data exists in the memory based on the member version information in the metadata. If not, an exception message can be returned to promptly inform the operation and maintenance personnel of the exception, avoiding the problem that the subsequent data processing steps are continued but the correct data is not written to the disk and the operation and maintenance end is unaware.

[0222] Finally, this embodiment also takes the distributed storage cluster as a whole as the object, focusing on how the access layer, the append write layer and the erasure layer cooperate with each other to implement a data processing method in an append write mode provided by this application, and provides a corresponding method embodiment. Specifically, applied to a distributed storage cluster including an access layer, an append write layer and an erasure layer, a data processing method in an append write mode includes:

[0223] S41: After receiving the stripe-aligned write request, the access layer applies to the additional write layer for an internal object number for storing the data segment to be written;

[0224] S42: the additional write layer initiates an internal object number application transaction, and returns the internal object number obtained by the application to the access layer;

[0225] S43: The access layer pushes the corresponding shard data to the members of the corresponding placement group in the erasure layer according to the internal object number;

[0226] S44: Each member in the erasure layer writes the received shard data to disk.

[0227] It is easy to know that this embodiment only explains the data processing method of the append write mode provided above from the perspective of the distributed storage cluster as a whole. Therefore, for the specific implementation plans of each side of the access layer, append write layer and erasure layer in the distributed storage cluster, please refer to the above-mentioned corresponding side embodiments, and this embodiment will not be repeated here.

[0228] In addition to the embodiment of the data processing method in the append write mode provided in the above embodiment, the present invention also provides an embodiment corresponding to a computer program product. A computer program product includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the data processing method in the append write mode described in any of the above embodiments can be implemented.

[0229] Since the embodiments of the computer program product part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the computer program product part, which will not be repeated here.

[0230] In the above embodiment, a data processing method in an append write mode is described in detail. The present invention also provides an embodiment corresponding to a data processing device in an append write mode. It should be noted that the present invention describes the above method from three sides: the access layer, the append write layer, and the erasure layer in the above embodiment. Therefore, in this embodiment, the device provided in this embodiment is also described from three sides: the access layer, the append write layer, and the erasure layer.

[0231] Applied to the access layer, this embodiment provides a data processing device in an append write mode, including:

[0232] A first application module is used for applying to the additional write layer for an internal object number for storing the data segment to be written after receiving a stripe-aligned write request;

[0233] An erasure coding module, used to perform erasure coding calculations on the data segment to be written;

[0234] The data writing module is used to push the encoded data of each shard to the member where the corresponding shard is located in the erasure layer according to the internal object number, so as to realize data storage.

[0235] Applied to the append-write layer, this embodiment provides a data processing device in the append-write mode, including:

[0236] A second application module is used to initiate an internal object number application transaction after receiving an internal object number acquisition request sent by the access layer; wherein the internal object number acquisition request is initiated by the access layer after receiving a stripe alignment write request;

[0237] The number acquisition module is used to obtain the internal object number applied for when the internal object number transaction is successful;

[0238] The number return module is used to return the internal object number to the access layer; after receiving the internal object number, the access layer: performs erasure coding calculation on the data segment to be written; according to the internal object number, the encoded shard data is pushed to the member where the corresponding shard is located in the erasure layer, so as to realize data storage.

[0239] Applied to the erasure correction layer, this embodiment provides a data processing device in an append write mode, including:

[0240] The data cache module is used to generate a corresponding task number to identify the shard data after each member receives the shard data pushed by the access layer, and store the shard data in the memory; wherein the shard data is obtained by the access layer after receiving the stripe-aligned write request and performing erasure coding calculation on the data segment to be written; each shard data is pushed to the corresponding member by the access layer based on the internal object number requested from the append write layer;

[0241] A transaction generation module, configured to generate a write transaction carrying a task number but no data if the primary member receives a metadata update request sent by the access layer, and send the write transaction to each member;

[0242] The data disk module is used to update the corresponding shard data stored in the memory to the write transaction according to the task number when each member receives the write transaction, and execute the write transaction.

[0243] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0244] Figure 8 A structural diagram of a data processing device in an append write mode provided by another embodiment of the present invention, such as Figure 8 As shown, a data processing device in an append write mode comprises: a memory 10 for storing a computer program;

[0245] The processor 11 is used to implement the steps of a data processing method in an append write mode in the above embodiment when executing a computer program.

[0246] The data processing device in the append write mode provided in this embodiment may include but is not limited to a mobile terminal, a personal computer, a workstation, etc.

[0247] Among them, the processor 11 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 11 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 11 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 11 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 11 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0248] The memory 10 may include one or more computer-readable storage media, which may be non-transitory. The memory 10 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 10 is at least used to store the following computer program 101, wherein, after the computer program is loaded and executed by the processor 11, it can implement the relevant steps of a data processing method in an append write mode disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 10 may also include an operating system 102 and data 103, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 102 may include Windows, Unix, Linux, etc. Data 103 may include, but is not limited to, a data processing method in an append write mode, etc.

[0249] In some embodiments, a data processing device in an additional write mode may further include a display screen 12 , an input / output interface 13 , a communication interface 14 , a power supply 15 , and a communication bus 16 .

[0250] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the data processing device in the append write mode, and may include more or less components than those shown in the figure.

[0251] An embodiment of the present invention provides a data processing device in an append write mode, including a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: a data processing method in an append write mode.

[0252] Finally, the present invention also provides an embodiment corresponding to a non-volatile storage medium. A computer program is stored on the non-volatile storage medium, and when the computer program is executed by a processor, the steps described in the above method embodiment (which may be a method corresponding to the access layer side, a method corresponding to the append write layer side, a method corresponding to the erasure layer side, or a method corresponding to the access layer side, the append write layer side, and the erasure layer side) are implemented.

[0253] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.

[0254] The above is a detailed introduction to a data processing method, device, program product and medium in an append write mode provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

[0255] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A data processing method in an append write mode, characterized in that: Applied to a distributed storage cluster, the distributed storage cluster includes: an access layer, an append write layer and an erasure layer; applied to the access layer side, including: When receiving a stripe-aligned write request, applying to the additional write layer for an internal object number for storing the data segment to be written; Performing erasure coding calculation on the data segment to be written to obtain corresponding data of each fragment; The corresponding shard data are pushed to the members of the corresponding placement group in the erasure correction layer according to the internal object number, so as to achieve data placement on the disk.

2. The data processing method in the append write mode according to claim 1, characterized in that: Pushing the encoded shard data to the members of the corresponding placement group in the erasure correction layer according to the internal object number to implement data placement on the disk includes: Determine, according to the internal object number, the placement group and the group members in the placement group corresponding to when the to-be-written data segment is written into the erasure correction layer; Perform erasure coding calculation on the data segment to be written, and map each of the shard data obtained by coding to each corresponding member in the group; Pushing each of the shard data to the corresponding member in the group; After receiving a successful data push response from each of the group members, a metadata update and data storage request is initiated to the primary member of each of the group members; The metadata to be updated further includes: forward relationship information; the forward relationship information indicates the corresponding relationship between the data segment to be written and each of the fragmented data obtained after erasure coding calculation.

3. The data processing method in the append write mode according to claim 2, characterized in that: When the member in the group fails to write data, the method further includes: Initiate a write request to the primary member; The write request carries the data segment to be written and the internal object number, so that the primary member can complete the erasure writing of the data segment to be written according to the internal object number.

4. The data processing method in the append write mode according to claim 3, characterized in that: Before performing erasure coding calculation on the data segment to be written, the method further includes: Determine whether all members in the group corresponding to the data segment to be written can write data; If yes, proceed to the step of performing erasure coding calculation on the data segment to be written; If not, determining the member in the group in which data cannot be written to be in an unwritable state; When the group member is in the unwritable state, it is determined that the group member fails to write data.

5. The data processing method in the append write mode according to claim 3, characterized in that: If there is a member in the group that does not return the data push success response, the method further includes: Determining the member in the group as being in a push failure state; When the group member is in the push failure state, it is determined that the group member fails to write data.

6. The data processing method in the append write mode according to claim 3, characterized in that: After initiating a metadata update and data storage request to the primary member, the method further includes: If no successful response to data being written to disk is received, it is determined that the member in the group has failed to write data.

7. The data processing method in the append write mode according to claim 2, characterized in that: After the data is stored on the disk, the method further includes: Sending a metadata submission request to the append write layer so that the append write layer writes the submitted metadata into a log or updates the corresponding metadata in the log; The submitted metadata also includes: the positive relationship information.

8. The data processing method in the append write mode according to claim 7, characterized in that: The method further comprises: After receiving the read request, forward relationship information and a buffer data acquisition request are sent to the additional write layer; According to the data segment to be read and the buffer data returned by the append write layer, determining whether it is still necessary to read data from the erasure correction layer; If necessary, read the target data from the erasure correction layer through the forward relationship information; wherein the target data is: data still missing in the data segment to be read based on the acquired buffer data; The buffered data and the target data are combined, and response data is constructed and returned according to the data format required by the read request.

9. The data processing method in the append write mode according to claim 8, characterized in that: Reading target data from the erasure correction layer through the forward relationship information includes: If the target data needs to be subjected to erasure decoding calculation, the target data to be read is aggregated according to stripes; Determine, according to the forward relationship information, each of the data fragments required for stripe-aligned reading of the target data; Reading corresponding shard data from each shard corresponding to the erasure correction layer; Perform erasure decoding calculation on the read slice data to obtain the target data for stripe-aligned reading.

10. The data processing method in the append write mode according to claim 9, characterized in that: Before reading the target data from the erasure correction layer by using the forward relationship information, the method further includes: Determine, according to the forward relationship information, position information of each of the shard data corresponding to the target data in the erasure correction layer; According to the location information, determining whether each of the sliced ​​data is a data slice or a check slice; If the data slice is missing, it is determined that erasure decoding calculation is required for the target data.

11. The data processing method in the append write mode according to any one of claims 2 to 10, characterized in that: The method further comprises: When any request is received, the request is scheduled based on the granularity of the object operated by the request; Among them, different requests for different objects are executed concurrently, and different requests for the same object are processed in order according to the sequence of request time.

12. The data processing method in the append write mode according to claim 11, characterized in that: The request time is the system time when the request is received; Then performing order-preserving processing on the request includes: When receiving the request, adding the request to the end of the request queue; Among them, the request that is ranked first in the request queue blocks the request that is ranked later, and when the request at the head of the request queue is executed, the execution action of the next request is triggered.

13. The data processing method in the append write mode according to claim 12, characterized in that: When the request is a stripe-aligned write request, performing order-preserving processing on the request includes: Directly trigger the stripe-aligned write request to write data to the erasure correction layer; and add the stripe-aligned write request to initiate metadata update and data write request to the primary member to the end of the request queue.

14. A data processing method in an append write mode, characterized in that: Applied to a distributed storage cluster, the distributed storage cluster includes: an access layer, an append write layer and an erasure layer; applied to the append write layer side, including: After receiving the internal object number acquisition request sent by the access layer, an internal object number application transaction is initiated; wherein the internal object number acquisition request is initiated by the access layer after receiving the stripe alignment write request; Obtain the internal object number applied for when the internal object number transaction succeeds; The internal object number is returned to the access layer; wherein, after receiving the internal object number, the access layer: performs erasure coding calculation on the data segment to be written to obtain corresponding shard data; and pushes the corresponding shard data to the group members of the corresponding placement group in the erasure layer according to the internal object number, so as to realize data placement on disk.

15. The data processing method in the append write mode according to claim 14, characterized in that: Also includes: When receiving the metadata submission request sent by the access layer, determining whether the log contains corresponding metadata; If not, writing the metadata into the log; If so, the corresponding metadata in the log will be updated.

16. The data processing method in the append write mode according to claim 14, characterized in that: Also includes: When receiving the forward relationship information and the buffer data acquisition request sent by the access layer, matching the corresponding buffer data from the memory according to the data segment to be read; Acquire the buffered data that hits the memory, and use the data portion that does not hit in the data segment to be read as target data; Acquire positive relationship information corresponding to the target data from the log; The forward relationship information corresponding to the hit buffer data and the target data is returned to the access layer as a response result.

17. A data processing method in an append write mode, characterized in that: Applied to a distributed storage cluster, the distributed storage cluster includes: an access layer, an append write layer and an erasure layer; applied to the erasure layer side, including: After each member in the group receives the shard data pushed by the access layer, a corresponding task number is generated to identify the shard data, and the shard data is stored in the memory; wherein the shard data is obtained by the access layer performing erasure coding calculation on the data segment to be written after receiving the stripe-aligned write request; each of the shard data is pushed by the access layer to the corresponding members in the corresponding placement group based on the internal object number requested from the additional write layer; If the master member among the members in the group receives the metadata update request sent by the access layer, a write transaction carrying the task number but not carrying data is generated, and the write transaction is sent to each member in the group; When each member in the group receives the write transaction, it updates the corresponding shard data stored in the memory into the write transaction according to the task number, and executes the write transaction.

18. The data processing method in the append write mode according to claim 17, characterized in that: After storing the slice data in the memory, the method further includes: Return the current member version information to the access layer; When the primary member receives the metadata update request sent by the access layer, the method further includes: According to the member version information carried in the metadata update request, checking whether the shard data corresponding to the metadata update request is retained in the memory; If not retained, an exception message is returned.

19. A data processing method in an append write mode, characterized in that: Applied to a distributed storage cluster, the distributed storage cluster includes: an access layer, an append write layer and an erasure layer; the method includes: When the access layer receives the stripe-aligned write request, it applies to the additional write layer for an internal object number for storing the data segment to be written; The additional write layer initiates an internal object number application transaction, and returns the internal object number obtained by the application to the access layer; The access layer pushes the corresponding shard data to the members in the corresponding placement group in the erasure layer according to the internal object number; Each member in the group in the erasure correction layer stores the received shard data on disk.

20. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the data processing method in the append write mode as described in any one of claims 1 to 19 are implemented.

21. A data processing device in an append write mode, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data processing method in the append write mode as described in any one of claims 1 to 19 when executing the computer program.

22. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data processing method in the append write mode as described in any one of claims 1 to 19 are implemented.

Citation Information

Cited By

  • Metadata persistence method, electronic equipment, storage medium and program product

    CN120523785A