Dual-active high-availability snapshot rollback method and electronic equipment

By creating highly available snapshots and synchronously rolling back data in the active-active system, the data inconsistency problem caused by snapshot rollback is resolved, ensuring that data is not lost in the event of a site failure, and achieving high availability and zero-loss data recovery.

CN120723541AActive Publication Date: 2025-09-30INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511186986.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-09-30
Estimated Expiration
2045-08-22

AI Technical Summary

Technical Problem

In the storage system, snapshot rollback causes data inconsistency in the active-active system, resulting in data loss, and high availability cannot be guaranteed, which cannot meet the critical business requirements of zero RTO and RPO.

Method used

By creating a high-availability snapshot, the preset snapshot module is used to read the target data from the snapshot volume corresponding to the active-active primary volume and roll it back to the active-active primary volume. A data rollback instruction is generated for the active-active secondary volume to ensure data consistency between the active-active primary and secondary volumes. The rollback is stopped when the data rollback result meets the preset conditions.

Benefits of technology

When a snapshot is rolled back, the active-active synchronization state is maintained to avoid data loss, ensure high availability, and meet the recovery time and data recovery point objectives of key businesses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723541A_ABST
    Figure CN120723541A_ABST
Patent Text Reader

Abstract

The invention discloses a rollback method for a dual-active high-availability snapshot and electronic equipment, and relates to the technical field of data storage, and the rollback method comprises the following steps: when a first data rollback instruction of a dual-active primary volume is received, generating a second data rollback instruction of a dual-active secondary volume, and sending the second data rollback instruction to the dual-active secondary volume, reading the target data in a first snapshot volume corresponding to the active-active main volume by using a preset snapshot module, correspondingly rolling back to the active-active main volume to obtain a first data feedback result, and receiving a second data feedback result of the active-active auxiliary volume; and obtaining a data rollback result based on the first data feedback result and the second data feedback result, and obtaining first snapshot data and second snapshot data when the data rollback result meets a preset rollback stopping condition. According to the method and the device, the problem of data loss caused by a site fault during snapshot rollback of data is solved, and the data volume can maintain an active-active synchronous state during snapshot rollback by creating the high-availability snapshot, writing the data and performing a rollback process, so that data loss caused by the site fault is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a rollback method and electronic device for an active-active high-availability snapshot. Background Art

[0002] In storage systems, snapshot technology is an important means of achieving data backup. However, when a site-level failure occurs in the storage system, all data in the entire data center and local data backups will be lost. Therefore, data security and availability become particularly important.

[0003] Related technologies typically use a copy mechanism or an active-active mechanism to perform point-in-time backup of volume data to provide site-level disaster recovery. However, existing technologies have the following problems when combining snapshots and active-active mechanisms: (1) Snapshot rollback causes active-active interruption: When a snapshot rollback is performed at one site, the data on the primary and secondary volumes in the active-active system will be inconsistent. If a site failure occurs at this time, data loss may occur.

[0004] (2) High availability cannot be guaranteed: During the traditional snapshot rollback process, the redundant protection function of the active-active system is temporarily invalid, which cannot meet the critical business requirements of zero RTO (Recovery Time Objective) and RPO (Recovery Point Objective), which needs to be solved urgently. Summary of the Invention

[0005] The present invention provides a rollback method and electronic device for an active-active high-availability snapshot, so as to at least solve the problem in the related art that data is lost when a site failure occurs during snapshot rollback.

[0006] The present invention provides a rollback method for an active-active high-availability snapshot, comprising: determining whether a first data rollback instruction of an active-active primary volume is received; if the first data rollback instruction of the active-active primary volume is received, generating a second data rollback instruction of an active-active secondary volume based on the first data rollback instruction, and sending the second data rollback instruction to the active-active secondary volume; using a preset snapshot module to read target data in a first snapshot volume corresponding to the active-active primary volume, rolling back the target data to the active-active primary volume, obtaining a first data feedback result of the active-active primary volume, and simultaneously receiving a second data feedback result of the active-active secondary volume; obtaining a data rollback result based on the first data feedback result and the second data feedback result, and obtaining the first snapshot data of the active-active primary volume and the second snapshot data of the active-active secondary volume when the data rollback result meets a preset stop-rollback condition.

[0007] The present invention also provides a rollback device for active-active high-availability snapshots, comprising: A judgment module, configured to judge whether a first data rollback instruction of the active-active primary volume has been received; a generating module configured to, upon receiving a first data rollback instruction of the active-active primary volume, generate a second data rollback instruction of the active-active secondary volume based on the first data rollback instruction, and send the second data rollback instruction to the active-active secondary volume; a receiving module configured to read target data from a first snapshot volume corresponding to the active-active primary volume using a preset snapshot module, roll back the target data to the active-active primary volume, obtain a first data feedback result of the active-active primary volume, and simultaneously receive a second data feedback result of the active-active secondary volume; The acquisition module is used to obtain a data rollback result based on the first data feedback result and the second data feedback result, and obtain the first snapshot data of the active-active primary volume and the second snapshot data of the active-active secondary volume when the data rollback result meets a preset stop rollback condition.

[0008] The present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned active-active high-availability snapshot rollback methods when executing the computer program.

[0009] The present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned active-active high-availability snapshot rollback methods are implemented.

[0010] The present invention also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned active-active high-availability snapshot rollback methods when executed by a processor.

[0011] Through the present invention, upon receiving a first data rollback instruction for the active-active primary volume, a second data rollback instruction for the active-active secondary volume is generated and sent to the active-active secondary volume. A preset snapshot module is used to read the target data from the first snapshot volume corresponding to the active-active primary volume, and the data is rolled back to the active-active primary volume accordingly, obtaining a first data feedback result. Simultaneously, a second data feedback result for the active-active secondary volume is received. A data rollback result is obtained based on the first and second data feedback results, and when the data rollback result meets a preset stop-rollback condition, the first snapshot data and the second snapshot data are obtained. This solves the problem of data loss caused by a site failure during a snapshot rollback. By creating a highly available snapshot, data writing, and rollback process, the data volume can maintain an active-active synchronization state during a snapshot rollback, thereby avoiding data loss due to a site failure. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0013] Figure 1 This is a schematic diagram of the implementation principle of snapshot copy-on-write in the related art; Figure 2 This is a schematic diagram of the implementation principle of active-active dual-write in related technologies; Figure 3 A schematic diagram of a process for rolling back a high-availability snapshot of an active-active high-availability snapshot provided by an embodiment of the present invention; Figure 4 A schematic diagram of creating a high-availability snapshot of an active-active volume provided by an embodiment of the present invention; Figure 5 A schematic diagram of data writing to an active-active volume after creating a high-availability snapshot according to an embodiment of the present invention; Figure 6 A schematic diagram of rolling back a high-availability snapshot provided by one embodiment of the present invention; Figure 7 A flowchart of rolling back a high-availability snapshot provided by one embodiment of the present invention; Figure 8 This is a block diagram illustrating an exemplary device for rolling back an active-active high-availability snapshot according to an embodiment of the present invention; Figure 9 FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0014] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.

[0015] It should be noted that, in the description of the present invention, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. The terms "first," "second," etc., in the present invention are used to distinguish similar objects, and are not used to describe a particular order or precedence.

[0016] In order to enable those skilled in the art to better understand the solutions of the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0017] Specifically, before introducing the embodiments of the present invention, we first introduce the volume data storage solution of the related technology. For storage systems, data backup is an indispensable function. Volume snapshots are often considered to be an important means of achieving data backup. Volume snapshots are for volumes (source volumes) in the storage system. They perform an immediate local point-in-time data backup. If the volume data is damaged due to misoperation or malicious destruction, such as data damage caused by ransomware, it can be repaired by rollback. The data of the snapshot volume can also be used for data analysis, data mining, etc. without affecting the volume data and business.

[0018] However, if a site-level failure in the storage system, such as a fire or other disaster, results in the complete loss of data in the entire data center, the local data backup will also be damaged. To address this scenario, data can be backed up remotely. At the same time, the host (data processing center) and the two storage systems can be interconnected. In other words, if one data site fails, the other data site can immediately take over. This mechanism is called active-active, ensuring that data is not lost in the event of a data site failure and that services can be immediately restored.

[0019] In related technologies, a common technology for taking snapshots of volumes is called copy-on-write. That is, before modifying the volume data, the data will be copied to the target snapshot volume first, and the difference data will be recorded through a bitmap (which data has been copied to the target snapshot volume and which data has not been copied). For example Figure 1 At time T0 in the example, there are eight blocks of data in the source volume. To generate a snapshot volume for the source volume, you need to generate a bitmap and initialize all bits to 0. The bitmap has eight bits, corresponding to the eight blocks of data in the source volume. When you want to write A to Z at time T1, you need to first copy A to the snapshot volume, then mark the first bit of the bitmap (corresponding to the first block of data A) as 1, and finally overwrite the data of the source volume with Z. To implement active-active replication for the volume, a common technology is the dual-write process, which means that when the host writes data to the volume, it will write data to both data sites at the same time. After all writes are completed, a success message will be returned to the host.

[0020] Furthermore, if Figure 2At time T0 in the figure, there are eight blocks of data in the active-active volume. At this time, the data of the active-active primary volume and the active-active secondary volume are synchronized. At time T1, if data Z is to be written to the active-active primary volume and the active-active secondary volume, the host will send a write request to the primary site where the active-active primary volume is located. The active-active module at the primary site will receive the write request and write the data. It will also send a write request to the secondary site where the active-active secondary volume is located. After the secondary site completes the write, it returns the request to the primary site. Then, after the write is complete on both the active-active primary volume and the active-active secondary volume, the primary site returns a write success message to the host. When the write is successful, the data is synchronized between the two sites.

[0021] However, based on the aforementioned technologies, volumes can utilize both active-active and snapshot data protection simultaneously. For example, if a snapshot is taken at one site in an active-active system and the data is damaged by ransomware, the snapshot volume's data needs to be rolled back to the source volume. This will cause data inconsistency between the two volumes in the active-active system. During the snapshot rollback process, the volume effectively loses backups at both sites. In this case, a copy of the data needs to be synchronized to the other site. If a site failure occurs during synchronization, data loss may occur.

[0022] Therefore, based on the above-mentioned problems, the embodiments of the present invention create a high-availability snapshot, data writing and rollback process. When the snapshot is rolled back, the data volume can maintain the active-active synchronization state, thereby avoiding data loss due to site failure. The following will be described in detail based on specific embodiments.

[0023] An embodiment of the present invention provides a rollback method for an active-active high-availability snapshot. The method is described in detail in conjunction with the execution flow of the rollback method for the active-active high-availability snapshot.

[0024] Specifically, Figure 3 A schematic diagram of a rollback method for an active-active high-availability snapshot provided by an embodiment of the present invention; like Figure 3 As shown in the figure, the rollback method of the active-active high-availability snapshot includes the following steps: In step S301, it is determined whether a first data rollback instruction of the active-active primary volume is received.

[0025] According to one embodiment of the present invention, before determining whether the first data rollback instruction of the active-active primary volume is received, the process further includes: determining 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; if the data rollback progress of the active-active primary volume is the first target progress, and the data rollback progress of the active-active secondary volume is the second target progress, identifying the first bit of the first snapshot bitmap corresponding to the active-active primary volume, and when the first bit is the first target value, using a preset snapshot module to read the target data corresponding to the first bit in the first snapshot volume corresponding to the active-active primary volume, and sending the first data rollback instruction to the active-active primary volume.

[0026] According to one embodiment of the present invention, before determining 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, it also includes: creating a corresponding first snapshot volume and a first snapshot bitmap for the active-active primary volume, and at the same time creating a corresponding second snapshot volume and a second snapshot bitmap for the active-active secondary volume; determining whether a data write instruction is received, and if a data write instruction is received, controlling the active-active primary volume to perform a data write operation based on the data write instruction, generating a third data feedback result, and sending the data write instruction to the active-active secondary volume at the same time, and receiving a fourth data feedback result of the active-active secondary volume; determining whether both the active-active primary volume and the active-active secondary volume have completed the write operation based on the third data feedback result and the third data feedback result; and generating a final feedback result if both the active-active primary volume and the active-active secondary volume have completed the write operation.

[0027] According to one embodiment of the present invention, controlling the active-active primary volume to perform a data write operation based on a data write instruction includes: determining whether a first bit of a first snapshot bitmap corresponding to the active-active primary volume is a second target value; if the first bit of the first snapshot bitmap is the second target value, controlling the active-active primary volume to perform a data write operation based on the data write instruction.

[0028] The preset snapshot module may be selected by those skilled in the art according to actual data storage requirements and is not specifically limited here.

[0029] Specifically, in order to solve the defects existing in the existing technology when combining snapshots and active-active, for example, when a snapshot rollback is performed at a data site, it will cause inconsistency in the data of the two volumes in the active-active system. At this time, if a data site failure occurs, it may cause data loss, thereby destroying the high availability guarantee of the active-active system. Therefore, the core of the solution of the embodiment of the present invention is to maintain the active-active synchronization state during the snapshot rollback process to ensure that data will not be lost even if a data site failure occurs during the rollback process.

[0030] Specifically, the embodiment of the present invention mainly includes a high-availability snapshot creation process and a high-availability snapshot rollback process. During the high-availability snapshot creation process, first, it is necessary to suspend the host's write request to the active-active primary volume and the active-active secondary volume, and wait for all unfinished dual-write operations (primary volume + secondary volume) to be completed synchronously to ensure that the data of the active-active primary volume and the active-active secondary volume are completely consistent when the snapshot is created (the basis for consistent snapshots). Among them, the embodiment of the present invention can achieve write suspension through the IO suspension mechanism of the active-active module to avoid dirty data.

[0031] Secondly, if Figure 4 As shown, when synchronously creating snapshots of the active-active primary volume and the active-active secondary volume, two snapshot volumes and two snapshot bitmaps are generated. The data backed up by these two snapshot volumes are the data of the active-active primary volume and the active-active secondary volume respectively, and the data of the active-active primary volume and the active-active secondary volume are the same, that is, the data backed up by these two snapshot volumes are the same. In order to effectively distinguish the active-active primary volume from the active-active secondary volume, an embodiment of the present invention can create a corresponding first snapshot volume and a first snapshot bitmap for the active-active primary volume, and at the same time create a corresponding second snapshot volume and a second snapshot bitmap for the active-active secondary volume. The initial states of the first snapshot bitmap and the second snapshot bitmap are consistent, and whether the data blocks of the active-active primary volume or the active-active secondary volume are modified can be marked. Subsequent writes can update the bitmap through the write-time copy mechanism.

[0032] Again, as Figure 5 As shown in the figure, the write recovery and dual write process are extended. At this time, the host write request is restored, and when the data write instruction sent by the host is received, the dual-active primary volume and the dual-active secondary volume have already generated snapshots respectively. Therefore, the dual-active primary volume can be controlled to perform data write operations based on the data write instruction, and the data write instruction can be sent to the dual-active secondary volume at the same time, so that the dual-active secondary volume also performs synchronous data write operations. In the process of executing data write, four steps are required: checking the bitmap, updating the bitmap, writing the primary volume data, and synchronizing the secondary volume data write through the dual-active module. In the process of checking the bitmap, the first snapshot corresponding to the dual-active primary volume needs to be updated. The bitmap and the second snapshot bitmap corresponding to the active-active secondary volume are evaluated in bit order. That is, the first bit (bit 0) of the first and second snapshot bitmaps is evaluated. If the first bit is the second target value (for example, 0), the active-active primary and secondary volumes are controlled to perform data write operations based on the data write instruction. The data in the first bit of the active-active primary volume is then copied to the first bit of the first snapshot volume, resulting in a third data feedback result for the active-active primary volume. Simultaneously, the data in the first bit of the active-active secondary volume is copied to the first bit of the second snapshot volume, resulting in a fourth data feedback result for the active-active secondary volume.

[0033] 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, indicating that the data has been copied. Finally, overwrite the data of the active-active primary volume and the active-active secondary volume and write it into Z.

[0034] Finally, the active-active module of the active-active primary volume receives the fourth data feedback result of 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 write operation. If both the active-active primary volume and the active-active secondary volume have completed the data write operation, a final feedback result is generated, for example, the final feedback result is that the data write is successful, and the final feedback result is fed back to the host.

[0035] Therefore, through the above-mentioned high-availability snapshot creation process, the first snapshot volume and the first snapshot bitmap of the active-active primary volume, as well as the second snapshot volume and the second snapshot bitmap of the active-active secondary volume can be kept completely consistent, which is equivalent to making a two-site backup of the snapshot volume. At the same time, it can ensure that during the subsequent rollback process, the data of the active-active primary volume and the active-active secondary volume sites are always synchronized.

[0036] Furthermore, in the event of data corruption or malicious attacks, the embodiment of the present invention needs to further perform a rollback process operation of the high-availability snapshot to restore the data to the state when the snapshot was created.

[0037] Specifically, if Figure 6 As shown, first, a preset snapshot module (which can be set 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 control the write operation 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, wherein the first target progress and the second target progress can both be 0, indicating that the check starts from the first bit of the bitmap (for example, bit 0), that is, when the data rollback progress of the active-active primary volume and the data rollback progress of the active-active secondary volume are both 0 At this time, a preset snapshot module can be used to identify the first bit of the first snapshot bitmap corresponding to the active-active primary volume. When the first bit is a first target value (for example, 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 active-active primary volume, and send a first data rollback instruction to the active-active primary volume. In other words, when the preset snapshot module identifies that the first bit of the first snapshot bitmap corresponding to the active-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 active-active primary volume, and send the first data rollback instruction to the active-active primary volume.

[0038] It should be noted that to ensure data consistency, all write operations to the active-active volume need to be suspended before the rollback to ensure that no new data is written to interfere with the rollback process.

[0039] For example, the snapshot module preset in the active-active primary volume checks each data block bit by bit in the order of the first snapshot bitmap to see whether it needs to be rolled back. If the target value corresponding to 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 required, and a first data rollback instruction is issued to the active-active module of the active-active primary volume. At the same time, the active-active module of the active-active primary volume also sends the same first data rollback instruction to the active-active module of the active-active secondary volume to ensure data consistency.

[0040] Therefore, through data rollback operations, data can be restored to a known, stable historical state to deal with unexpected situations such as data corruption, loss, or erroneous changes.

[0041] In step S302, if a first data rollback instruction of the active-active primary volume is received, a second data rollback instruction of the active-active secondary volume is generated based on the first data rollback instruction, and the second data rollback instruction is sent to the active-active secondary volume.

[0042] Specifically, if the active-active module of the active-active primary volume receives a first data rollback instruction, it generates a second data rollback instruction for the active-active secondary volume based on the first data rollback instruction, and sends the second data rollback instruction to the active-active secondary volume, so that the active-active secondary volume can also perform data rollback synchronously with the active-active primary volume according to the second data rollback instruction.

[0043] In step S303, the preset snapshot module is used to read the target data in the first snapshot volume corresponding to the active-active primary volume, and the target data is rolled back to the active-active primary volume to obtain the first data feedback result of the active-active primary volume, and at the same time receive the second data feedback result of the active-active secondary volume.

[0044] According to one embodiment of the present invention, a preset snapshot module is used to read target data in a first snapshot volume corresponding to an active-active primary volume, and the target data is rolled back to the active-active primary volume to obtain a first data feedback result of the active-active primary volume, while simultaneously receiving a second data feedback result of the active-active secondary volume, including: using a preset snapshot module to read target data corresponding to a first bit in a first snapshot bitmap in a first snapshot volume corresponding to the active-active primary volume, and rolling back the target data corresponding to the first bit in the first snapshot bitmap to the active-active primary volume to obtain the first data feedback result of the active-active primary volume; while simultaneously receiving the second data feedback result of the active-active secondary volume, wherein the second data feedback result includes reading target data corresponding to a first bit in a second snapshot bitmap in a second snapshot volume corresponding to the active-active secondary volume, and rolling back the target data corresponding to the first bit in the second snapshot bitmap to the active-active secondary volume.

[0045] Specifically, if Figure 6 and Figure 7 As shown, when the active-active primary volume and the active-active secondary volume need to roll back data, it is first necessary to use the preset snapshot module to read the corresponding target data (for example, A) in the first snapshot volume corresponding to the active-active primary volume, and roll back the target data A to the active-active primary volume to obtain the first data feedback result of the active-active primary volume; at this time, the preset snapshot module will also read the corresponding target data (for example, A) in the second snapshot volume corresponding to the active-active secondary volume, and roll back the target data A to the active-active secondary volume to obtain the second data feedback result of the active-active secondary volume, and feed back the second data feedback result to the active-active module of the active-active primary volume.

[0046] Optionally, in an embodiment of the present application, under the premise of ensuring the eventual consistency of data, the rollback operations of the primary active-active volume and the active-active auxiliary volume can also be allowed to be executed asynchronously within a certain range to improve the rollback speed and system performance. For example, an "eventual consistency" mode is introduced, and a successful data feedback result can be returned after the active-active primary volume completes the rollback, and the asynchronous rollback task of the active-active auxiliary volume is started at the same time. At this time, the system monitors the rollback progress of the active-active primary volume through the heartbeat and status synchronization mechanism to ensure that it is finally completed.

[0047] Therefore, by synchronously rolling back data from their respective snapshot volumes to the primary and secondary volumes, the data at both sites is ensured to be consistent throughout the rollback operation, maintaining active-active high availability and ensuring that no data is lost during the rollback process even in the event of a site-level catastrophic failure.

[0048] In step S304, a data rollback result is obtained based on the first data feedback result and the second data feedback result. When the data rollback result meets the preset rollback stop condition, the first snapshot data of the active-active primary volume and the second snapshot data of the active-active secondary volume are obtained.

[0049] The preset rollback stop condition can be set by those skilled in the art according to actual snapshot storage requirements and is not specifically limited here.

[0050] Specifically, when the active-active module of the active-active primary volume receives the second data feedback result of the active-active auxiliary volume, it needs to judge the second data feedback result. If it is identified that the data rollback of the active-active auxiliary 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.

[0051] According to one embodiment of the present invention, after obtaining the data rollback result based on the first data feedback result and the second data feedback result, it also includes: updating the data rollback progress of the active-active primary volume and the data rollback progress of the active-active auxiliary volume, and judging whether both the active-active primary volume and the active-active auxiliary volume have completed the full rollback; if the active-active primary volume or the active-active auxiliary volume has not completed the full rollback, judging whether the active-active primary volume and the active-active auxiliary volume continue to execute the data rollback step; if the active-active primary volume and the active-active auxiliary volume continue to execute the data rollback step, continuing to execute the step of reading the target data in the first snapshot volume corresponding to the active-active primary volume using the preset snapshot module, until the updated data rollback progress of the active-active primary volume and the data rollback progress of the active-active auxiliary volume meet the preset stop rollback condition, and then stopping the data rollback.

[0052] According to one embodiment of the present invention, after determining whether the active-active primary volume and the active-active secondary volume continue to execute the data rollback step, the process further includes: if the active-active primary volume and the active-active secondary volume stop executing the data rollback step, directly updating the data rollback progress of the active-active primary volume and the data rollback progress of the active-active secondary volume.

[0053] According to an embodiment of the present invention, after determining whether both the active-active primary volume and the active-active secondary volume have completed full rollback, the method further includes: directly stopping data rollback if both the active-active primary volume and the active-active secondary volume have completed full rollback.

[0054] Specifically, if Figure 7As shown, the system continues to determine whether both the active-active primary volume and the active-active secondary volume have completed the full rollback. If the active-active primary volume or the active-active secondary volume has not completed the full rollback, it is further determined whether the active-active primary volume and the active-active secondary volume need to continue the data rollback step. If the active-active primary volume and the active-active secondary volume need to continue the data rollback step, the system continues to execute the step of reading the target data from the first snapshot volume corresponding to the active-active primary volume using the preset snapshot module. That is, the system checks the second bits (i.e., bit 1) of the first snapshot bitmap and the second snapshot bitmap. If the values ​​of the corresponding positions of the second bits of the first snapshot bitmap and the second snapshot bitmap are still 1, the system continues to read the corresponding target data from the first snapshot volume corresponding to the active-active primary volume using the preset snapshot module, and sends a first data rollback instruction to the active-active primary volume. After the active-active module of the active-active primary volume receives the first data rollback instruction, it generates a second data rollback instruction for the active-active secondary volume and sends the second data rollback instruction to the active-active secondary volume. The specific rollback process has been described in detail above and is not described in detail here to avoid redundancy.

[0055] Furthermore, if the active-active primary volume and the active-active secondary volume stop executing the data rollback step, the data rollback progress of the active-active primary volume and the data rollback progress of the active-active secondary volume can be directly updated at this time. That is, if the value of the corresponding position of the second bit of the first snapshot bitmap and the second snapshot bitmap is 0 (indicating that the data block is consistent between the snapshot source volume and the current volume), there is no need to roll back the data at this time, skip the data block, and directly increase and update the rollback progress. Then, the preset snapshot module will continue the above detection process until all bits in the first snapshot bitmap and the second snapshot bitmap are traversed. At this time, it means that the data rollback result meets the preset stop rollback condition, that is, the data rollback operation of the entire volume is completed, and finally the first snapshot data of the active-active primary volume and the second snapshot data of the active-active secondary volume can be obtained, that is, the data of the active-active primary volume and the active-active secondary volume will be restored to the state at the time of snapshot creation, and after the data rollback is completed, the data write operation to the active-active volume can be reopened to resume normal business processes.

[0056] Therefore, through the data rollback process described above, high availability of the active-active volume can be achieved when rolling back data. That is, when any site fails, user data will not be lost. For example, when data A is rolled back, the primary site of the active-active primary volume fails, and the secondary site of the active-active secondary volume still maintains a complete snapshot data.

[0057] In summary, based on the discussion of the above embodiments, the present invention can achieve the following beneficial effects: (1) The present invention ensures that the data of the active-active primary volume and the active-active secondary volume remain consistent throughout the entire rollback operation through the mechanism of synchronous snapshot creation and synchronous rollback. This means that even during the rollback, the system still has the high availability characteristics of active-active. (2) The rollback operation of the present invention is performed synchronously on both the primary and secondary sites through a dual-write mechanism. Each data write (rollback) requires the success of both sites simultaneously. Therefore, even if a catastrophic failure (such as power outage or fire) occurs at one site during the rollback process, the other site will have fully preserved the rolled-back data, achieving zero data loss. (3) The present invention uses the "copy-on-write" mechanism and bitmap management to accurately control which data blocks need to be copied from the snapshot volume to the active-active primary volume and the active-active secondary volume. It also uses the dual-write and feedback confirmation mechanism to ensure that every write operation to the active-active primary volume and the active-active secondary volume is synchronized and confirmed, thereby ensuring a high degree of data consistency between the primary and secondary volumes.

[0058] According to the rollback method for active-active high-availability snapshots proposed in an embodiment of the present invention, upon receiving a first data rollback instruction for the active-active primary volume, a second data rollback instruction for the active-active secondary volume is generated and sent to the active-active secondary volume. A preset snapshot module is used to read the target data from the first snapshot volume corresponding to the active-active primary volume, and the data is rolled back to the active-active primary volume accordingly, obtaining a first data feedback result. Simultaneously, a second data feedback result for the active-active secondary volume is received. A data rollback result is obtained based on the first and second data feedback results, and when the data rollback result meets a preset stop-rollback condition, the first snapshot data and the second snapshot data are obtained. This solves the problem of data loss caused by a site failure during a snapshot rollback. By creating a highly available snapshot, writing data, and rolling back the process, the data volume can maintain active-active synchronization during a snapshot rollback, thereby avoiding data loss due to a site failure.

[0059] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0060] An embodiment of the present invention also provides a rollback device for active-active high-availability snapshots.

[0061] Figure 8 This is a block diagram of an exemplary device for rolling back an active-active high-availability snapshot according to an embodiment of the present invention.

[0062] like Figure 8 As shown, the rollback device 10 for active-active high-availability snapshot includes: a judgment module 100 , a generation module 200 , a receiving module 300 and an acquisition module 400 .

[0063] The judgment module 100 is used to judge whether a first data rollback instruction of the active-active primary volume is received; The generation module 200 is configured to, upon receiving a first data rollback instruction of the active-active primary volume, generate a second data rollback instruction of the active-active secondary volume based on the first data rollback instruction, and send the second data rollback instruction to the active-active secondary volume; The receiving module 300 is configured to use a preset snapshot module to read target data from a first snapshot volume corresponding to the active-active primary volume, roll back the target data to the active-active primary volume, obtain a first data feedback result for the active-active primary volume, and simultaneously receive a second data feedback result for the active-active secondary volume. The acquisition 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 the first snapshot data of the active-active primary volume and the second snapshot data of the active-active secondary volume when the data rollback result meets a preset rollback stop condition.

[0064] According to one embodiment of the present invention, before determining whether a first data rollback instruction of the active-active primary volume is received, the determination module 100 further includes: The first judgment unit is configured to judge whether the data rollback progress of the active-active primary volume is at a first target progress, and whether the data rollback progress of the active-active secondary volume is at a second target progress; The identification unit is configured to identify a first bit of a first snapshot bitmap corresponding to the active-active primary volume if the data rollback progress of the active-active primary volume is a first target progress and a second target progress, and when the first bit is a first target value, use a preset snapshot module to read target data corresponding to the first bit in the first snapshot volume corresponding to the active-active primary volume, and send a first data rollback instruction to the active-active primary volume.

[0065] According to one embodiment of the present invention, before determining whether the data rollback progress of the active-active primary volume is at the first target progress and whether the data rollback progress of the active-active secondary volume is at the second target progress, the determining unit further includes: A creation subunit is used to create a first snapshot volume and a first snapshot bitmap corresponding to the active-active primary volume, and simultaneously create a second snapshot volume and a second snapshot bitmap corresponding to the active-active secondary volume; The control subunit is configured to determine whether a data write instruction has been received. If a data write instruction has been received, the control subunit controls the active-active primary volume to perform a data write operation based on the data write instruction, generates a third data feedback result, simultaneously sends the data write instruction to the active-active secondary volume, and receives a fourth data feedback result from the active-active secondary volume. a judgment subunit, configured to judge whether the write operation on both the active-active primary volume and the active-active secondary volume is completed based on the third data feedback result and the third data feedback result; The generation subunit is used to generate a final feedback result if the write operation is completed on both the active-active primary volume and the active-active secondary volume.

[0066] According to one embodiment of the present invention, the control subunit includes: A judgment sub-component, used to judge whether the first bit of the first snapshot bitmap corresponding to the active-active primary volume is the second target value; The control component is configured to control the active-active primary volume to perform a data write operation based on the data write instruction if the first bit of the first snapshot bitmap is the second target value.

[0067] According to one embodiment of the present invention, the receiving module 300 includes: The rollback unit is configured to read target data corresponding to a first bit in a first snapshot bitmap in a first snapshot volume corresponding to the active-active primary volume using a preset snapshot module, and roll back the target data corresponding to the first bit in the first snapshot bitmap to the active-active primary volume to obtain a first data feedback result of the active-active primary volume; A receiving unit is used to simultaneously receive a second data feedback result of the active-active auxiliary volume, wherein the second data feedback result includes reading target data corresponding to a first bit in a second snapshot bitmap in a second snapshot volume corresponding to the active-active auxiliary volume, and rolling back the target data corresponding to the first bit in the second snapshot bitmap to the active-active auxiliary volume.

[0068] According to one embodiment of the present invention, after obtaining the data rollback result based on the first data feedback result and the second data feedback result, the acquisition module 400 further includes: An update unit, configured to update the data rollback progress of the active-active primary volume and the active-active secondary volume, and determine whether the rollback of both the active-active primary volume and the active-active secondary volume has been completed; The second judgment unit is configured to judge whether the active-active primary volume or the active-active secondary volume should continue to perform the data rollback step if the rollback has not been completed in full. The execution unit is configured to, if the active-active primary volume and the active-active secondary volume continue to execute the data rollback step, continue to execute the step of reading target data from the first snapshot volume corresponding to the active-active primary volume using a preset snapshot module until the updated data rollback progress of the active-active primary volume and the updated data rollback progress of the active-active secondary volume meet a preset rollback stop condition, and then stop the data rollback.

[0069] According to one embodiment of the present invention, after determining whether the active-active primary volume and the active-active secondary volume continue to perform the data rollback step, the second determination unit further includes: The update subunit is configured to directly update the data rollback progress of the active-active primary volume and the data rollback progress of the active-active secondary volume if the active-active primary volume and the active-active secondary volume stop executing the data rollback step.

[0070] According to one embodiment of the present invention, after determining whether both the active-active primary volume and the active-active secondary volume have completed full rollback, the updating unit further includes: The rollback stop unit is used to directly stop data rollback if both the active-active primary volume and the active-active secondary volume have completed the rollback.

[0071] According to one embodiment of the present invention, the first target value is 1 and the second target value is 0.

[0072] In summary, the description of the features in the embodiment corresponding to the rollback device of the active-active high-availability snapshot can be found in the relevant description of the embodiment corresponding to the rollback method of the active-active high-availability snapshot, which will not be repeated here.

[0073] An embodiment of the present invention further provides an electronic device, which may include: A memory 901 , a processor 902 , and a computer program stored in the memory 901 and executable on the processor 902 .

[0074] When the processor 902 executes the program, the rollback method of the active-active high-availability snapshot provided in the above embodiment is implemented.

[0075] Furthermore, the electronic device further includes: The communication interface 903 is used for communication between the memory 901 and the processor 902 .

[0076] The memory 901 is used to store computer programs that can be run on the processor 902 .

[0077] The memory 901 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0078] If the memory 901, processor 902, and communication interface 903 are implemented independently, the communication interface 903, memory 901, and processor 902 can be interconnected via a bus and communicate with 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. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0079] 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 communicate with each other through an internal interface.

[0080] The processor 902 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.

[0081] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above-mentioned active-active high-availability snapshot rollback method embodiments when running.

[0082] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0083] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned active-active high-availability snapshot rollback method embodiments are implemented.

[0084] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0085] The above is a detailed introduction to the rollback method for active-active high-availability snapshots provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only intended to help understand the method and core ideas of the present invention. It should be noted that, for those skilled in the art, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A rollback method for active-active high-availability snapshots, characterized in that: include: Determining whether a first data rollback instruction of the active-active primary volume is received; If a first data rollback instruction of the active-active primary volume is received, generating a second data rollback instruction of the active-active secondary volume based on the first data rollback instruction, and sending the second data rollback instruction to the active-active secondary volume; Using a preset snapshot module, read target data from a first snapshot volume corresponding to the active-active primary volume, roll back the target data to the active-active primary volume, obtain a first data feedback result of the active-active primary volume, and simultaneously receive a second data feedback result of the active-active secondary volume; A data rollback result is obtained based on the first data feedback result and the second data feedback result. When the data rollback result meets a preset rollback stop condition, first snapshot data of the active-active primary volume and second snapshot data of the active-active secondary volume are obtained.

2. The rollback method of active-active high-availability snapshot according to claim 1, characterized in that: Before determining whether a first data rollback instruction of the active-active primary volume is received, the method further includes: Determine whether the data rollback progress of the active-active primary volume is at the first target progress, and whether the data rollback progress of the active-active secondary volume is at the second target progress; If the data rollback progress of the active-active primary volume is the first target progress, and the data rollback progress of the active-active secondary volume is the second target progress, a first bit of a first snapshot bitmap corresponding to the active-active primary volume is identified, and when the first bit is a first target value, the preset snapshot module is used to read target data corresponding to the first bit in a first snapshot volume corresponding to the active-active primary volume, and the first data rollback instruction is sent to the active-active primary volume.

3. The rollback method of active-active high-availability snapshot according to claim 2, characterized in that: Before determining whether the data rollback progress of the active-active primary volume is at the first target progress and whether the data rollback progress of the active-active secondary volume is at the second target progress, the method further includes: Creating a corresponding first snapshot volume and a first snapshot bitmap for the active-active primary volume, and creating a corresponding second snapshot volume and a second snapshot bitmap for the active-active secondary volume; Determining whether a data write instruction has been received; if so, controlling the active-active primary volume to perform a data write operation based on the data write instruction, generating a third data feedback result, simultaneously sending the data write instruction to the active-active secondary volume, and receiving a fourth data feedback result from the active-active secondary volume; Determining whether both the active-active primary volume and the active-active secondary volume have completed write operations based on the third data feedback result and the third data feedback result; If the write operation is completed on both the active-active primary volume and the active-active secondary volume, a final feedback result is generated.

4. The rollback method of active-active high-availability snapshot according to claim 3, characterized in that: The controlling the active-active primary volume to perform a data write operation based on the data write instruction includes: Determining whether a first bit of a first snapshot bitmap corresponding to the active-active primary volume is a second target value; If the first bit of the first snapshot bitmap is the second target value, the active-active primary volume is controlled to perform a data write operation based on the data write instruction.

5. The rollback method of active-active high-availability snapshot according to claim 1, characterized in that: The method of using a preset snapshot module to read target data from a first snapshot volume corresponding to the active-active primary volume, rolling back the target data to the active-active primary volume, obtaining a first data feedback result of the active-active primary volume, and simultaneously receiving a second data feedback result of the active-active secondary volume includes: Using the preset snapshot module, read target data corresponding to a first bit in a first snapshot bitmap in a first snapshot volume corresponding to the active-active primary volume, and roll back the target data corresponding to the first bit in the first snapshot bitmap to the active-active primary volume, thereby obtaining a first data feedback result of the active-active primary volume; At the same time, a second data feedback result of the active-active auxiliary volume is received, wherein the second data feedback result includes reading target data corresponding to the first bit in the second snapshot bitmap in the second snapshot volume corresponding to the active-active auxiliary volume, and rolling back the target data corresponding to the first bit in the second snapshot bitmap to the active-active auxiliary volume.

6. The rollback method of active-active high-availability snapshot according to claim 1, characterized in that: After obtaining a data rollback result based on the first data feedback result and the second data feedback result, the method further includes: Updating the data rollback progress of the active-active primary volume and the data rollback progress of the active-active secondary volume, and determining whether the rollback of both the active-active primary volume and the active-active secondary volume has been completed; If the active-active primary volume or the active-active secondary volume has not completed the rollback, determining whether the active-active primary volume and the active-active secondary volume should continue to perform the data rollback step; If the active-active primary volume and the active-active secondary volume continue to execute the data rollback step, the step of using the preset snapshot module to read the target data from the first snapshot volume corresponding to the active-active primary volume continues to be executed until the updated data rollback progress of the active-active primary volume and the data rollback progress of the active-active secondary volume meet the preset stop rollback condition, and then the data rollback is stopped.

7. The rollback method of active-active high-availability snapshot according to claim 6, characterized in that: After determining whether the active-active primary volume and the active-active secondary volume continue to perform the data rollback step, the method further includes: If the active-active primary volume and the active-active secondary volume stop executing the data rollback step, the data rollback progress of the active-active primary volume and the data rollback progress of the active-active secondary volume are directly updated.

8. The rollback method of active-active high-availability snapshot according to claim 6, characterized in that: After determining whether the dual-active primary volume and the dual-active secondary volume have both completed the rollback, the method further includes: If the rollback of both the active-active primary volume and the active-active secondary volume is complete, the data rollback is stopped directly.

9. The rollback method of active-active high-availability snapshot according to claim 2 or 4, characterized in that: The first target value is 1, and the second target value is 0.

10. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the rollback method for active-active high-availability snapshots according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Implementation method of multi-machine backup

    CN106850255A

  • Snapshot rollback method and device, equipment and storage medium

    CN110658993A

  • Active-active implementation method and device for database

    CN111352766A

  • Data backup method, device and system and computer readable storage medium

    CN111400097A

  • Data rollback updating method and device, computer equipment and storage medium

    CN112416860A