Data recovery method and device for distributed storage system, equipment and medium
By periodically calculating the number of recoverable objects in a distributed storage system and adjusting the recovery speed, the problem of high complexity in the failure recovery process of distributed storage system is solved, the accuracy and reliability of recovery speed is improved, and the administrator is simplified operation process.
Patent Information
- Application Number
- CN202411170338.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2025-01-03
AI Technical Summary
During the failure recovery process of distributed storage systems, the recovery speed is affected by multiple parameters, which requires in-depth understanding and experience of administrators. It is complex and time-consuming to operate, making it difficult to ensure recovery efficiency and service quality.
The object storage device periodically determines the number of objects to be restored, and calculates the number of objects to be restored based on the target recovery speed of the current cycle and the number of objects to be restored in the storage pool, adjusts the recovery speed, and ensures the accuracy and reliability of the recovery process. sex.
Reduces the complexity of administrators to adjust recovery speed, improves the ease of use of distributed storage systems, ensures the accuracy and reliability of recovery speed, and reduces deviations in the recovery process.
Smart Images

Figure CN119248568A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a data recovery method and a data recovery device for a distributed storage system. Background Art
[0002] The essence of a distributed storage system's fault recovery process is the repair of object data within a storage pool. A storage pool consists of many placement groups, each comprised of multiple object storage devices and providing data redundancy. Object data repair is triggered when the object storage device membership of a placement group changes or recovers after a failure.
[0003] The current distributed object storage device failure recovery process requires calculating all objects requiring recovery and placing them in a recovery queue. The recovery thread then periodically performs object recovery. The speed of object recovery is controlled by controlling multiple parameters, such as the number of object storage devices restored within a recovery cycle and the number of placement groups for the object storage devices. Distributed storage recovery speed is influenced by multiple parameters and requires careful tuning and monitoring to ensure recovery efficiency and service quality under varying loads and failure conditions. This requires administrators to have in-depth knowledge and experience to effectively manage the cluster recovery process, which is complex and time-consuming. Summary of the Invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide a data recovery method for a distributed storage system and a corresponding data recovery device for a distributed storage system that overcome the above problems or at least partially solve the above problems.
[0005] According to a first aspect of an embodiment of the present invention, a data recovery method for a distributed storage system is provided, wherein the distributed storage system includes a monitor and a plurality of object storage devices; the method includes:
[0006] The object storage device periodically determines the number of objects to be restored, and sends the number of objects to be restored to the monitor;
[0007] receiving a target recovery speed for a current cycle and a number of objects to be recovered in a storage pool in the current cycle sent by the monitor; the storage pool includes objects stored by the plurality of object storage devices; the target recovery speed represents the number of recoverable objects in the storage pool per unit time;
[0008] determining the number of recoverable objects in the current cycle according to the number of objects to be recovered in the object storage device, the target recovery speed of the current cycle, and the number of objects to be recovered in the storage pool in the current cycle;
[0009] Recovery is performed according to the number of recoverable objects in the current cycle.
[0010] Optionally, determining the number of recoverable objects in the current cycle based on the number of objects to be recovered in the object storage device, the target recovery speed of the current cycle, and the number of objects to be recovered in the storage pool in the current cycle includes:
[0011] Obtaining the duration of the current cycle;
[0012] The ratio of the number of objects to be recovered in the object storage device to the number of objects to be recovered in the storage pool in the current cycle, multiplied by the duration of the current cycle and the target recovery speed of the current cycle, is used as the number of recoverable objects in the current cycle.
[0013] Optionally, the recovering according to the number of recoverable objects in the current period includes:
[0014] Get the number of actually restored objects and the number of recoverable objects in the previous cycle;
[0015] Determining whether the number of actually restored objects in the previous cycle is the same as the number of restorable objects;
[0016] If the number of actually restored objects in the previous cycle is the same as the number of restorable objects, the number of restorable objects in the current cycle is rounded up to obtain the number of actually restored objects in the current cycle, and restoration is performed based on the number of actually restored objects in the current cycle.
[0017] If the actual number of restored objects in the previous cycle is different from the number of restoreable objects, determine the difference between the actual number of restored objects in the previous cycle and the number of restoreable objects; subtract the difference from the number of restoreable objects calculated in the current cycle and round up to obtain the actual number of restored objects in the current cycle, and perform restoration according to the actual number of restored objects in the current cycle.
[0018] Optionally, sending the number of objects to be restored to the monitor includes:
[0019] The object storage device periodically sends a placement group status message to the monitor, where the placement group status message includes the number of objects to be recovered.
[0020] Optionally, the receiving, from the monitor, the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle includes:
[0021] A placement group status confirmation message sent by the monitor is received, where the placement group status confirmation message includes a target recovery speed for the current cycle and a number of objects to be recovered in the storage pool in the current cycle.
[0022] According to a second aspect of an embodiment of the present invention, a data recovery method for a distributed storage system is provided, wherein the distributed storage system includes a monitor and a plurality of object storage devices; the method includes:
[0023] The monitor periodically obtains the number of objects to be restored from the plurality of object storage devices;
[0024] Obtaining a target recovery speed for a current cycle, where the target recovery speed represents the number of recoverable objects in a storage pool per unit time; the storage pool includes objects stored by the plurality of object storage devices;
[0025] determining, according to the number of objects to be restored on the plurality of object storage devices, the number of objects to be restored in the storage pool in the current cycle;
[0026] The target recovery speed of the current cycle and the number of objects to be recovered in the storage pool within the current cycle are sent to the multiple object storage devices respectively, so that the multiple object storage devices respectively determine the number of recoverable objects in the current cycle according to the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool within the current cycle and perform recovery according to the number of recoverable objects in the current cycle.
[0027] Optionally, the monitor periodically obtains the number of objects to be restored from the multiple object storage devices, including:
[0028] The monitor periodically obtains placement group status messages sent by multiple object storage devices, where the placement group status messages include the number of objects to be recovered from the multiple object storage devices.
[0029] Optionally, sending the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle to the multiple object storage devices respectively includes:
[0030] Sending a placement group status confirmation message to each of the plurality of object storage devices, wherein the placement group status confirmation message includes a target recovery speed of the current cycle and a number of objects to be recovered in the storage pool in the current cycle.
[0031] According to a third aspect of the present invention, there is provided a data recovery apparatus for a distributed storage system, the distributed storage system comprising a monitor and a plurality of object storage devices; the apparatus comprising:
[0032] a first sending module, configured for the object storage device to periodically determine the number of objects to be restored, and send the number of objects to be restored to the monitor;
[0033] a first receiving module, configured to receive a target recovery speed for a current cycle and a number of objects to be recovered in a storage pool in the current cycle, sent by the monitor; the storage pool includes objects stored by the plurality of object storage devices; the target recovery speed represents the number of recoverable objects in the storage pool per unit time;
[0034] a first determining module, configured to determine the number of recoverable objects in the current cycle according to the number of objects to be recovered in the object storage device, the target recovery speed of the current cycle, and the number of objects to be recovered in the storage pool in the current cycle;
[0035] The first recovery module is configured to perform recovery according to the number of recoverable objects in the current cycle.
[0036] Optionally, the first determining module includes:
[0037] A first acquisition submodule is used to obtain the duration of the current cycle;
[0038] The first calculation submodule is used to take the ratio of the number of objects to be recovered in the object storage device to the number of objects to be recovered in the storage pool in the current cycle, multiplied by the duration of the current cycle and the target recovery speed of the current cycle, as the number of recoverable objects in the current cycle.
[0039] Optionally, the first recovery module includes:
[0040] The second acquisition submodule is used to obtain the number of actually restored objects and the number of recoverable objects in the previous cycle;
[0041] A first determining submodule, configured to determine whether the number of actually restored objects in the previous cycle is the same as the number of restorable objects;
[0042] a first recovery submodule configured to, if the number of actually recovered objects in the previous cycle is the same as the number of recoverable objects, round up the number of recoverable objects in the current cycle to obtain the number of actually recovered objects in the current cycle, and perform recovery according to the number of actually recovered objects in the current cycle;
[0043] The second recovery submodule is used to determine the difference between the number of actual recovery objects in the previous cycle and the number of recoverable objects if they are different; subtract the difference from the number of recoverable objects calculated in the current cycle and round up to obtain the number of actual recovery objects in the current cycle, and perform recovery according to the number of actual recovery objects in the current cycle.
[0044] Optionally, the first sending module includes:
[0045] The first sending submodule is configured to cause the object storage device to periodically send a placement group status message to the monitor, where the placement group status message includes the number of objects to be recovered.
[0046] Optionally, the first receiving module includes:
[0047] The first receiving submodule is configured to receive a placement group status confirmation message sent by the monitor, where the placement group status confirmation message includes a target recovery speed for the current cycle and a number of objects to be recovered in the storage pool in the current cycle.
[0048] According to a fourth aspect of the present invention, there is provided a data recovery apparatus for a distributed storage system, the distributed storage system comprising a monitor and a plurality of object storage devices; the apparatus comprising:
[0049] A first acquisition module, configured for the monitor to periodically acquire the number of objects to be restored from the plurality of object storage devices;
[0050] A second acquisition module is configured to acquire a target recovery speed for a current cycle, wherein the target recovery speed represents the number of recoverable objects in a storage pool per unit time; the storage pool includes objects stored by the plurality of object storage devices;
[0051] a second determining module, configured to determine the number of objects to be restored in the storage pool in the current cycle according to the number of objects to be restored in the plurality of object storage devices;
[0052] The second sending module is used to send the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle to the multiple object storage devices respectively, so that the multiple object storage devices determine the number of recoverable objects in the current cycle according to the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle, and perform recovery according to the number of recoverable objects in the current cycle.
[0053] Optionally, the first acquisition module includes:
[0054] The third acquisition submodule is configured to enable the monitor to periodically acquire placement group status messages sent by a plurality of object storage devices, where the placement group status messages include the number of objects to be recovered from the plurality of object storage devices.
[0055] Optionally, the second sending module includes:
[0056] The second sending submodule is configured to send a placement group status confirmation message to each of the plurality of object storage devices, wherein the placement group status confirmation message includes a target recovery speed of the current cycle and a number of objects to be recovered in the storage pool in the current cycle.
[0057] According to a fifth aspect of the present invention, an electronic device is provided, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the data recovery method of the distributed storage system as described above is implemented.
[0058] According to a sixth aspect of the present invention, a computer-readable storage medium is provided, which, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the data recovery method of the distributed storage system as described above.
[0059] The technical solutions provided by the embodiments of the present invention may have the following beneficial effects:
[0060] An embodiment of the present invention provides a data recovery method for a distributed storage system, comprising: an object storage device periodically determining the number of objects to be recovered and sending the number of objects to be recovered to a monitor; receiving a target recovery speed for the current cycle and the number of objects to be recovered in a storage pool within the current cycle; determining the number of recoverable objects within the current cycle based on the number of objects to be recovered by the object storage device, the target recovery speed for the current cycle, and the number of objects to be recovered in the storage pool within the current cycle; and performing recovery based on the number of recoverable objects within the current cycle. By adjusting the number of recoverable objects within the current cycle for recovery, the embodiment of the present invention can control the accuracy and reliability of the recovery speed of distributed storage, reducing the complexity of administrators previously controlling the recovery speed by adjusting multiple configuration parameters, and increasing the ease of use of distributed storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 This is a flowchart of a data recovery method for a distributed storage system provided by an embodiment of the present invention;
[0062] Figure 2 This is a flowchart of another method for recovering data in a distributed storage system provided by an embodiment of the present invention;
[0063] Figure 3 This is a structural block diagram of a data recovery device for a distributed storage system provided by an embodiment of the present invention;
[0064] Figure 4 This is a structural block diagram of another data recovery device for a distributed storage system provided by an embodiment of the present invention;
[0065] Figure 5 This is a structural block diagram of an electronic device provided by an embodiment of the present invention;
[0066] Figure 6 This is a structural block diagram of a computer-readable storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0067] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0068] Reference Figure 1 , shows a flowchart of a data recovery method for a distributed storage system provided by an embodiment of the present invention, the method may specifically include the following steps:
[0069] Step 101: The object storage device periodically determines the number of objects to be restored, and sends the number of objects to be restored to the monitor;
[0070] An object storage device (OSD) is a physical or virtual device used to store and manage objects in a distributed storage system. An OSD is a fundamental component of a distributed storage system, responsible for storing and managing data objects and supporting operations such as reading, writing, and deleting data. A monitor is a component in a distributed storage system responsible for monitoring, managing, and coordinating the activities of other nodes.
[0071] Since the number of objects to be restored in the object storage device changes continuously with the restoration cycle, the number of objects to be restored needs to be determined in each cycle and sent to the monitor.
[0072] In one embodiment, step 101 includes: the object storage device periodically sending a placement group status message to the monitor, where the placement group status message includes the number of objects to be recovered.
[0073] Placement Group Status Messages (PGStat) are messages used to synchronize and report placement group (PG) status information in distributed storage systems. A placement group is a carrier for placing objects. By periodically sending these messages, the monitor can monitor placement group status in real time, ensuring that data recovery proceeds as planned and making adjustments as system status changes.
[0074] Step 102: Receive a target recovery speed for a current cycle and the number of objects to be recovered in a storage pool in the current cycle, sent by the monitor; the storage pool includes objects stored by the plurality of object storage devices; the target recovery speed represents the number of recoverable objects in the storage pool per unit time;
[0075] The target recovery speed can be expressed in N (objects) / s. By receiving information, the object storage device can adjust the number of objects to be restored within a cycle to ensure that the data recovery speed is not too fast and causes resource waste.
[0076] In one embodiment, step 102 includes: receiving a placement group status confirmation message sent by the monitor, wherein the placement group status confirmation message includes a target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle.
[0077] A placement group status confirmation is a confirmation message sent by the monitor to the object storage device in a distributed storage system to confirm that it has received updated information about the number of objects to be restored and has counted the number of objects to be restored in the storage pool during the current cycle.
[0078] Step 103: determining the number of recoverable objects in the current cycle based on the number of objects to be recovered in the object storage device, the target recovery speed of the current cycle, and the number of objects to be recovered in the storage pool in the current cycle;
[0079] The number of objects pending recovery for an object storage device is the sum of all unrecovered objects requiring recovery across the entire object storage device. The number of objects pending recovery for a storage pool is the sum of all objects pending recovery for all object storage devices within the storage pool. The number of recoverable objects in the current cycle is calculated based on the number of objects pending recovery for the object storage device, the target recovery speed for the current cycle, and the number of objects pending recovery for the storage pool within the current cycle.
[0080] In one embodiment, step 103 may include the following sub-steps:
[0081] Sub-step S31, obtaining the duration of the current cycle;
[0082] The duration of the current cycle may be T.
[0083] Sub-step S32, taking the ratio of the number of objects to be recovered in the object storage device to the number of objects to be recovered in the storage pool in the current cycle, multiplied by the duration of the current cycle and the target recovery speed of the current cycle, as the number of recoverable objects in the current cycle.
[0084] Because the number of objects to be restored on the object storage device and in the storage pool varies from cycle to cycle, the number of recoverable objects calculated for each cycle may not be the same. The number of recoverable objects calculated for each cycle can be an integer or a floating-point number. Floating-point numbers represent numbers with a decimal fraction.
[0085] This method for determining the number of recoverable objects within the current cycle helps ensure that data recovery in distributed storage systems proceeds at a preset speed, maintaining data consistency and system stability. This effectively controls the recovery speed within each recovery cycle, preventing significant deviations between the actual recovery speed and the set target recovery speed, and ensuring that the average recovery speed throughout the recovery process remains close to the set target recovery speed. This mechanism helps improve data recovery efficiency and overall system performance, ensuring that distributed storage systems can effectively respond to failures and recover quickly.
[0086] Step 104: Perform recovery according to the number of recoverable objects in the current cycle.
[0087] The number of recoverable objects serves as a reference for the actual number of recoverable objects. If the calculated number of recoverable objects is an integer, the actual number of recoverable objects equals the number of recoverable objects. If the calculated number of recoverable objects is a floating-point number, the actual number of recoverable objects is the rounded-up number of recoverable objects. In other words, the actual number of recoverable objects is always greater than or equal to the calculated number of recoverable objects.
[0088] Each cycle is performed according to this object recovery step. After a cycle ends, if the number of restored objects in the object storage device is 0, the object recovery is determined to be complete and the recovery process ends. If the number of restored objects in the object storage device is not 0, the recovery process of the next cycle continues.
[0089] In one embodiment, step 104 may include the following sub-steps:
[0090] Sub-step S41, obtaining the number of actually restored objects and the number of restorable objects in the previous cycle;
[0091] The deviation between the actual number of restored objects and the number of restorable objects in the previous cycle is determined by obtaining the number of restored objects and the number of restorable objects in the previous cycle, and the deviation is corrected by compensating the number of restored objects in the cycle.
[0092] Sub-step S42, determining whether the number of actually restored objects in the previous cycle is the same as the number of restorable objects;
[0093] If they are the same, it is determined that there is no deviation between the actual number of restored objects in the previous period and the number of recoverable objects, and no deviation correction is required. If they are not the same, it is determined that there is a deviation between the actual number of restored objects in the previous period and the number of recoverable objects, and the deviation needs to be corrected.
[0094] Sub-step S43: If the number of actually restored objects in the previous cycle is the same as the number of restorable objects, round up the number of restorable objects in the current cycle to obtain the number of actually restored objects in the current cycle, and perform restoration based on the number of actually restored objects in the current cycle.
[0095] The actual number of restored objects will only be an integer, so the number of recoverable objects in the current cycle must be rounded up. If the number of recoverable objects calculated for the current cycle is an integer, rounding up is not required. Rounding up ensures that the actual recovery speed does not fall below the set target recovery speed, which helps to quickly restore data while maintaining controllability of the data recovery process.
[0096] For example, if the actual number of restored objects in the previous cycle was 60 and the number of recoverable objects in the previous cycle was also 60, then the speed in the previous cycle was considered stable without deviation. If the calculated number of recoverable objects in the current cycle was 65.6, then the actual number of restored objects in the current cycle is 66.
[0097] Sub-step S44: If the number of actual recovery objects in the previous cycle is different from the number of recoverable objects, determine the difference between the number of actual recovery objects in the previous cycle and the number of recoverable objects; subtract the difference from the number of recoverable objects calculated in the current cycle and round up to obtain the number of actual recovery objects in the current cycle, and perform recovery according to the number of actual recovery objects in the current cycle.
[0098] Specifically, if the number of objects actually restored in the previous cycle exceeds the recoverable number, the difference is used as compensation. By subtracting the difference, the number of restored objects in the current cycle can be reduced to correct for the over-recovery in the previous cycle, ensuring that the average recovery speed throughout the recovery process is close to the set target recovery speed. With periodic object recovery compensation, the number of objects over-recovered in the previous cycle is corrected within the current cycle to regulate the recovery speed of the cycle.
[0099] For example, if the actual number of restored objects in the previous cycle was 60, and the number of recoverable objects in the previous cycle was 59.4, the deviation in the previous cycle is determined to be 0.6. The number of recoverable objects calculated in the current cycle is 61.3. The deviation of 0.6 from the previous cycle is then applied to the current cycle. The calculated number of recoverable objects in the current cycle is 61.3 minus 0.6, which is 60.7. 60.7 is rounded up to the nearest integer, resulting in the actual number of restored objects in the current cycle being 61.
[0100] An embodiment of the present invention provides a data recovery method for a distributed storage system, comprising: an object storage device periodically determining the number of objects to be recovered, and sending the number of objects to be recovered to a monitor; receiving a target recovery speed for the current cycle and the number of objects to be recovered in a storage pool within the current cycle; determining the number of recoverable objects within the current cycle based on the number of objects to be recovered by the object storage device, the target recovery speed for the current cycle, and the number of objects to be recovered in the storage pool within the current cycle; and performing recovery based on the number of recoverable objects within the current cycle. The embodiment of the present invention determines the number of recoverable objects within the current cycle, performs recovery based on the number of recoverable objects within the current cycle, controls the recovery speed of each cycle to be close to the target value, ensures the accuracy and reliability of the recovery speed of the distributed storage, reduces the complexity of the administrator's previous control of the recovery speed by adjusting multiple configuration parameters, and increases the ease of use of the distributed storage.
[0101] Reference Figure 2 , shows a flowchart of another method for recovering data in a distributed storage system provided by an embodiment of the present invention. The method may specifically include the following steps:
[0102] Step 201: The monitor periodically obtains the number of objects to be restored from the plurality of object storage devices;
[0103] By periodically acquiring this information, the monitor can globally monitor the progress of data recovery and adjust the recovery strategy based on actual conditions to ensure the controllability and efficiency of the data recovery process.
[0104] In one embodiment, step 201 includes: the monitor periodically obtaining placement group status messages sent by multiple object storage devices, where the placement group status messages include the number of objects to be recovered in the multiple object storage devices.
[0105] Placement group status messages are used to synchronize and report placement group status information within a distributed storage system. A placement group is a carrier for placing objects. By periodically receiving these messages, the monitor can monitor placement group status in real time, ensuring that data recovery proceeds as planned and making adjustments as system status changes.
[0106] Step 202: Obtain a target recovery speed for the current cycle, where the target recovery speed represents the number of recoverable objects in a storage pool per unit time; the storage pool includes objects stored by the plurality of object storage devices;
[0107] The target recovery speed can be expressed in N (objects) / s. By sending speed information to the object storage device, the object storage device can adjust the number of objects to be recovered within the cycle to ensure that the data recovery speed is not too fast and causes resource waste.
[0108] Step 203: determining the number of objects to be restored in the storage pool in the current cycle according to the number of objects to be restored in the plurality of object storage devices;
[0109] The number of objects to be restored in the storage pool in the current cycle is the sum of the numbers of objects to be restored in multiple object storage devices.
[0110] Step 204: Send the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle to the multiple object storage devices respectively, so that the multiple object storage devices determine the number of recoverable objects in the current cycle according to the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle, and perform recovery according to the number of recoverable objects in the current cycle.
[0111] Restoration of multiple object storage devices occurs simultaneously. Each object storage device calculates the number of recoverable objects in the current cycle based on the target recovery speed for the current cycle and the number of objects to be recovered in the storage pool during the current cycle. The number of objects actually recovered in the current cycle is calculated based on the deviation from the previous cycle and the number of recoverable objects calculated for the current cycle. At the end of a cycle, if the number of recovered objects in the object storage device is zero, object recovery is considered complete and the recovery process ends. If the number of recovered objects in the object storage device is not zero, the recovery process continues for the next cycle.
[0112] In one embodiment, step 204 includes: sending a placement group status confirmation message to each of the plurality of object storage devices, the placement group status confirmation message including the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle.
[0113] In a distributed storage system, a placement group status confirmation is a message sent by the monitor to the object storage device to confirm receipt of updated information about the number of objects to be restored across multiple object storage devices. This message also counts the number of objects to be restored in the storage pool during the current cycle. Sending placement group status confirmation messages from object storage devices allows them to adjust the number of objects to be restored within a cycle based on the placement group status confirmation message, ensuring that data recovery is not too rapid and wastes resources.
[0114] An embodiment of the present invention provides a data recovery method for a distributed storage system, comprising: an object storage device periodically determining the number of objects to be recovered, and sending the number of objects to be recovered to a monitor; receiving a target recovery speed for the current cycle and the number of objects to be recovered in a storage pool within the current cycle; determining the number of recoverable objects within the current cycle based on the number of objects to be recovered by the object storage device, the target recovery speed for the current cycle, and the number of objects to be recovered in the storage pool within the current cycle; and performing recovery based on the number of recoverable objects within the current cycle. The embodiment of the present invention determines the number of recoverable objects within the current cycle, performs recovery based on the number of recoverable objects within the current cycle, controls the recovery speed of each cycle to be close to the target value, ensures the accuracy and reliability of the recovery speed of the distributed storage, reduces the complexity of the administrator's previous control of the recovery speed by adjusting multiple configuration parameters, and increases the ease of use of the distributed storage.
[0115] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required for the embodiments of the present invention.
[0116] Reference Figure 3 , shows a structural block diagram of a data recovery device for a distributed storage system provided by an embodiment of the present invention, which may specifically include the following modules:
[0117] A first sending module 301 is configured for the object storage device to periodically determine the number of objects to be restored and send the number of objects to be restored to the monitor;
[0118] A first receiving module 302 is configured to receive a target recovery speed for a current cycle and a number of objects to be recovered in a storage pool in the current cycle, sent by the monitor; the storage pool includes objects stored by the plurality of object storage devices; the target recovery speed represents the number of recoverable objects in the storage pool per unit time;
[0119] A first determining module 303 is configured to determine the number of recoverable objects in the current cycle based on the number of objects to be recovered in the object storage device, the target recovery speed of the current cycle, and the number of objects to be recovered in the storage pool in the current cycle;
[0120] The first recovery module 304 is configured to perform recovery according to the number of recoverable objects in the current cycle.
[0121] In one embodiment, the first determining module includes:
[0122] A first acquisition submodule is used to obtain the duration of the current cycle;
[0123] The first calculation submodule is used to take the ratio of the number of objects to be recovered in the object storage device to the number of objects to be recovered in the storage pool in the current cycle, multiplied by the duration of the current cycle and the target recovery speed of the current cycle, as the number of recoverable objects in the current cycle.
[0124] In this way, the recovery speed within each recovery cycle can be effectively controlled to avoid a large deviation between the actual recovery speed and the set target recovery speed, ensuring that the average recovery speed of the entire recovery process is close to the set target recovery speed. This mechanism helps improve the efficiency of data recovery and the overall performance of the system, ensuring that the distributed storage system can effectively respond to failures and recover quickly.
[0125] In one embodiment, the first recovery module includes:
[0126] The second acquisition submodule is used to obtain the number of actually restored objects and the number of recoverable objects in the previous cycle;
[0127] A first determining submodule, configured to determine whether the number of actually restored objects in the previous cycle is the same as the number of restorable objects;
[0128] a first recovery submodule configured to, if the number of actually recovered objects in the previous cycle is the same as the number of recoverable objects, round up the number of recoverable objects in the current cycle to obtain the number of actually recovered objects in the current cycle, and perform recovery according to the number of actually recovered objects in the current cycle;
[0129] The second recovery submodule is used to determine the difference between the number of actual recovery objects in the previous cycle and the number of recoverable objects if they are different; subtract the difference from the number of recoverable objects calculated in the current cycle and round up to obtain the number of actual recovery objects in the current cycle, and perform recovery according to the number of actual recovery objects in the current cycle.
[0130] The actual number of restored objects will only be an integer, so the number of recoverable objects in the current cycle must be rounded up. If the number of recoverable objects calculated for the current cycle is an integer, rounding up is not required. Rounding up ensures that the actual recovery speed does not fall below the set target recovery speed, which helps to quickly restore data while maintaining controllability of the data recovery process.
[0131] If the number of objects actually restored in the previous cycle exceeds the recoverable number, the difference is used as compensation. By subtracting the difference, the number of restored objects in the current cycle can be reduced to correct for the over-recovery in the previous cycle, ensuring that the average recovery speed throughout the recovery process is close to the set target recovery speed. Periodic object recovery compensation corrects the number of objects that were over-recovered in the previous cycle by restoring them within the current cycle to regulate the recovery speed.
[0132] In one embodiment, the first sending module includes:
[0133] The first sending submodule is configured to cause the object storage device to periodically send a placement group status message to the monitor, where the placement group status message includes the number of objects to be recovered.
[0134] A placement group is a carrier for placing objects. By periodically sending these messages, the monitor can monitor the status of the placement group in real time, ensuring that data recovery proceeds as planned and making adjustments as the system status changes.
[0135] In one embodiment, the first receiving module includes:
[0136] The first receiving submodule is configured to receive a placement group status confirmation message sent by the monitor, where the placement group status confirmation message includes a target recovery speed for the current cycle and a number of objects to be recovered in the storage pool in the current cycle.
[0137] By receiving information, the object storage device can adjust the number of objects to be restored within a cycle to ensure that the data recovery speed is not too fast and causes resource waste.
[0138] An embodiment of the present invention provides a data recovery device for a distributed storage system, the device comprising an object storage device that periodically determines the number of objects to be recovered and sends the number of objects to be recovered to a monitor; receives a target recovery speed for the current cycle and the number of objects to be recovered in a storage pool within the current cycle; determines the number of recoverable objects within the current cycle based on the number of objects to be recovered on the object storage device, the target recovery speed for the current cycle, and the number of objects to be recovered in the storage pool within the current cycle; and performs recovery based on the number of recoverable objects within the current cycle. By determining the number of recoverable objects within the current cycle and performing recovery based on the number of recoverable objects within the current cycle, the embodiment of the present invention controls the recovery speed of each cycle to be close to the target value, thereby ensuring the accuracy and reliability of the recovery speed of the distributed storage, reducing the complexity of administrators controlling the recovery speed by adjusting multiple configuration parameters in the past, and increasing the ease of use of the distributed storage.
[0139] Reference Figure 4 , shows a structural block diagram of another data recovery device for a distributed storage system provided by an embodiment of the present invention, which may specifically include the following modules:
[0140] A first acquisition module, configured for the monitor to periodically acquire the number of objects to be restored from the plurality of object storage devices;
[0141] A second acquisition module is configured to acquire a target recovery speed for a current cycle, wherein the target recovery speed represents the number of recoverable objects in a storage pool per unit time; the storage pool includes objects stored by the plurality of object storage devices;
[0142] a second determining module, configured to determine the number of objects to be restored in the storage pool in the current cycle according to the number of objects to be restored in the plurality of object storage devices;
[0143] The second sending module is used to send the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle to the multiple object storage devices respectively, so that the multiple object storage devices determine the number of recoverable objects in the current cycle according to the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle, and perform recovery according to the number of recoverable objects in the current cycle.
[0144] In one embodiment, the first acquisition module includes:
[0145] The third acquisition submodule is configured to enable the monitor to periodically acquire placement group status messages sent by a plurality of object storage devices, where the placement group status messages include the number of objects to be recovered from the plurality of object storage devices.
[0146] By periodically receiving these messages, the monitor can monitor the status of the placement group in real time, ensure that the data recovery process proceeds as planned, and make corresponding adjustments when the system status changes.
[0147] In one embodiment, the second sending module includes:
[0148] The second sending submodule is configured to send a placement group status confirmation message to each of the plurality of object storage devices, wherein the placement group status confirmation message includes a target recovery speed of the current cycle and a number of objects to be recovered in the storage pool in the current cycle.
[0149] By sending a placement group status confirmation message through the object storage device, the object storage device can adjust the number of objects to be restored within a period according to the placement group status confirmation message, ensuring that the data recovery speed is not too fast and causes resource waste.
[0150] An embodiment of the present invention provides a data recovery method for a distributed storage system, comprising: an object storage device periodically determining the number of objects to be recovered, and sending the number of objects to be recovered to a monitor; receiving a target recovery speed for the current cycle and the number of objects to be recovered in a storage pool within the current cycle; determining the number of recoverable objects within the current cycle based on the number of objects to be recovered by the object storage device, the target recovery speed for the current cycle, and the number of objects to be recovered in the storage pool within the current cycle; and performing recovery based on the number of recoverable objects within the current cycle. The embodiment of the present invention determines the number of recoverable objects within the current cycle, performs recovery based on the number of recoverable objects within the current cycle, controls the recovery speed of each cycle to be close to the target value, ensures the accuracy and reliability of the recovery speed of the distributed storage, reduces the complexity of the administrator's previous control of the recovery speed by adjusting multiple configuration parameters, and increases the ease of use of the distributed storage.
[0151] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0152] like Figure 5 , showing a structural block diagram of an electronic device 50 provided in an embodiment of the present invention, including:
[0153] The processor 501, the memory 502, and the computer program 5021 stored in the memory 502 and capable of running on the processor 501, when the computer program 5021 is executed by the processor 501, implements the various processes of the data recovery method embodiment of the above-mentioned distributed storage system and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0154] like Figure 6, shows a structural block diagram of a computer-readable storage medium 60 provided in an embodiment of the present invention. A computer program 601 is stored on the computer-readable storage medium 60. When the computer program 601 is executed by the processor, the various processes of the data recovery method embodiment of the above-mentioned distributed storage system are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0155] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0156] Those skilled in the art will appreciate that embodiments of the present invention may provide methods, apparatus, or computer program products. Thus, embodiments of the present invention may take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0157] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems) and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks 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 terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal 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.
[0158] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0159] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0160] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0161] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or includes elements that are inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0162] The above is a detailed introduction to the data recovery method, device, equipment and storage medium of a distributed storage system provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
Claims
1. A data recovery method for a distributed storage system, characterized in that: The distributed storage system includes a monitor and a plurality of object storage devices; the method includes: The object storage device periodically determines the number of objects to be restored, and sends the number of objects to be restored to the monitor; Receiving the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle sent by the monitor; the storage pool includes objects stored by the multiple object storage devices; the target recovery speed represents the number of recoverable objects in the storage pool per unit time; Determining the number of recoverable objects in the current cycle according to the number of objects to be recovered in the object storage device, the target recovery speed of the current cycle, and the number of objects to be recovered in the storage pool in the current cycle; Recovery is performed according to the number of recoverable objects in the current cycle.
2. The method according to claim 1, characterized in that: The determining the number of recoverable objects in the current cycle according to the number of objects to be recovered in the object storage device, the target recovery speed of the current cycle, and the number of objects to be recovered in the storage pool in the current cycle includes: Obtaining the duration of the current cycle; The ratio of the number of objects to be recovered in the object storage device to the number of objects to be recovered in the storage pool in the current cycle, multiplied by the duration of the current cycle and the target recovery speed of the current cycle, is taken as the number of recoverable objects in the current cycle.
3. The method according to claim 1, characterized in that The recovering according to the number of recoverable objects in the current cycle includes: Get the number of actually restored objects and the number of restorable objects in the previous cycle; Determining whether the number of actually restored objects in the previous cycle is the same as the number of restorable objects; If the number of actually restored objects in the previous cycle is the same as the number of restorable objects, the number of restorable objects in the current cycle is rounded up to obtain the number of actually restored objects in the current cycle, and restoration is performed according to the number of actually restored objects in the current cycle; If the number of actually restored objects in the previous cycle is different from the number of restorable objects, Then determine the difference between the number of actual restored objects in the previous cycle and the number of restoreable objects; subtract the difference from the number of restoreable objects calculated in the current cycle and round up to obtain the actual number of restored objects in the current cycle, and perform restoration according to the actual number of restored objects in the current cycle.
4. The method according to claim 1, characterized in that The sending the number of objects to be restored to the monitor includes: The object storage device periodically sends a placement group status message to the monitor, where the placement group status message includes the number of objects to be restored.
5. The method according to claim 1, characterized in that: The receiving device sends a target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle. include: Receive a placement group status confirmation message sent by the monitor, the placement group status confirmation message including the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle quantity.
6. A data recovery method for a distributed storage system, characterized in that: The distributed storage system includes a monitor and a plurality of object storage devices; the method includes: The monitor periodically obtains the number of objects to be restored from the plurality of object storage devices; Acquire a target recovery speed of a current cycle, where the target recovery speed represents the number of recoverable objects in a storage pool per unit time; the storage pool includes objects stored by the multiple object storage devices; Determining the number of objects to be restored in the storage pool in the current cycle according to the number of objects to be restored in the multiple object storage devices; The target recovery speed of the current cycle and the number of objects to be recovered in the storage pool within the current cycle are sent to the multiple object storage devices respectively, so that the multiple object storage devices determine the number of recoverable objects in the current cycle according to the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool within the current cycle, and perform recovery according to the number of recoverable objects in the current cycle.
7. The method according to claim 6, characterized in that The monitor periodically obtains the number of objects to be restored of the plurality of object storage devices, including: The monitor periodically obtains placement group status messages sent by multiple object storage devices, where the placement group status messages include the number of objects to be recovered from the multiple object storage devices.
8. The method according to claim 6, characterized in that The sending the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle to the multiple object storage devices respectively includes: Sending placement group status confirmation messages to the multiple object storage devices respectively, wherein the placement group status confirmation messages include the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool in the current cycle.
9. A data recovery device for a distributed storage system, characterized in that: The distributed storage system includes a monitor and a plurality of object storage devices; the apparatus includes: A first sending module, configured for the object storage device to periodically determine the number of objects to be restored, and send the number of objects to be restored to the monitor; A first receiving module, configured to receive a target recovery speed of a current cycle and the number of objects to be recovered in a storage pool in the current cycle sent by the monitor; the storage pool includes objects stored by the multiple object storage devices; the target recovery speed represents the number of recoverable objects in the storage pool per unit time; A first determining module, configured to determine the number of recoverable objects in the current cycle according to the number of objects to be recovered in the object storage device, the target recovery speed of the current cycle, and the number of objects to be recovered in the storage pool in the current cycle; The first recovery module is used to recover according to the number of recoverable objects in the current cycle.
10. A data recovery device for a distributed storage system, characterized in that: The distributed storage system includes a monitor and a plurality of object storage devices; the apparatus includes: A first acquisition module, configured for the monitor to periodically acquire the number of objects to be restored of the plurality of object storage devices; A second acquisition module is used to acquire a target recovery speed of a current cycle, wherein the target recovery speed represents the number of recoverable objects in a storage pool per unit time; the storage pool includes objects stored by the multiple object storage devices; A second determining module, configured to determine the number of objects to be restored in the storage pool in the current cycle according to the number of objects to be restored in the plurality of object storage devices; A second sending module is used to send the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool within the current cycle to the multiple object storage devices respectively, so that the multiple object storage devices determine the number of recoverable objects in the current cycle according to the target recovery speed of the current cycle and the number of objects to be recovered in the storage pool within the current cycle, and perform recovery according to the number of recoverable objects in the current cycle.
11. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the data recovery method of the distributed storage system as described in any one of claims 1 to 8 are implemented.
12. A non-volatile readable storage medium, characterized in that: The non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data recovery method of the distributed storage system according to any one of claims 1 to 8 are implemented.
