Disaster recovery exception handling method and system, computer device and storage medium
By performing disk array mirroring or verification operations in the storage system, the correction status of the secondary volume is temporarily modified to obtain read permissions, which solves the problem of read failure caused by abnormal data blocks in the primary volume and improves the self-repair capability and efficiency of disaster recovery.
Patent Information
- Application Number
- CN202211076993.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-05
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2042-09-05
AI Technical Summary
In storage systems, when a data block anomaly occurs on the primary volume, existing technologies cannot effectively switch to the secondary volume to retrieve the data, resulting in read failures and affecting disaster recovery efficiency. This problem is particularly pronounced when hardware is aging or SSD chips have been read and written too many times.
When the primary volume fails to read data, a disk array mirroring or verification operation is performed to obtain the data blocks that failed to be read. The correction status of the secondary volume is temporarily modified to allow read access, thus enabling the primary volume to obtain data read permissions and enabling data reading on the secondary volume.
It improves the self-healing capability of disaster recovery and anomaly handling, ensuring that the status of the secondary volume is temporarily modified to obtain read permission when it is not allowed to be read, thereby improving the reliability of data reading and the efficiency of disaster recovery.
Smart Images

Figure CN115454709B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data disaster recovery, and in particular, to a disaster recovery exception processing method and system, a computer device and a storage medium. BACKGROUND
[0002] In a storage system, RC (Remote Copy) defines the relationship between volumes, and usually one volume is designated as a primary volume and the other as a secondary volume. Usually, a host application writes data to the primary volume, and no I / O (Input / Output) operation is performed on the secondary volume. Although data is only written to one volume, the system will copy the data to another volume according to the remote copy relationship, and when disaster recovery occurs, the copied data on the other volume can be used as a backup.
[0003] If the primary system (including the primary volume) completely fails, the secondary system (including the secondary volume) will be switched to, and the secondary volume of the secondary system will be used to provide continuous data storage services to the upper host (or host cluster); if the primary volume does not completely fail, but only one or more blocks (data blocks) have data exceptions, if the upper host issues a read I / O operation to obtain the one or more data blocks at this time, the read operation will still be timed out after multiple read retries, and the secondary volume will not be switched to obtain data at this time, and a read failure will be returned to the upper host in this state. For this scenario, the storage itself has array-level mirroring or checking, which can read out the one or more data blocks from the array-level mirroring, or calculate the one or more data blocks by using the raid5 / raid6 check bits; when there is no mirroring at the array level or the check bits of the one or more data blocks also have errors, the upper host will necessarily read data and fail, so the scenario of read I / O operation failure of the upper application host will occur, and the probability of the above scenario will obviously increase when the underlying disk has aged or the HDD has lost magnetism, or the read / write times of the SSD solid-state particles are too many, which seriously affects the disaster recovery processing efficiency. SUMMARY
[0004] Based on this, the present application provides a disaster recovery exception processing method, system, computer device and storage medium to improve the disaster recovery exception processing capability.
[0005] In one aspect, a disaster recovery exception processing method is provided, which comprises:
[0006] The host performs a data read operation on the primary volume, and performs a mirror operation or a check operation of the disk array when the data read operation of the host on the primary volume fails.
[0007] When the mirror operation or the check operation of the disk array fails, a read-failed data block is obtained from the primary volume, and a corresponding to-be-read data block on a secondary volume is determined according to the read-failed data block;
[0008] The primary volume sends a data read instruction for the to-be-read data block to the secondary volume, and the secondary volume corresponding to the to-be-read data block is determined through the data read instruction;
[0009] The correction state of the secondary volume corresponding to the to-be-read data block is configured as an allowed readable state, so as to obtain temporary read permission of the primary volume on the secondary volume;
[0010] The data read operation on the to-be-read data block is performed on the secondary volume in the allowed readable state.
[0011] In one embodiment, before the primary volume sends the data read instruction for the to-be-read data block to the secondary volume, the method further includes:
[0012] The correction state of the secondary volume is defined, and different read permissions are configured for the secondary volumes in different correction states; wherein the correction state includes the allowed readable state and the refused readable state;
[0013] When the correction state of the secondary volume is configured as the allowed readable state, the primary volume is allowed to obtain read permission on the secondary volume, and the data read operation initiated by the primary volume on the secondary volume is allowed to be performed;
[0014] When the correction state of the secondary volume is configured as the refused readable state, the primary volume is refused to obtain read permission on the secondary volume, and the data read operation initiated by the primary volume on the secondary volume is refused to be performed.
[0015] In one embodiment, the corresponding to-be-read data block on the secondary volume is determined according to the read-failed data block, and includes:
[0016] The to-be-read data block at the same position information on the secondary volume is determined according to the position information of the read-failed data block on the primary volume.
[0017] In one embodiment, before the primary volume sends the data read instruction for the to-be-read data block to the secondary volume, the method further includes:
[0018] The flag bit state of the to-be-read data block is obtained from the secondary volume according to a bitmap;
[0019] The flag bit state of the to-be-read data block is determined;
[0020] if the flag bit state of the to-be-read data block is in the readable state, storing the position information of the to-be-read data block on the secondary volume to the data read instruction;
[0021] if the flag bit state of the secondary volume corresponding to the to-be-read data block is in the unreadable state, returning failure information to the primary volume.
[0022] In one embodiment, the primary volume sends a data read instruction for the to-be-read data block to the secondary volume, and determines the secondary volume corresponding to the to-be-read data block through the data read instruction, including:
[0023] The primary volume sends the data read instruction for the to-be-read data block to the secondary volume to obtain the position information of the to-be-read data block on the secondary volume from the data read instruction;
[0024] determining the secondary volume corresponding to the to-be-read data block according to the position information of the to-be-read data block on the secondary volume;
[0025] wherein the to-be-read data block is located on the secondary volume.
[0026] In one embodiment, the data read operation for the to-be-read data block on the secondary volume in the readable state includes:
[0027] performing the data read operation of the to-be-read data block by the primary volume to obtain the body data and the check data of the to-be-read data block;
[0028] checking the check data in the to-be-read data block, and returning the to-be-read data block to the host after the check data passes the check, and saving the to-be-read data block to the corresponding position on the primary volume.
[0029] In one embodiment, after performing the data read operation for the to-be-read data block on the secondary volume in the readable state, it further includes:
[0030] after the primary volume completes the data read operation from the secondary volume, configuring the correction state of the secondary volume as the unreadable state to close the temporary read permission of the primary volume to the secondary volume.
[0031] On the other hand, a disaster recovery exception handling system is provided, including:
[0032] The read operation module is configured to perform a data read operation on the master volume by the host, perform a mirror operation or a check operation of the disk array when the data read operation on the master volume by the host fails, and perform a data read operation on the to-be-read data block on the secondary volume in the readable state.
[0033] The data block module is configured to acquire the read-failed data block from the master volume when the mirror operation or the check operation of the disk array fails, and determine the corresponding to-be-read data block on the secondary volume according to the read-failed data block.
[0034] The read instruction module is configured to send a data read instruction for the to-be-read data block from the master volume to the secondary volume, and determine the secondary volume corresponding to the to-be-read data block through the data read instruction.
[0035] The state configuration module is configured to configure a modified state of the secondary volume corresponding to the to-be-read data block as the readable state, and configure the modified state of the secondary volume as the unreadable state after the data read operation of the master volume on the secondary volume is completed.
[0036] The permission configuration module is configured to acquire or close a temporary read permission of the master volume on the secondary volume.
[0037] In another aspect, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the following steps are implemented:
[0038] The host performs a data read operation on the master volume, and performs a mirror operation or a check operation of the disk array when the data read operation on the master volume by the host fails.
[0039] When the mirror operation or the check operation of the disk array fails, the read-failed data block is acquired from the master volume, and the corresponding to-be-read data block on the secondary volume is determined according to the read-failed data block.
[0040] The master volume sends a data read instruction for the to-be-read data block to the secondary volume, and determines the secondary volume corresponding to the to-be-read data block through the data read instruction.
[0041] The modified state of the secondary volume corresponding to the to-be-read data block is configured as the readable state, so as to acquire a temporary read permission of the master volume on the secondary volume.
[0042] The data read operation on the to-be-read data block is performed on the secondary volume in the readable state.
[0043] In yet another aspect, a computer readable storage medium is provided, which stores a program, and when the program is executed by a processor, the processor is caused to perform the following steps:
[0044] The host performs a data read operation on the primary volume, and when the data read operation of the host on the primary volume fails to read a data block, the mirror operation or the check operation of the disk array is performed;
[0045] When the mirror operation or the check operation of the disk array fails, the failed-to-read data block is obtained from the primary volume, and the corresponding data block to be read on the secondary volume is determined according to the failed-to-read data block;
[0046] The primary volume sends a data read instruction for the data block to be read to the secondary volume, and the secondary volume corresponding to the data block to be read is determined through the data read instruction;
[0047] The correction state of the secondary volume corresponding to the data block to be read is configured as a permission-to-read state to obtain temporary read permission of the primary volume on the secondary volume;
[0048] The data read operation on the data block to be read is performed on the secondary volume in the permission-to-read state.
[0049] The above technical solutions of the present application have the following advantages compared with the prior art:
[0050] The above disaster recovery exception processing method, system, computer device and storage medium, the method configures a correction state for the secondary end, different correction states correspond to different read permissions of the primary end on the secondary end, and when the secondary end is not allowed to read the data block, the correction state of the secondary end is temporarily modified to temporarily obtain the data read permission of the secondary end, and the primary end is allowed to read the data block of the secondary end, thereby improving the self-repair function and further improving the disaster recovery exception processing capability. BRIEF DESCRIPTION OF DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0052] Figure 1 is the first method flowchart of the disaster recovery exception processing method provided by the embodiments of the present application;
[0053] Figure 2 is the second method flowchart of the disaster recovery exception processing method provided by the embodiments of the present application;
[0054] Figure 3 This is a schematic diagram of the test topology structure of the disaster recovery exception handling method provided in an embodiment of the present application;
[0055] Figure 4 This is a system structure diagram of the disaster recovery exception handling system provided by an embodiment of the present application;
[0056] Figure 5 This is a device structure diagram of the computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0058] Example 1:
[0059] Reference Figure 1 As shown, Figure 1 This is a flowchart of the first method of the disaster recovery exception handling method provided in an embodiment of the present application.
[0060] The method comprises the following steps:
[0061] S101, a host performs a data read operation on a primary volume, and when a data block read failure occurs in the host's data read operation on the primary volume, performs a mirroring operation or a verification operation on a disk array;
[0062] Specifically, for data storage, disasters seriously affect the security of data storage. Although the probability of disasters is small, the impact on storage security is huge. Different disaster recovery processing methods are equipped for different disasters, among which the probability of natural disasters is 7%, and the disaster recovery processing method for 7% of natural disasters is remote disaster backup protection; the probability of hardware failure is 44%, and the probability of software, human and virus failure is 49%, and the disaster recovery processing method for 44% of hardware failure and 49% of software failure is local data center protection. Among them, the remote disaster backup protection includes synchronous remote replication and asynchronous remote replication, and the synchronous remote replication has the following characteristics: (1) double write I / O response time + distance delay; (2) no data loss; (3) intra / inter-cluster (<300Km), note: when upgrading, it may cause performance to be affected; (4) suitable for site-level data protection (Recovery Point Object, Recovery Point Object) requiring RPO=0; (5) prefer FC network, also can be used for IP network. The characteristics of asynchronous remote replication are: (1) consistent asynchronous replication; (2) can be configured between two remote sites (>300Km), all write I / Os are transmitted to the opposite end according to the source volume receiving sequence, note: only the write I / O response time is limitedly affected, and there is a possibility of data loss; (3) suitable for site-level data protection allowing RPO>0; (4) prefer FC network, also can be used for IP network. In synchronous remote replication, the secondary end has the latest data of the primary end, and in asynchronous remote replication, all I / Os are transmitted to the secondary end in sequence, and the secondary end always has a consistent data that is not the latest. The basic principle of remote replication is: the relationship between any storage pool / controller and two volumes; the volume capacity must be consistent; the data block size of the storage pool can be different; before the initialization copy is completed, the secondary volume data is inconsistent; the secondary volume cannot be a volume mapped to the host. The state of remote replication includes the following states: inconsistent stop state, the primary volume allows read and write, and the secondary volume does not allow read and write; inconsistent copy state, the primary volume allows read and write, and the secondary volume does not allow read and write; consistent stop state, the primary volume allows read and write, and the secondary volume only allows read; consistent synchronization state, the primary volume allows read and write, and the secondary volume only allows read; idle state, the primary volume and the secondary volume both allow read and write, and the replication relationship in the idle state enters this state when the network is disconnected; idle disconnected state, the primary volume and the secondary volume both allow read and write, and the replication relationship in the idle state enters this state when the network is disconnected; inconsistent disconnected state, the primary volume allows read and write, and the secondary volume does not allow read and write, and the replication relationship in the inconsistent state enters this state when the network is disconnected; consistent disconnected state, the primary volume allows read and write, and the secondary volume only allows read, and the replication relationship in the consistent state enters this state when the network is disconnected.
[0063] As described in the above background, the host performs a data read operation on the primary volume, when the data read operation on the primary volume by the host fails due to an error, a mirror operation or a check operation of the disk array is performed to recover the failed data block through the mirror operation or the check operation of the disk array.
[0064] S102, when the mirror operation or the check operation of the disk array fails, obtaining the failed data block from the primary volume, and determining the corresponding data block to be read on the secondary volume according to the failed data block;
[0065] Specifically, the failed data block is recovered through the mirror operation or the check operation of the disk array, and when the recovery of the failed data block through the mirror operation or the check operation of the disk array fails, that is, there is no mirror at the array level or the check bit of the one or more data blocks also fails, at this time, the host reads data will certainly fail due to timeout, at this time, if the primary end and the secondary end of the remote replication are in consistent synchronization state or consistent stop state, the read I / O of the primary volume of the primary end can read the data block from the same position of the secondary end, but if the primary end and the secondary end of the remote replication are in inconsistent synchronization state or inconsistent stop state, at this time, the secondary end is not allowed to read the data block, therefore, the disaster recovery exception processing method proposed in the present application temporarily modifies the correction state of the secondary end to temporarily allow the primary end to read the data block of the secondary end, first, the failed data block is obtained from the primary volume, and the corresponding data block to be read on the secondary volume is determined according to the failed data block.
[0066] S103, the primary volume sends a data read instruction for the data block to be read to the secondary volume, and determines the secondary volume corresponding to the data block to be read through the data read instruction;
[0067] After obtaining the corresponding data block to be read from the secondary volume according to the failed data block, the primary volume sends a data read instruction for the data block to be read to the secondary volume, and determines the secondary volume corresponding to the data block to be read through the data read instruction, so as to configure the correction state of the secondary volume corresponding to the data block to be read.
[0068] S104, configuring the correction state of the secondary volume corresponding to the data block to be read as an allowed readable state to obtain temporary reading permission of the secondary volume by the primary volume;
[0069] Specifically, after obtaining the secondary volume corresponding to the data block to be read, the correction state of the secondary volume corresponding to the data block to be read is configured, that is, the correction state of the secondary volume corresponding to the data block to be read is configured as an allowed readable state to obtain temporary reading permission of the secondary volume by the primary volume, so as to allow the reading operation of the primary volume on the secondary volume.
[0070] S105, performing a data read operation on the to-be-read data block on the secondary volume in the allowed readable state;
[0071] Specifically, after the modification state of the secondary volume corresponding to the to-be-read data block is configured as the allowed readable state, the temporary read permission of the primary volume on the secondary volume is obtained, so that the primary end can perform the data block read operation on the secondary volume in the allowed readable state to read the to-be-read data block on the secondary volume.
[0072] In one embodiment, before the primary volume sends the data read instruction to the secondary volume on the to-be-read data block, the method further comprises:
[0073] defining a modification state of the secondary volume, and configuring different read permissions for the secondary volume in different modification states; wherein the modification state includes the allowed readable state and the refused readable state;
[0074] when the modification state of the secondary volume is configured as the allowed readable state, the primary volume is allowed to obtain the read permission of the secondary volume, and the data read operation initiated by the primary volume to the secondary volume is allowed to be performed;
[0075] when the modification state of the secondary volume is configured as the refused readable state, the primary volume is refused to obtain the read permission of the secondary volume, and the data read operation initiated by the primary volume to the secondary volume is refused to be performed.
[0076] Specifically, in order to obtain the temporary read permission of the secondary volume, a modification state of the secondary volume is defined, and the temporary read permission of the secondary volume is changed through the modification state. The modification state includes the allowed readable state and the refused readable state. When the modification state of the secondary volume is configured as the allowed readable state, the primary end is allowed to obtain the read permission of the secondary volume, and the data read operation initiated by the primary volume to the secondary volume is allowed to be performed. When the modification state of the secondary volume is configured as the refused readable state, the primary end is refused to obtain the read permission of the secondary volume, and the data read operation initiated by the primary volume to the secondary volume is refused to be performed.
[0077] In one embodiment, the to-be-read data block on the secondary volume is determined according to the data block of the read failure, comprising:
[0078] determining the to-be-read data block at the same position information on the secondary volume according to the position information of the data block of the read failure on the primary volume.
[0079] Specifically, the primary volume and the secondary volume are one-to-one correspondence, and the data blocks on the primary volume and the data blocks on the secondary volume are also one-to-one correspondence. Therefore, after obtaining the data blocks with failed reading from the primary volume, the position information of the data blocks with failed reading on the primary volume can be located, and further, the data blocks at the same position on the secondary volume can be determined according to the correspondence of the data blocks on the primary volume and the secondary volume. For example, the logical block addresses of the data blocks with failed reading on the primary volume are 2, 3 and 4, and the logical block addresses of the corresponding data blocks on the secondary volume are also 2, 3 and 4, and the data blocks with logical block addresses of 2, 3 and 4 on the secondary volume are the data blocks to be read.
[0080] In one embodiment, before the primary volume sends the data reading instruction for the data blocks to be read to the secondary volume, the primary volume further comprises:
[0081] acquiring the flag bit state of the data blocks to be read from the secondary volume according to the bitmap;
[0082] Specifically, the bitmap saves the synchronization status of the data blocks of the primary volume and the secondary volume, and the bitmap is provided with the flag bit state, and according to the flag bit state, it can be judged whether the data block corresponding to the flag bit is synchronized. According to the bitmap, the flag bit state of the data blocks to be read is acquired from the secondary volume, so as to judge whether the data blocks to be read are synchronized according to the flag bit state of the data blocks to be read. According to the flag bit state on the bitmap, it can be judged whether the synchronization is completed, so as to record the relationship of the remote replication state. If the initialization has completed the synchronization, the remote replication relationship (synchronous remote replication, asynchronous remote replication) and has been started, at this time, the remote replication relationship becomes the consistent synchronization state; the consistent synchronization state stops the remote replication relationship, at this time, the remote replication relationship becomes the consistent stop state. Wherein, the bitmap space of 1 bit points to one copy granularity of the remote replication, which is called grainsize (grainsize), and the grainsize is 256 KB by default. The maximum value of the bitmap space is the parameter TraceID defined by unit32, and the TraceID indicates 2^32*256KB / 1024 / 1024 / 1024=1024TB data amount by default.
[0083] judging the flag bit state of the data blocks to be read;
[0084] if the flag bit state of the data blocks to be read is the synchronized state, storing the position information of the data blocks to be read on the secondary volume into the data reading instruction;
[0085] if the flag bit state of the secondary volume corresponding to the data blocks to be read is the unsynchronized state, returning the failure information to the primary volume.
[0086] Specifically, if the flag bit state of the secondary volume corresponding to the to-be-read data block is in the synchronized state, the position information of the to-be-read data block on the secondary volume is stored into the data read instruction, so that the primary volume sends the data read instruction for the to-be-read data block to the secondary volume, and the data read operation of the primary volume on the secondary volume is further performed; if the flag bit state of the secondary volume corresponding to the to-be-read data block is in the unsynchronized state, failure information is returned to the primary volume.
[0087] In one of the embodiments, the primary volume sends the data read instruction for the to-be-read data block to the secondary volume to obtain the secondary volume corresponding to the to-be-read data block according to the data read instruction, including:
[0088] The primary volume sends the data read instruction for the to-be-read data block to the secondary volume to obtain the position information of the to-be-read data block on the secondary volume from the data read instruction;
[0089] The secondary volume corresponding to the to-be-read data block is determined according to the position information of the to-be-read data block on the secondary volume;
[0090] The to-be-read data block is located on the secondary volume.
[0091] Specifically, after the position information of the to-be-read data block is stored into the data read instruction, the primary volume sends the data read instruction to the secondary volume to obtain the position information of the to-be-read data block on the secondary volume from the data read instruction. When the data read operation initiated by the host to the primary volume fails, the to-be-read data block corresponding to the data block that fails to be read on the primary volume can be located on the secondary volume, because the data blocks on the primary volume and the data blocks on the secondary volume are in a one-to-one correspondence. The to-be-read data block on the secondary volume is consistent with the content of the data block that fails to be read on the primary volume, so when the host fails to read data from the primary volume, the primary volume obtains the corresponding data block from the secondary volume to recover the data block that fails to be read on the primary volume through the data block on the secondary volume. The corresponding data block obtained from the secondary volume by the primary volume is called the to-be-read data block, and the secondary volume corresponding to the to-be-read data block can be determined according to the position information of the to-be-read data block on the secondary volume.
[0092] In one of the embodiments, the data read operation for the to-be-read data block on the secondary volume in the allowed readable state includes:
[0093] The data read operation of the primary volume for the to-be-read data block is performed to obtain the body data and the check data in the to-be-read data block;
[0094] Specifically, if the flag bit state of the secondary volume corresponding to the to-be-read data block is in the readable state, the data read operation of the primary volume on the secondary volume is allowed to be performed, so that the primary volume reads the to-be-read data block from the secondary volume, and the to-be-read data block includes two parts, one part is the body data, that is, the actual data stored, and the other part is the check data, that is, the data used for performing the data integrity check, and thus the primary volume can obtain the required body data and check data after performing the data read operation on the secondary volume.
[0095] The check data in the to-be-read data block is checked, and after the check data passes the check, the to-be-read data block is returned to the host, and the to-be-read data block is saved to a corresponding position on the primary volume.
[0096] Specifically, after the primary volume performs the data read operation on the to-be-read data block from the secondary volume, the body data and the check data are obtained, and then the primary volume checks the obtained check data, if the check fails, it indicates that the data is incomplete or abnormal, and the check failure information is returned, if the check passes, it indicates that the data is complete and normal, and the data (to-be-read data block) after the check passes can be returned to the host, and the to-be-read data block is saved to a corresponding data block position on the primary volume, the read-failed data block on the primary volume is recovered, and the data read is completed.
[0097] In one embodiment, after the secondary volume in the readable state is executed, the data read operation on the to-be-read data block further includes:
[0098] After the primary volume completes the data read operation on the secondary volume, the correction state of the secondary volume is configured as the readable state, so as to close the temporary read permission of the primary volume on the secondary volume.
[0099] Specifically, since the primary volume is only temporarily allowed to read the to-be-read data of the secondary volume at this time, after the operation on the to-be-read data block on the secondary volume is completed, the correction state of the secondary volume needs to be modified to the readable state, so as to close the temporary read permission of the primary volume on the secondary volume, and improve the security performance of data storage.
[0100] In one embodiment, the method further includes:
[0101] The cluster system environment is established on the primary end and the secondary end, and the communication link between the primary end and the secondary end is established.
[0102] The primary end includes the primary volume, and the secondary end includes the secondary volume.
[0103] Specifically, the primary end comprises a primary volume, the secondary end comprises a secondary volume, to realize remote synchronization between the primary end and the secondary end, first, a cluster system environment is established through the primary end and the secondary end, and then a communication link (low layer link, which can be IP, FC, FCoE, RoCE, etc.) between the primary end and the secondary end is established, so as to facilitate communication between the primary end and the secondary end, to realize remote synchronization (remote synchronous replication, remote asynchronous replication) function between the primary end and the secondary end.
[0104] Embodiment two:
[0105] Referring to Figure 2 , a second method flow chart of the disaster recovery exception processing method provided by the embodiment of the application is shown. Figure 2 In the method shown, the same or similar contents as in the method shown in Figure 2 may refer to the description in the method Figure 1 , and will not be described here. Figure 1
[0106] S201, a cluster system environment is established at the primary end and the secondary end, and a communication link between the primary end and the secondary end is established;
[0107] The primary end comprises a primary volume, the secondary end comprises a secondary volume, to realize remote synchronization between the primary end and the secondary end, first, a cluster system environment is established through the primary end and the secondary end, and then a communication link between the primary end and the secondary end is established, so as to facilitate communication between the primary end and the secondary end, to realize remote synchronization function between the primary end and the secondary end.
[0108] S202, a correction state of the secondary volume is defined, and different read permissions are configured for the secondary volume in different correction states;
[0109] In order to obtain temporary read permission for the secondary volume, a correction state of the secondary volume is defined, and the permission of temporarily reading data of the secondary volume is changed through the correction state. The correction state includes an allowed readable state and a denied readable state. When the correction state of the secondary volume is configured as the allowed readable state, the primary end is allowed to obtain read permission for the secondary volume, and the data read operation initiated by the primary volume to the secondary volume is allowed to be executed. When the correction state of the secondary volume is configured as the denied readable state, the primary end is denied to obtain read permission for the secondary volume, and the data read operation initiated by the primary volume to the secondary volume is denied to be executed.
[0110] S203, the host performs a data read operation on the primary volume, and when data block read failure occurs in the data read operation of the host on the primary volume, a mirror operation or a check operation of the disk array is executed;
[0111] When the host performs a data read operation on the primary volume, if an error occurs in the data read operation of the host on the primary volume, causing a data block read failure, a mirror operation or a check operation of the disk array is performed to recover the read-failed data block through the mirror operation or the check operation of the disk array.
[0112] S204, obtaining the read-failed data block from the primary volume when the mirror operation or the check operation of the disk array fails;
[0113] The read-failed data block is recovered through the mirror operation or the check operation of the disk array, and when the recovery of the read-failed data block through the mirror operation or the check operation of the disk array fails, that is, there is no mirror at the array level or the check bit of the one or more data blocks also has an error, at this time, the host reading data will inevitably fail due to a read timeout, at this time, if the primary end and the secondary end of the remote replication are in a consistent synchronization state or a consistent stop state, the read I / O of the read-failed data block on the primary volume of the primary end can read the data block from the same position of the secondary end, but if the primary end and the secondary end of the remote replication are in an inconsistent synchronization state or an inconsistent stop state, at this time, the secondary end is not allowed to read the data block, therefore, the disaster recovery exception processing method proposed in the present application temporarily modifies the correction state of the secondary end to temporarily allow the primary end to read the data block of the secondary end, first obtaining the read-failed data block from the primary volume.
[0114] S205, determining the to-be-read data block at the same position information on the secondary volume according to the position information of the read-failed data block on the primary volume;
[0115] The primary volume and the secondary volume are one-to-one corresponding, and the data blocks on the primary volume and the secondary volume are also one-to-one corresponding. Therefore, after obtaining the read-failed data block from the primary volume, the position information of the read-failed data block on the primary volume can be located, and further, according to the corresponding relationship between the data blocks on the primary volume and the secondary volume, the to-be-read data block at the same position on the secondary volume can be determined.
[0116] S206, obtaining the flag bit state of the to-be-read data block from the secondary volume according to the bitmap;
[0117] The bitmap saves the synchronization situation of the data blocks of the primary volume and the secondary volume, and the bitmap is provided with a flag bit state, according to which it can be judged whether the data block corresponding to the flag bit is synchronized. According to the bitmap, the flag bit state of the to-be-read data block is obtained from the secondary volume, so as to judge whether the to-be-read data block has been synchronized according to the flag bit state of the to-be-read data block.
[0118] S207, judging the flag bit state of the to-be-read data block;
[0119] If the flag bit state of the to-be-read data block is the synchronized state, the position information of the to-be-read data block on the secondary volume is stored into the data read instruction;
[0120] If the flag bit state of the secondary volume corresponding to the to-be-read data block is the unsynchronized state, failure information is returned to the primary volume.
[0121] If the flag bit state of the secondary volume corresponding to the to-be-read data block is the synchronized state, the position information of the to-be-read data block on the secondary volume is stored into the data read instruction, so that the primary volume sends the data read instruction to the secondary volume, and further performs the data read operation on the secondary volume. If the flag bit state of the secondary volume corresponding to the to-be-read data block is the unsynchronized state, failure information is returned to the primary volume.
[0122] S208, the position information of the to-be-read data block on the secondary volume is stored into the data read instruction;
[0123] If the flag bit state of the secondary volume corresponding to the to-be-read data block is the synchronized state, the position information of the to-be-read data block on the secondary volume is stored into the data read instruction, so that the primary volume sends the data read instruction to the secondary volume, and further performs the data read operation on the secondary volume.
[0124] S209, the primary volume sends the data read instruction of the to-be-read data block to the secondary volume to obtain the position information of the to-be-read data block on the secondary volume from the data read instruction;
[0125] After the position information of the to-be-read data block is stored into the data read instruction, the primary volume sends the data read instruction of the to-be-read data block to the secondary volume to obtain the position information of the to-be-read data block on the secondary volume from the data read instruction. When the host initiates the data read operation to the primary volume fails, the to-be-read data block corresponding to the read-failed data block on the primary volume can be located. Since the data blocks on the primary volume and the secondary volume are in one-to-one correspondence, the to-be-read data block corresponding to the read-failed data block on the primary volume can be obtained on the secondary volume. The to-be-read data block on the secondary volume is consistent with the content of the read-failed data block on the primary volume. Therefore, when the host reads the data from the primary volume fails, the primary volume obtains the corresponding data block from the secondary volume to recover the read-failed data block on the primary volume through the data block on the secondary volume. The corresponding data block obtained from the secondary volume by the primary volume is called the to-be-read data block.
[0126] S210, the secondary volume corresponding to the to-be-read data block is determined according to the position information of the to-be-read data block on the secondary volume;
[0127] S211, configure the modification state of the secondary volume corresponding to the to-be-read data block as an allowed readable state to obtain temporary read permission of the primary volume on the secondary volume;
[0128] After obtaining the secondary volume corresponding to the to-be-read data block, the modification state of the secondary volume corresponding to the to-be-read data block is configured as an allowed readable state to obtain temporary read permission of the primary volume on the secondary volume, so as to allow the read operation of the primary volume on the secondary volume.
[0129] S212, perform a data read operation of the primary volume on the to-be-read data block to obtain body data and check data of the to-be-read data block;
[0130] If the flag bit state of the secondary volume corresponding to the to-be-read data block is an allowed readable state, the data read operation of the primary volume on the secondary volume is allowed to be performed, so that the primary volume reads the to-be-read data block from the secondary volume. The to-be-read data block includes two parts, one part is body data, that is, actual data stored, and the other part is check data, which is data used for performing data integrity check. Therefore, after the primary volume performs the data read operation on the secondary volume, the required body data and check data can be obtained.
[0131] S213, check the check data in the to-be-read data block, and return the to-be-read data block to the host after the check data passes the check, and save the to-be-read data block to a corresponding position on the primary volume;
[0132] After the primary volume performs the data read operation on the to-be-read data block from the secondary volume, the body data and check data are obtained. Then, the primary volume checks the obtained check data. If the check fails, it indicates that the data is incomplete or abnormal, and the check failure information is returned. If the check passes, it indicates that the data is complete and normal. The data (to-be-read data block) after the check passes can be returned to the host, and the to-be-read data block is saved to a corresponding data block position on the primary volume. The read failed data block on the primary volume is recovered to complete the data read.
[0133] S214, configure the modification state of the secondary volume as a refused readable state after the primary volume finishes the data read operation on the secondary volume to close the temporary read permission of the primary volume on the secondary volume.
[0134] Since the primary volume is only temporarily allowed to read the to-be-read data on the secondary volume at this time, after the operation on the to-be-read data block on the secondary volume is performed, the modification state of the secondary volume needs to be modified as a refused readable state to close the temporary read permission of the primary volume on the secondary volume, thereby improving the security performance of data storage.
[0135] The disaster recovery exception handling method of the present application is tested. During the test, 1, the storage pool uses an array of RAID0, and there is no redundancy protection at the underlying array level. 2, a remote replication environment is built, such as the topology structure shown in Figure 3 The topology structure shown in
[0136] In addition, the disaster recovery exception handling method of the present application can additionally increase a layer of protection measures when the original storage underlying array redundancy protection is used, and has a fast self-repairing function. The storage product has practicality under different I / O models and different scenes, especially for fast storage multi-control systems. Further, the present application cooperates with the host automatic detection monitoring technology to quickly and efficiently respond and repair data of different storage products, greatly improves the product safety and reliability, and provides an important protection method for product optimization and improvement.
[0137] It should be understood that, although Figures 1-2 The steps in the flowchart are displayed in sequence according to the arrows, but these steps are not necessarily executed in sequence according to the arrows. Unless otherwise specified in this article, the execution of these steps has no strict order limitation, and these steps can be executed in other orders. Moreover, Figures 1-2 At least part of the steps in
[0138] Embodiment three:
[0139] Referring to Figure 4 The system structure diagram of the disaster recovery exception handling system provided by the present application is shown in Figure 4
[0140] The disaster recovery exception handling system of the present embodiment comprises:
[0141] The read operation module is configured to execute a data read operation on the host volume, execute a mirror operation or a check operation of the disk array when the data read operation on the host volume fails, and execute a data read operation on the to-be-read data block of the secondary volume in the readable state.
[0142] After the modification state of the secondary volume corresponding to the to-be-read data block is configured as the readable state, the temporary read permission of the host volume on the secondary volume is obtained, so that the host can execute a read operation on the to-be-read data block of the secondary volume in the readable state through the read operation module. In addition, the data read operation on the host volume and the mirror operation or the check operation of the disk array are executed through the read operation module.
[0143] The data block module is configured to obtain the read-failed data block from the host volume when the data read operation on the host volume fails, and determine the to-be-read data block at the same position information on the secondary volume according to the position information of the read-failed data block on the host volume.
[0144] Before the host volume sends a data read instruction to the secondary volume, the upper host initiates a data read operation on the host volume. Since one or more data blocks of the host volume are abnormal, the upper host cannot execute a data read operation on the abnormal data block from the host volume. Therefore, when the data read operation on the host volume fails, the data block module is used to obtain the read-failed data block from the host volume. The data block module is also used to determine the to-be-read data block at the same position information on the secondary volume according to the position information of the read-failed data block on the host volume.
[0145] The read instruction module is configured to send a data read instruction of the to-be-read data block from the host volume to the secondary volume, and determine the secondary volume corresponding to the to-be-read data block through the data read instruction.
[0146] The disaster recovery exception processing method temporarily modifies the modification state of the secondary volume when the secondary volume does not allow reading of the data block, to temporarily allow the host to read the data block of the secondary volume. First, the host volume sends a data read instruction of the to-be-read data block to the secondary volume through the read instruction module. The data read instruction stores the related information of the to-be-read data block, and the secondary volume corresponding to the to-be-read data block can be determined according to the data read instruction.
[0147] The state configuration module is configured to configure the modification state of the secondary volume corresponding to the to-be-read data block as the readable state, and configure the modification state of the secondary volume as the readable state after the data read operation on the secondary volume by the host volume is completed.
[0148] After obtaining the corresponding auxiliary volume of the to-be-read data block according to the data reading instruction, the modification state of the auxiliary volume is configured to change to the readable state; since the to-be-read data of the auxiliary volume is only temporarily allowed to be read at this time, the modification state of the auxiliary volume needs to be modified to the unreadable state after the operation on the to-be-read data block on the auxiliary volume is completed. The above configuration of the modification state of the auxiliary volume is completed by the state configuration module.
[0149] The permission configuration module is configured to obtain or close the temporary reading permission of the main volume to the auxiliary volume.
[0150] The modification state of the auxiliary volume corresponding to the to-be-read data block is configured to the readable state to obtain the temporary reading permission of the main volume to the auxiliary volume, and the modification state of the auxiliary volume is configured to the unreadable state after the main volume completes the data reading operation from the auxiliary volume to close the temporary reading permission of the main volume to the auxiliary volume. The above permission obtaining or closing is performed by the permission configuration module.
[0151] In one of the embodiments, the disaster recovery exception processing system further comprises:
[0152] The flag obtaining module is configured to obtain the flag state of the to-be-read data block from the auxiliary volume according to the bitmap.
[0153] The bitmap saves the synchronization state of the data blocks of the main volume and the auxiliary volume, and the bitmap is provided with the flag state. According to the flag state, it can be judged whether the data block corresponding to the flag is synchronized. The flag obtaining module obtains the flag state of the to-be-read data block from the auxiliary volume according to the bitmap, so as to judge whether the to-be-read data block is synchronized according to the flag state of the to-be-read data block.
[0154] The data verification module is configured to verify the to-be-read data block read from the auxiliary volume by the main volume, and return the to-be-read data block to the host after the verification is passed.
[0155] After the main volume reads the to-be-read data block from the auxiliary volume, the main volume obtains the body data and the verification data, and then verifies the verification data obtained by the data verification module. If the verification fails, it means that the data is incomplete or abnormal, and the verification failure information is returned. If the verification is passed, it means that the data is complete and normal. The data (to-be-read data block) after the verification is passed can be returned to the host. At the same time, the to-be-read data block is saved to the corresponding data block position on the main volume, the data block that fails to read on the main volume is recovered, and the data reading is completed.
[0156] The communication link module is configured to establish a cluster system environment at the main end and the auxiliary end, and establish a communication link between the main end and the auxiliary end.
[0157] The primary end comprises a primary volume, and the secondary end comprises a secondary volume. To realize remote synchronization between the primary end and the secondary end, first, a cluster system environment is established for the primary end and the secondary end through a communication link module, and then a communication link is established between the primary end and the secondary end through the communication link module, so as to facilitate communication between the primary end and the secondary end, and realize remote synchronization between the primary end and the secondary end.
[0158] The specific limitations of the disaster recovery exception processing system can refer to the limitations of the method described above, which will not be repeated here. Each module in the disaster recovery exception processing system described above can be realized by software, hardware and their combination. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0159] Embodiment Four
[0160] The embodiment provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and characterized in that the processor implements the steps of the disaster recovery exception processing method when executing the computer program.
[0161] The computer device can be a terminal, and its internal structure diagram can be as shown in Figure 5 The computer device comprises a processor, a memory, a network interface, a display screen and an input device connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement the disaster recovery exception processing method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0162] Those skilled in the art should understand that Figure 5 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can comprise more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0163] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0164] The host performs a data read operation on the primary volume, and performs a mirror operation or a check operation of the disk array when the data read operation of the host on the primary volume fails to read a data block;
[0165] When the mirror operation or the check operation of the disk array fails, a data block that fails to be read is obtained from the primary volume, and a corresponding data block to be read on the secondary volume is determined according to the data block that fails to be read;
[0166] The primary volume sends a data read instruction for the data block to be read to the secondary volume, and determines the secondary volume corresponding to the data block to be read through the data read instruction;
[0167] The correction state of the secondary volume corresponding to the data block to be read is configured as a permitted readable state to obtain temporary read permission of the primary volume on the secondary volume.
[0168] Embodiment five:
[0169] The embodiment provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0170] The host performs a data read operation on the primary volume, and performs a mirror operation or a check operation of the disk array when the data read operation of the host on the primary volume fails to read a data block;
[0171] When the mirror operation or the check operation of the disk array fails, a data block that fails to be read is obtained from the primary volume, and a corresponding data block to be read on the secondary volume is determined according to the data block that fails to be read;
[0172] The primary volume sends a data read instruction for the data block to be read to the secondary volume, and determines the secondary volume corresponding to the data block to be read through the data read instruction;
[0173] The correction state of the secondary volume corresponding to the data block to be read is configured as a permitted readable state to obtain temporary read permission of the primary volume on the secondary volume.
[0174] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, databases, or other media in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0175] The technical features of the above embodiments can be combined in any way. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.
[0176] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of the patent of the present application should be subject to the appended claims.
Claims
1. A method for handling disaster recovery exceptions, characterized in that: The method comprises: The host performs a data read operation on a primary volume, and performs a mirror operation or a check operation of a disk array when a data block read fails in the data read operation of the host on the primary volume; When the mirror operation or the check operation of the disk array fails, a read-failed data block is obtained from the primary volume, and a corresponding to-be-read data block on a secondary volume is determined according to the read-failed data block; The primary volume sends a data read instruction for the to-be-read data block to the secondary volume, and determines the secondary volume corresponding to the to-be-read data block through the data read instruction; A modification state of the secondary volume corresponding to the to-be-read data block is configured as an allowed readable state to obtain temporary read permission of the primary volume on the secondary volume; The data read operation on the to-be-read data block is performed on the secondary volume in the allowed readable state; After the data read operation of the primary volume on the secondary volume is completed, the modification state of the secondary volume is configured as a rejected readable state to close the temporary read permission of the primary volume on the secondary volume; Before the primary volume sends the data read instruction for the to-be-read data block to the secondary volume, the method further comprises: defining a modification state of the secondary volume, and configuring different read permissions for the secondary volume in different modification states; wherein the modification state comprises the allowed readable state and the rejected readable state.
2. The disaster recovery exception handling method of claim 1, wherein, Before the primary volume sends the data read instruction for the to-be-read data block to the secondary volume, the method further comprises: When the modification state of the secondary volume is configured as the allowed readable state, the primary volume is allowed to obtain read permission of the secondary volume and is allowed to perform the data read operation initiated by the primary volume to the secondary volume; When the modification state of the secondary volume is configured as the rejected readable state, the primary volume is rejected to obtain read permission of the secondary volume and is rejected to perform the data read operation initiated by the primary volume to the secondary volume. 3.The disaster recovery exception handling method of claim 1, wherein, The determination of the corresponding to-be-read data block on the secondary volume according to the read-failed data block comprises: determining the to-be-read data block at the same position information on the secondary volume according to the position information of the read-failed data block on the primary volume.
4. The disaster recovery exception handling method of claim 2, wherein, Before the primary volume sends the data read instruction for the to-be-read data block to the secondary volume, the method further comprises: obtaining a flag bit state of the to-be-read data block from the secondary volume according to a bitmap; judging the flag bit state of the to-be-read data block; if the flag bit state of the to-be-read data block is a synchronized state, storing position information of the to-be-read data block on the secondary volume into the data read instruction; if the flag bit state of the secondary volume corresponding to the to-be-read data block is an unsynchronized state, returning a failure information to the primary volume.
5. The disaster recovery exception handling method of claim 4, wherein, The primary volume sends the data read instruction for the to-be-read data block to the secondary volume to obtain the position information of the to-be-read data block on the secondary volume from the data read instruction. determine the secondary volume corresponding to the to-be-read data block according to the position information that the to-be-read data block is located on the secondary volume; wherein the to-be-read data block is located on the secondary volume.
6. The disaster recovery exception handling method of claim 5, wherein, The data reading operation on the to-be-read data block is performed on the secondary volume in the readable state, including: performing the data reading operation on the to-be-read data block by the primary volume to obtain the body data and the check data in the to-be-read data block; checking the check data in the to-be-read data block, and returning the to-be-read data block to the host after the check data is checked, and saving the to-be-read data block to the corresponding position on the primary volume.
7. A disaster recovery exception handling system for implementing the disaster recovery exception handling method according to any one of claims 1 to 6, characterized by The disaster recovery exception processing system includes: a reading operation module, configured to perform the data reading operation on the primary volume by the host, perform the mirroring operation or the check operation of the disk array when the data reading operation on the primary volume by the host fails, and perform the data reading operation on the to-be-read data block on the secondary volume in the readable state; a data block module, configured to obtain the data block that fails in reading from the primary volume when the mirroring operation or the check operation of the disk array fails, and determine the corresponding to-be-read data block on the secondary volume according to the data block that fails in reading; a reading instruction module, configured to send the data reading instruction on the to-be-read data block from the primary volume to the secondary volume, and determine the secondary volume corresponding to the to-be-read data block through the data reading instruction; a state configuration module, configured to configure the modified state of the secondary volume corresponding to the to-be-read data block as the readable state, and configure the modified state of the secondary volume as the readable state after the data reading operation on the to-be-read data block by the primary volume is completed; a permission configuration module, configured to obtain or close the temporary reading permission of the primary volume on the secondary volume.
8. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer readable storage medium stores a program, and when the program is executed by the processor, the processor executes the steps of the method in any one of claims 1-6.
Citation Information
Patent Citations
Cross-region copy block storage device
CN114514500A
Asynchronous remote replication method, system and device and computer readable storage medium
CN114595099A