Rollback method of dual-active high-availability snapshot and electronic device
By generating data rollback instructions for dual-active secondary volumes in the storage system and using the snapshot module to roll back data in the snapshot volume of the primary volume, the data inconsistency problem caused by snapshot rollback is solved, and data loss is avoided and high availability is guaranteed in the event of failure.
Patent Information
- Application Number
- CN202511186986.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-08-22
AI Technical Summary
In storage systems, snapshot rollback can lead to data inconsistency in active-active systems, resulting in data loss and compromising high availability, thus failing to meet the critical business requirements for zero RTO and RPO.
By generating a data rollback command for the active-active secondary volume, the target data is read from the snapshot volume of the primary volume using a preset snapshot module and rolled back to the primary volume. The feedback result from the secondary volume is received, and the data rollback result is obtained based on the feedback result. When the conditions for stopping the rollback are met, the snapshot data is obtained, ensuring the data consistency between the active-active primary volume and the secondary volume.
During snapshot rollback, maintain active-active synchronization to avoid data loss, ensure high availability, and meet the recovery time and data recovery point targets for critical business operations.
Smart Images

Figure CN120723541B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data storage, and in particular to a rollback method of a dual-active high-availability snapshot and an electronic device. BACKGROUND
[0002] In a storage system, snapshot technology is an important means to realize data backup, but when a site-level fault occurs in the storage system, the data of the entire data center and the local data backup will be lost, therefore, the security and availability of data become particularly important.
[0003] In the related art, a copy mechanism or a dual-active mechanism is usually used to perform a time point backup on volume data to provide site-level disaster recovery capability, however, the existing technology has the following problems when combining snapshots and dual-active:
[0004] (1) Snapshot rollback causes interruption of dual-active: when snapshot rollback is performed at a site, the master volume and the auxiliary volume data in the dual-active system will be inconsistent, at this time, if a site fault occurs, data loss may be caused.
[0005] (2) High availability cannot be guaranteed: during the traditional snapshot rollback process, the redundancy protection function of the dual-active system is temporarily disabled, which cannot meet the requirement of zero RTO (Recovery Time Objective) and RPO (Recovery Point Objective) for critical business, and needs to be solved urgently. SUMMARY
[0006] The present application provides a rollback method of a dual-active high-availability snapshot and an electronic device to at least solve the problem that data is lost when a site fault occurs during snapshot rollback in the related art.
[0007] The present application provides a rollback method of a dual-active high-availability snapshot, comprising: judging whether a first data rollback instruction of a dual-active master volume is received; if the first data rollback instruction of the dual-active master volume is received, generating a second data rollback instruction of a dual-active auxiliary volume based on the first data rollback instruction, and sending the second data rollback instruction to the dual-active auxiliary volume; reading target data in a first snapshot volume corresponding to the dual-active master volume by using a preset snapshot module, rolling back the target data to the dual-active master volume to obtain a first data feedback result of the dual-active master volume, and receiving a second data feedback result of the dual-active auxiliary volume at the same time; obtaining a data rollback result based on the first data feedback result and the second data feedback result, and obtaining first snapshot data of the dual-active master volume and second snapshot data of the dual-active auxiliary volume when the data rollback result meets a preset stop rollback condition.
[0008] The application further provides a double-active high-availability snapshot rollback device, comprising:
[0009] A judgment module is configured to judge whether a first data rollback instruction of a double-active master volume is received.
[0010] A generation module is configured to, if the first data rollback instruction of the double-active master volume is received, generate a second data rollback instruction of a double-active auxiliary volume based on the first data rollback instruction, and send the second data rollback instruction to the double-active auxiliary volume.
[0011] A receiving module is configured to read target data in a first snapshot volume corresponding to the double-active master volume by using a preset snapshot module, roll back the target data to the double-active master volume to obtain a first data feedback result of the double-active master volume, and simultaneously receive a second data feedback result of the double-active auxiliary volume.
[0012] An acquisition module is configured to obtain a data rollback result based on the first data feedback result and the second data feedback result, and obtain first snapshot data of the double-active master volume and second snapshot data of the double-active auxiliary volume when the data rollback result meets a preset stop-rollback condition.
[0013] The application further provides an electronic device, comprising a memory configured to store a computer program, and a processor configured to execute the computer program to implement the steps of any of the double-active high-availability snapshot rollback methods.
[0014] The application further provides a computer-readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the steps of any of the double-active high-availability snapshot rollback methods.
[0015] The application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of any of the double-active high-availability snapshot rollback methods.
[0016] According to the application, when a first data rollback instruction of a double-active master volume is received, a second data rollback instruction of a double-active auxiliary volume is generated and sent to the double-active auxiliary volume, target data in a first snapshot volume corresponding to the double-active master volume is read by using a preset snapshot module, and the target data is rolled back to the double-active master volume to obtain a first data feedback result, and a second data feedback result of the double-active auxiliary volume is simultaneously received; a data rollback result is obtained based on the first and second data feedback results, and first snapshot data and second snapshot data are obtained when the data rollback result meets a preset stop-rollback condition. The application solves the problem that data is lost due to site failure when data is rolled back from a snapshot, and through the creation of a high-availability snapshot, data writing and rollback processes, the data volume can maintain a double-active synchronization state when the snapshot is rolled back, thereby avoiding data loss due to site failure. Attached Figure Description
[0017] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A schematic diagram illustrating the implementation principle of copy-on-write for snapshots in related technologies;
[0019] Figure 2 A schematic diagram illustrating the implementation principle of dual-active dual-write in related technologies;
[0020] Figure 3 A flowchart illustrating a rollback method for a dual-active high-availability snapshot provided in an embodiment of the present invention;
[0021] Figure 4 A schematic diagram illustrating the creation of a highly available snapshot using a dual-active volume, provided in one embodiment of the present invention;
[0022] Figure 5 This is a schematic diagram illustrating data writing to a dual-active volume after creating a highly available snapshot, according to one embodiment of the present invention.
[0023] Figure 6 This is a schematic diagram illustrating a rollback high-availability snapshot provided in one embodiment of the present invention;
[0024] Figure 7 A flowchart illustrating the rollback of a high-availability snapshot provided in one embodiment of the present invention;
[0025] Figure 8 This is a block diagram illustrating a rollback apparatus for a dual-active high-availability snapshot according to an embodiment of the present invention.
[0026] Figure 9 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0028] It should be noted that in the description of the present application, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or apparatus including a series of elements includes not only those elements, but also other elements not explicitly listed, or further includes elements inherent to such a process, method, article or apparatus. The terms "first", "second" and the like in the present application are used to distinguish similar objects, not to describe a specific order or sequence.
[0029] In order to better understand the present application by those skilled in the art, the present application will be further described in detail below in conjunction with the drawings and specific embodiments.
[0030] Specifically, before introducing the embodiments of the present application, first introduce the related technology of volume data storage scheme, for the storage system, the backup of data is an indispensable function, the volume snapshot is often considered as an important means to realize the data backup, the volume snapshot is the data backup of the volume (source volume) in the storage system at a local time point, if the data of the volume is damaged due to misoperation, malicious destruction, such as ransom, can be repaired by rollback, and data analysis, data mining and other purposes can be carried out on the data of the snapshot volume, without affecting the data and business of the volume.
[0031] However, when the storage system fails at the site level, such as fire or other disasters, resulting in the loss of all data in the entire data center, the local data backup will also be damaged. To cope with this scenario, data can be backed up remotely, and at the same time, the host (data processing center) and the two storage systems can be connected to each other, that is, when one data site fails, the other data site can immediately take over. This mechanism is called dual active, so that when the data site fails, the data will not be lost and can be immediately restored to service.
[0032] In the related art, when taking a snapshot of a volume, the common technology is called write-time copy, that is, before modifying the data of the volume, the data will be copied to the target snapshot volume, and the difference data is recorded through a bitmap (which block of data has been copied to the target snapshot volume, which block of data has not been copied). Figure 1At T0 moment in the source volume, there are eight pieces of data in total, at this time, the snapshot volume is generated for the source volume, a bitmap needs to be generated and all are initialized to 0, there are eight bits in the bitmap, corresponding to eight pieces of data of the source volume; when A is written as Z at T1 moment, A needs to be copied to the snapshot volume first, then the first bit (corresponding to the first piece of data A) of the bitmap is marked as 1, and finally the data of the source volume is overwritten with Z, and the double-active is implemented on the volume. The common technology is a double-write process, that is, when the host writes data to the volume, data is written to two data sites at the same time, and the host returns success after waiting for all the data to be written.
[0033] Further, as shown in Figure 2 At T0 moment in the source volume, there are eight pieces of data in total, at this time, the snapshot volume is generated for the source volume, a bitmap needs to be generated and all are initialized to 0, there are eight bits in the bitmap, corresponding to eight pieces of data of the source volume; when A is written as Z at T1 moment, A needs to be copied to the snapshot volume first, then the first bit (corresponding to the first piece of data A) of the bitmap is marked as 1, and finally the data of the source volume is overwritten with Z, and the double-active is implemented on the volume. The common technology is a double-write process, that is, when the host writes data to the volume, data is written to two data sites at the same time, and the host returns success after waiting for all the data to be written.
[0034] However, based on the above technical means, the volume can use double-active and snapshot data protection means at the same time, assuming that a snapshot is taken at one site of a double-active system, when the data is damaged by ransomware, the data of the snapshot volume needs to be rolled back to the source volume, at this time, the data of the two volumes in the double-active system is inconsistent, and in the process of rolling back the snapshot, the volume actually loses the backup of the two sites. At this time, a copy of data needs to be synchronized to the other site again, and if a site failure occurs again during data synchronization, data loss may occur.
[0035] Therefore, based on the above problems, the embodiment of the present application creates a high-availability snapshot, data writing and rollback process, so that the data volume can maintain a double-active synchronization state when the snapshot is rolled back, thereby avoiding data loss due to site failure. The following will be described in detail based on specific embodiments.
[0036] The embodiment of the present application provides a double-active high-availability snapshot rollback method, and the method is described in detail in combination with the execution process of the double-active high-availability snapshot rollback method.
[0037] Specifically, Figure 3 A flowchart of a double-active high-availability snapshot rollback method provided by the embodiment of the present application is shown in the figure.
[0038] As shown in Figure 3 In the double-active high-availability snapshot rollback method, the following steps are included:
[0039] In step S301, it is judged whether the first data rollback instruction of the dual-active master volume is received.
[0040] According to one embodiment of the present application, before judging whether the first data rollback instruction of the dual-active master volume is received, further comprising: judging whether the data rollback progress of the dual-active master volume is the first target progress and whether the data rollback progress of the dual-active auxiliary volume is the second target progress; if the data rollback progress of the dual-active master volume is the first target progress and the data rollback progress of the dual-active auxiliary volume is the second target progress, identifying the first bit of the first snapshot bitmap corresponding to the dual-active master volume, and when the first bit is the first target value, reading the target data corresponding to the first bit in the first snapshot volume corresponding to the dual-active master volume by using the preset snapshot module, and sending the first data rollback instruction to the dual-active master volume.
[0041] According to one embodiment of the present application, before judging whether the data rollback progress of the dual-active master volume is the first target progress and whether the data rollback progress of the dual-active auxiliary volume is the second target progress, further comprising: creating the first snapshot volume and the first snapshot bitmap corresponding to the dual-active master volume, and creating the second snapshot volume and the second snapshot bitmap corresponding to the dual-active auxiliary volume; judging whether the data write instruction is received, if the data write instruction is received, controlling the dual-active master volume to perform the data write operation based on the data write instruction, generating the third data feedback result, sending the data write instruction to the dual-active auxiliary volume, and receiving the fourth data feedback result of the dual-active auxiliary volume; judging whether the dual-active master volume and the dual-active auxiliary volume both complete the write operation based on the third data feedback result and the fourth data feedback result; if the dual-active master volume and the dual-active auxiliary volume both complete the write operation, generating the final feedback result.
[0042] According to one embodiment of the present application, controlling the dual-active master volume to perform the data write operation based on the data write instruction comprises: judging whether the first bit of the first snapshot bitmap corresponding to the dual-active master volume is the second target value; if the first bit of the first snapshot bitmap is the second target value, controlling the dual-active master volume to perform the data write operation based on the data write instruction.
[0043] The preset snapshot module can be selected by those skilled in the art according to actual data storage requirements, which is not limited here.
[0044] Specifically, to solve the defects of the prior art when combining the snapshot and the dual-active, for example, when performing the snapshot rollback in a data site, the data of the two volumes in the dual-active system is inconsistent, at this time, if the data site fails, data loss may occur, thereby destroying the high availability guarantee of the dual-active system. Therefore, the core of the scheme of the embodiment of the present application is that the dual-active synchronization state can be maintained during the snapshot rollback process, so as to ensure that the data will not be lost even if the data site fails during the rollback process.
[0045] Specifically, the embodiment mainly includes a high-availability snapshot creation process and a high-availability snapshot rollback process. In the high-availability snapshot creation process, first, the host needs to suspend the write request to the dual-active primary volume and the dual-active secondary volume, wait for all the uncompleted dual-write operations (primary volume+secondary volume) to be synchronized, and ensure that the data of the dual-active primary volume and the dual-active secondary volume is completely consistent (the basis of the consistent snapshot) when the snapshot is created. In this embodiment, the write suspension can be realized by the IO suspension mechanism of the dual-active module to avoid dirty data.
[0046] Secondly, as shown in the figure, Figure 4 the synchronous snapshot creation of the dual-active primary volume and the dual-active secondary volume generates two snapshot volumes and two snapshot bitmaps. The data backed up by the two snapshot volumes is the data of the dual-active primary volume and the dual-active secondary volume respectively, and the data of the dual-active primary volume and the dual-active secondary volume is the same, that is, the data backed up by the two snapshot volumes is the same. To effectively distinguish the dual-active primary volume and the dual-active secondary volume, this embodiment can create a corresponding first snapshot volume and a first snapshot bitmap for the dual-active primary volume, and create a corresponding second snapshot volume and a second snapshot bitmap for the dual-active secondary volume. The initial state of the first snapshot bitmap and the second snapshot bitmap is consistent, which can mark whether the data block of the dual-active primary volume or the dual-active secondary volume is modified. The subsequent write can update the bitmap through the copy-on-write mechanism.
[0047] Thirdly, as shown in the figure, Figure 5 the recovery write and dual-write expansion process. At this time, the host write request is recovered, and when the data write instruction sent by the host is received, the dual-active primary volume and the dual-active secondary volume have generated snapshots respectively. Therefore, the dual-active primary volume can be controlled to perform data write operation based on the data write instruction, and the data write instruction is sent to the dual-active secondary volume so that the dual-active secondary volume also performs synchronous data write operation. In the data write process, four steps of checking bitmap, updating bitmap, primary volume data write, and synchronously writing secondary volume data through the dual-active module are needed. In the bitmap checking process, the first snapshot bitmap corresponding to the dual-active primary volume and the second snapshot bitmap corresponding to the dual-active secondary volume are sequentially determined according to the order of bits, that is, the first bit (0th bit) of the first snapshot bitmap and the second snapshot bitmap is determined first. If the first bit is the second target value (for example, 0), the dual-active primary volume and the dual-active secondary volume are controlled to perform data write operation based on the data write instruction, then the data of the first bit of the dual-active primary volume is copied into the first bit of the first snapshot volume to obtain the third data feedback result of the dual-active primary volume, and the data of the first bit of the dual-active secondary volume is copied into the first bit of the second snapshot volume to obtain the fourth data feedback result of the dual-active secondary volume.
[0048] For example, if you want to write data Z to the active-active primary volume, you need to first copy the data A in the first position of the active-active primary volume to the first position of the first snapshot volume. At the same time, copy the data A in the first position of the active-active secondary volume to the first position of the second snapshot volume. Then, mark the first bit of the first snapshot bitmap and the second snapshot bitmap as 1 to indicate that the data has been copied. Finally, overwrite the data of the active-active primary volume and the active-active secondary volume into Z.
[0049] Finally, the active-active module of the active-active primary volume receives the fourth data feedback result from the active-active secondary volume, and combines it with the third data feedback result of the active-active primary volume to determine whether both the active-active primary volume and the active-active secondary volume have completed the data writing operation. If both the active-active primary volume and the active-active secondary volume have completed the data writing operation, a final feedback result is generated, such as the final feedback result being "data writing successful", and the final feedback result is sent back to the host.
[0050] Therefore, through the above high-availability snapshot creation process, the first snapshot volume and first snapshot bitmap of the dual-active primary volume, as well as the second snapshot volume and second snapshot bitmap of the dual-active secondary volume, can be kept completely consistent. This is equivalent to backing up the snapshot volume to two sites. At the same time, it can ensure that the data of the dual-active primary volume and dual-active secondary volume sites remain synchronized during the subsequent rollback process.
[0051] Furthermore, in the event of data corruption or malicious attacks, this embodiment of the invention requires further execution of the high-availability snapshot rollback process to restore the data to the state at the time the snapshot was created.
[0052] Specifically, such as Figure 6 As shown, firstly, a preset snapshot module (which can be configured according to storage requirements) is set on the active-active module of the active-active primary volume to manage the rollback progress of the active-active primary volume and the active-active secondary volume, and to control the write operations during the rollback process according to the bitmap. Secondly, it is determined whether the data rollback progress of the active-active primary volume is the first target progress and whether the data rollback progress of the active-active secondary volume is the second target progress. Both the first and second target progress can be 0, indicating that the check starts from the first bit (e.g., bit 0) of the bitmap. In other words, when both the data rollback progress of the active-active primary volume and the active-active secondary volume are 0... At this point, the preset snapshot module can be used to identify the first bit of the first snapshot bitmap corresponding to the dual-active primary volume. When the first bit is the first target value (e.g., 1), the preset snapshot module can be used to read the target data corresponding to the first bit in the first snapshot volume corresponding to the dual-active primary volume and send the first data rollback command to the dual-active primary volume. In other words, when the preset snapshot module identifies that the first bit of the first snapshot bitmap corresponding to the dual-active primary volume is 1, the preset snapshot module can be used to read the target data corresponding to the first bit in the first snapshot volume corresponding to the dual-active primary volume and send the first data rollback command to the dual-active primary volume.
[0053] It should be noted that in order to ensure data consistency, all write operations to the dual-active volume need to be suspended before rollback, ensuring that no new data is written to interfere with the rollback process.
[0054] For example, the preset snapshot module in the dual-active primary volume checks whether each data block needs to be rolled back in the order of the first snapshot bitmap. If the target value of the first bit in the first snapshot bitmap is 1 (indicating that the data block is inconsistent between the snapshot source volume and the current volume), data rollback is needed, and the first data rollback instruction is issued to the dual-active module of the dual-active primary volume. At the same time, the dual-active module of the dual-active primary volume also sends the same first data rollback instruction to the dual-active module of the dual-active secondary volume to ensure data consistency.
[0055] Thus, through the data rollback operation, the data can be restored to a known and stable historical state to deal with unexpected situations such as data corruption, loss or erroneous changes.
[0056] In step S302, if the first data rollback instruction of the dual-active primary volume is received, the second data rollback instruction of the dual-active secondary volume is generated based on the first data rollback instruction, and the second data rollback instruction is sent to the dual-active secondary volume.
[0057] Specifically, if the dual-active module of the dual-active primary volume receives the first data rollback instruction, the second data rollback instruction of the dual-active secondary volume is generated based on the first data rollback instruction, and the second data rollback instruction is sent to the dual-active secondary volume, so that the dual-active secondary volume can also perform data rollback according to the second data rollback instruction and the dual-active primary volume.
[0058] In step S303, the target data is read in the first snapshot volume corresponding to the dual-active primary volume using the preset snapshot module, the target data is rolled back to the dual-active primary volume, the first data feedback result of the dual-active primary volume is obtained, and the second data feedback result of the dual-active secondary volume is received.
[0059] According to one embodiment of the present application, the target data is read from the first snapshot volume corresponding to the dual-active master volume by using the preset snapshot module, and the target data is rolled back to the dual-active master volume to obtain a first data feedback result of the dual-active master volume, and a second data feedback result of the dual-active secondary volume is received simultaneously, comprising: the target data corresponding to the first bit in the first snapshot bitmap is read from the first snapshot volume corresponding to the dual-active master volume by using the preset snapshot module, and the target data corresponding to the first bit in the first snapshot bitmap is rolled back to the dual-active master volume to obtain the first data feedback result of the dual-active master volume; and the second data feedback result of the dual-active secondary volume is received simultaneously, wherein the second data feedback result comprises reading the target data corresponding to the first bit in the second snapshot bitmap from the second snapshot volume corresponding to the dual-active secondary volume, and rolling back the target data corresponding to the first bit in the second snapshot bitmap to the dual-active secondary volume.
[0060] Specifically, as shown in Figure 6 and Figure 7 When the dual-active master volume and the dual-active secondary volume need to be rolled back, the corresponding target data (for example, A) is first read from the first snapshot volume corresponding to the dual-active master volume by using the preset snapshot module, and the target data A is rolled back to the dual-active master volume to obtain a first data feedback result of the dual-active master volume; at this time, the preset snapshot module also reads the corresponding target data (for example, A) from the second snapshot volume corresponding to the dual-active secondary volume, and rolls back the target data A to the dual-active secondary volume to obtain a second data feedback result of the dual-active secondary volume, and feeds back the second data feedback result to the dual-active module of the dual-active master volume.
[0061] Optionally, in the embodiment of the present application, under the premise of ensuring data eventual consistency, the rollback operations of the master dual-active volume and the dual-active secondary volume can also be executed asynchronously within a certain range to improve the rollback speed and system performance, for example, the "eventual consistency" mode is introduced, the dual-active master volume returns a successful data feedback result after completing the rollback, and at the same time, an asynchronous rollback task of the dual-active secondary volume is started, at this time, the system monitors the rollback progress of the dual-active master volume through the heartbeat and state synchronization mechanism to ensure the final completion.
[0062] Thus, by synchronously rolling back the data from the respective snapshot volumes to the master volume and the secondary volume, it is ensured that the data of the two sites is always in a consistent state during the entire rollback operation, so as to maintain the dual-active high availability, and it is ensured that even if a catastrophic failure occurs at the site level during the rollback process, no data will be lost.
[0063] In step S304, a data rollback result is obtained based on the first data feedback result and the second data feedback result, and when the data rollback result meets a preset stop rollback condition, a first snapshot data of the dual-active master volume and a second snapshot data of the dual-active secondary volume are obtained.
[0064] The preset stop rollback condition can be set by a person skilled in the art according to actual snapshot storage requirements, and is not specifically limited here.
[0065] Specifically, the dual-active module of the dual-active primary volume needs to determine the second data feedback result when receiving the second data feedback result of the dual-active secondary volume. If it is identified that the data rollback of the dual-active secondary volume is completed, the data rollback result is obtained based on the first data feedback result and the second data feedback result, and the data rollback result is fed back to the preset snapshot module. At this time, the first data rollback is completed, and the rollback progress is increased by 1.
[0066] According to an embodiment of the present application, after obtaining the data rollback result based on the first data feedback result and the second data feedback result, the method further comprises updating the data rollback progress of the dual-active primary volume and the data rollback progress of the dual-active secondary volume, and determining whether the dual-active primary volume and the dual-active secondary volume have completed all rollback. If the dual-active primary volume or the dual-active secondary volume has not completed all rollback, it is determined whether the dual-active primary volume and the dual-active secondary volume continue to execute the data rollback step. If the dual-active primary volume and the dual-active secondary volume continue to execute the data rollback step, the step of reading the target data from the first snapshot volume corresponding to the dual-active primary volume using the preset snapshot module is continued until the updated data rollback progress of the dual-active primary volume and the data rollback progress of the dual-active secondary volume meet the preset stop rollback condition, and the data rollback is stopped.
[0067] According to an embodiment of the present application, after determining whether the dual-active primary volume and the dual-active secondary volume continue to execute the data rollback step, the method further comprises: if the dual-active primary volume and the dual-active secondary volume stop executing the data rollback step, directly updating the data rollback progress of the dual-active primary volume and the data rollback progress of the dual-active secondary volume.
[0068] According to an embodiment of the present application, after determining whether the dual-active primary volume and the dual-active secondary volume have completed all rollback, the method further comprises: if the dual-active primary volume and the dual-active secondary volume have completed all rollback, directly stopping the data rollback.
[0069] Specifically, as Figure 7As shown, it is continuously judged whether the dual-active master volume and the dual-active auxiliary volume complete the full rollback. If the dual-active master volume or the dual-active auxiliary volume does not complete the full rollback, it is further judged whether the dual-active master volume and the dual-active auxiliary volume need to continue to execute the data rollback step. If the dual-active master volume and the dual-active auxiliary volume need to continue to execute the data rollback step, the step of reading the target data in the first snapshot volume corresponding to the dual-active master volume by using the preset snapshot module is continued, that is, the second bit (i.e., the first bit) of the first snapshot bitmap and the second snapshot bitmap is checked. If the value of the second bit of the first snapshot bitmap and the second snapshot bitmap at the corresponding position is still 1, the corresponding target data in the first snapshot volume corresponding to the dual-active master volume is continuously read by using the preset snapshot module, the first data rollback instruction is sent to the dual-active master volume, and the second data rollback instruction of the dual-active auxiliary volume is generated after the dual-active module of the dual-active master volume receives the first data rollback instruction. The second data rollback instruction is sent to the dual-active auxiliary volume. The specific rollback process has been described in detail above, and thus is not described in detail here to avoid redundancy.
[0070] Further, if the dual-active master volume and the dual-active auxiliary volume stop executing the data rollback step, the data rollback progress of the dual-active master volume and the data rollback progress of the dual-active auxiliary volume can be directly updated at this time. That is, if the value of the second bit of the first snapshot bitmap and the second snapshot bitmap at the corresponding position is 0 (indicating that the data block is consistent between the snapshot source volume and the current volume), data rollback is not needed at this time, the data block is skipped, the rollback progress is directly increased and updated, and then the preset snapshot module continuously performs the above detection process until all bits in the first snapshot bitmap and the second snapshot bitmap are traversed. At this time, it is indicated that the data rollback result satisfies the preset stop rollback condition, that is, the entire volume data rollback operation is completed. Finally, the first snapshot data of the dual-active master volume and the second snapshot data of the dual-active auxiliary volume can be obtained, that is, the data of the dual-active master volume and the dual-active auxiliary volume will be restored to the state at the snapshot creation time. After the data rollback is completed, the data writing operation on the dual-active volume can be restarted to restore the normal business process.
[0071] Therefore, through the above-described rollback data flow, high availability of the dual-active volume during rollback data can be achieved. That is, when any one site fails, the user's data will not be lost. For example, when data A is rolled back, the primary site of the dual-active master volume fails, and the secondary site of the dual-active auxiliary volume still exists and maintains a complete snapshot data.
[0072] In summary, based on the above-described embodiments, the present application can achieve the following beneficial effects:
[0073] (1) The present application ensures that the data of the dual-active master volume and the dual-active auxiliary volume is always consistent during the entire rollback operation by using the mechanism of synchronous snapshot creation and synchronous rollback. This means that even during the rollback, the system still has the high availability feature of dual-active.
[0074] (2) The rollback operation of the present application is executed synchronously in the primary and secondary sites through the double-write mechanism, and each data write (rollback) requires the simultaneous success of both sites. Therefore, even if a catastrophic failure (such as power failure, fire) occurs in one site during the rollback process, the other site has saved the rolled-back data completely, realizing zero data loss;
[0075] (3) The present application precisely controls which data blocks need to be copied from the snapshot volume to the dual-active primary volume and the dual-active secondary volume through the "copy-on-write" mechanism and bitmap management, and ensures that each write operation of the dual-active primary volume and the dual-active secondary volume is synchronized and confirmed through the double-write and feedback confirmation mechanism, thereby guaranteeing the high consistency of data between the primary and secondary volumes.
[0076] According to the rollback method of the dual-active high-availability snapshot provided by the embodiment of the present application, when the first data rollback instruction of the dual-active primary volume is received, the second data rollback instruction of the dual-active secondary volume is generated and sent to the dual-active secondary volume, the target data is read in the first snapshot volume corresponding to the dual-active primary volume by using the preset snapshot module, and is rolled back to the dual-active primary volume to obtain the first data feedback result, and the second data feedback result of the dual-active secondary volume is received at the same time; the data rollback result is obtained based on the first and second data feedback results, and the first snapshot data and the second snapshot data are obtained when the data rollback result meets the preset stop rollback condition. The problem that data loss will occur if a site failure occurs during snapshot rollback is solved, and through the creation of a high-availability snapshot, data writing and rollback process, the data volume can maintain a dual-active synchronization state during snapshot rollback, thereby avoiding data loss caused by site failure.
[0077] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment.
[0078] The embodiment of the present application also provides a rollback device of a dual-active high-availability snapshot.
[0079] Figure 8 is a block diagram of the rollback device of the dual-active high-availability snapshot of the embodiment of the present application.
[0080] As shown in Figure 8 , the rollback device of the dual-active high-availability snapshot 10 comprises a judgment module 100, a generation module 200, a receiving module 300 and an acquisition module 400.
[0081] The judgment module 100 is configured to judge whether the first data rollback instruction of the dual-active primary volume is received.
[0082] The generating module 200 is configured to, if the first data rollback instruction of the dual-active primary volume is received, generate a second data rollback instruction of a dual-active secondary volume based on the first data rollback instruction, and send the second data rollback instruction to the dual-active secondary volume.
[0083] The receiving module 300 is configured to read target data in a first snapshot volume corresponding to the dual-active primary volume by using a preset snapshot module, roll back the target data to the dual-active primary volume to obtain a first data feedback result of the dual-active primary volume, and receive a second data feedback result of the dual-active secondary volume.
[0084] The obtaining module 400 is configured to obtain a data rollback result based on the first data feedback result and the second data feedback result, and obtain first snapshot data of the dual-active primary volume and second snapshot data of the dual-active secondary volume when the data rollback result meets a preset stop rollback condition.
[0085] According to an embodiment of the present application, before judging whether the first data rollback instruction of the dual-active primary volume is received, the judging module 100 further comprises:
[0086] The first judging unit is configured to judge whether a data rollback progress of the dual-active primary volume is a first target progress and whether a data rollback progress of the dual-active secondary volume is a second target progress.
[0087] The identifying unit is configured to, if the data rollback progress of the dual-active primary volume is the first target progress and the data rollback progress of the dual-active secondary volume is the second target progress, identify a first bit of a first snapshot bitmap corresponding to the dual-active primary volume, and read target data corresponding to the first bit in a first snapshot volume corresponding to the dual-active primary volume by using a preset snapshot module and send a first data rollback instruction to the dual-active primary volume when the first bit is a first target value.
[0088] According to an embodiment of the present application, before judging whether the data rollback progress of the dual-active primary volume is the first target progress and whether the data rollback progress of the dual-active secondary volume is the second target progress, the judging unit further comprises:
[0089] The creating sub-unit is configured to create a first snapshot volume and a first snapshot bitmap corresponding to the dual-active primary volume, and create a second snapshot volume and a second snapshot bitmap corresponding to the dual-active secondary volume.
[0090] The control sub-unit is configured to judge whether a data write instruction is received, generate a third data feedback result based on the data write instruction and control the dual-active primary volume to perform a data write operation if the data write instruction is received, send the data write instruction to the dual-active secondary volume, and receive a fourth data feedback result of the dual-active secondary volume.
[0091] The judging sub-unit is configured to judge whether the dual-active primary volume and the dual-active secondary volume both complete the write operation based on the third data feedback result and the fourth data feedback result.
[0092] The generating subunit is configured to generate a final feedback result if the write operation is completed on both the primary volume and the secondary volume.
[0093] According to an embodiment of the present application, the control subunit comprises:
[0094] The judging subunit is configured to judge whether the first bit of the first snapshot bitmap corresponding to the primary volume is a second target value.
[0095] The control subunit is configured to control the primary volume to perform the data write operation based on the data write instruction if the first bit of the first snapshot bitmap is the second target value.
[0096] According to an embodiment of the present application, the receiving module 300 comprises:
[0097] The rollback unit is configured to read the target data corresponding to the first bit in the first snapshot bitmap in the first snapshot volume corresponding to the primary volume by using the preset snapshot module, and rollback the target data corresponding to the first bit in the first snapshot bitmap to the primary volume to obtain a first data feedback result of the primary volume.
[0098] The receiving unit is configured to simultaneously receive a second data feedback result of the secondary volume, wherein the second data feedback result comprises reading the target data corresponding to the first bit in the second snapshot bitmap in the second snapshot volume corresponding to the secondary volume, and rollback the target data corresponding to the first bit in the second snapshot bitmap to the secondary volume.
[0099] According to an embodiment of the present application, after obtaining the data rollback result based on the first data feedback result and the second data feedback result, the obtaining module 400 further comprises:
[0100] The updating unit is configured to update the data rollback progress of the primary volume and the data rollback progress of the secondary volume, and judge whether the primary volume and the secondary volume have completed all rollback.
[0101] The second judging unit is configured to judge whether the primary volume and the secondary volume continue to perform the data rollback step if the primary volume or the secondary volume has not completed all rollback.
[0102] The executing unit is configured to continue to perform the step of reading the target data in the first snapshot volume corresponding to the primary volume by using the preset snapshot module if the primary volume and the secondary volume continue to perform the data rollback step, until the data rollback progress of the updated primary volume and the data rollback progress of the secondary volume satisfy a preset rollback stopping condition, and then stop the data rollback.
[0103] According to one of the embodiments of the present application, after judging whether the double-active master volume and the double-active auxiliary volume continue to perform the data rollback step, the second judging unit further comprises:
[0104] The updating sub-unit is configured to directly update the data rollback progress of the double-active master volume and the data rollback progress of the double-active auxiliary volume if the double-active master volume and the double-active auxiliary volume stop performing the data rollback step.
[0105] According to one of the embodiments of the present application, after judging whether the double-active master volume and the double-active auxiliary volume both complete the full rollback, the updating unit further comprises:
[0106] The rollback stopping unit is configured to directly stop the data rollback if the double-active master volume and the double-active auxiliary volume both complete the full rollback.
[0107] According to one of the embodiments of the present application, the first target value is 1 and the second target value is 0.
[0108] In summary, the features of the embodiments of the double-active high-availability snapshot rollback device can be referred to the related descriptions of the embodiments of the double-active high-availability snapshot rollback method, which will not be repeated here.
[0109] The embodiments of the present application further provide an electronic device, which can comprise:
[0110] The memory 901, the processor 902 and the computer program stored in the memory 901 and executable on the processor 902.
[0111] The processor 902 implements the double-active high-availability snapshot rollback method provided in the above embodiments when executing the program.
[0112] Further, the electronic device further comprises:
[0113] The communication interface 903 is configured to communicate between the memory 901 and the processor 902.
[0114] The memory 901 is configured to store the computer program executable on the processor 902.
[0115] The memory 901 can include a high-speed RAM memory, and can also include a non-volatile memory, for example, at least one disk memory.
[0116] If the memory 901, the processor 902 and the communication interface 903 are implemented independently, the communication interface 903, the memory 901 and the processor 902 can be connected with each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 9 Only one thick line is used in the figure to represent the bus, but it does not mean that there is only one bus or only one type of bus.
[0117] Optionally, in a specific implementation, if the memory 901, the processor 902 and the communication interface 903 are integrated on a chip, the memory 901, the processor 902 and the communication interface 903 can complete communication between each other through an internal interface.
[0118] The processor 902 can be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present application.
[0119] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is configured to execute steps in any of the above-mentioned embodiments of the rollback method of the double-active high-availability snapshot when running.
[0120] In an exemplary embodiment, the above-mentioned computer readable storage medium can include, but is not limited to, a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0121] Embodiments of the present application also provide a computer program product, which includes a computer program, and the computer program is executed by a processor to implement steps in any of the above-mentioned embodiments of the rollback method of the double-active high-availability snapshot.
[0122] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0123] The above provides a detailed description of the rollback method for a dual-active high-availability snapshot provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this invention.
Claims
1. A method for rollback of a snapshot of dual-active high availability, characterized in that, The method comprises the following steps: determining whether a first data rollback instruction of a dual-active master volume is received; if the first data rollback instruction of the dual-active master volume is received, generating a second data rollback instruction of a dual-active secondary volume based on the first data rollback instruction, and sending the second data rollback instruction to the dual-active secondary volume; reading target data in a first snapshot volume corresponding to the dual-active master volume by using a preset snapshot module, rolling back the target data to the dual-active master volume to obtain a first data feedback result of the dual-active master volume, and simultaneously receiving a second data feedback result of the dual-active secondary volume; obtaining a data rollback result based on the first data feedback result and the second data feedback result, and obtaining first snapshot data of the dual-active master volume and second snapshot data of the dual-active secondary volume when the data rollback result meets a preset stop rollback condition; wherein the rollback method of the dual-active high-availability snapshot comprises a high-availability snapshot creation process and a high-availability snapshot rollback process, in the high-availability snapshot creation process, the write request of the host to the dual-active master volume and the dual-active secondary volume is paused, the dual-write operation that is not completed is waited to be completely synchronized, and after the dual-write operation is synchronized, the dual-active master volume and the dual-active secondary volume are synchronously created snapshot, the first snapshot volume, the first snapshot bitmap, the second snapshot volume and the second snapshot bitmap are generated, and after the creation is completed, the data recovery write and the dual-write process are executed, and when the dual-active master volume and the dual-active secondary volume complete the data write operation, the final feedback result is generated, wherein in the data write process, the steps of checking the bitmap, updating the bitmap, writing the master volume data and synchronously writing the secondary volume data by using the dual-active module are performed; the step of reading target data in a first snapshot volume corresponding to the dual-active master volume by using a preset snapshot module, rolling back the target data to the dual-active master volume to obtain a first data feedback result of the dual-active master volume, and simultaneously receiving a second data feedback result of the dual-active secondary volume comprises the steps of: reading target data corresponding to a first bit in a first snapshot bitmap in the first snapshot volume corresponding to the dual-active master volume by using the preset snapshot module, rolling back the target data corresponding to the first bit in the first snapshot bitmap to the dual-active master volume to obtain the first data feedback result of the dual-active master volume, and simultaneously receiving the second data feedback result of the dual-active secondary volume, wherein the second data feedback result comprises the steps of: reading target data corresponding to a first bit in a second snapshot bitmap in a second snapshot volume corresponding to the dual-active secondary volume, and rolling back the target data corresponding to the first bit in the second snapshot bitmap to the dual-active secondary volume, wherein the first bit is 1.
2. The method of claim 1, wherein, Before determining whether a first data rollback instruction of a dual-active master volume is received, the method further comprises the steps of: determining whether a data rollback progress of the dual-active master volume is a first target progress and whether a data rollback progress of the dual-active secondary volume is a second target progress. If the data rollback progress of the dual-active primary volume is the first target progress and the data rollback progress of the dual-active secondary volume is the second target progress, a first bit of a first snapshot bitmap corresponding to the dual-active primary volume is identified, and when the first bit is a first target value, target data corresponding to the first bit is read from a first snapshot volume corresponding to the dual-active primary volume by using the preset snapshot module, and the first data rollback instruction is sent to the dual-active primary volume. 3.The dual-active high-availability snapshot rollback method according to claim 2, characterized in that, Before judging whether the data rollback progress of the dual-active primary volume is the first target progress and whether the data rollback progress of the dual-active secondary volume is the second target progress, the method further comprises: creating a first snapshot volume and a first snapshot bitmap corresponding to the dual-active primary volume, and creating a second snapshot volume and a second snapshot bitmap corresponding to the dual-active secondary volume; judging whether a data write instruction is received, if the data write instruction is received, controlling the dual-active primary volume to perform a data write operation based on the data write instruction, generating a third data feedback result, sending the data write instruction to the dual-active secondary volume, and receiving a fourth data feedback result of the dual-active secondary volume; judging whether the dual-active primary volume and the dual-active secondary volume both complete the write operation based on the third data feedback result and the fourth data feedback result; if the dual-active primary volume and the dual-active secondary volume both complete the write operation, generating a final feedback result.
4. The dual-active high-availability snapshot rollback method according to claim 3, wherein, The method of controlling the dual-active primary volume to perform a data write operation based on the data write instruction comprises: judging whether a first bit of a first snapshot bitmap corresponding to the dual-active primary volume is a second target value; if the first bit of the first snapshot bitmap is the second target value, controlling the dual-active primary volume to perform a data write operation based on the data write instruction.
5. The method of claim 1, wherein, After obtaining the data rollback result based on the first data feedback result and the second data feedback result, the method further comprises: updating the data rollback progress of the dual-active primary volume and the data rollback progress of the dual-active secondary volume, and judging whether the dual-active primary volume and the dual-active secondary volume both complete all rollback; if the dual-active primary volume or the dual-active secondary volume does not complete all rollback, judging whether the dual-active primary volume and the dual-active secondary volume continue to perform the data rollback step; if the dual-active primary volume and the dual-active secondary volume continue to perform the data rollback step, the step of reading target data from a first snapshot volume corresponding to the dual-active primary volume by using a preset snapshot module is continued to be performed until the data rollback progress of the dual-active primary volume and the data rollback progress of the dual-active secondary volume after being updated meet a preset stop rollback condition, and the data rollback is stopped.
6. The method of claim 5, wherein, After judging whether the dual-active primary volume and the dual-active secondary volume continue to perform the data rollback step, the method further comprises: if the dual-active primary volume and the dual-active secondary volume stop performing the data rollback step, the data rollback progress of the dual-active primary volume and the data rollback progress of the dual-active secondary volume are directly updated.
7. The method of claim 5, wherein, After judging whether the dual-active primary volume and the dual-active secondary volume both complete all rollback, the method further comprises: if the dual-active primary volume and the dual-active secondary volume both complete all rollback, the data rollback is directly stopped.
8. The method of claim 2 or 4, wherein, The first target value is 1, and the second target value is 0.
9. An electronic device, comprising: Comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the program to implement the steps of the method for rolling back a snapshot of dual-active high availability according to any one of claims 1 to 8.
Citation Information
Patent Citations
Implementation method of multi-machine backup
CN106850255A
Snapshot rollback method and device, equipment and storage medium
CN110658993A
Data rollback updating method and device, computer equipment and storage medium
CN112416860A