Data processing method and electronic device of a distributed block storage system

CN121070277BActive Publication Date: 2026-10-27JINAN INSPUR DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511234684.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2026-10-27
Estimated Expiration
2045-08-29

AI Technical Summary

Technical Problem

[0005]本发明的目的是提供一种分布式块存储系统的数据处理方法和电子设备,以解决写差异日志对存储系统性能的影响的技术问题

Benefits of technology

[0044]本发明的有益效果在于,首先,该方法中,目标对象存储设备接收由用于接收业务的节点发送的复合写请求,然后根据复合写请求确定出的复合写操作,得到复合写操作在自身中对应的目标差异日志对象和目标数据对象;之后将复合写操作进行事务合并,并在事务内控制复合写操作以并行方式写到对应的目标差异日志对象和目标数据对象中。通过该方法实现了将差异日志数据和写数据写入到了分布式块存储系统中;其次,分布式块存储系统中至少一个卷在多个放置组中均有对应的差异日志对象,差异日志对象用于存储归属于同一放置组的分块的差异日志信息。即将差异日志对象分散在多个放置组中,由多个差异日志对象来存储差异日志;而不是将卷的所有分块的数据差异日志都保存在一个差异日志对象中,由一个差异日志对象来存储差异日志,故而,降低了差异日志对象的锁冲突;再次,将差异日志对象分散在多个放置组,由于放置组是逻辑管理单元,数据对象会被映射到特定的放置组中,因此,保证了写差异日志和写数据两个操作必然会落在同一个放置组。当用于接收业务的节点对目标分块对应的写数据请求和写差异日志请求合并后得到复合写请求,在网络上一起传输,即合并了两者的IO路径,而不是写数据差异日志和写数据两个过程串行进行,所以,写IO的路径变短,同时系统内的实际写IO次数也减少,即降低了写放大的影响,降低了写差异日志操作引入的额外网络传输时延;另外,通过在一个放置组内进行写差异日志和写数据的事务合并,使得事务的统一调度处理节约了系统资源占用和调度开销,且,写差异日志和写数据两个操作间为并行写,缩短了数据落盘时延,事务合并还提供了数据差异日志和数据之间的强一致性保证,可以适应有强一致性要求的应用场景。可见,通过本发明提供的方法减少了写差异日志对存储系统性能的影响,保证了存储系统的性能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121070277B_ABST
    Figure CN121070277B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method and electronic equipment of a distributed block storage system, and relates to the technical field of distributed block storage. At least one volume in the distributed block storage system has a corresponding differential log object in multiple placement groups, and the differential log object is used for storing differential log information of blocks belonging to the same placement group. That is, the differential log objects are dispersed in multiple placement groups, and the differential log objects are used for storing differential logs, so that lock conflicts of the differential log objects are reduced; the differential log objects are dispersed in multiple placement groups, so that the two operations of writing differential logs and writing data will inevitably fall in the same placement group. By merging the IO paths of the two, the actual write IO times in the system are also reduced, that is, the influence of write amplification is reduced, and additional network transmission delay introduced by the write differential log operation is reduced; in addition, resources and scheduling overhead are saved through transaction merging, and strong consistency between data differential logs and data is also ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed block storage technology, and in particular to a data processing method and electronic device for a distributed block storage system. Background Technology

[0002] Distributed block storage systems have many features such as cloning, migration, local replication, remote replication, and active-active architecture. These features all require data replication between two volumes within or between systems.

[0003] To improve data replication efficiency, related technologies record data difference logs (or simply difference logs) when handling input / output (IO) operations. When data replication of a volume is required, only the parts of the volume with changed data need to be copied or deleted based on the difference log. Because of the introduction of difference log writing, it is necessary to minimize the impact of difference log writing on storage system performance to ensure the overall performance of the storage system.

[0004] Therefore, how to reduce the impact of writing difference logs on the performance of storage systems, thereby ensuring the performance of storage systems, is a technical problem that urgently needs to be solved by those in this field. Summary of the Invention

[0005] The purpose of this invention is to provide a data processing method and electronic device for a distributed block storage system to solve the technical problem of the impact of writing differential logs on the performance of the storage system.

[0006] To address the aforementioned technical problems, this invention provides a data processing method for a distributed block storage system, applied to a target object storage device within the distributed block storage system; wherein at least one volume in the distributed block storage system has corresponding difference log objects in multiple placement groups, the difference log objects being used to store difference log information of blocks belonging to the same placement group; the target object storage device is the object storage device mapped to the target placement group to which the target block belongs; the method includes:

[0007] Receive a composite write request sent by a node used to receive services; wherein the composite write request is obtained by merging the write data request and write difference log request corresponding to the target block by the node used to receive services;

[0008] The compound write operation is determined based on the compound write request;

[0009] Obtain the target differential log object and target data object corresponding to the composite write operation within itself;

[0010] The compound write operation is merged into a transaction, and within the transaction, the compound write operation is controlled to be written to the corresponding target differential log object and target data object in parallel.

[0011] On the one hand, in the distributed block storage system, the entire data logical space corresponding to a volume with a capacity greater than a preset value is divided into multiple volume partitions, and each volume partition corresponds to a differential log object in all placement groups of the distributed block storage system.

[0012] On the other hand, the creation of the difference log object includes:

[0013] Obtain the identifier of the block data object; wherein, the identifier of the data object consists of at least the prefix of the block device, the volume number, and the index of the block data object; the index of the block data object is obtained by sequentially incrementing the number of each block data object according to its order in the data logical space of the volume;

[0014] Map chunked data objects to placement groups;

[0015] Retrieve the block data objects belonging to the same placement group based on the identifier of the block data object;

[0016] Retrieve the chunked data object containing the differential logs;

[0017] Use the block data difference log corresponding to the block data object with the difference log as the target block data difference log;

[0018] At a minimum, obtain the prefix, volume number, placement group identifier, and target block data difference logs belonging to the same placement group for the corresponding difference log information;

[0019] A difference log object corresponding to a placement group is established based on the prefix, volume number, placement group identifier, and target chunk data difference log belonging to the same placement group. The chunk data difference log is stored in key-value pair format. The key value in the key-value pair is the index of the chunk data object, and the value in the key-value pair is used to represent the change status of the chunk data.

[0020] On the other hand, before controlling the compound write operation within the transaction to write to the corresponding target difference log object and target data object in parallel, the following is also included:

[0021] Upon receiving a read / write input / output operation that characterizes access to the target differential log object, determine whether it is the first access;

[0022] If so, then read the data content of the target difference log object and cache the entire data content in memory;

[0023] After caching the entire data content in memory, if a request to read the differential log is received, the data content cached in memory is used to respond to the request.

[0024] On the other hand, after caching the entire data content into memory, before performing transaction merging on the compound write operation and controlling the compound write operation to be written to the corresponding target difference log object and target data object in parallel within the transaction, the method further includes:

[0025] Obtain the data corresponding to the write difference log operation in the compound write operation;

[0026] The data corresponding to the write difference log operation and the data content of the memory cache are merged to obtain the write merged difference log;

[0027] The step of controlling the compound write operation within a transaction to write to the corresponding target difference log object and target data object in parallel includes:

[0028] Within a transaction, the compound write operation is controlled to write the merged differential log to the target differential log object in parallel, and to write the data corresponding to the write data operation in the compound write operation to the target data object.

[0029] On the other hand, the difference log object is an empty data object; writing the merged difference log to the target difference log object includes:

[0030] The merged difference log is written to the target difference log object in the form of metadata of the target difference log object.

[0031] On the other hand, after obtaining the target differential log object and target data object corresponding to the compound write operation within itself, the method further includes:

[0032] Acquire the locks of the target difference log object and the target chunk data object;

[0033] After performing transaction merging on the composite write operation and controlling the composite write operation to be written to the corresponding target difference log object and target data object in parallel within the transaction, the method further includes:

[0034] Release the lock on the target differential log object and the lock on the target chunk data object.

[0035] On the other hand, the target object storage device is the primary object storage device in the target placement group; after merging the data corresponding to the write difference log operation and the data content of the memory cache to obtain the write merged difference log, the method further includes:

[0036] The merged difference log and the data corresponding to the write data operation in the compound write operation are sent to the slave object storage device in the target placement group so that the slave object storage device can write the merged difference log and the data corresponding to the write data operation in the compound write operation in parallel.

[0037] On the other hand, after writing the merged difference log and the data corresponding to the write data operation in the composite write operation to the object storage device in parallel, the method further includes:

[0038] Receive the information sent from the object storage device that represents a write response;

[0039] After releasing the locks on the target differential log object and the target chunk data object, the process further includes:

[0040] The node for receiving services sends information representing a write response to the node, so that after receiving the information representing a write response, the node for receiving services sends information representing a write response to the user.

[0041] To address the aforementioned technical problems, the present invention also provides an electronic device, comprising:

[0042] Memory, used to store computer programs;

[0043] A processor is used to implement the steps of the data processing method of the distributed block storage system described above when executing the computer program.

[0044] The beneficial effects of this invention are as follows: First, in this method, the target object storage device receives a composite write request sent by a node used to receive services. Then, based on the composite write operation determined by the composite write request, it obtains the target differential log object and target data object corresponding to the composite write operation within itself. Next, the composite write operation is merged into a transaction, and within the transaction, the composite write operation is controlled to be written to the corresponding target differential log object and target data object in parallel. This method enables the writing of differential log data and write data into the distributed block storage system. Second, in the distributed block storage system, at least one volume has corresponding differential log objects in multiple placement groups. The differential log objects are used to store differential log information of blocks belonging to the same placement group. Instead of storing all the data difference logs for all blocks of a volume in a single difference log object, the difference logs are distributed across multiple placement groups, with multiple difference log objects storing the difference logs. This reduces lock contention for the difference log objects. Furthermore, by distributing the difference log objects across multiple placement groups, and since placement groups are logical management units, data objects are mapped to specific placement groups. This ensures that both writing difference logs and writing data will necessarily fall within the same placement group. When the node receiving the service merges the write data request and write difference log request corresponding to the target block to obtain a composite write request, it transmits them together over the network. This merges the I / O paths of both processes, instead of performing the write data difference log and write data processes serially. Therefore, the write I / O path is shortened, and the actual number of write I / O operations within the system is reduced, thus mitigating the impact of write amplification and reducing the additional network transmission latency introduced by the write difference log operation. Furthermore, by merging write difference log and write data transactions within a single placement group, unified transaction scheduling saves system resources and scheduling overhead. The write difference log and write data operations are performed in parallel, shortening data write-to-disk latency. Transaction merging also provides strong consistency guarantees between the data difference log and the data, adapting to application scenarios with strong consistency requirements. Therefore, the method provided by this invention reduces the impact of write difference logs on storage system performance, ensuring the performance of the storage system.

[0045] In addition, for volumes with a capacity greater than the preset value, the entire corresponding logical data space is divided into multiple volume partitions. Each volume partition corresponds to a differential log object in all placement groups of the distributed block storage system, which enables more accurate data change information.

[0046] When creating difference log objects, the indexes of the chunk data objects are obtained by sequentially increasing the numbers according to the order of each chunk data object in the volume's logical data space. This avoids index conflicts and ensures the uniqueness of the chunk data object indexes. The chunk data difference log is stored in key-value pair format, that is, it is recorded in a byte-compact key-value pair manner. Each key-value pair occupies only a small number of bytes, minimizing the difference log size and also minimizing memory cache overhead. The cached difference log supports fast lookup by key, facilitating on-demand access to difference log information. Moreover, the difference log object corresponding to the placement group is created based on the prefix of the difference log information corresponding to the placement group, the volume number, the placement group identifier, and the target chunk data difference log belonging to the same placement group. The target chunk data difference log is the log corresponding to the chunk data object where the difference log exists. In other words, the difference logs in the difference data object only need to contain the data (or non-all zeros) of those blocks. If they do not contain data, it means that the corresponding block has never been written or that the data in that block is all zeros. Compared with creating a difference log object corresponding to a placement group based on the difference logs of all blocks belonging to the same placement group, the method provided by this invention reduces the idle time occupied by the difference data object. In addition, when creating the difference log object corresponding to the placement group, the volume number and the identification of the placement group are also considered, which can quickly associate the log with the corresponding volume and placement group. At the same time, it is convenient to quickly locate the target log in the future, reduce the matching cost, and improve the efficiency of the system in managing and using difference logs.

[0047] By using full memory caching of difference logs, when an object storage device receives a read / write I / O request to access a difference log object, if it is the first access, it reads the difference log object data content and caches it in memory. Subsequent reads of the difference log can directly use the cached content for delivery; subsequent writes of the difference log can directly use the cached content to merge the newly written content, thus avoiding read amplification effect.

[0048] The merged difference log is written to the target difference log object as metadata. When writing a data object, in addition to writing the data itself, the metadata of that data object must also be updated. In this method, the difference log object is designed as an empty data object. The difference log information it records is not stored as data, but as part of the metadata of that data object, stored together with the original metadata. This reduces one disk write operation for the disk, saving the consumption of writing object data.

[0049] In addition, the present invention also provides an electronic device that has the same or corresponding technical features as the data processing method of the distributed block storage system mentioned above, and has the same effect. Attached Figure Description

[0050] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 A flowchart illustrating a data processing method for a distributed block storage system provided in an embodiment of the present invention;

[0052] Figure 2 An example diagram of a difference log provided in an embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram of IO in the scenario where each volume partition corresponds to a differential log object in each PG, as provided by the present invention.

[0054] Figure 4 This is a schematic diagram of a bitmap format provided in an embodiment of the present invention;

[0055] Figure 5 This is a schematic diagram of IO in a scenario where each volume uses an independent heterogeneous log object to record the data change status of all blocks in the volume, as provided in an embodiment of the present invention.

[0056] Figure 6 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.

[0058] The core of this invention is to provide a data processing method and electronic device for a distributed block storage system to solve the technical problem of the impact of writing differential logs on the performance of the storage system.

[0059] Distributed block storage is typically organized and managed hierarchically based on storage pools, volumes, and objects. A storage system can be divided into one or more storage pools. Physically, a storage pool generally uses multiple disks on multiple nodes as its storage medium, and these disks are balanced according to a storage pool redundancy strategy, logically divided into multiple redundancy groups (referred to as Placement Groups (PGs) in this paper). Each PG contains multiple disks belonging to different physical nodes, and each disk is logically managed by a process (referred to as an Object Storage Device (OSD) in this paper). At any given time, a PG has one master disk, and the OSD responsible for managing the master disk is called the master OSD.

[0060] A storage pool can contain one or more volumes. The entire data logical space of a volume is divided into blocks of a fixed size (referred to as the block data object size in this article). Each block corresponds one-to-one with a data object (referred to as a block data object) in the storage pool to which the volume belongs. This data object is then mapped to a PG using a fixed hash algorithm. Each block data object in the volume is uniquely assigned an index number to distinguish different block data objects, such as by sequentially incrementing the numbering according to the order of the block data objects in the volume's data logical space.

[0061] Distributed block storage systems offer numerous functionalities such as cloning, migration, local replication, remote replication, and active-active replication, all of which require data replication between two volumes within or between systems. Measures to improve data replication efficiency primarily include: 1) efficient data replication, such as replicating initial all-zero data; 2) incremental replication, which replicates only the portion that has changed relative to a baseline (e.g., a snapshot). The implementation of these measures relies on awareness of the range and state of data changes. Therefore, a common practice is to record the range and state of data changes caused by write I / O (e.g., no data, data present, deleted, no change), i.e., a data difference log (or simply difference log), while processing write I / O. When data replication of a volume is required, only the portions of the volume with changed data need to be copied or deleted based on the difference log. The difference log is also used for functions such as data capacity statistics. While the difference log can improve data replication efficiency, writing to the difference log also incurs additional performance overhead, affecting the performance of online write I / O. Therefore, minimizing the performance overhead of writing the difference log is crucial.

[0062] Therefore, this invention provides a new data processing method for a distributed block storage system to reduce the performance overhead of writing difference logs and improve the performance of the storage system.

[0063] Furthermore, it should be noted that the idea of ​​the new distributed block storage system data processing method provided by this invention can be used not only for data difference logs, but also for the storage organization and management of other types of state information based on block data objects (such as quotas).

[0064] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The data processing method for a distributed block storage system provided in this embodiment is applied to a target object storage device within the distributed block storage system. In the distributed block storage system, at least one volume has corresponding difference log objects in multiple placement groups. These difference log objects are used to store difference log information for blocks belonging to the same placement group. The target object storage device is the object storage device mapped to the target placement group to which the target block belongs. Furthermore, to improve the accuracy of data change reporting, in implementation, in the distributed block storage system, the entire logical data space corresponding to a volume with a capacity greater than a preset value is divided into multiple volume partitions. Each volume partition corresponds to a difference log object in all placement groups of the distributed block storage system. The preset value is not limited and is determined based on actual conditions. Figure 1 A flowchart of a data processing method for a distributed block storage system provided in an embodiment of the present invention is shown below. Figure 1 As shown, the method includes:

[0065] S10: Receive a composite write request sent by the node used to receive services; wherein, the composite write request is obtained by merging the write data request and write difference log request corresponding to the target block by the node used to receive services;

[0066] S11: Determine the compound write operation based on the compound write request;

[0067] S12: Retrieve the target differential log object and target data object corresponding to the compound write operation within itself;

[0068] S13: Merge the compound write operations into a transaction, and within the transaction, control the compound write operations to be written in parallel to the corresponding target differential log objects and target data objects.

[0069] The entire logical data space of a volume is divided into one or more partitions (referred to as volume partitions in this paper) of appropriate size. Each volume partition contains an appropriate number of blocks, and a block does not span two adjacent volume partitions. A single difference log object is split into multiple parts, and each volume partition corresponds to one difference log object in each PG. This object stores the difference logs of all blocks belonging to that PG within the volume partition. Based on this, the operations of writing difference logs and writing data can be merged, that is, the I / O paths of the two can be merged and transmitted together over the network, thereby eliminating the additional network transmission latency introduced by writing difference log operations, or shortening the write I / O path. At the same time, the different difference log objects after splitting support concurrent access, which can greatly reduce the probability of difference log object lock contention.

[0070] Since each volume partition corresponds to a difference log object in each PG, the two operations of writing the difference log and writing data must fall on the same PG. Therefore, it is easy to merge the two operations of writing the difference log and writing data into a local transaction. The two write operations within the transaction can also be optimized from serial to parallel, further reducing network latency and processing latency. The transaction mechanism can guarantee the consistency between the two.

[0071] In this method, the target object storage device receives a composite write request sent by a node used to receive services. Then, based on the composite write operation determined by the request, it obtains the target difference log object and target data object corresponding to the composite write operation within itself. Next, the composite write operation is merged into a transaction, and within the transaction, the composite write operation is controlled to be written to the corresponding target difference log object and target data object in parallel. This method achieves the writing of difference log data and write data into the distributed block storage system. Secondly, in the distributed block storage system, at least one volume has corresponding difference log objects in multiple placement groups. These difference log objects are used to store the difference log information of blocks belonging to the same placement group. This means that the difference log objects are distributed across multiple placement groups, with multiple difference log objects storing the difference logs, rather than storing all the data difference logs of all blocks in a single difference log object. Therefore, lock contention for difference log objects is reduced. Thirdly, by distributing the difference log objects across multiple placement groups, and since placement groups are logical management units, data objects are mapped to specific placement groups. This ensures that both writing difference logs and writing data operations will necessarily fall within the same placement group. When the node receiving the service merges the write data request and write difference log request corresponding to the target block to obtain a composite write request, it transmits them together over the network. This merges the I / O paths of both processes, instead of performing the write data difference log and write data processes serially. Therefore, the write I / O path is shortened, and the actual number of write I / O operations within the system is reduced, thus mitigating the impact of write amplification and reducing the additional network transmission latency introduced by the write difference log operation. Furthermore, by merging write difference log and write data transactions within a single placement group, unified transaction scheduling saves system resources and scheduling overhead. The write difference log and write data operations are performed in parallel, shortening data write-to-disk latency. Transaction merging also provides strong consistency guarantees between the data difference log and the data, adapting to application scenarios with strong consistency requirements. Therefore, the method provided by this invention reduces the impact of write difference logs on storage system performance, ensuring the performance of the storage system.

[0072] To enable the creation of a suitable difference log object, in some embodiments, the creation of the difference log object includes:

[0073] Obtain the identifier of the block data object; wherein, the identifier of the data object consists of at least the prefix of the block device, the volume number, and the index of the block data object; the index of the block data object is obtained by sequentially incrementing the number of each block data object according to its order in the data logical space of the volume;

[0074] Map chunked data objects to placement groups;

[0075] Retrieve the block data objects belonging to the same placement group based on the identifier of the block data object;

[0076] Retrieve the chunked data object containing the differential logs;

[0077] Use the block data difference log corresponding to the block data object with the difference log as the target block data difference log;

[0078] At a minimum, obtain the prefix, volume number, placement group identifier, and target block data difference logs belonging to the same placement group for the corresponding difference log information;

[0079] Based on the prefix, volume number, placement group identifier, and target chunk data difference logs belonging to the same placement group, a difference log object corresponding to the placement group is created. The chunk data difference logs are stored in key-value pair format. The key value in the key-value pair is the index of the chunk data object, and the value in the key-value pair is used to represent the change status of the chunk data.

[0080] Specifically, to help those skilled in the art better understand the creation of the difference log object, i.e., the organization of the difference log content, the following description uses an example of 4MB per block and a total of 1024 PGs in the storage pool:

[0081] a) Divide the entire logical space of the volume into one or more volume partitions of an appropriate size (e.g., 4TB), then each volume partition contains an appropriate number of blocks (e.g., 1M).

[0082] b) Each volume partition corresponds to a differential log object in each PG. The differential log object is named by a combination of volume identifier, baseline (such as snapshot) identifier, volume partition identifier, and PG identifier.

[0083] c) Each difference log object stores the difference logs of all blocks belonging to a certain PG in a volume partition (e.g., an average of 1024 blocks). Each difference data object only contains the difference logs of the blocks that contain data (or are not all zeros). If it does not contain the difference logs, it means that the corresponding block has not been written or the data in the block is all zeros.

[0084] d) Each data chunk difference log is stored in a byte-compressed key-value format. The key-value format of the data chunk difference log is as follows:

[0085] key:<obj_idx> ;value:<obj_bits> ;

[0086] Here, the key is the index of the block data object (obj_idx), and the value is the change status of the block data (obj_bits).<obj_idx> For example, 26 bits supports the corresponding maximum volume capacity; value:<obj_bits> For example, 6 bits.

[0087] e) The difference log is stored in the cache as a variable-length key-value array (vector) to minimize memory overhead. The array supports fast lookup (binary search), and comparisons between two key-value pairs can be performed using integer values, which is highly efficient. Furthermore, the key-value format can be extended; for example, blocks can be further subdivided into two levels, using more bits to describe the data change status of each sub-block, thus providing more accurate data change information.

[0088] In the difference log, `oid` is the identifier for the chunk data object, consisting of a prefix, volume and snapshot identifiers, and the chunk data object index; `pg` is the PG identifier; `objmap` is the difference log object, whose name consists of a prefix, volume and snapshot identifiers, and the `pg` identifier. If the volume is partitioned, the name should also include volume partition information. Each key-value pair (corresponding to one chunk data difference log) in `objmap` is represented as a tuple, where key-value pairs with a value of 0 are not stored. The expressions for `oid` and `pg` are as follows:

[0089] oid:<rbd_data.image_id[.snap_id]> .<obj_idx> ;

[0090] pg:<pool_id> .<pg_id> .<pg_num> .

[0091] The following example illustrates the organization of the differential log content using a volume containing only 6 objects in a storage pool with only two PGs. Figure 2 This is an example diagram of a difference log provided for an embodiment of the present invention. For example... Figure 2As shown, the block data object identifiers are 0 to 5. Each block data object identifier consists of a prefix (rbd_data), the volume to which it belongs, and the corresponding block data object index. For example, block data object identifier 0 corresponds to rbd_data.1.0; block data object identifier 3 corresponds to rbd_data.1.3; block data object identifier 4 corresponds to rbd_data.1.4; block data object identifier 1 corresponds to rbd_data.1.1; block data object identifier 2 corresponds to rbd_data.1.2; and block data object identifier 5 corresponds to rbd_data.1.5. Each block data object is hashed and mapped to its corresponding placement group. For example, block data object identifiers 0, 3, and 4 belong to placement group 0 (PG0's identifier is (1, 0, 2)); block data object identifiers 1, 2, and 5 belong to placement group 1 (PG1's identifier is (1, 1, 2)). Each differential log object corresponding to a placement group consists of a prefix, volume and snapshot identifiers, and a PG identifier. The prefix for a PG is rbd_objmap. Taking the differential log corresponding to placement group 0 as an example, the organizational structure of the differential log is explained. Figure 2 In the difference log corresponding to placement group 0, the blue 1 represents the volume ID, 0 represents the partition number (if the volume is not partitioned, this value is always 0), the orange numbers (1, 0, 2) represent the placement group number, and the red numbers represent the block index; the 0 after the red number in parentheses indicates that there are no differences. It is worth noting that the initialization includes all key-value pairs, and a value of 0 indicates that there are no differences.

[0092] In this method, when creating the difference log object, the index of the chunk data object is obtained by sequentially incrementing the number of each chunk data object according to its order in the volume's logical data space. This avoids index conflicts and ensures the uniqueness of the chunk data object's index. The chunk data difference log is stored in key-value pair format, that is, it is recorded in a byte-compact key-value pair manner. Each key-value pair occupies only a small number of bytes, minimizing the difference log size and also minimizing memory cache overhead. The cached difference log supports fast lookup by key, facilitating on-demand access to difference log information. Furthermore, a difference log object corresponding to the placement group is created based on the prefix of the difference log information corresponding to the placement group, the volume number, the placement group identifier, and the target chunk data difference log belonging to the same placement group. The target chunk data difference log is the log corresponding to the chunk data object where the difference log exists. In other words, the difference logs in the difference data object only need to contain the data (or non-all zeros) of those blocks. If they do not contain data, it means that the corresponding block has never been written or that the data in that block is all zeros. Compared with creating a difference log object corresponding to a placement group based on the difference logs of all blocks belonging to the same placement group, the method provided by this invention reduces the idle time occupied by the difference data object. In addition, when creating the difference log object corresponding to the placement group, the volume number and the identification of the placement group are also considered, which can quickly associate the log with the corresponding volume and placement group. At the same time, it is convenient to quickly locate the target log in the future, reduce the matching cost, and improve the efficiency of the system in managing and using difference logs.

[0093] To avoid write amplification, in some embodiments, before controlling the compound write operation within a transaction to write to the corresponding target difference log object and target data object in parallel, the following is also included:

[0094] Upon receiving read / write input / output operations that characterize the target differential log object being accessed, determine whether it is the first access.

[0095] If so, read the data content of the target differential log object and cache the entire data content in memory;

[0096] After caching all the data content in memory, if a request to read the differential log is received, the cached data content is used to respond to the request.

[0097] Specifically, when the main OSD receives a read / write I / O request to access the difference log object, if it is the first access, it reads the data content of the difference log object and caches it in memory. When reading the difference log later, the cached content can be used directly for delivery. When writing the difference log later, the cached content can be used directly to merge the newly written content, thus avoiding the read amplification effect.

[0098] In some embodiments, after caching the data content in memory, performing transaction merging on the compound write operation, and before controlling the compound write operation to be written in parallel to the corresponding target difference log object and target data object within the transaction, the method further includes:

[0099] Retrieve the data corresponding to the write difference log operation in the compound write operation;

[0100] The data corresponding to the write difference log operation and the data content in the memory cache are merged to obtain the write merged difference log.

[0101] Controlling compound write operations within a transaction to write to the corresponding target difference log object and target data object in parallel includes:

[0102] Within a transaction, control the compound write operation to write the merged difference log to the target difference log object in parallel, and to write the data corresponding to the write data operation in the compound write operation to the target data object.

[0103] In this method, after the difference log data is placed in memory, the difference logs are merged before writing the corresponding data to obtain the final difference log. Compared to writing the difference log data to disk and then reading it from disk, the method provided in this embodiment avoids write amplification and reduces additional overhead.

[0104] To further reduce disk write operations, in some embodiments, the difference log object is an empty data object; writing the merged difference log to the target difference log object includes:

[0105] The merged difference logs are written to the target difference log object as metadata.

[0106] When writing a data object, in addition to writing the data itself, it is also necessary to update the metadata of that data object. Here, the difference log object is designed as an empty data object. The difference log information it records is not stored in the form of data, but is stored as part of the metadata of the data object along with the original metadata. That is, this embodiment only writes the metadata of the difference log object, which reduces one disk write operation for the disk.

[0107] Furthermore, to avoid write conflicts, in some embodiments, after acquiring the target difference log object and target data object corresponding to the compound write operation, the method further includes: acquiring the lock of the target difference log object and the lock of the target block data object; after merging the compound write operation into a transaction and controlling the compound write operation to write to the corresponding target difference log object and target data object in parallel within the transaction, the method further includes: releasing the lock of the target difference log object and the lock of the target block data object. The method provided in this embodiment avoids write conflicts by using locking.

[0108] To ensure data consistency between master and slave devices in a distributed block storage system, in some embodiments, the target object storage device is the master object storage device in the target placement group; after merging the data corresponding to the write difference log operation and the data content in the memory cache to obtain the write merged difference log, the method further includes:

[0109] The merged difference log and the data corresponding to the write data operations in the compound write operation are sent to the slave object storage device in the target placement group so that the slave object storage device can write the merged difference log and the data corresponding to the write data operations in the compound write operation in parallel.

[0110] To facilitate user understanding of the write processing progress, in practice, after writing the data corresponding to the write operations from the parallel write-merged difference log and compound write operations from the object storage device, the method further includes:

[0111] Receive information sent from the object storage device to represent a write response;

[0112] After releasing the locks on the target differential log object and the target chunk data object, the following steps are also included:

[0113] Send information representing a write response to the node used to receive the service, so that the node used to receive the service can send information representing a write response to the user after receiving the information representing a write response.

[0114] To enable those skilled in the art to better understand the data processing method of the distributed block storage system provided by this invention, Figure 3 This is a schematic diagram illustrating the I / O in a scenario where each volume partition corresponds to a differential log object in each PG, as provided by this invention. Figure 3 As shown, in this scenario, the objects involved in the interaction include the service access node (i.e., the node used to receive services) and the first placement group (i.e., PG1). The first placement group includes the master object storage device (i.e., the master OSD) and the slave object storage devices (i.e., the slave OSDs).

[0115] The business access node receives the write data request and sends the write difference log and write data request to the main object storage device of the first placement group;

[0116] In the primary object storage device of the first placement group, acquire the differential log object lock and the block data object; merge the newly written content into the differential log cache; send the merged differential log and write data to the secondary object storage device of the first placement group; write the merged differential log and write data in parallel in the secondary object storage device and the secondary object storage device of the first placement group;

[0117] The first placement group sends a write response from the object storage device to the main object storage device of the first placement group;

[0118] The primary object storage device of the first placement group releases the differential log object lock and the block data object lock; and sends a write response to the business access node.

[0119] The service access node sends a write response to the user.

[0120] After the primary object storage device sends the merged difference log and write data to the secondary object storage device, the merged difference log and write data are written in parallel on the secondary object storage device. To ensure the stability and efficiency of the data writing process on the secondary object storage device, the data processing method also includes:

[0121] After receiving the write data request and corresponding data sent by the main object storage device from the object storage device, the data is fragmented into multiple equal-length data blocks.

[0122] Generate a unique identifier label for each data block; the label contains the data block sequence number and the data check code.

[0123] A temporary cache area is allocated from the storage medium built into the object storage device, and each data block is temporarily stored in the temporary cache area according to the identification tag order;

[0124] Integrity checks are performed on each data block in the temporary cache area. If the check passes, the data block is written from the temporary cache area to the target storage location of the object storage device, and the data storage index is updated. If the check fails, a retransmission request is sent to the main object storage device.

[0125] This method facilitates fine-grained management and tracking of data through data fragmentation and tagging, reducing the impact of single-block data anomalies on the overall write process. The use of temporary cache areas can reduce the frequent read and write losses when data is directly written to the target storage location, thus extending the lifespan of the storage medium. The integrity verification step can detect data transmission anomalies in advance, ensuring the accuracy of written data and reducing the cost of subsequent data error correction, thereby improving the overall stability and efficiency of the data writing process from the object storage device.

[0126] The following section continues to explain the entire process of difference log processing (specifically, methods to accelerate difference log write performance in distributed block storage systems). The difference log processing process includes the following steps:

[0127] (1) Organizational difference log content. This has been described in detail above and will not be repeated here.

[0128] (2) Merge IO paths for writing difference logs and writing data:

[0129] The operations of writing the difference log and writing data for a certain block are combined into a single composite operation, transmitted together over the network, and sent to the master OSD of the PG to which the block belongs for processing.

[0130] (3) Write the difference log and write the data to perform transaction merging:

[0131] The main OSD is responsible for mutual exclusion handling between composite operations, and needs to acquire the object lock of the difference object and the object lock of the block data object at the same time.

[0132] The master OSD is responsible for transaction processing of compound operations, adding two write operations into the same transaction, and the two write operations within the transaction are written in parallel.

[0133] (4) Use full memory caching of difference logs on the main OSD:

[0134] (5) Only write the metadata of the difference log object.

[0135] In this embodiment of the invention, a block and its difference log belong to the same PG, so that the IO paths of the two operations of writing difference logs and writing data can be merged and transmitted together on the network to the main OSD of the PG for processing.

[0136] In practice, to reduce the capacity overhead of the difference log and facilitate management, the data difference log can also be recorded at the block granularity. For example, for each volume, an independently organized data object (hereinafter referred to as the difference log object) is used to record the data change status of all blocks in the volume. Each block only needs to consume a small amount of space (such as a few bits) to express the various data change statuses of the block (this article refers to it as the block data difference log). Figure 4 This is a schematic diagram of a bitmap format provided in an embodiment of the present invention, such as... Figure 4 As shown, the entire difference log information is organized in bitmap format and in the order of the block data object index (e.g., Figure 4The identifier (full name: Block Data Object Identifier, abbreviated as OID) in the bitmap ranges from 1 to m, and the bits in the bitmap range from 0 to 2m. A fixed number of bits (obj_bits) are sequentially allocated to each partition in the bitmap to store the data change status information of that partition. The Block Data Object Identifier (oid) is represented as:

[0137] oid:rbd_data.image_id[.snap_id]>.<obj_idx> ;

[0138] The chunk data object identifier consists of a prefix (rbd_data), a volume (image_id), a snapshot identifier (snap_id), and a chunk data object index (obj_idx).

[0139] Each volume uses a separate differential log object to record the data change status of all blocks within that volume, leading to severe lock contention on the differential log object. Specifically, when multiple concurrent write I / Os need to write to the differential log, because all block data differential logs for the volume are stored in a single differential log object, even if these concurrent write I / Os operate on different blocks, mutual exclusion contention will occur on the differential log object lock during the write operation. The higher the concurrency, the more severe the lock contention, meaning concurrent write I / Os will become a bottleneck when accessing the differential log object. Furthermore, since the differential log object and most block data objects generally belong to different PGs, the processes of writing data to the differential log and writing data can only be performed serially. This results in a longer write I / O path and an increase in the actual number of write I / Os within the system, i.e., a write amplification effect. In addition, a write I / O typically involves only one or a few blocks, covering only a small space in the differential log (such as a few bits), but when writing to disk, it needs to be aligned and merged before writing. This alignment includes not only aligning the blocks containing differential log information (to avoid reading the entire object) but also aligning the smallest underlying allocation unit, i.e., a read amplification effect.

[0140] Figure 5 This is a schematic diagram illustrating the I / O in a scenario where each volume uses an independent heterogeneous log object to record the data change status of all blocks within that volume, as provided in an embodiment of the present invention. Figure 5 As shown, in this scenario, the objects involved in the interaction include the service access node (i.e., the node used to receive services), the first placement group (i.e., PG1), and the second placement group (i.e., PG2). The first placement group includes the master object storage device (i.e., the master OSD) and the slave object storage devices (i.e., slave OSDs); the second placement group includes the master object storage device (i.e., the master OSD) and the slave object storage devices (i.e., slave OSDs). Figure 5 In this context, the input / output process includes:

[0141] The business access node receives a write data request and sends the write difference log request to the main object storage device in the first placement group;

[0142] In the primary object storage device of the first placement group, acquire the differential log object lock; align the write differential log object; align the read content and merge the newly written content; write the merged differential log to the secondary object storage device of the first placement group; write the merged differential log; release the differential log object lock; and send a write response to the business access node.

[0143] Write the merged difference log to the slave object storage device in the first placement group;

[0144] The above process describes the input and output process for writing a difference log. The following section will further explain the input and output process for writing data.

[0145] The business access node sends the write data request to the main object storage device in the second placement group;

[0146] In the master object storage device of the second placement group, the block data object lock is acquired, data is written to itself, and the write data is sent to the slave object storage device in the second placement group; the slave object storage device in the second placement group writes data, and after the write is completed, sends a write response to the master object storage device in the second placement group.

[0147] Finally, the primary object storage device in the second placement group releases the block data object lock and sends a write response to the service access node, which then sends a write response to the user.

[0148] By comparison Figure 3 and Figure 5 It is evident that, in the scenario where each volume partition corresponds to a differential log object in each PG, the IO path is shortened, and write amplification and read amplification effects are avoided and reduced. This improves differential log write performance.

[0149] The data processing method for a distributed block storage system in a scenario where each volume partition corresponds to a differential log object in each PG, provided by this invention, has the following advantages:

[0150] (1) Splitting a single differential log object into multiple objects reduces the probability of lock contention.

[0151] (2) A block and its differential log belong to the same PG, so the IO paths of writing differential log and writing data can be merged and transmitted together on the network to the main OSD of the PG for processing, thereby eliminating the additional network transmission delay introduced by writing differential log operations.

[0152] (3) Within a PG, transaction merging of writing difference logs and writing data can be implemented, which brings at least three benefits: First, the unified scheduling and processing of transactions saves system resources and scheduling overhead; second, the serial writing between the two operations of writing difference logs and writing data can be optimized into parallel writing, shortening the data write-to-disk latency; finally, transaction merging also provides strong consistency guarantee between data difference logs and data, which can adapt to application scenarios with strong consistency requirements.

[0153] (4) Using full memory caching of difference log information avoids the read amplification effect of writing difference log data and also improves the performance of reading difference logs.

[0154] (5) The difference log object is an empty data object. The block data difference log information recorded by it is accessed in the form of the object's metadata, which saves the overhead of writing object data.

[0155] (6) Recording difference logs using byte-compacted KV records and caching and persisting them using KV arrays can minimize the memory cache capacity and disk capacity of the difference logs. In scenarios where there are few differences between two baselines (such as adjacent snapshots) (such as frequent snapshot application scenarios), the KV recording method will actually occupy less memory and disk capacity compared to the original bitmap method.

[0156] The above describes a data processing method for a distributed block storage system applied to a target object storage device in a distributed block storage system. This embodiment also provides a data processing method for a distributed block storage system applied to a node receiving services. The data processing method for a distributed block storage system provided in this embodiment is applied to a node receiving services. In the distributed block storage system, at least one volume has corresponding difference log objects in multiple placement groups. The difference log objects are used to store the difference log information of blocks belonging to the same placement group. The target object storage device is the object storage device mapped to the target placement group to which the target block belongs. The method includes:

[0157] Obtain the write data request and write difference log request corresponding to the target block;

[0158] Merge the write data request and write difference log request corresponding to the target block to obtain a composite write request;

[0159] The compound write request is sent to the target object storage device so that the target object storage device can determine the compound write operation based on the compound write request; the target difference log object and target data object corresponding to the compound write operation are obtained in itself; the compound write operation is merged into a transaction, and within the transaction, the compound write operation is controlled to be written to the corresponding target difference log object and target data object in parallel.

[0160] The data processing method for a distributed block storage system applied to a node receiving services provided in this embodiment has the same or corresponding technical features as the data processing method for a distributed block storage system applied to a target object storage device described above. The embodiments of the data processing method for a distributed block storage system applied to a target object storage device have been described in detail above, and the embodiments of the data processing method for a distributed block storage system applied to a node receiving services will not be repeated here, but the effects are the same.

[0161] In the above embodiments, the data processing method of the distributed block storage system has been described in detail. The present invention also provides embodiments of a data processing device and electronic device for the distributed block storage system. It should be noted that the present invention describes the embodiments of the device portion from two perspectives: one based on functional modules, and the other based on hardware.

[0162] The data processing apparatus for a distributed block storage system provided in this embodiment of the invention includes, from the perspective of functional modules:

[0163] The first receiving module is used to receive a composite write request sent by a node used to receive services; wherein, the composite write request is obtained by merging the write data request and write difference log request corresponding to the target block by the node used to receive services;

[0164] The first determining module is used to determine the compound write operation based on the compound write request;

[0165] The first acquisition module is used to acquire the target differential log object and target data object corresponding to the compound write operation within itself;

[0166] The transaction merging module is used to merge compound write operations into transactions and control the compound write operations to be written to the corresponding target difference log objects and target data objects in parallel within the transaction.

[0167] In some embodiments, the data processing apparatus of the distributed block storage system includes a creation module for creating differential log objects.

[0168] The specific components of the module include:

[0169] The second acquisition module is used to acquire the identifier of the block data object; wherein, the identifier of the data object consists of at least the prefix of the block device, the volume number, and the index of the block data object; the index of the block data object is obtained by sequentially incrementing the number of each block data object according to its order in the data logical space of the volume;

[0170] The mapping module is used to map chunked data objects to placement groups;

[0171] The third acquisition module is used to acquire block data objects belonging to the same placement group based on the identifier of the block data object.

[0172] The fourth acquisition module is used to acquire block data objects that contain differential logs;

[0173] As a module, it is used to take the block data difference log corresponding to the block data object with difference log as the target block data difference log;

[0174] The fifth acquisition module is used to acquire at least the prefix, volume number, placement group identifier, and target block data difference log belonging to the same placement group for the difference log information corresponding to the placement group;

[0175] A submodule is created to build a difference log object corresponding to the placement group based on the prefix, volume number, placement group identifier, and target block data difference log belonging to the same placement group. The block data difference log is stored in key-value pair format. The key value in the key-value pair is the index of the block data object, and the value in the key-value pair is used to represent the change status of the block data.

[0176] In some embodiments, the data processing apparatus of the distributed block storage system further includes:

[0177] The judgment module is used to determine whether it is the first access when it receives a read / write input / output operation that represents the target difference log object. If it is, the read and cache module is triggered; if not, the receive and response module is triggered.

[0178] The read and cache module is used to read the data content of the target differential log object and cache the entire data content in memory;

[0179] The receiving and response module is used to respond to a request to read the differential log using the cached data after the data content has been fully cached in memory.

[0180] In some embodiments, the data processing apparatus of the distributed block storage system further includes:

[0181] The sixth acquisition module is used to acquire the data corresponding to the write difference log operation in the compound write operation;

[0182] The merge module is used to merge the data corresponding to the write difference log operation and the data content in the memory cache to obtain the write merged difference log;

[0183] The transaction merging module is specifically used to control compound write operations within a transaction to write the merged differential log to the target differential log object in parallel, and to write the data corresponding to the write data operations in the compound write operation to the target data object.

[0184] In some embodiments, the data processing apparatus of the distributed block storage system further includes:

[0185] The seventh acquisition module is used to acquire the locks of the target differential log object and the target block data object;

[0186] The release module is used to release the locks on the target differential log object and the target chunk data object.

[0187] In some embodiments, the data processing apparatus of the distributed block storage system further includes:

[0188] The first sending module is used to send the merged differential log and the data corresponding to the write data operation in the compound write operation to the slave object storage device in the target placement group, so that the slave object storage device can write the merged differential log and the data corresponding to the write data operation in the compound write operation in parallel.

[0189] In some embodiments, the data processing apparatus of the distributed block storage system further includes:

[0190] The second receiving module is used to receive information sent from the object storage device to represent a write response;

[0191] The second sending module is used to send information representing a write response to the node used to receive the service, so that after receiving the information representing the write response, the node used to receive the service can send information representing the write response to the user.

[0192] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.

[0193] Figure 6 A structural diagram of an electronic device provided in an embodiment of the present invention. This embodiment is based on a hardware perspective, such as... Figure 6 As shown, the electronic device includes:

[0194] Memory 20 is used to store computer programs;

[0195] The processor 21 is configured to execute a computer program to implement the steps of a data processing method for a distributed block storage system as described in the above embodiments.

[0196] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array. The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.

[0197] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the data processing method of the distributed block storage system disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the data processing method of the distributed block storage system mentioned above.

[0198] In some embodiments, the electronic device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0199] Those skilled in the art will understand that Figure 6 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.

[0200] The electronic device provided in this embodiment of the invention includes 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 for a distributed block storage system, with the same effect as above.

[0201] This invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the data processing method for the distributed block storage system described above.

[0202] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments (which may be a method corresponding to the target object storage device side, a method corresponding to the node side for receiving services, or a method corresponding to both the target object storage device side and the node side for receiving services).

[0203] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, 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. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0204] The computer-readable storage medium provided by this invention includes the data processing method of the distributed block storage system mentioned above, and has the same effect.

[0205] The foregoing has provided a detailed description of the data processing method and electronic device for a distributed block storage system provided by the present invention. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and relevant parts can be referred to the method section. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the present invention.

[0206] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A data processing method for a distributed block storage system, characterized in that, A target object storage device applied in a distributed block storage system; in the distributed block storage system, at least one volume has corresponding differential log objects in multiple placement groups, and the differential log objects are used to store differential log information of blocks belonging to the same placement group; The target object storage device is the object storage device mapped to the target placement group to which the target block belongs; the method includes: Receive a composite write request sent by a node used to receive services; wherein the composite write request is obtained by merging the write data request and write difference log request corresponding to the target block by the node used to receive services; The compound write operation is determined based on the compound write request; Obtain the target differential log object and target data object corresponding to the composite write operation within itself; The composite write operation is merged into a transaction, and within the transaction, the composite write operation is controlled to be written to the corresponding target difference log object and target data object in parallel. Before controlling the compound write operation to be written in parallel to the corresponding target difference log object and target data object within the transaction, the following is also included: Upon receiving a read / write input / output operation that characterizes access to the target differential log object, determine whether it is the first access; If so, then read the data content of the target difference log object and cache the entire data content in memory; After caching the entire data content into memory, if a request to represent reading the difference log is received, the data content cached in memory is used to respond to the request to represent reading the difference log. After caching the entire data content into memory, and before performing transaction merging on the compound write operation and controlling the compound write operation to write to the corresponding target difference log object and target data object in parallel within the transaction, the method further includes: Obtain the data corresponding to the write difference log operation in the compound write operation; The data corresponding to the write difference log operation and the data content of the memory cache are merged to obtain the write merged difference log; The step of controlling the compound write operation within a transaction to write to the corresponding target difference log object and target data object in parallel includes: Within a transaction, the composite write operation is controlled to write the merged differential log to the target differential log object in parallel, and the data corresponding to the write data operation in the composite write operation is written to the target data object. After obtaining the target differential log object and target data object corresponding to the compound write operation within itself, the method further includes: Acquire the locks of the target difference log object and the target chunk data object; After performing transaction merging on the composite write operation and controlling the composite write operation to be written to the corresponding target difference log object and target data object in parallel within the transaction, the method further includes: Release the lock on the target differential log object and the lock on the target chunk data object.

2. The data processing method for the distributed block storage system according to claim 1, characterized in that, In the distributed block storage system, the entire logical space corresponding to a volume with a capacity greater than a preset value is divided into multiple volume partitions, and each volume partition corresponds to a differential log object in all placement groups of the distributed block storage system.

3. The data processing method for a distributed block storage system according to claim 1 or 2, characterized in that, Creating the difference log object includes: Obtain the identifier of the block data object; wherein, the identifier of the data object consists of at least the prefix of the block device, the volume number, and the index of the block data object; the index of the block data object is obtained by sequentially incrementing the number of each block data object according to its order in the data logical space of the volume; Map chunked data objects to placement groups; Retrieve the block data objects belonging to the same placement group based on the identifier of the block data object; Retrieve the chunked data object containing the differential logs; Use the block data difference log corresponding to the block data object with the difference log as the target block data difference log; At a minimum, obtain the prefix, volume number, placement group identifier, and target block data difference logs belonging to the same placement group for the corresponding difference log information; A difference log object corresponding to a placement group is established based on the prefix, volume number, placement group identifier, and target chunk data difference log belonging to the same placement group. The chunk data difference log is stored in key-value pair format. The key value in the key-value pair is the index of the chunk data object, and the value in the key-value pair is used to represent the change status of the chunk data.

4. The data processing method for the distributed block storage system according to claim 3, characterized in that, The difference log object is an empty data object; writing the merged difference log to the target difference log object includes: The merged difference log is written to the target difference log object in the form of metadata of the target difference log object.

5. The data processing method for a distributed block storage system according to claim 4, characterized in that, The target object storage device is the primary object storage device in the target placement group; After merging the data corresponding to the write difference log operation and the data content in the memory cache to obtain the merged difference log, the process further includes: The merged difference log and the data corresponding to the write data operation in the compound write operation are sent to the slave object storage device in the target placement group so that the slave object storage device can write the merged difference log and the data corresponding to the write data operation in the compound write operation in parallel.

6. The data processing method for a distributed block storage system according to claim 5, characterized in that, After writing the merged difference log and the data corresponding to the write data operation in the composite write operation to the object storage device in parallel, the method further includes: Receive the information sent from the object storage device that represents a write response; After releasing the locks on the target differential log object and the target chunk data object, the process further includes: The node for receiving services sends information representing a write response to the node, so that after receiving the information representing a write response, the node for receiving services sends information representing a write response to the user.

7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the data processing method of the distributed block storage system as described in any one of claims 1 to 6 when executing the computer program.

Citation Information

Patent Citations

  • Data reconstruction method and system based on distributed log difference

    CN118132297A