Full recovery method and device, storage medium and processor

By writing to the database according to preset rules according to the version number and updated version number during the full recovery process, the problem of low write operation efficiency in the existing technology is solved and a more efficient data recovery process is achieved.

CN114691423BActive Publication Date: 2024-09-20BEIJING XSKY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210243446.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2024-09-20
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

When performing full recovery, the existing technology prohibits writing operations on the metadata information being restored, resulting in low write operation efficiency and seriously affecting user experience.

Method used

Send the full recovery version number and metadata information to the target slave node through the target master node, and write the database according to the version number and updated version number according to the preset rules to ensure the order of data writing and avoid prohibition of write operations.

Benefits of technology

It improves the efficiency of write operations, avoids prohibition of write operations during full recovery, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114691423B
    Figure CN114691423B
Patent Text Reader

Abstract

The present application discloses a method and device for full recovery, a storage medium and a processor. The method includes: sending the first target data information to the target slave node through the target master node; sending the second target data information to the target slave node through the target master node; the target slave node writes the first target data information and the second target data information into the first target disk of the target slave node, and feeds back the signal one that the first target data information has been written and / or the signal two that the second target data information has been written to the target master node; in the target slave node, according to the full recovery version number and the update version number, the first target data information and the second target data information are written into the first database in the target slave node according to preset rules. Through this application, the problem in the related art that when performing full recovery, it is prohibited to write the metadata information in the recovery, resulting in relatively low efficiency of the write operation is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data recovery technology, and in particular to a method and device for full recovery, a storage medium, and a processor. Background Art

[0002] A general distributed storage system will record a log (referred to as oplog) for each write operation. The log contains the globally unique version information (referred to as version) of the entire distributed storage system. In the replica mode, each oplog is distributed to each replica node as part of the write operation to complete local persistence. When a replica node crashes and then restarts, it can be compared with the replica node (referred to as the primary node) containing complete data in the distributed storage system based on its latest persistent oplog version information. It can be known which data is missing from the node that was restarted after the crash, and data can be restored from the primary node. However, since the disk space is always limited, it is impossible to persist these oplogs forever. It is inevitable to delete the oplog to release and reduce the space it occupies. Therefore, there may be missing oplogs that cannot be found in the primary node. At this time, a full recovery is required. In the prior art, when performing a full recovery, it is prohibited to write to the metadata file being recovered, that is, if the client IO writes to the file in the full recovery, the client IO is blocked until the full recovery operation of the file is completed. This operation mode makes the efficiency of the write operation relatively low, which seriously affects the user experience.

[0003] With regard to the problem in the related art that when performing full recovery, writing operations on metadata information being recovered is prohibited, resulting in relatively low efficiency of writing operations, no effective solution has been proposed yet. Summary of the invention

[0004] The main purpose of the present application is to provide a method and device for full recovery, a storage medium and a processor to solve the problem in the related art that when performing full recovery, writing operations on metadata information being recovered is prohibited, resulting in relatively low efficiency of writing operations.

[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for full recovery is provided. The method comprises: sending a first target data information to a target slave node through a target master node, wherein the first target data information at least includes: a full recovery version number and a first metadata information, and the target slave node is a slave node to be fully recovered; sending a second target data information to the target slave node through the target master node, wherein the second target data information at least includes: an update version number and a second metadata information, and the second metadata information is update operation information for a target file; the target slave node writes the first target data information and the second target data information into a first target disk of the target slave node, and feeds back a signal 1 that the first target data information has been written and / or a signal 2 that the second target data information has been written to the target master node; in the target slave node, according to the full recovery version number and the update version number, the first target data information and the second target data information are written into the first database in the target slave node according to a preset rule.

[0006] Furthermore, in the target slave node, according to the full recovery version number and the update version number, writing the first target data information and the second target data information into the first database in the target slave node according to the preset rules includes: if the full recovery version number is less than the update version number, writing the first target data information into the first database according to the preset rules; if the full recovery version number is greater than or equal to the update version number, writing the second target data information into the first database according to the preset rules, and then writing the first target data information into the first database according to the preset rules.

[0007] Furthermore, before sending the first target data information to the target slave node through the target master node, the method also includes: obtaining the current submission version number one of the target master node, and using the submission version number one as the full recovery version number; reading a preset amount of first metadata information from the second database of the target master node to obtain the first metadata information; and using the full recovery version number and the first metadata information as the first target data information.

[0008] Furthermore, after sending the first target data information to the target slave node through the target master node, the method also includes: scanning through the target master node whether there is third metadata information in the second database, wherein the third metadata information is metadata information other than the first metadata information; if the third metadata information exists, obtaining the current submission version number two of the target master node; using the submission version number two as the full recovery version number; using the full recovery version number and the third metadata information as the first target data information, and sending the first target data information to the target slave node; continuing to execute the step of scanning through the target master node whether there is fourth metadata information in the second database until all metadata information in the second database has been sent to the target slave node, or the number of first target data information sent by the target master node has reached a preset value of one.

[0009] Furthermore, before sending the second target data information to the target slave node through the target master node, the method also includes: receiving second metadata information of the update operation for the target file through the target master node, and assigning an update version number to the second metadata information; and using the update version number and the second metadata information as the second target data information.

[0010] Furthermore, after sending the second target data information to the target slave node through the target master node, the method also includes: the target master node writes the second target data information to the second target disk of the target master node; after receiving the signal two, the target master node feeds back signal three to the target object, wherein the signal three indicates that the update operation for the target file has been successful.

[0011] Furthermore, after the target master node feeds back signal 2 to the target object, the method also includes: writing the second target data information into a second database of the target master node according to the preset rules; and using the updated version number in the second target data information as the latest submitted version number of the target master node.

[0012] Furthermore, before sending the first target data information to the target slave node through the target master node, the method also includes: communicating the target master node with multiple slave nodes to determine the target slave node to be fully restored; the target master node informs the target slave node that the updated version number to be sent is the preset value two, and the full recovery version number is greater than or equal to the preset value three, wherein the preset value two is greater than or equal to the preset value three.

[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a device for full recovery is provided. The device includes: a first sending unit, used to send first target data information to a target slave node through a target master node, wherein the first target data information at least includes: a full recovery version number and a first metadata information, and the target slave node is a slave node to be fully recovered; a second sending unit, used to send second target data information to the target slave node through the target master node, wherein the second target data information at least includes: an update version number and a second metadata information, and the second metadata information is update operation information for the target file; a first feedback unit, used for the target slave node to write the first target data information and the second target data information into the first target disk of the target slave node, and feedback the signal 1 that the first target data information has been written and / or the signal 2 that the second target data information has been written to the target master node; a first writing unit, used in the target slave node, according to the full recovery version number and the update version number, write the first target data information and the second target data information into the first database in the target slave node according to a preset rule.

[0014] Furthermore, the first writing unit includes: a first writing module, used to write the first target data information into the first database according to a preset rule if the full recovery version number is less than the update version number; a second writing module, used to write the second target data information into the first database according to the preset rule if the full recovery version number is greater than or equal to the update version number, and then write the first target data information into the first database according to the preset rule.

[0015] Furthermore, the device also includes: a first acquisition unit, used to obtain the current submission version number one of the target master node before sending the first target data information to the target slave node through the target master node, and use the submission version number one as the full recovery version number; a reading unit, used to read a preset amount of first metadata information from the second database of the target master node to obtain the first metadata information; a first determination unit, used to use the full recovery version number and the first metadata information as the first target data information.

[0016] Furthermore, the device also includes: a scanning unit, which is used to scan whether there is third metadata information in the second database through the target master node after sending the first target data information to the target slave node through the target master node, wherein the third metadata information is metadata information other than the first metadata information; a second acquisition unit, which is used to obtain the current submission version number two of the target master node if the third metadata information exists; a second determination unit, which is used to use the submission version number two as the full recovery version number; a third determination unit, which is used to use the full recovery version number and the third metadata information as the first target data information, and send the first target data information to the target slave node; a first execution unit, which is used to continue to execute the step of scanning whether there is fourth metadata information in the second database through the target master node until all metadata information in the second database has been sent to the target slave node, or the number of first target data information sent by the target master node has reached a preset value of one.

[0017] Furthermore, the device also includes: a receiving unit, which is used to receive second metadata information of an update operation for the target file through the target master node before sending the second target data information to the target slave node through the target master node, and assign an update version number to the second metadata information; a fourth determination unit, which is used to use the update version number and the second metadata information as the second target data information.

[0018] Furthermore, the device also includes: a second writing unit, which is used for the target master node to write the second target data information to the second target disk of the target master node after sending the second target data information to the target slave node through the target master node; a second feedback unit, which is used for the target master node to feedback signal three to the target object after receiving signal two, wherein signal three indicates that the update operation on the target file has been successful.

[0019] Furthermore, the device also includes: a third writing unit, used to write the second target data information into the second database of the target master node according to the preset rules after the target master node feeds back signal 2 to the target object; a fourth determination unit, used to use the updated version number in the second target data information as the latest submitted version number of the target master node.

[0020] Furthermore, the device also includes: a communication unit, used to communicate with multiple slave nodes before sending the first target data information to the target slave node through the target master node to determine the target slave node to be fully restored; an update unit, used by the target master node to inform the target slave node that the update version number to be sent is a preset value of two, and that the full recovery version number is greater than or equal to a preset value of three, wherein the preset value of two is greater than or equal to the preset value of three.

[0021] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer-readable storage medium is provided, wherein the storage medium stores a program, wherein when the program is running, the device where the storage medium is located is controlled to execute any one of the full recovery methods described above.

[0022] In order to achieve the above objective, according to another aspect of the present application, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the above-mentioned full recovery methods when running.

[0023] Through the present application, the following steps are adopted: sending first target data information to a target slave node through a target master node, wherein the first target data information at least includes: a full recovery version number and first metadata information, and the target slave node is a slave node to be fully recovered; sending second target data information to a target slave node through the target master node, wherein the second target data information at least includes: an update version number and second metadata information, and the second metadata information is update operation information for a target file; the target slave node writes the first target data information and the second target data information into a first target disk of the target slave node, and feeds back a signal one indicating that the first target data information has been written and / or a signal two indicating that the second target data information has been written to the target master node; in the target slave node, according to the full recovery version number and the update version number, the first target data information and the second target data information are written into a first database in the target slave node according to preset rules, thereby solving the problem in the related art that when performing a full recovery, writing operations on metadata information in recovery is prohibited, resulting in relatively low efficiency of write operations. By writing the first target data information and the second target data information into the first target disk of the target slave node, and then writing the first target data information and the second target data information into the first database of the target slave node according to the full recovery version number and the update version number, the phenomenon of prohibiting the writing operation of the metadata information being recovered during the full recovery process is avoided, thereby achieving the effect of improving the efficiency of the write operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0025] Figure 1 is a flowchart of a method for full recovery provided according to an embodiment of the present application;

[0026] Figure 2 is a flowchart of an optional full recovery method provided according to an embodiment of the present application;

[0027] Figure 3 It is a schematic diagram of a device for full recovery provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0029] In order to enable those skilled in the art to better understand the solution of the present application, 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 only 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 should fall within the scope of protection of the present application.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] The present invention is described below in conjunction with preferred implementation steps. Figure 1 is a flowchart of a method for full recovery provided in an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0032] Step S101, sending first target data information to a target slave node through a target master node, wherein the first target data information includes at least: a full recovery version number and first metadata information, and the target slave node is a slave node to be fully recovered.

[0033] Specifically, the target master node (also called the primary node) determines the target slave node that needs to be fully restored by communicating with all the slave nodes. Then the first target data information including the full recovery version number and the first metadata information is sent to the target slave node. The first metadata information may be partial metadata information of the target master node, or it may be all metadata information of the target master node. In the process of full recovery, the target master node contains a large amount of metadata information, which can only be sent to the target slave node in batches. In the process of full recovery, the target master node continues to send the full recovery version number and metadata information to the target slave node until all the metadata information of the target master node has been sent or the number of transmissions of the target master node reaches the upper limit. The full recovery version number may remain unchanged or change all the time during the full recovery process. The full recovery version number is determined by the submission version number, and the submission version number changes with the change of the update version number.

[0034] Step S102: Send the second target data information to the target slave node through the target master node, wherein the second target data information at least includes: an update version number and second metadata information, and the second metadata information is update operation information for the target file.

[0035] Specifically, while the target master node sends the first target data information, there may be an update operation for the target file. In this case, the target master node will also send the update version number and the second metadata information to the target slave node. When the second metadata information of the update operation for the target file is successfully written into the second database of the target master node, the update version number will be used as the latest submitted version number of the target master node. It should be noted that there is no order in which the target master node successfully writes the second metadata information into the second database of the target master node and sends the second metadata information to the target slave node.

[0036] Step S103, the target slave node writes the first target data information and the second target data information into the first target disk of the target slave node, and feeds back signal one indicating that the first target data information has been written and / or signal two indicating that the second target data information has been written to the target master node.

[0037] Specifically, after the target slave node receives the first target data information and the second target data information, it first writes the first target data information and the second target data information into the first target disk of the target slave node, and feeds back the signal one and the signal two that the data of the target master node has been written. However, for the target slave node, this process can only be considered complete when the data is written into the first database in the target slave node. The order in which the target slave node receives the first target data information and the second target data information is uncertain, and there is no order of precedence in writing into the first target disk. However, when writing into the first database, the order of writing needs to be guaranteed to ensure that the latest data information can be written into the first database last. The first target disk can use an SSD cache disk. For random small-granularity read and write operations, the performance of SSD is at least two orders of magnitude higher than that of HDD. For file access updates on metadata information, it is a typical small-granularity read and write operation. Therefore, for greater iops and lower latency, an SSD cache disk is introduced as the first target disk. It should be noted that after the data is written into the first database of the target slave node, the data information in the first target disk will be cleared.

[0038] Step S104, in the target slave node, according to the full recovery version number and the update version number, the first target data information and the second target data information are written into the first database in the target slave node according to a preset rule.

[0039] Specifically, the order of writing the first target data information and the second target data information into the first database in the target slave node needs to be determined according to the full recovery version number and the update version number, and the first target data information and the second target data information are written into the first database in the target slave node in strict accordance with the preset rules. The kv store backend based on rocks DB can be used as the first database. The data in the rocks DB database is stored in the form of key-value pairs. This form ensures atomicity, that is, if a certain key is updated and read at the same time, the key value pair is stored in the first database.<key,value> When the key-value pair is a new key-value pair, the update operation will not be affected, and the read operation will either read the old key-value pair or the updated key-value pair, but will not read a half-new and half-old key-value pair. Therefore, the first target data information and the first target data information are written into the first database in the form of a key-value pair (i.e., the above preset rule).

[0040] To summarize, by writing the first target data information and the second target data information into the first target disk of the target slave node, and then writing the first target data information and the second target data information into the first database of the target slave node according to the full recovery version number and the update version number, the phenomenon of prohibiting the writing operation of the metadata information being recovered during the full recovery process is avoided, thereby improving the efficiency of the writing operation.

[0041] Optionally, in the full recovery method provided in an embodiment of the present application, in the target slave node, according to the full recovery version number and the update version number, the first target data information and the second target data information are written into the first database in the target slave node according to preset rules, including: if the full recovery version number is less than the update version number, the first target data information is written into the first database according to the preset rules; if the full recovery version number is greater than or equal to the update version number, the second target data information is written into the first database according to the preset rules, and then the first target data information is written into the first database according to the preset rules.

[0042] Specifically, when the full recovery version number is less than the update version number, the first target data information is written to the first database. When the full recovery version number is greater than or equal to the update version number, the second target data information is written to the first database before the first target data information is written to the first database. The above judgment process ensures the order of data writing to the first database, avoiding the situation where the metadata information that is last written to the first database is not the latest one.

[0043] Optionally, in the full recovery method provided in an embodiment of the present application, before sending the first target data information to the target slave node through the target master node, the method also includes: obtaining the current submission version number one of the target master node, and using the submission version number one as the full recovery version number; reading a preset amount of first metadata information from the second database of the target master node to obtain the first metadata information; and using the full recovery version number and the first metadata information as the first target data information.

[0044] Specifically, the current submission version number 1 of the target master node is used as the full recovery version number, and then a preset amount of first metadata information is read in the second database, and then the full recovery version number and the first metadata information are used as the first target data information. The above steps ensure that the target slave node can accurately obtain the full recovery version number.

[0045] Optionally, in the full recovery method provided in an embodiment of the present application, after sending the first target data information to the target slave node through the target master node, the method also includes: scanning through the target master node whether there is third metadata information in the second database, wherein the third metadata information is metadata information other than the first metadata information; if the third metadata information exists, obtaining the current submission version number two of the target master node; using the submission version number two as the full recovery version number; using the full recovery version number and the third metadata information as the first target data information, and sending the first target data information to the target slave node; continuing to execute the step of scanning through the target master node whether there is fourth metadata information in the second database until all metadata information in the second database has been sent to the target slave node, or the number of first target data information sent by the target master node has reached a preset value of one.

[0046] Specifically, during the full recovery process, the target master node continuously sends the full recovery version number and metadata information to the target slave node until all the metadata information of the target master node has been sent or the number of transmissions of the target master node reaches the upper limit. Therefore, the target master node determines whether there is a third metadata information by scanning the second database. When the third metadata information exists, it queries again to obtain the current submission version number two of the target master node, and then sends the submission version number two and the third metadata information as the new first target data information to the target slave node. It should be noted that the submission version number two may be the same as the submission version number one, or it may be different. It cannot be determined whether the target master node has successfully written the second metadata information of the update operation for the target file to the second database of the target master node before querying to obtain the submission version number two. Therefore, the submission version number may have changed, or it may not have changed. Through the above steps, it is guaranteed that the target slave node completes the full recovery work.

[0047] Optionally, in the full recovery method provided in an embodiment of the present application, before sending the second target data information to the target slave node through the target master node, the method also includes: receiving second metadata information of the update operation for the target file through the target master node, and assigning an update version number to the second metadata information; using the update version number and the second metadata information as the second target data information.

[0048] Specifically, the target master node receives the second metadata information of the update operation for the target file. There may be more than one update operation. The target master node assigns an update version number to the second metadata information according to the order in which it is received, and then uses the update version number and the second metadata information as the second target data information. Through the above steps, the write operation is ensured to proceed smoothly.

[0049] Optionally, in the full recovery method provided in an embodiment of the present application, after sending the second target data information to the target slave node through the target master node, the method also includes: the target master node writes the second target data information to the second target disk of the target master node; after receiving signal two, the target master node feeds back signal three to the target object, wherein signal three indicates that the update operation on the target file has been successful.

[0050] Specifically, the target master node also first writes the second target data information to the second target disk of the target master node, and after receiving the signal two from the target slave node, it feeds back the signal three indicating that the update operation for the target file has been successful to the target object. However, for the target master node, this process is considered complete only when the data is written to the second database in the target master node. The kv store backend based on rocks DB is also used as the second database. The ssd cache disk is used as the second target disk. Through the above steps, only the data needs to be written to the target disk to indicate that the write operation has been completed, which reduces the waiting time for the write operation and improves the efficiency of the write operation.

[0051] Optionally, in the full recovery method provided in an embodiment of the present application, after the target master node feeds back signal two to the target object, the method also includes: writing the second target data information into the second database of the target master node according to preset rules; and using the updated version number in the second target data information as the latest submitted version number of the target master node.

[0052] Specifically, it is explained here that the submission version number of the target master node changes with the change of the submission version number. Such a processing method further ensures the order of data writing in the first database.

[0053] Optionally, in the full recovery method provided in an embodiment of the present application, before sending the first target data information to the target slave node through the target master node, the method also includes: communicating the target master node with multiple slave nodes to determine the target slave node to be fully recovered; the target master node informs the target slave node that the updated version number to be sent is the preset value two, and the full recovery version number is greater than or equal to the preset value three, wherein the preset value two is greater than or equal to the preset value three.

[0054] Specifically, the target master node (also called the primary node) communicates with all slave nodes to determine the target slave node that needs to be fully restored. The target master node will inform the target slave node that the update version number received later is the preset value 2, and the full recovery version number is greater than or equal to the preset value 3. This operation is due to the fact that the order in which the target slave node receives the first target data information and the second target data information is uncertain, so as to avoid the target slave node writing the second target data information into the first database after receiving the second target data information first.

[0055] The method for full recovery provided in an embodiment of the present application includes sending first target data information to a target slave node through a target master node, wherein the first target data information includes at least: a full recovery version number and first metadata information, and the target slave node is a slave node to be fully recovered; sending second target data information to a target slave node through the target master node, wherein the second target data information includes at least: an update version number and second metadata information, and the second metadata information is update operation information for a target file; the target slave node writes the first target data information and the second target data information into a first target disk of the target slave node, and feeds back a signal one indicating that the first target data information has been written and / or a signal two indicating that the second target data information has been written to the target master node; in the target slave node, according to the full recovery version number and the update version number, the first target data information and the second target data information are written into a first database in the target slave node according to preset rules, thereby solving the problem in the related art that when performing a full recovery, writing operations on metadata information being recovered is prohibited, resulting in relatively low efficiency of write operations. By writing the first target data information and the second target data information into the first target disk of the target slave node, and then writing the first target data information and the second target data information into the first database of the target slave node according to the full recovery version number and the update version number, the phenomenon of prohibiting the writing operation of the metadata information being recovered during the full recovery process is avoided, thereby achieving the effect of improving the efficiency of the write operation.

[0056] like Figure 2 As shown, a flowchart of an optional full recovery method provided according to an embodiment of the present application is shown. Figure 2 ①-⑥ represent the processing flow of write operations, and ⑦-⑩ represent the processing flow of full recovery.

[0057] ① Indicates that the write operation (client op) is sent to the target master node (primary mds);

[0058] ②Indicates that the primary mds sends the client op to other target slave nodes (slave mds);

[0059] ③Indicates that the SSD cache disk of the slave MDS has completed the write operation;

[0060] ④ Indicates that the slave mds replies to the primary mds with a successful write message;

[0061] ⑤Indicates that the primary MDS has completed writing to the SSD cache disk locally;

[0062] ⑥ After the primary mds and all slave mds complete writing, they reply to the client;

[0063] ⑦ indicates reading metadata information from the secondary database (rocks DB) of the primary mds;

[0064] ⑧Indicates that the primary mds sends a sync op (metadata information and full recovery version number, etc.) to the target slave node (slave mds) that needs full recovery;

[0065] ⑨ indicates that the SSD cache disk of the slave MDS has completed writing the sync op;

[0066] ⑩ Indicates that the slave mds replies to the primary mds with a successful write message.

[0067] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0068] The embodiment of the present application also provides a device for full recovery. It should be noted that the device for full recovery in the embodiment of the present application can be used to execute the method for full recovery provided in the embodiment of the present application. The device for full recovery provided in the embodiment of the present application is introduced below.

[0069] Figure 3 Schematic diagram of a device for full recovery according to an embodiment of the present application. Figure 3 As shown, the device includes: a first sending unit 301, a second sending unit 302, a first feedback unit 303 and a first writing unit 304.

[0070] The first sending unit 301 is used to send first target data information to a target slave node through a target master node, wherein the first target data information at least includes: a full recovery version number and first metadata information, and the target slave node is a slave node to be fully recovered.

[0071] The second sending unit 302 is used to send second target data information to the target slave node through the target master node, wherein the second target data information at least includes: an update version number and second metadata information, and the second metadata information is update operation information for the target file.

[0072] The first feedback unit 303 is used for the target slave node to write the first target data information and the second target data information into the first target disk of the target slave node, and to feed back signal one indicating that the first target data information has been written and / or signal two indicating that the second target data information has been written to the target master node.

[0073] The first writing unit 304 is used to write the first target data information and the second target data information into the first database in the target slave node according to a preset rule based on the full recovery version number and the update version number in the target slave node.

[0074] The full recovery device provided in the embodiment of the present application sends the first target data information to the target slave node through the target master node through the first sending unit 301, wherein the first target data information at least includes: a full recovery version number and first metadata information, and the target slave node is a slave node to be fully recovered; the second sending unit 302 sends the second target data information to the target slave node through the target master node, wherein the second target data information at least includes: an update version number and a second metadata information, and the second metadata information is update operation information for the target file; the first feedback unit 303 writes the first target data information and the second target data information into the first target disk of the target slave node, and feeds back a signal 1 indicating that the first target data information has been written and / or a signal 2 indicating that the second target data information has been written to the target master node; the first writing unit 304 writes the first target data information and the second target data information into the first database in the target slave node according to the full recovery version number and the update version number in the target slave node according to a preset rule, thereby solving the problem in the related art that when performing full recovery, the write operation is prohibited for the metadata information being recovered, resulting in relatively low efficiency of the write operation. By writing the first target data information and the second target data information into the first target disk of the target slave node, and then writing the first target data information and the second target data information into the first database of the target slave node according to the full recovery version number and the update version number, the phenomenon of prohibiting the writing operation of the metadata information being recovered during the full recovery process is avoided, thereby achieving the effect of improving the efficiency of the write operation.

[0075] Optionally, in the full recovery device provided in an embodiment of the present application, the first writing unit 304 includes: a first writing module, used to write the first target data information into the first database according to a preset rule if the full recovery version number is less than the update version number; a second writing module, used to write the second target data information into the first database according to the preset rule if the full recovery version number is greater than or equal to the update version number, and then write the first target data information into the first database according to the preset rule.

[0076] Optionally, in the full recovery device provided in an embodiment of the present application, the device also includes: a first acquisition unit, used to obtain the current submission version number one of the target master node before sending the first target data information to the target slave node through the target master node, and use the submission version number one as the full recovery version number; a reading unit, used to read a preset amount of first metadata information from the second database of the target master node to obtain the first metadata information; a first determination unit, used to use the full recovery version number and the first metadata information as the first target data information.

[0077] Optionally, in the full recovery device provided in the embodiment of the present application, the device also includes: a scanning unit, which is used to scan whether there is third metadata information in the second database through the target master node after sending the first target data information to the target slave node through the target master node, wherein the third metadata information is metadata information other than the first metadata information; a second acquisition unit, which is used to obtain the current submission version number two of the target master node if the third metadata information exists; a second determination unit, which is used to use the submission version number two as the full recovery version number; a third determination unit, which is used to use the full recovery version number and the third metadata information as the first target data information, and send the first target data information to the target slave node; a first execution unit, which is used to continue to execute the step of scanning whether there is fourth metadata information in the second database through the target master node until all metadata information in the second database has been sent to the target slave node, or the number of first target data information sent by the target master node has reached a preset value of one.

[0078] Optionally, in the full recovery device provided in an embodiment of the present application, the device also includes: a receiving unit, used to receive second metadata information of an update operation for the target file through the target master node before sending the second target data information to the target slave node through the target master node, and assign an updated version number to the second metadata information; a fourth determination unit, used to use the updated version number and the second metadata information as the second target data information.

[0079] Optionally, in the full recovery device provided in an embodiment of the present application, the device also includes: a second writing unit, used for the target master node to write the second target data information to the second target disk of the target master node after sending the second target data information to the target slave node through the target master node; a second feedback unit, used for the target master node to feedback signal three to the target object after receiving signal two, wherein signal three indicates that the update operation on the target file has been successful.

[0080] Optionally, in the full recovery device provided in an embodiment of the present application, the device also includes: a third writing unit, used to write the second target data information into the second database of the target master node according to preset rules after the target master node feedbacks signal two to the target object; a fourth determination unit, used to use the updated version number in the second target data information as the latest submitted version number of the target master node.

[0081] Optionally, in the full recovery device provided in the embodiment of the present application, the device also includes: a communication unit, used to communicate with the target master node with multiple slave nodes to determine the target slave node to be fully recovered before sending the first target data information to the target slave node through the target master node; an update unit, used by the target master node to inform the target slave node that the update version number to be sent is a preset value of two, and that the full recovery version number is greater than or equal to a preset value of three, wherein the preset value two is greater than or equal to the preset value three.

[0082] The device for full recovery includes a processor and a memory. The above-mentioned first sending unit 301, second sending unit 302, first feedback unit 303 and first writing unit 304 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0083] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to achieve full recovery without blocking write operations.

[0084] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0085] An embodiment of the present invention provides a computer-readable storage medium having a program stored thereon, and a method for implementing full recovery when the program is executed by a processor.

[0086] An embodiment of the present invention provides a processor, which is used to run a program, wherein a method for performing full recovery is performed when the program is running.

[0087] An embodiment of the present invention provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: first target data information is sent to a target slave node through a target master node, wherein the first target data information includes at least: a full recovery version number and first metadata information, and the target slave node is a slave node to be fully recovered; second target data information is sent to a target slave node through the target master node, wherein the second target data information includes at least: an update version number and second metadata information, and the second metadata information is update operation information for a target file; the target slave node writes the first target data information and the second target data information into a first target disk of the target slave node, and feeds back a signal one indicating that the first target data information has been written and / or a signal two indicating that the second target data information has been written to the target master node; in the target slave node, according to the full recovery version number and the update version number, the first target data information and the second target data information are written into a first database in the target slave node according to preset rules.

[0088] Optionally, in the target slave node, based on the full recovery version number and the update version number, writing the first target data information and the second target data information into the first database in the target slave node according to preset rules includes: if the full recovery version number is less than the update version number, writing the first target data information into the first database according to the preset rules; if the full recovery version number is greater than or equal to the update version number, writing the second target data information into the first database according to the preset rules, and then writing the first target data information into the first database according to the preset rules.

[0089] Optionally, before sending the first target data information to the target slave node through the target master node, the method also includes: obtaining the current submission version number one of the target master node, and using the submission version number one as the full recovery version number; reading a preset amount of first metadata information from the second database of the target master node to obtain the first metadata information; and using the full recovery version number and the first metadata information as the first target data information.

[0090] Optionally, after sending the first target data information to the target slave node through the target master node, the method also includes: scanning through the target master node whether there is third metadata information in the second database, wherein the third metadata information is metadata information other than the first metadata information; if the third metadata information exists, obtaining the current submission version number two of the target master node; using the submission version number two as the full recovery version number; using the full recovery version number and the third metadata information as the first target data information, and sending the first target data information to the target slave node; continuing to execute the step of scanning through the target master node whether there is fourth metadata information in the second database until all metadata information in the second database has been sent to the target slave node, or the number of first target data information sent by the target master node has reached a preset value of one.

[0091] Optionally, before sending the second target data information to the target slave node through the target master node, the method also includes: receiving second metadata information of an update operation for the target file through the target master node, and assigning an update version number to the second metadata information; and using the update version number and the second metadata information as the second target data information.

[0092] Optionally, after sending the second target data information to the target slave node through the target master node, the method also includes: the target master node writes the second target data information to the second target disk of the target master node; after receiving signal two, the target master node feeds back signal three to the target object, wherein signal three indicates that the update operation for the target file has been successful.

[0093] Optionally, after the target master node feeds back signal 2 to the target object, the method further includes: writing the second target data information into a second database of the target master node according to preset rules; and using the updated version number in the second target data information as the latest submitted version number of the target master node.

[0094] Optionally, before sending the first target data information to the target slave node through the target master node, the method further includes: communicating the target master node with multiple slave nodes to determine the target slave node to be fully restored; the target master node notifies the target slave node that the update version number to be sent is a preset value of two, and the full recovery version number is greater than or equal to a preset value of three, wherein the preset value of two is greater than or equal to the preset value of three. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.

[0095] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: sending first target data information to a target slave node through a target master node, wherein the first target data information at least includes: a full recovery version number and first metadata information, and the target slave node is a slave node to be fully recovered; sending second target data information to a target slave node through the target master node, wherein the second target data information at least includes: an update version number and second metadata information, and the second metadata information is update operation information for a target file; the target slave node writes the first target data information and the second target data information into a first target disk of the target slave node, and feeds back a signal one indicating that the first target data information has been written and / or a signal two indicating that the second target data information has been written to the target master node; in the target slave node, based on the full recovery version number and the update version number, the first target data information and the second target data information are written into a first database in the target slave node according to preset rules.

[0096] Optionally, in the target slave node, based on the full recovery version number and the update version number, writing the first target data information and the second target data information into the first database in the target slave node according to preset rules includes: if the full recovery version number is less than the update version number, writing the first target data information into the first database according to the preset rules; if the full recovery version number is greater than or equal to the update version number, writing the second target data information into the first database according to the preset rules, and then writing the first target data information into the first database according to the preset rules.

[0097] Optionally, before sending the first target data information to the target slave node through the target master node, the method also includes: obtaining the current submission version number one of the target master node, and using the submission version number one as the full recovery version number; reading a preset amount of first metadata information from the second database of the target master node to obtain the first metadata information; and using the full recovery version number and the first metadata information as the first target data information.

[0098] Optionally, after sending the first target data information to the target slave node through the target master node, the method also includes: scanning through the target master node whether there is third metadata information in the second database, wherein the third metadata information is metadata information other than the first metadata information; if the third metadata information exists, obtaining the current submission version number two of the target master node; using the submission version number two as the full recovery version number; using the full recovery version number and the third metadata information as the first target data information, and sending the first target data information to the target slave node; continuing to execute the step of scanning through the target master node whether there is fourth metadata information in the second database until all metadata information in the second database has been sent to the target slave node, or the number of first target data information sent by the target master node has reached a preset value of one.

[0099] Optionally, before sending the second target data information to the target slave node through the target master node, the method also includes: receiving second metadata information of an update operation for the target file through the target master node, and assigning an update version number to the second metadata information; and using the update version number and the second metadata information as the second target data information.

[0100] Optionally, after sending the second target data information to the target slave node through the target master node, the method also includes: the target master node writes the second target data information to the second target disk of the target master node; after receiving signal two, the target master node feeds back signal three to the target object, wherein signal three indicates that the update operation for the target file has been successful.

[0101] Optionally, after the target master node feeds back signal 2 to the target object, the method further includes: writing the second target data information into a second database of the target master node according to preset rules; and using the updated version number in the second target data information as the latest submitted version number of the target master node.

[0102] Optionally, before sending the first target data information to the target slave node through the target master node, the method also includes: communicating the target master node with multiple slave nodes to determine the target slave node to be fully restored; the target master node informs the target slave node that the update version number to be sent is the preset value two, and the full recovery version number is greater than or equal to the preset value three, wherein the preset value two is greater than or equal to the preset value three.

[0103] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0104] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0105] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0106] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0107] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0108] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0109] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0110] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0111] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0112] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for full recovery, characterized in that: include: Sending first target data information to a target slave node through a target master node, wherein the first target data information includes at least: a full recovery version number and first metadata information, and the target slave node is a slave node to be fully recovered; Sending second target data information to the target slave node through the target master node, wherein the second target data information at least includes: an update version number and second metadata information, and the second metadata information is update operation information for the target file; The target slave node writes the first target data information and the second target data information into the first target disk of the target slave node, and feeds back a signal 1 indicating that the first target data information has been written and / or a signal 2 indicating that the second target data information has been written to the target master node; In the target slave node, according to the full recovery version number and the update version number, the first target data information and the second target data information are written into a first database in the target slave node according to a preset rule; Wherein, in the target slave node, according to the full recovery version number and the update version number, writing the first target data information and the second target data information into the first database in the target slave node according to the preset rule comprises: If the full recovery version number is smaller than the update version number, writing the first target data information into the first database according to a preset rule; If the full recovery version number is greater than or equal to the update version number, the second target data information is written into the first database according to the preset rule, and then the first target data information is written into the first database according to the preset rule.

2. The method according to claim 1, characterized in that Before sending the first target data information to the target slave node through the target master node, the method further includes: Obtain the current submission version number 1 of the target master node, and use the submission version number 1 as the full recovery version number; Read a preset amount of first metadata information from the second database of the target master node to obtain the first metadata information; The full recovery version number and the first metadata information are used as the first target data information.

3. The method according to claim 2, characterized in that After sending the first target data information to the target slave node through the target master node, the method further includes: Scanning the second database by the target master node whether third metadata information exists, wherein the third metadata information is metadata information other than the first metadata information; If the third metadata information exists, obtaining the second submission version number of the target master node; The submitted version number 2 is used as the full recovery version number; Using the full recovery version number and the third metadata information as the first target data information, and sending the first target data information to the target slave node; Continue to execute the step of scanning whether there is fourth metadata information in the second database through the target master node until all metadata information in the second database has been sent to the target slave node, or the number of first target data information sent by the target master node has reached a preset value of one.

4. The method according to claim 1, characterized in that: Before sending the second target data information to the target slave node through the target master node, the method further includes: receiving second metadata information of an update operation for the target file through the target master node, and assigning an update version number to the second metadata information; The update version number and the second metadata information are used as the second target data information.

5. The method according to claim 4, characterized in that After sending the second target data information to the target slave node through the target master node, the method further includes: The target master node writes the second target data information into a second target disk of the target master node; After receiving the second signal, the target master node feeds back a third signal to the target object, wherein the third signal indicates that the update operation on the target file has been successful.

6. The method according to claim 5, characterized in that After the target master node feeds back signal 2 to the target object, the method further includes: Writing the second target data information into the second database of the target master node according to the preset rule; The updated version number in the second target data information is used as the latest submitted version number of the target master node.

7. The method according to claim 1, characterized in that Before sending the first target data information to the target slave node through the target master node, the method further includes: The target master node communicates with multiple slave nodes to determine the target slave node to be fully restored; The target master node informs the target slave node that the update version number to be sent is the preset value two, and the full recovery version number is greater than or equal to the preset value three, wherein the preset value two is greater than or equal to the preset value three.

8. A full recovery device, characterized in that: include: A first sending unit is used to send first target data information to a target slave node through a target master node, wherein the first target data information at least includes: a full recovery version number and first metadata information, and the target slave node is a slave node to be fully recovered; A second sending unit is used to send second target data information to the target slave node through the target master node, wherein the second target data information at least includes: an update version number and second metadata information, and the second metadata information is update operation information for the target file; A first feedback unit is used for the target slave node to write the first target data information and the second target data information into the first target disk of the target slave node, and to feed back a signal 1 indicating that the first target data information has been written and / or a signal 2 indicating that the second target data information has been written to the target master node; A first writing unit is used to write the first target data information and the second target data information into a first database in the target slave node according to a preset rule in the target slave node according to the full recovery version number and the update version number; Among them, the first writing unit includes: a first writing module, which is used to write the first target data information into the first database according to the preset rules if the full recovery version number is less than the update version number; a second writing module, which is used to write the second target data information into the first database according to the preset rules if the full recovery version number is greater than or equal to the update version number, and then write the first target data information into the first database according to the preset rules.

9. A computer-readable storage medium, characterized in that: The storage medium stores a program, wherein the program executes the full recovery method described in any one of claims 1 to 7.

10. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the method for full recovery described in any one of claims 1 to 7.