An abnormal recovery method, device, electronic device and storage medium

By recording the differential data storage location of the main device and adding attributes to be updated in the backup device, and superimposed updates are performed in combination with normal business data, the problem that the backup device cannot be backed up when synchronous remote replication function is abnormal, and the coordination between differential updates and business processing is achieved, reducing the impact on the performance of the main device.

CN115202935BActive Publication Date: 2025-07-25JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210895823.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-27
Publication Date
2025-07-25
Estimated Expiration
2042-07-27

AI Technical Summary

Technical Problem

When the synchronous remote replication function is abnormal, the backup device cannot perform backup, resulting in the recording of differential data needs to be processed sequentially, affecting the normal service processing performance of the main device.

Method used

Record the different data storage location of the main device, and when the synchronous remote copy function is restored, find the data object in the backup device and add the attributes to be updated, and combine the normal business data for overlay updates.

Benefits of technology

Without affecting the normal service processing of the main device, differential updates on the standby device are realized, reducing the performance impact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115202935B_ABST
    Figure CN115202935B_ABST
Patent Text Reader

Abstract

The present invention provides an exception recovery method, apparatus, electronic device and storage medium, relating to the storage field. The method is applied to a storage system, and the storage system includes a primary device and a secondary device. The method includes: when it is determined that an exception occurs in the synchronous remote replication function, recording the storage location of the differential data only written to the primary device in the primary device; when it is determined that the synchronous remote replication function is restored, searching for the data object corresponding to the storage location in the secondary device, and adding an attribute to be updated to the data object; when receiving normal service data, determining the write location of the normal service data in the primary device; when it is determined that the target data object corresponding to the write location in the secondary device has an attribute to be updated, reading the original data corresponding to the write location in the primary device, superimposing the original data and the normal service data, and updating the target data object with the superimposed result; the differential update of the secondary device can be combined with the normal service flow of the primary device to reduce the performance impact.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the storage field, and particularly to an exception recovery method, apparatus, electronic device, and computer-readable storage medium. Background Art

[0002] Synchronous remote replication technology is a mainstream technical means for high availability of data backup storage. That is, a synchronous remote replication function can be set between the primary device and the secondary device to achieve storage backup of the secondary device for the primary device. In related technologies, when the synchronous remote replication function fails, the secondary device cannot perform backup. At this time, the differential data written to the primary device during the failure period can be recorded on the primary device, and the secondary device can be differentially updated according to this record after the failure is recovered. However, the recording of differential data usually needs to be processed sequentially, and the processing of each record is atomic. That is, when processing the update request corresponding to each record, the primary device cannot process normal service requests, which is likely to cause a large number of update requests to compete with normal service requests during large-scale differential updates, thus easily affecting the original service processing performance of the primary device. Summary of the Invention

[0003] The purpose of the present invention is to provide an exception recovery method, apparatus, electronic device, and computer-readable storage medium, which can combine the differential update of the secondary device with the normal service flow of the primary device to reduce the performance impact on the primary device for processing the normal service flow.

[0004] To solve the above technical problems, the present invention provides an exception recovery method applied to a storage system. The storage system includes a primary device and a secondary device, and the method includes:

[0005] When it is determined that the synchronous remote replication function is abnormal, record the storage location of the differential data written only to the primary device in the primary device;

[0006] When it is determined that the synchronous remote replication function is restored, find the data object corresponding to the storage location in the secondary device, and add an attribute to be updated to the data object;

[0007] When receiving normal service data, determine the write location of the normal service data in the primary device;

[0008] When it is determined that the target data object corresponding to the write location in the secondary device has the attribute to be updated, read the original data corresponding to the write location in the primary device, superimpose the original data and the normal service data, and update the target data object with the superimposed result.

[0009] Optionally, before searching for the data object corresponding to the storage location in the standby device, it further includes:

[0010] Determine whether a preset differential update condition is satisfied; the preset differential update condition is that the total abnormal time of the synchronous remote replication function does not exceed a preset time, or the total size of the differential data does not exceed a preset threshold;

[0011] If so, enter the step of searching for the data object corresponding to the storage location in the standby device;

[0012] If not, restore the standby device using the full amount of data in the master device.

[0013] Optionally, before determining whether the preset differential update condition is satisfied, it further includes:

[0014] Determine the capacity size, writing method, and average traffic within a preset past time range of the master volume in the master device;

[0015] Use the capacity size, the writing method, and the average traffic to determine the preset time or the preset threshold.

[0016] Optionally, before determining that the synchronous remote replication function has an abnormality, it further includes:

[0017] When receiving the normal service data, write the normal service data into the master device and the standby device respectively through the synchronous remote replication function, and determine whether the return values returned by the master device and the standby device are the same;

[0018] If not, determine that the synchronous remote replication function has an abnormality.

[0019] Optionally, before determining that the synchronous remote replication function is restored, it further includes:

[0020] Obtain the network status, cluster status, and storage pool status of the storage system, and determine whether the synchronous remote replication function is restored according to the network status, the cluster status, and the storage pool status.

[0021] Optionally, the recording of the storage location of the differential data written only to the master device in the master device includes:

[0022] Create a bitmap on the master device and use the bitmap to record the storage location.

[0023] Optionally, after updating the target data object using the superimposed result, it further includes:

[0024] Remove the attribute to be updated of the target data object.

[0025] Optionally, before receiving normal service data, it further includes:

[0026] Adding a synchronization status to the primary volume of the primary device and the secondary volume of the secondary device;

[0027] Correspondingly, before determining that the target data object corresponding to the write position in the secondary device has the to-be-updated attribute, it further includes:

[0028] Determining whether the synchronization status is set for the target primary volume corresponding to the normal service data in the primary device;

[0029] If so, searching in the secondary device for the target secondary volume that has the synchronization status set together with the target primary volume, and determining whether the target data object corresponding to the write position in the target secondary volume has the to-be-updated attribute.

[0030] Optionally, it further includes:

[0031] Periodically detecting whether there is data update in the secondary volume of the secondary device, and when it is determined that there is data update in the secondary volume, creating a snapshot for the secondary volume;

[0032] Creating an auxiliary volume based on the snapshot;

[0033] Correspondingly, after determining that the synchronous remote replication function is abnormal, it further includes:

[0034] Using the auxiliary volume to replace the secondary volume to provide data access services externally.

[0035] The present invention further provides an exception recovery device, which is applied to a storage system, and the storage system includes a primary device and a secondary device, and includes:

[0036] A recording module, configured to record the storage location of the differential data written only to the primary device in the primary device when it is determined that the synchronous remote replication function is abnormal;

[0037] An attribute adding module, configured to search in the secondary device for the data object corresponding to the storage location and add a to-be-updated attribute to the data object when it is determined that the synchronous remote replication function is restored;

[0038] A write position determining module, configured to determine the write position of the normal service data in the primary device when the normal service data is received;

[0039] An update module, when it is determined that the target data object corresponding to the write position in the standby device has the to-be-updated attribute, reads the original data corresponding to the write position in the primary device, superimposes the original data and the normal service data, and updates the target data object with the superimposed result.

[0040] The present invention also provides an electronic device, including:

[0041] A memory, configured to store a computer program;

[0042] A processor, configured to implement the abnormal recovery method as described above when executing the computer program.

[0043] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the abnormal recovery method as described above is implemented.

[0044] The present invention provides an abnormal recovery method, which is applied to a storage system. The storage system includes a primary device and a standby device, and includes: when it is determined that an abnormality occurs in the synchronous remote replication function, recording the storage position of the differential data written only to the primary device in the primary device; when it is determined that the synchronous remote replication function is restored, searching for the data object corresponding to the storage position in the standby device, and adding a to-be-updated attribute to the data object; when receiving normal service data, determining the write position of the normal service data in the primary device; when it is determined that the target data object corresponding to the write position in the standby device has the to-be-updated attribute, reading the original data corresponding to the write position in the primary device, superimposing the original data and the normal service data, and updating the target data object with the superimposed result.

[0045] It can be seen that when the present invention determines that the synchronous remote replication function is abnormal, it can record the storage location of the differential data written only to the primary device in this device. Furthermore, when it is determined that the synchronous remote replication function is restored, the corresponding data object can be found in the secondary device according to this storage location, and a to-be-updated attribute is added to this data object. Subsequently, when the present invention receives normal service data, it will determine the corresponding write location of this data in the primary device, and determine whether the target data object corresponding to this write location in the secondary device has a to-be-updated attribute. If it has, the original data corresponding to the write location can be extracted from the primary device, and the original data is superimposed on the normal service data. Then, the target data object in the secondary device is updated using the superimposed result. It can be understood that the original data corresponding to the write location already contains the differential data written only to the primary device. Therefore, updating the target data object in the secondary device using the superimposed result can not only achieve differential update of the target data object using the differential data, but also combine the differential update with the normal service flow of the primary device to achieve differential update of the secondary device while the service is online, which can effectively avoid the performance impact of the existing differential update on the primary device's processing of the original service. The present invention also provides an exception recovery device, an electronic device, and a computer-readable storage medium, which have the above beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0047] Figure 1 It is a flowchart of an exception recovery method provided by an embodiment of the present invention;

[0048] Figure 2 It is a structural block diagram of an exception recovery device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0050] In the related art, after the synchronous remote replication function returns to normal, the master device can use the recorded differential data to perform differential recovery on the slave device. However, the recording of differential data usually needs to be processed sequentially, and the processing of each record is atomic, that is, when processing the update request corresponding to each record, the master device cannot process normal service requests. Therefore, when performing large-scale differential updates, a large number of update requests are likely to compete with normal service requests, which is likely to affect the original service processing performance of the master device. In view of this, the present invention provides an exception recovery method, which can combine the differential update of the slave device with the normal service flow of the master device to reduce the performance impact on the master device for processing the normal service flow. Please refer to Figure 1 , Figure 1 is a flowchart of an exception recovery method provided by an embodiment of the present invention. This method is applied to a storage system, and the storage system includes a master device and a slave device, and may include:

[0051] S101. When it is determined that the synchronous remote replication function has an exception, record the storage location of the differential data only written to the master device in the master device.

[0052] When the synchronous remote replication function is normal, when service data is written to the master device, it will be written to the slave device through the synchronous remote replication function to achieve backup. However, when this function fails, the service data can only be written to the master device and cannot be backed up to the slave device; at this time, in order to facilitate data recovery of the slave device when the synchronous remote replication function returns to normal, the service data (i.e., differential data) written to the master device during the failure period should be recorded separately so that this part of the service data can be rewritten to the slave device according to this record later. Specifically, the embodiment of the present invention records the storage location of the differential data in the master device, because the storage location of the same data in the master device and the slave device is the same. In this way, later, only need to read the data from the master device according to the storage location of the differential data and write it to the same location in the slave device. It should be noted that the embodiment of the present invention does not limit the specific recording method of the storage location of the differential data. For example, it can be recorded through log information or a bitmap can be used for recording. The bitmap is usually used to mark the location of the differential data in the storage device. Considering that the bitmap is more convenient to process, the embodiment of the present invention will use a bitmap to record the storage location of the differential data in the master device.

[0053] In a possible case, recording the storage location of the differential data only written to the master device in the master device may include:

[0054] Step 11: Create a bitmap on the master device and use the bitmap to record the storage location.

[0055] Further, it should be noted that the embodiments of the present invention do not limit how to detect whether the synchronous remote replication function is abnormal. For example, it can be detected through the network status and the working status of software and hardware of the standby device, or directly detected according to the response status of the primary and standby devices to the same service data. To improve the detection efficiency, in the embodiments of the present invention, it will be determined whether the synchronous remote replication function is abnormal according to the response status of the primary and standby devices to the same service data. Specifically, when receiving normal service data, it can be written into the primary device and the standby device respectively through the synchronous remote replication function, and at the same time, it is judged whether the return values returned by these two devices are the same. If they are the same, it can be determined that the synchronous remote replication function is normal, otherwise, it can be determined that the synchronous remote replication function is abnormal.

[0056] In a possible situation, before determining that the synchronous remote replication function is abnormal, it may further include:

[0057] Step 21: When receiving normal service data, write the normal service data into the primary device and the standby device respectively through the synchronous remote replication function, and judge whether the return values returned by the primary device and the standby device are the same; if so, go to Step 22; if not, go to Step 23;

[0058] Step 22: Determine that the synchronous remote replication function is normal.

[0059] Step 23: Determine that the synchronous remote replication function is abnormal.

[0060] S102. When it is determined that the synchronous remote replication function is restored, find the data object corresponding to the storage location in the standby device, and add an attribute to be updated to the data object.

[0061] After determining that the synchronous remote replication function is restored, the embodiments of the present invention will not immediately read the differential data from the primary device and update the standby device. Instead, first, according to the recorded storage location of the differential data, find the corresponding data object in the standby device, and add an attribute to be updated to this object, that is, simply put, make a special mark on this data object for identification. It should be noted that the embodiments of the present invention do not limit the specific form of the attribute to be updated, which can be set according to actual application requirements. Further, it should be noted that the embodiments of the present invention do not limit how to determine that the synchronous remote replication function has returned to normal. Specifically, the network status, cluster status, and storage pool status of the storage system can be collected, and when it is determined that the network, cluster, and storage pool are all in a normal working state, it is determined that the synchronous remote replication function has returned to normal.

[0062] In a possible situation, before determining that the synchronous remote replication function is restored, it may further include:

[0063] Step 31: Obtain the network status, cluster status, and storage pool status of the storage system, and determine whether the synchronous remote replication function is restored based on the network status, cluster status, and storage pool status.

[0064] S103: When receiving normal service data, determine the write location of the normal service data in the primary device.

[0065] After marking the attributes to be updated, the primary and standby devices in the embodiments of the present invention will wait for the normal service data stream, and complete the differential update process while processing the service flow. Specifically, after receiving the normal service data, in addition to writing this data normally into the primary device, the embodiments of the present invention will also determine the write location of this service data in the primary device, and then search for the corresponding target data object in the standby device according to this location. Subsequently, the embodiments of the present invention will determine whether the target data object is marked with the attribute to be updated, and when it is determined that it has this attribute, use the original data corresponding to the write location in the primary device and the above normal service data to update the target data object.

[0066] S104: When it is determined that the target data object corresponding to the write location in the standby device has the attribute to be updated, read the original data corresponding to the write location in the primary device, superimpose the original data and the normal service data, and use the superimposed result to update the target data object.

[0067] It can be understood that if the target data object is set with the attribute to be updated, the differential data has been included in the original data corresponding to it in the primary device. Therefore, superimposing this original data and the current normal service data and using the superimposed result to update the target data object not only completes the processing of the normal service data, but also can complete the differential update of the target data object. In other words, the embodiments of the present invention can achieve online differential update, that is, combine the differential update of the standby device with the normal service flow processing process to avoid the performance impact of separately processing the differential update on the primary device's processing of the normal service flow. Further, it can be understood that after updating the target data object, the attribute to be updated of the target data object can be removed to avoid repeated updates of this object in the future.

[0068] In a possible situation, after updating the target data object with the superimposed result, it may further include:

[0069] Step 41: Remove the attribute to be updated of the target data object.

[0070] Of course, since the judgment on the updated attributes will still interfere with the processing of the normal business process, further, a synchronization status can be set for the primary volume and the secondary volume with different data in the primary device and the secondary device. Then, when receiving normal business data, the judgment process for the data to be updated is only executed when it is determined that the target primary volume corresponding to the data in the primary device has the above synchronization status. In this way, after the primary volume and the secondary volume with the synchronization status have completed differential updates, only the synchronization status needs to be cleared to restore to the state of only processing normal business data. It can be understood that the above synchronization status can be removed when it is determined that the secondary volume does not contain any data objects with attributes to be updated. It should be noted that the embodiments of the present invention do not limit the specific form of the synchronization status, which can be set according to actual application requirements.

[0071] In a possible case, before receiving normal business data, it may further include:

[0072] Step 51: Add a synchronization status to the primary volume of the primary device and the secondary volume of the secondary device;

[0073] Correspondingly, before determining that the target data object corresponding to the write position in the secondary device has an attribute to be updated, it further includes:

[0074] Step 52: Determine whether the target primary volume corresponding to the normal business data in the primary device has a synchronization status; if yes, go to Step 53; if no, go to Step 54;

[0075] Step 53: Search for the target secondary volume with the same synchronization status as the target primary volume in the secondary device, and determine whether the target data object corresponding to the write position in the target secondary volume has an attribute to be updated.

[0076] Step 54: Write the normal business data into the primary device and the secondary device normally.

[0077] Furthermore, it can be understood that the main body executing this method can be a dedicated data recovery process, which can be set either in the primary device or in a management device dedicated to managing the primary device and the secondary device, and can be set according to actual application requirements.

[0078] Based on the above embodiments, when the present invention determines that the synchronous remote replication function is abnormal, it can record the storage location of the differential data written only to the primary device in this device. Furthermore, when it is determined that the synchronous remote replication function is restored, it can find the corresponding data object in the secondary device according to this storage location and add an attribute to be updated to this data object. Subsequently, when the present invention receives normal service data, it will determine the corresponding write location of this data in the primary device and determine whether the target data object corresponding to this write location in the secondary device has an attribute to be updated. If it has, the original data corresponding to the write location can be extracted from the primary device, and the original data is superimposed on the normal service data. Then, the target data object in the secondary device is updated using the superimposed result. It can be understood that the original data corresponding to the write location already includes the differential data written only to the primary device. Therefore, updating the target data object in the secondary device using the superimposed result can not only achieve differential updating of the target data object using the differential data, but also combine the differential updating with the normal service flow of the primary device to achieve differential updating of the secondary device while the service is online, which can effectively reduce the performance impact of the existing differential updating on the primary device for processing the original service.

[0079] Based on the above embodiments, considering that differential updating will still have a certain impact on the performance of the primary device for processing the normal service flow, the scale of differential updating can be further considered, and a better recovery method can be selected between differential updating and full - volume updating according to this scale. In a possible situation, before finding the data object corresponding to the storage location in the secondary device, it may further include:

[0080] S201. Determine whether a preset differential update condition is met; the preset differential update condition is that the total abnormal time of the synchronous remote replication function does not exceed a preset time, or the total size of the differential data does not exceed a preset threshold; if so, proceed to step S202; if not, proceed to step S203;

[0081] In an embodiment of the present invention, before data recovery of the standby device, it is possible to first determine whether the abnormal situation of the synchronous remote replication function meets a preset differential update condition. If it meets, the differential synchronization method is adopted; otherwise, the standby device is fully updated using the full amount of data in the master device. The embodiment of the present invention can specifically adopt two preset differential update conditions, that is, it is possible to determine whether the total abnormal time of the synchronous remote replication function exceeds a preset time. If it exceeds, it can be determined that the preset differential update condition is not met; and, it is possible to determine whether the total size of the differential data exceeds a preset threshold. If it exceeds, it can be determined that the preset differential update condition is not met. In other words, the embodiment of the present invention can determine the scale of differential update through the total abnormal time or the total size of differential data. If the scale is large, the differential update will have a greater impact on the efficiency of the master device in processing normal service data. At this time, the full update method can be adopted; if the scale is small, the master device can complete the recovery of the standby device in a short time, that is, the differential update method can be adopted. In this way, the performance impact of differential update on the master device in processing normal service data can be further reduced.

[0082] It should be noted that the embodiment of the present invention does not limit the specific values of the above-mentioned preset time and preset threshold, which can be set according to actual application requirements. In addition, the above-mentioned preset time and preset threshold can be set manually or adaptively according to the characteristics of the master volume and the service flow processed during the abnormal period of the synchronous remote replication function. Specifically, the capacity size, write mode (such as sequential write, random write, etc.) of the master volume and the average traffic in the past preset time range can be collected, and the above-mentioned preset time or preset threshold can be determined through methods such as weighting and gear setting according to the capacity size, write mode and average traffic.

[0083] In a possible situation, before determining whether the preset differential update condition is met, it may further include:

[0084] Step 61: Determine the capacity size, write mode of the master volume in the master device and the average traffic in the past preset time range;

[0085] Step 62: Determine the preset time or preset threshold using the capacity size, write mode and average traffic.

[0086] S202. Enter the step of finding the data object corresponding to the storage location in the standby device;

[0087] S203. Recover the standby device using the full amount of data in the master device.

[0088] It should be noted that the embodiments of the present invention do not limit the specific process of performing a full recovery on the standby device using all data. One can refer to existing full recovery solutions or adjust according to the differential update solution provided by the embodiments of the present invention to obtain a full update solution.

[0089] Based on the above embodiments, the embodiments of the present invention can further consider the scale of differential updates and select a more optimal recovery method between differential updates and full updates according to this scale, so as to further reduce the performance impact of differential updates on the main device's processing of normal business data.

[0090] Based on the above embodiments, considering that when the synchronous remote replication function is abnormal, the standby device cannot carry out normal business operations either. To avoid data loss problems on the standby device during the abnormal period, snapshots can also be set for the standby device periodically, and an auxiliary volume can be generated based on this snapshot. Then, when the synchronous remote replication function is abnormal, data access services can be provided to the outside through this auxiliary volume to avoid data loss problems. In one possible scenario, this method may further include:

[0091] S301: Periodically detect whether there is data update in the standby volume of the standby device, and when it is determined that there is data update in the standby volume, create a snapshot for the standby volume;

[0092] It should be noted that the embodiments of the present invention do not limit the specific detection period, which can be set according to actual application requirements. In addition, the embodiments of the present invention do not limit how to detect whether there is data update in the standby volume (that is, determine whether there is data increase, deletion, or modification in the standby volume compared with the previous detection), and existing solutions can be referred to. The embodiments of the present invention also do not limit how to create a snapshot, and related technologies in the storage field can also be referred to.

[0093] S302: Create an auxiliary volume based on the snapshot.

[0094] Correspondingly, after it is determined that the synchronous remote replication function is abnormal, it may further include:

[0095] S303: Use the auxiliary volume to replace the standby volume to provide data access services to the outside.

[0096] It should be noted that the auxiliary volume is a read-only volume and can record all the data of the standby volume before the abnormality. In this way, external devices can read the required data through the auxiliary volume, and thus the data loss problem caused by the failure of the standby device can be avoided.

[0097] Next, the abnormal recovery device, electronic device, and computer-readable storage medium provided by the embodiments of the present invention will be introduced. The abnormal recovery device, electronic device, and computer-readable storage medium described below can be correspondingly referred to with the abnormal recovery method described above.

[0098] Please refer to Figure 2 , Figure 2 which is a structural block diagram of an exception recovery device provided by an embodiment of the present invention. The device is applied to a storage system, which includes a primary device and a secondary device. The device may include:

[0099] A recording module 201, configured to record the storage location of the differential data written only to the primary device in the primary device when it is determined that the synchronous remote replication function is abnormal;

[0100] An attribute adding module 202, configured to find the data object corresponding to the storage location in the secondary device and add an attribute to be updated to the data object when it is determined that the synchronous remote replication function is restored;

[0101] A writing position determining module 203, configured to determine the writing position of the normal service data in the primary device when receiving the normal service data;

[0102] An updating module 204, configured to read the original data corresponding to the writing position in the primary device, superimpose the original data and the normal service data, and update the target data object with the superimposed result when it is determined that the target data object corresponding to the writing position in the secondary device has an attribute to be updated.

[0103] Optionally, the device may further include:

[0104] A differential recovery judgment module, configured to judge whether a preset differential update condition is satisfied; the preset differential update condition is that the total abnormal time of the synchronous remote replication function does not exceed a preset time, or the total size of the differential data does not exceed a preset threshold;

[0105] A delta recovery module, configured to, if so, call the attribute adding module;

[0106] A full recovery module, configured to, if not, recover the secondary device using the full data in the primary device.

[0107] Optionally, the device may further include:

[0108] A primary volume parameter determining module, configured to determine the capacity size, writing method, and average traffic within a past preset time range of the primary volume in the primary device;

[0109] A setting module, configured to determine the preset time or preset threshold using the capacity size, writing method, and average traffic.

[0110] Optionally, the device may further include:

[0111] Anomaly detection module, which is used to, when receiving normal service data, write the normal service data into the primary device and the standby device respectively through the synchronous remote replication function, and determine whether the return values returned by the primary device and the standby device are the same; if not, it is determined that the synchronous remote replication function has an anomaly.

[0112] Optionally, the device may further include:

[0113] Recovery detection module, which is used to obtain the network status, cluster status and storage pool status of the storage system, and determine whether the synchronous remote replication function is restored according to the network status, cluster status and storage pool status.

[0114] Optionally, the recording module 201 may include:

[0115] Recording sub-module, which is used to create a bitmap on the primary device and record the storage location by using the bitmap.

[0116] Optionally, the device may further include:

[0117] Attribute removal module, which is used to remove the attributes to be updated of the target data object.

[0118] Optionally, the device may further include:

[0119] Status adding module, which is used to add a synchronization status to the primary volume of the primary device and the standby volume of the standby device;

[0120] Correspondingly, the device may further include:

[0121] Synchronization status judgment module, which is used to judge whether the target primary volume corresponding to the normal service data in the primary device is set with a synchronization status;

[0122] The write location determination module is further used to, if so, find the target standby volume that is set with the synchronization status together with the target primary volume in the standby device, and determine whether the target data object corresponding to the write location in the target standby volume has an attribute to be updated.

[0123] Optionally, the device may further include:

[0124] Update detection module, which is used to periodically detect whether there is data update in the standby volume of the standby device, and create a snapshot for the standby volume when it is determined that there is data update in the standby volume;

[0125] Auxiliary volume creation module, which is used to create an auxiliary volume based on the snapshot;

[0126] Auxiliary volume data access service module, which is used to, after determining that the synchronous remote replication function has an anomaly, use the auxiliary volume to replace the standby volume to provide data access services externally.

[0127] An embodiment of the present invention further provides an electronic device, including:

[0128] A memory for storing a computer program;

[0129] A processor for implementing the steps of the above-mentioned exception recovery method when executing the computer program.

[0130] Since the embodiments of the electronic device part correspond to the embodiments of the exception recovery method part, for the embodiments of the electronic device part, please refer to the description of the embodiments of the exception recovery method part, which will not be elaborated here.

[0131] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the exception recovery method in any of the above embodiments are implemented.

[0132] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the exception recovery method part, for the embodiments of the storage medium part, please refer to the description of the embodiments of the exception recovery method part, which will not be elaborated here.

[0133] The embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, please refer to the description in the method part.

[0134] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0135] The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0136] The above has introduced in detail an exception recovery method, device, electronic device and computer-readable storage medium provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims

1. An abnormal recovery method, applied to a storage system, the storage system including a primary device and a secondary device, characterized in that, Including: When it is determined that the synchronous remote replication function is abnormal, record the storage location of the differential data written only to the master device in the master device; When it is determined that the synchronous remote replication function is restored, search for the data object corresponding to the storage location in the slave device, and add an attribute to be updated to the data object; When receiving normal service data, determine the write location of the normal service data in the master device; When it is determined that the target data object corresponding to the write location in the slave device has the attribute to be updated, read the original data corresponding to the write location in the master device, superimpose the original data and the normal service data, and update the target data object with the superimposed result.

2. The abnormal recovery method according to claim 1, wherein Before searching for the data object corresponding to the storage location in the slave device, it further includes: Judge whether a preset differential update condition is met; the preset differential update condition is that the total abnormal time of the synchronous remote replication function does not exceed a preset time, or the total size of the differential data does not exceed a preset threshold; If so, enter the step of searching for the data object corresponding to the storage location in the slave device; If not, restore the slave device using the full amount of data in the master device.

3. The abnormal recovery method according to claim 2, wherein Before judging whether the preset differential update condition is met, it further includes: Determine the capacity size, write mode and average traffic within a preset past time range of the master volume in the master device; Determine the preset time or the preset threshold using the capacity size, the write mode and the average traffic.

4. The abnormal recovery method according to claim 1, characterized in that Before determining that the synchronous remote replication function is abnormal, it further includes: When receiving the normal service data, write the normal service data to the master device and the slave device respectively through the synchronous remote replication function, and judge whether the return values returned by the master device and the slave device are the same; If not, it is determined that the synchronous remote replication function is abnormal.

5. The abnormal recovery method according to claim 1, wherein Before determining that the synchronous remote replication function is restored, it further includes: Obtain the network status, cluster status and storage pool status of the storage system, and determine whether the synchronous remote replication function is restored according to the network status, the cluster status and the storage pool status.

6. The abnormal recovery method according to claim 1, wherein The recording of the storage location of the differential data written only to the master device in the master device includes: Create a bitmap on the master device, and record the storage location using the bitmap.

7. The abnormal recovery method according to claim 1, wherein After updating the target data object with the superimposed result, it further includes: Remove the attribute to be updated of the target data object.

8. The abnormal recovery method according to claim 1, wherein Before receiving the normal service data, it further includes: Add a synchronization status to the master volume of the master device and the slave volume of the slave device; Correspondingly, before determining that the target data object corresponding to the write location in the slave device has the attribute to be updated, it further includes: Judge whether the target master volume corresponding to the normal service data in the master device is set with the synchronization status; If so, search for a target standby volume that is set with the synchronization state together with the target primary volume in the standby device, and determine whether the target data object corresponding to the write position in the target standby volume has the to-be-updated attribute.

9. The abnormal recovery method according to any one of claims 1 to 8, characterized in that, Further included are: Periodically detect whether there is data update in the standby volume in the standby device, and when it is determined that there is data update in the standby volume, create a snapshot for the standby volume; Create an auxiliary volume based on the snapshot; Correspondingly, after it is determined that the synchronous remote replication function is abnormal, further included are: Use the auxiliary volume to replace the standby volume to provide data access services externally.

10. An exception recovery device is applied to a storage system, and the storage system includes a primary device and a secondary device, characterized in that, Included are: A recording module, configured to record the storage location of the differential data written only to the primary device in the primary device when it is determined that the synchronous remote replication function is abnormal; An attribute adding module, configured to search for the data object corresponding to the storage location in the standby device and add the to-be-updated attribute to the data object when it is determined that the synchronous remote replication function is restored; A write position determining module, configured to determine the write position of the normal service data in the primary device when the normal service data is received; An update module, configured to read the original data corresponding to the write position in the primary device, superimpose the original data and the normal service data, and update the target data object with the superimposed result when it is determined that the target data object corresponding to the write position in the standby device has the to-be-updated attribute.

11. An electronic device, characterized in that, Included are: A memory, configured to store a computer program; A processor, configured to implement the abnormal recovery method according to any one of claims 1 to 10 when executing the computer program.

12. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are loaded and executed by a processor, the abnormal recovery method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Data processing method and device, electronic equipment and storage medium

    CN110908838A

  • Data migration method and device, equipment and medium

    CN111324295A