Duplicate data recovery method, system, electronic device and storage medium

By using bluestore as the underlying data management component of the distributed storage cluster and adding metadata information as node logs during different write operations, the dual-write problem in the process of replica data recovery in the distributed storage cluster is solved, and write performance is improved.

CN112162883BActive Publication Date: 2024-10-18BEIJING INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011034112.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-27
Publication Date
2024-10-18
Estimated Expiration
2040-09-27

AI Technical Summary

Technical Problem

Existing technologies suffer from a double-write problem during the recovery of replica data in distributed storage clusters, which leads to reduced write performance.

Method used

Bluestore is set as the underlying data management component of the distributed storage cluster. Metadata information is added during WAL write operations and object data metadata is generated during uppercase operations. This metadata is stored as node logs and the replica data is restored based on the node logs after the cluster loses power.

Benefits of technology

It effectively reduces the probability of dual-write issues during replica data recovery and improves the write performance of the distributed storage cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112162883B_ABST
    Figure CN112162883B_ABST
Patent Text Reader

Abstract

The present application discloses a method for recovering replica data, which includes setting bluestore as the underlying data management component of a distributed storage cluster; when bluestore performs a wal write operation, adding metadata information to the wal data; when bluestore performs a write operation, generating metadata information for the object data; setting the wal data with metadata information added and the metadata information for the object data as a node log; after the distributed storage cluster collectively loses power and is powered on again, recovering the replica data of all nodes in the distributed storage cluster according to the node log. The present application can reduce the probability of double writing problems occurring during the recovery of replica data and improve the write performance of the distributed storage cluster. The present application also discloses a replica data recovery system, a storage medium, and an electronic device, which have the above beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] A distributed storage cluster can aggregate the storage space in multiple storage devices into a storage pool that can provide a unified access interface and management interface to application servers, thereby giving full play to the performance and disk utilization of storage devices.

[0003] The data in the distributed storage cluster can be stored in the form of a replica group, and multiple nodes in the distributed storage node include replicas of the same data to improve the reliability of the distributed storage cluster. When a global power failure occurs in the distributed storage cluster, the related technology usually uses the journal (a log mode of the etx4 file system) mechanism of the traditional file system itself to implement data integrity detection and data recovery, but the journal mechanism will cause serious double writing problems when writing data, resulting in reduced write performance.

[0004] Therefore, how to reduce the probability of double writing problems occurring during the recovery of replica data and improve the writing performance of the distributed storage cluster is a technical problem that those skilled in the art currently need to solve. Summary of the invention

[0005] The purpose of the present application is to provide a copy data recovery method, system, electronic device and storage medium, which can reduce the probability of double writing problems occurring during copy data recovery and improve the write performance of a distributed storage cluster.

[0006] In order to solve the above technical problems, the present application provides a copy data recovery method, which includes:

[0007] Set bluestore as the underlying data management component of the distributed storage cluster;

[0008] When the bluestore performs a wal write operation, metadata information is added to the wal data;

[0009] When the bluestore performs an upper write operation, metadata information of the object data is generated;

[0010] Set the wal data added with the metadata information and the metadata information of the object data as the node log;

[0011] After the distributed storage cluster is collectively powered off and then powered on again, the replica data of all nodes in the distributed storage cluster are restored according to the node log.

[0012] Optionally, restoring the replica data of all nodes in the distributed storage cluster according to the node log includes:

[0013] Determine an arbitration node, and use the arbitration node to determine an online node in the distributed storage cluster;

[0014] Using the arbitration node to send a node log collection command to the online node, so that the online node transmits the metadata information in the node log to the arbitration node;

[0015] Determine a first type of node and a second type of node using the arbitration node; wherein the first type of node is a node storing the node log, and the second type of node is a node not storing the node log;

[0016] A data pull instruction is sent to the second type of node so that the second type of node pulls data from the first type of node and restores the replica data.

[0017] Optionally, before using the arbitration node to send a node log collection command to the online node, the method further includes:

[0018] Determine whether the number of online nodes is greater than a preset number;

[0019] Determine whether the waiting time of the arbitration node is greater than a preset time; wherein the waiting time is the time the arbitration node waits for the node of the distributed storage cluster to send an online notification message;

[0020] If the number of online nodes is greater than a preset number and the waiting time of the arbitration node is greater than a preset time, the operation of using the arbitration node to send a node log collection command to the online nodes is performed.

[0021] Optionally, before using the arbitration node to send a node log collection command to the online node, the method further includes:

[0022] Determine whether the number of online nodes is equal to the total number of nodes in the distributed storage cluster;

[0023] If so, the operation of using the arbitration node to send a node log collection command to the online node is executed.

[0024] Optionally, the second-type node pulls data from the first-type node and restores the replica data, including:

[0025] If the second-type node lacks the wal data with the metadata information added, pull the wal data with the metadata information added from the corresponding first-type node, and overwrite the wal data to the local to restore the copy data;

[0026] If the second-type node lacks the metadata information of the object data, the object data is pulled from the corresponding first-type node and the object data is overwritten locally to restore the copy data.

[0027] Optionally, the metadata information includes object ID, offset and byte length.

[0028] Optionally, the wal write operation includes a small write operation and / or an overwrite write operation;

[0029] The small write operation is the write operation of the bluestore on the data whose amount after splitting is less than the minimum block, and the large write operation is the write operation of the bluestore on the data whose amount after splitting is equal to an integer multiple of the minimum block.

[0030] The present application also provides a copy data recovery system, which includes:

[0031] The component setting module is used to set BlueStore as the underlying data management component of the distributed storage cluster;

[0032] A first metadata generation module, used to add metadata information to WAL data when the bluestore performs a WAL write operation;

[0033] A second metadata generation module, configured to generate metadata information of object data when the bluestore performs an uppercase operation;

[0034] A log setting module, used to set the wal data added with the metadata information and the metadata information of the object data as a node log;

[0035] The data recovery module is used to recover the replica data of all nodes in the distributed storage cluster according to the node log after the distributed storage cluster is collectively powered off and powered on again.

[0036] The present application also provides a storage medium on which a computer program is stored. When the computer program is executed, the steps of the above-mentioned copy data recovery method are implemented.

[0037] The present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned copy data recovery method when calling the computer program in the memory.

[0038] The present application provides a replica data recovery method, including setting bluestore as the underlying data management component of a distributed storage cluster; when the bluestore performs a wal write operation, adding metadata information to the wal data; when the bluestore performs an upper write operation, generating metadata information of the object data; setting the wal data with the metadata information added and the metadata information of the object data as a node log; after the distributed storage cluster is collectively powered off and powered on again, restoring the replica data of all nodes in the distributed storage cluster according to the node log.

[0039] This application uses bluestore as the underlying data management component of the distributed storage cluster, and performs different node log generation operations according to the type of write operation performed by bluestore. Specifically, when bluestore performs a wal write operation, the wal data and corresponding metadata information generated by the wal write operation are used as node logs; when bluestore performs an upper write operation, the metadata information of the object data corresponding to the upper write operation is recorded separately, and only the metadata information of the object data is used as the node log. After the distributed storage cluster is collectively powered off and powered on again, this application restores the replica data according to the previously recorded node log. Since the metadata information generated by the wal write operation and the upper write operation in this application is stored in different ways, the metadata information of the upper write operation is stored separately as a node log, which can effectively avoid the double write problem of the object data corresponding to the upper write operation. It can be seen that this application can reduce the probability of double write problems in the process of replica data recovery and improve the write performance of the distributed storage cluster. The present application also provides a replica data recovery system, an electronic device and a storage medium, which have the above-mentioned beneficial effects and are not repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0041] Figure 1 A flowchart of a copy data recovery method provided in an embodiment of the present application;

[0042] Figure 2A flowchart of a multi-copy data consistency detection and recovery method based on Bluestore provided in an embodiment of the present application;

[0043] Figure 3 A schematic diagram of the structure of a copy data recovery system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0045] See below Figure 1 , Figure 1 A flowchart of a copy data recovery method provided in an embodiment of the present application.

[0046] Specific steps may include:

[0047] S101: Set bluestore as the underlying data management component of the distributed storage cluster;

[0048] Among them, this embodiment can be applied to a distributed storage cluster. Bluestore is a high-performance data storage system. Bluestore is a component of Ceph. In this embodiment, Bluestore is used to replace Filestore as the underlying data management component of the distributed storage cluster to solve the write performance problem caused by double writing in Filestore.

[0049] As a feasible implementation method, the bluestore mentioned in this step can be a simplified and pruned bluestore, which retains the basic data stream processing functions and removes the OSD (Object Storage Devices) and PG (placementgroup, a rule for classifying objects of the same type in ceph) related functions of bluestore as a ceph custom component. When bluestore processes data, this embodiment can add fields (including object ID, offset and length) to record the source of the data, that is, metadata information, based on its original logic. By adding metadata fields to the original wal data structure of bluestore, the speed of data inspection can be accelerated.

[0050] S102: When Bluestore performs a WAL write operation, metadata information is added to the WAL data;

[0051] S103: When bluestore performs an upper write operation, metadata information of the object data is generated;

[0052] Among them, wal (write ahead log) writing operation is a concept in bluestore. Wal writing operation does not need to double write all data, but only needs to store the lowercase and overwritten data in the node log first. This step uses wal data to replace the original entire object data for lowercase and overwritten writes, reducing the amount of data and alleviating the resource consumption caused by data transmission.

[0053] Specifically, the wal write operation includes a small write operation and / or an overwrite write operation. The small write operation is the write operation of the bluestore on the data whose data volume after splitting is less than the minimum block, and the large write operation is the write operation of the bluestore on the data whose data volume after splitting is equal to an integer multiple of the minimum block. The above splitting refers to: splitting the data according to the minimum block (such as 4KB). If the byte length of a certain data is less than the minimum block, the operation of writing the data is determined to be a small write operation; if the byte length of a certain data is an integer multiple of the minimum block, the operation of writing the data is determined to be an large write operation; if the byte length of a certain data is greater than the minimum block but not an integer multiple of the minimum block, the write operation of the data that is an integer multiple of the minimum block is determined to be an large write operation, and the write operation of the remaining less than the minimum block is determined to be a small write operation. For example, if the minimum block is 4KB and a certain data is 9KB, the operation of writing the first 8KB is determined to be a large write operation, and the operation of writing the last 1KB is determined to be a small write operation.

[0054] In this embodiment, when bluestore performs a wal write operation, the data obtained by the wal write operation is wal data. This embodiment can generate metadata information of the wal data and add the metadata information of the wal data to the wal data, that is, store the wal data and its metadata information together. When bluestore performs an uppercase operation, the data obtained by the uppercase operation is object data. This embodiment can generate metadata information of the object data and record the metadata information separately, and does not store the metadata information of the object data together with the object data.

[0055] S104: setting the wal data added with the metadata information and the metadata information of the object data as a node log;

[0056] Among them, this step uses two types of information as node log (logfile, log), the first type of information is wal data and metadata information of wal data, and the second type of information is metadata information of object data. A distributed storage cluster can include multiple nodes. This embodiment can generate a corresponding node log for each node. The node log stores the wal data and metadata information of wal data in the node, as well as metadata information of object data. The above metadata information may include object ID, offset and byte length. Object ID to the identifier of the object where data is written in the node.

[0057] S105: After the distributed storage cluster is collectively powered off and then powered on again, the replica data of all nodes in the distributed storage cluster are restored according to the node log.

[0058] After the distributed storage cluster loses power and then powers on again, this step can use the node logs of all nodes to detect the integrity of the replica data of each node, and use the node logs to perform replica data recovery operations on nodes that lack replica data.

[0059] This embodiment uses bluestore as the underlying data management component of the distributed storage cluster, and performs different node log generation operations according to the type of write operation performed by bluestore. Specifically, when bluestore performs a wal write operation, the wal data and corresponding metadata information generated by the wal write operation are used as node logs; when bluestore performs an upper write operation, the metadata information of the object data corresponding to the upper write operation is recorded separately, and only the metadata information of the object data is used as the node log. After the distributed storage cluster is collectively powered off and powered on again, this embodiment restores the replica data according to the previously recorded node log. Since the metadata information generated by the wal write operation and the upper write operation in this embodiment is stored in different ways, the metadata information of the upper write operation is stored separately as a node log, which can effectively avoid the double write problem of the object data corresponding to the upper write operation. It can be seen that this embodiment can reduce the probability of double write problems during the recovery of replica data and improve the write performance of the distributed storage cluster.

[0060] As for Figure 1 For further description of the corresponding embodiment, in S105, the replica data of all nodes in the distributed storage cluster can be restored in the following manner:

[0061] Step 1: Determine an arbitration node, and use the arbitration node to determine an online node in the distributed storage cluster;

[0062] As a feasible implementation method, before executing step 2, this embodiment can also determine whether the number of online nodes is greater than a preset number; determine whether the waiting time of the arbitration node is greater than a preset time; wherein the waiting time is the time the arbitration node waits for the node of the distributed storage cluster to send an online notification message; if the number of online nodes is greater than the preset number and the waiting time of the arbitration node is greater than the preset time, the operation of using the arbitration node to send a node log collection command to the online nodes in step 2 is executed. When the arbitration node receives the online notification message sent by a node, it determines that the node is an online node.

[0063] As another feasible implementation, before executing step 2, this embodiment can also determine whether the number of online nodes is equal to the total number of nodes in the distributed storage cluster; if so, execute the operation of sending a node log collection command to the online nodes using the arbitration node in step 2.

[0064] Step 2: Use the arbitration node to send a node log collection command to the online node, so that the online node can transmit the metadata information in the node log to the arbitration node;

[0065] Among them, this step can send a node log collection command to all online nodes including the arbitration node. After receiving the node log collection command, all online nodes can read the node log from RocksDB, extract metadata information (including metadata information of WAL data and metadata information of object data) from the node log, and send the metadata information to the arbitration node.

[0066] Step 3: Determine the first type of nodes and the second type of nodes using the arbitration node;

[0067] Among them, the purpose of this step is to divide the online nodes in the distributed storage cluster into first-class nodes and second-class nodes according to whether the base point stores the node log. The first-class nodes are nodes that store the node log, and the second-class nodes are nodes that do not store the node log.

[0068] Step 4: Send a data pull instruction to the second type of node, so that the second type of node pulls data from the first type of node and restores the replica data.

[0069] Among them, the data pull instruction is a data acquisition instruction, which is used to enable the second type of node that does not store the node log to pull data from the first type of node and restore the replica data. Furthermore, the process of the second type of node pulling data from the first type of node and restoring the replica data may include: if the second type of node lacks the wal data with the metadata information added, then pull the wal data with the metadata information added from the corresponding first type of node, and overwrite the wal data locally to restore the replica data; if the second type of node lacks the metadata information of the object data, then pull the object data from the corresponding first type of node, and overwrite the object data locally to restore the replica data. It can be understood that each replica of a replica group can be stored in multiple nodes, and the corresponding first type node mentioned above is a node belonging to the same replica group as the second type node.

[0070] It should be noted that the first-class nodes and the second-class nodes are node classification methods relative to the same replica group. Therefore, in this embodiment, the arbitration node can be used to determine the first-class nodes and the second-class nodes corresponding to each replica group, and a data pull instruction can be sent to the second-class nodes so that the second-class nodes can pull data from the first-class nodes belonging to the same replica group and restore the replica data. For example, there are nodes A, B, and C, and the replicas of replica group 1 are stored in A and B, respectively, and the replicas of replica group 2 are stored in B and C, respectively. If after the distributed storage cluster is collectively powered off and powered on again, no node log is stored in A, only the node log corresponding to replica group 1 is stored in B, and only the node log corresponding to replica group 2 is stored in B, then for replica group 1, B is a first-class node and A is a second-class node; for replica group 2, B is a second-class node and C is a first-class node. Therefore, A can pull the node log corresponding to replica group 1 from B, and B can pull the node log corresponding to replica group 2 from C.

[0071] In this embodiment, after a global power outage occurs in the distributed storage cluster and all power is restored, the node with missing data is found by comparing and analyzing the node logs, and the node is notified to pull data from the node with intact data. Based on the above operations, data detection and recovery in the case of global power outage and power restoration can be achieved. In this embodiment, the PG log mechanism in the traditional solution is abandoned, and a method of directly comparing the wal data in the bluestore is used to detect data consistency. Since the amount of wal data is much smaller than the amount of data of the entire object, the resource loss when recovering data can be reduced, and the recovery speed can be improved. At the same time, using bluestore as the underlying storage also avoids the double writing problem and data loss problem of the file system.

[0072] The following is an example of the implementation process of the above embodiment using practical applications. Figure 2 , Figure 2 A flowchart of a multi-copy data consistency detection and recovery method based on Bluestore provided in an embodiment of the present application. This embodiment may include the following steps:

[0073] Step 1: Simplify and trim bluestore, retain the basic functions of bluestore for data management, and remove various customized functions of bluestore as a ceph customized component (such as support for OSD, PG function, etc.) to optimize the performance of bluestore.

[0074] Step 2: Replace the original traditional file system (such as ext4) of the distributed storage cluster with bluestore, and use bluestore as the underlying data allocation management component. Ext4 is a file management system that is mostly used as the default system disk file system in Linux systems.

[0075] Step 3: Modify the IO process of bluestore so that when bluestore writes wal (such as lowercase or overwrite), metadata information (globally unique ID of the object to be written, offset offset and byte length length) is added to the wal data; when bluestore writes uppercase, metadata information (globally unique ID of the object to be written, offset and length) is recorded separately. This step refers to the wal data with metadata information added and the metadata information recorded separately as node log.

[0076] The lowercase is a concept in bluestore, which is used to indicate the process of writing data whose amount after splitting is less than a minimum block; the uppercase is a concept in bluestore, which indicates the process of writing data whose amount after splitting is exactly equal to an integer multiple of the minimum block.

[0077] Step 4: When the distributed storage cluster loses power collectively and then powers on again, an arbitration node is selected from all nodes, the online nodes in the distributed storage cluster are determined, and a node log collection command is sent to all online nodes (including the arbitration node itself).

[0078] Step 5: After all online nodes receive the command to collect local logs, they start reading node logs from RocksDB (a local database), extracting metadata information from the node logs, and sending the metadata information to the arbitration node.

[0079] Step 6: Find the node where the data is missing and notify the node where the data is missing to pull the data from the node with intact data belonging to the same replica group in order to restore the data replica.

[0080] After receiving the metadata information of all node logs, the arbitration node can divide the online nodes into the first type of nodes and the second type of nodes according to whether the online nodes send metadata information; wherein the first type of nodes are nodes that store the node logs, and the second type of nodes are nodes that do not store the node logs. If the second type of nodes lacks the wal data with the metadata information added, the wal data with the metadata information added is pulled from the first type of nodes belonging to the same replica group, and the wal data is overwritten locally to restore the replica data; if the second type of nodes lacks the metadata information of the object data, the object data is pulled from the first type of nodes belonging to the same replica group, and the object data is overwritten locally to restore the replica data.

[0081] This embodiment uses a streamlined and optimized bluestore to replace the traditional ext4 file system, uses the bluestore wal data with a small amount of data to check data consistency and perform recovery, and provides a log verification process and processing method after the distributed storage system is collectively powered off and powered on again. This embodiment uses a streamlined and improved bluestore as the underlying data organization management component of distributed storage, effectively avoiding the performance loss caused by double writing of the journal log of the traditional ext4 file system, and avoiding data loss caused by not knowing the upper-level data organization format when the journal log is rolled back. At the same time, it can optimize the problem of excessive transmission data volume caused by the need to copy the entire object when restoring data in the native bluestore.

[0082] See also Figure 3 , Figure 3 A schematic diagram of the structure of a copy data recovery system provided in an embodiment of the present application;

[0083] The system may include:

[0084] A component setting module 100 is used to set bluestore as the underlying data management component of a distributed storage cluster;

[0085] A first metadata generation module 200, configured to add metadata information to WAL data when the bluestore performs a WAL write operation;

[0086] A second metadata generation module 300, configured to generate metadata information of object data when the bluestore performs an uppercase operation;

[0087] A log setting module 400, used to set the wal data added with the metadata information and the metadata information of the object data as a node log;

[0088] The data recovery module 500 is used to recover the replica data of all nodes in the distributed storage cluster according to the node log after the distributed storage cluster is collectively powered off and then powered on again.

[0089] This embodiment uses bluestore as the underlying data management component of the distributed storage cluster, and performs different node log generation operations according to the type of write operation performed by bluestore. Specifically, when bluestore performs a wal write operation, the wal data and corresponding metadata information generated by the wal write operation are used as node logs; when bluestore performs an upper write operation, the metadata information of the object data corresponding to the upper write operation is recorded separately, and only the metadata information of the object data is used as the node log. After the distributed storage cluster is collectively powered off and powered on again, this embodiment restores the replica data according to the previously recorded node log. Since the metadata information generated by the wal write operation and the upper write operation in this embodiment is stored in different ways, the metadata information of the upper write operation is stored separately as a node log, which can effectively avoid the double write problem of the object data corresponding to the upper write operation. It can be seen that this embodiment can reduce the probability of double write problems during the recovery of replica data and improve the write performance of the distributed storage cluster.

[0090] The data recovery module 500 includes:

[0091] A node determination unit, used to determine an arbitration node, and use the arbitration node to determine an online node in the distributed storage cluster;

[0092] An information collection unit, configured to use the arbitration node to send a node log collection command to the online node, so that the online node transmits metadata information in the node log to the arbitration node;

[0093] A node classification unit, used to determine a first type of node and a second type of node using the arbitration node; wherein the first type of node is a node storing the node log, and the second type of node is a node not storing the node log;

[0094] A data pulling unit is used to send a data pulling instruction to the second type of node so that the second type of node pulls data from the first type of node and restores the replica data.

[0095] Furthermore, it also includes:

[0096] The first status judgment module is used to judge whether the number of online nodes is greater than a preset number; and is also used to judge whether the waiting time of the arbitration node is greater than a preset time; wherein the waiting time is the time the arbitration node waits for the node of the distributed storage cluster to send an online notification message; if the number of online nodes is greater than a preset number and the waiting time of the arbitration node is greater than the preset time, then the operation of using the arbitration node to send a node log collection command to the online nodes is executed.

[0097] The second status judgment module is used to judge whether the number of the online nodes is equal to the total number of nodes in the distributed storage cluster; if so, execute the operation of using the arbitration node to send a node log collection command to the online nodes.

[0098] Furthermore, the process of the second-type node pulling data from the first-type node and restoring the copy data includes: if the second-type node lacks the wal data with the metadata information added, then pulling the wal data with the metadata information added from the corresponding first-type node, and overwriting the wal data locally to restore the copy data; if the second-type node lacks the metadata information of the object data, then pulling the object data from the corresponding first-type node, and overwriting the object data locally to restore the copy data.

[0099] Furthermore, the metadata information includes an object ID, an offset, and a byte length.

[0100] Further, the wal write operation includes a small write operation and / or an overwrite write operation;

[0101] The small write operation is the write operation of the bluestore on the data whose amount after splitting is less than the minimum block, and the large write operation is the write operation of the bluestore on the data whose amount after splitting is equal to an integer multiple of the minimum block.

[0102] Since the embodiments of the system 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 system part, which will not be repeated here.

[0103] The present application also provides a storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0104] The present application also provides an electronic device, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the electronic device may also include various network interfaces, power supplies and other components.

[0105] 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 various embodiments can be referred to each other. For the system 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 principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.

[0106] 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 "comprises", "comprising" 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 "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A copy data recovery method, characterized in that: include: Set bluestore as the underlying data management component of the distributed storage cluster; When the bluestore performs a wal write operation, metadata information is added to the wal data; When the bluestore performs an upper write operation, metadata information of the object data is generated; Set the wal data added with the metadata information and the metadata information of the object data as the node log; After the distributed storage cluster is collectively powered off and then powered on again, restoring the replica data of all nodes in the distributed storage cluster according to the node log; Wherein, restoring the replica data of all nodes in the distributed storage cluster according to the node log includes: Determine an arbitration node, and use the arbitration node to determine an online node in the distributed storage cluster; Using the arbitration node to send a node log collection command to the online node, so that the online node transmits metadata information in the node log to the arbitration node; Determine a first type of node and a second type of node using the arbitration node; wherein the first type of node is a node storing the node log, and the second type of node is a node not storing the node log; Sending a data pull instruction to the second type of node, so that the second type of node pulls data from the first type of node and restores the replica data; The wal write operation includes a small write operation and / or an overwrite write operation; wherein the small write operation is the write operation of the bluestore on the data whose data volume after splitting is less than the minimum block, and the large write operation is the write operation of the bluestore on the data whose data volume after splitting is equal to an integer multiple of the minimum block.

2. The method for restoring copy data according to claim 1, characterized in that: Before using the arbitration node to send a node log collection command to the online node, the method further includes: Determine whether the number of online nodes is greater than a preset number; Determine whether the waiting time of the arbitration node is greater than a preset time; wherein the waiting time is the time the arbitration node waits for the node of the distributed storage cluster to send an online notification message; If the number of online nodes is greater than a preset number and the waiting time of the arbitration node is greater than a preset time, the operation of using the arbitration node to send a node log collection command to the online nodes is performed.

3. The copy data recovery method according to claim 1, characterized in that: Before using the arbitration node to send a node log collection command to the online node, the method further includes: Determine whether the number of online nodes is equal to the total number of nodes in the distributed storage cluster; If so, the operation of using the arbitration node to send a node log collection command to the online node is executed.

4. The method for restoring copy data according to claim 1, characterized in that: The second type of node pulls data from the first type of node and restores the replica data, including: If the second-type node lacks the wal data with the metadata information added, pull the wal data with the metadata information added from the corresponding first-type node, and overwrite the wal data to the local to restore the copy data; If the second-type node lacks metadata information of the object data, the object data is pulled from the corresponding first-type node and the object data is overwritten locally to restore the copy data.

5. The copy data recovery method according to claim 1, characterized in that: The metadata information includes object ID, offset and byte length.

6. A copy data recovery system, characterized in that: include: The component setting module is used to set BlueStore as the underlying data management component of the distributed storage cluster; A first metadata generation module, used to add metadata information to WAL data when the bluestore performs a WAL write operation; A second metadata generation module, configured to generate metadata information of object data when the bluestore performs an uppercase operation; A log setting module, used to set the wal data added with the metadata information and the metadata information of the object data as a node log; A data recovery module, used to restore the replica data of all nodes in the distributed storage cluster according to the node log after the distributed storage cluster is collectively powered off and powered on again; Wherein, restoring the replica data of all nodes in the distributed storage cluster according to the node log includes: Determine an arbitration node, and use the arbitration node to determine an online node in the distributed storage cluster; Using the arbitration node to send a node log collection command to the online node, so that the online node transmits metadata information in the node log to the arbitration node; Determine a first type of node and a second type of node using the arbitration node; wherein the first type of node is a node storing the node log, and the second type of node is a node not storing the node log; Sending a data pull instruction to the second type of node, so that the second type of node pulls data from the first type of node and restores the replica data; The wal write operation includes a small write operation and / or an overwrite write operation; wherein the small write operation is the write operation of the bluestore on the data whose data volume after splitting is less than the minimum block, and the large write operation is the write operation of the bluestore on the data whose data volume after splitting is equal to an integer multiple of the minimum block.

7. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of the copy data recovery method according to any one of claims 1 to 5 are implemented.

8. A storage medium, characterized in that: The storage medium stores computer executable instructions, and when the computer executable instructions are loaded and executed by the processor, the steps of the copy data recovery method as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Rapid data restoration method for distributed file system (DFS)

    CN102024016A

  • Method, device and system for switching of data stream

    CN103678163A