Mirror image volume data synchronization method and system, electronic equipment and storage medium
By obtaining application scenario information and read and write frequency in the mirror volume, determining the synchronization strategy and algebraic values, and synchronizing the recent snapshot data to the auxiliary space, the problem of reducing high availability of the mirror volume is solved, and data integrity and availability of the main space and the auxiliary space are achieved.
Patent Information
- Application Number
- CN202510824425.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-06-19
AI Technical Summary
In the prior art, the multi-generation snapshot data before the latest data is lost after the secondary space failure recovery, resulting in a reduced high availability of the mirror volume.
By obtaining the application scenario information of the mirror volume, determining the target synchronization strategy, and determining the target synchronization algebra value based on the read and write frequency information, positioning the most recent snapshot data of the corresponding algebra in the main space, synchronizing it to the auxiliary space, ensuring that both the main space and the auxiliary space retain complete historical snapshot data.
Improves the high availability of mirrored volumes, and even if the main space fails, the secondary space can provide historical snapshot data, enhancing the availability and integrity of the data.
Smart Images

Figure CN120353768A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technologies, and in particular, to a method, a system, an electronic device, and a storage medium for mirror volume data synchronization. Background Art
[0002] Currently, in order to achieve high data availability of a data volume, an ordinary data volume is often converted into a mirror volume. The mirror volume externally maps to a single volume for the host. There are two volume storage spaces in the underlying storage pool, namely a primary space and a secondary space. Data is synchronized between the primary space and the secondary space. When the primary space fails, the secondary space provides services externally as the primary space.
[0003] In related technologies, taking the example of the secondary space resuming online after a failure, usually only the latest data of the primary space during the failure recovery period of the secondary space is synchronized. During this period, the primary space usually saves multiple generations of snapshot data based on Continuous Data Protection (CDP for short). As a result, the re - online secondary space may lose multiple generations of snapshot data before the latest data. If the primary space fails later and the secondary space provides services externally as the primary space, this secondary space will be unable to provide these generations of snapshot data due to data loss, reducing the high availability of the mirror volume. Summary of the Invention
[0004] The present application provides a method, a system, an electronic device, and a storage medium for mirror volume data synchronization to at least solve the problem of reducing the high availability of the mirror volume in related technologies.
[0005] The present application provides a method for mirror volume data synchronization, including: Obtaining application scenario information of the mirror volume; wherein, the application scenario information at least includes service information; Determining a target synchronization policy of the mirror volume according to the application scenario information of the mirror volume; When the target synchronization policy is partial synchronization, determining read - write frequency information of the mirror volume according to the service information; Determining a target synchronization generation value according to the read - write frequency information of the mirror volume; Locating the nearest snapshot data of the corresponding generation in the primary space according to the target synchronization generation value, and using the nearest snapshot data of the corresponding generation as the data to be synchronized; Synchronizing the data to be synchronized to the secondary space; Wherein, the mirror volume includes a primary space and a secondary space.
[0006] The present application further provides a mirror volume data synchronization device, including: An obtaining module, configured to obtain application scenario information of the mirror volume; wherein, the application scenario information at least includes service information; The first determination module is configured to determine the target synchronization policy of the mirror volume according to the application scenario information of the mirror volume; The second determination module is configured to determine the read-write frequency information of the mirror volume according to the service information when the target synchronization policy is partial synchronization; The third determination module is configured to determine the target synchronization generation value according to the read-write frequency information of the mirror volume; The first synchronization module is configured to locate the nearest snapshot data of the corresponding generation in the main space according to the target synchronization generation value, and use the nearest snapshot data of the corresponding generation as the data to be synchronized; The second synchronization module is configured to synchronize the data to be synchronized to the secondary space; Wherein, the mirror volume includes a main space and a secondary space.
[0007] The present application further provides a mirror volume data synchronization system, including: a main space, a secondary space, and a mirror volume data synchronization device; The main space and the secondary space belong to different storage pools; The main space is used to store snapshot data; The secondary space is used to synchronously store the snapshot data stored in the main space; The mirror volume data synchronization device synchronizes the data to be synchronized in the main space to the secondary space based on any of the above mirror volume data synchronization methods.
[0008] The present application further provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any of the above mirror volume data synchronization methods when executing the computer program.
[0009] The present application further provides a computer-readable storage medium, in which a computer program is stored, and wherein the computer program implements the steps of any of the above mirror volume data synchronization methods when executed by a processor.
[0010] The present application further provides a computer program product, including a computer program, and the computer program implements the steps of any of the above mirror volume data synchronization methods when executed by a processor.
[0011] Through the present application, since the target synchronization generation value matching the application scenario information of the mirror volume is determined, and according to the target synchronization generation value, the nearest snapshot data of the corresponding generation is located in the main space, so as to use the nearest snapshot data of the corresponding generation as the data to be synchronized, and finally the data to be synchronized is synchronized to the secondary space, so that both the main space and the secondary space of the mirror volume retain complete historical snapshot data. Even if the main space fails, the secondary space can provide historical snapshot data, improving the high availability of the mirror volume. Description of the Drawings
[0012] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0013] Figure 1 Schematic diagram of the network structure based on the embodiments of the present application; Figure 2 Schematic flowchart of the mirror volume data synchronization method provided by the embodiments of the present application; Figure 3 Schematic diagram of the data structure of a mirror volume provided by the embodiments of the present application; Figure 4 Schematic diagram of the data structure of another mirror volume provided by the embodiments of the present application; Figure 5 Schematic diagram of the data structure of yet another mirror volume provided by the embodiments of the present application; Figure 6 Schematic diagram of the structure of the mirror volume data synchronization device provided by the embodiments of the present application; Figure 7 Schematic diagram of the structure of the mirror volume data synchronization system provided by the embodiments of the present application; Figure 8 Schematic diagram of the structure of the electronic device provided by the embodiments of the present application. Detailed implementation manners
[0014] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present application.
[0015] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0016] CDP is a data protection technology. By adding a record similar to a timestamp (generation id, gen_id) to each IO of the volume, it is used to record which generation of snapshot relationship each IO belongs to. In this way, the data corresponding to the CDP snapshots taken at different times for the volume all belong to the volume itself. In the underlying storage space of the volume, data at the same location at different times is distinguished by gen_id, and old data is not considered invalid and recycled. Compared with traditional non-CDP snapshots, CDP snapshots do not need to generate an additional target volume. Only by using gen_id can the data of a certain generation of snapshots be quickly found, omitting the data replication process of the traditional snapshot's Copy On Write (COW). This means that the performance of CDP snapshots is almost lossless, and the data protection is stronger, and it can even restore data to almost any past time point.
[0017] For example, for a volume, when no CDP snapshot is created, the gen_id values of all IOs are 0. After creating a CDP snapshot, this snapshot is the 0th generation snapshot, and the corresponding data is all the data of the source volume with gen_id being 0. After the snapshot is created, the gen_id of the source volume will be incremented by 1, that is, the gen_id of subsequent IOs becomes 1. Take another CDP snapshot, then this new CDP snapshot is the 1st generation snapshot, and then gen_id will be incremented by 1 again, and the gen_id of the subsequent IOs becomes 2, and so on. Since the host IOs are not uniform, some positions on the source volume may often receive IOs, and some positions may have fewer IOs. Therefore, the gen_id of each position is not equal. After multiple rounds of CDP snapshots, the gen_id in the hot area is often very large or directly the number of snapshots, and the gen_id in the cold area may hardly change. When reading an IO of the source volume, just read the data with the largest gen_id at each position, which is the latest data; when reading the data of a certain generation of CDP snapshots, the gen_id needs to be specified. If the id exists in this area, directly read the corresponding data. If it does not exist, then check whether gen_id - 1 exists, and keep looking forward until the data is found. The data found is the data corresponding to the specified gen_id.
[0018] The mirror volume technology is a data high-availability technology. For an ordinary volume, what is externally mapped to the host is one volume. Similarly, there is only one volume storage space in the underlying storage pool, and all the data written to this volume is in a single copy. When the storage space of the storage pool where this volume is located fails (for example, the RAID in the storage pool fails due to software reasons and cannot provide services, or the hard disks that make up the RAID fail due to hardware reasons and the number of failed disks exceeds the tolerance of the RAID), it will cause this volume and even all the volumes in the entire storage pool to become unusable. Even if the corresponding errors cannot be repaired, the business data in these volumes cannot be recovered. The mirror volume technology, however, provides an additional guarantee for the data in the volume. For a mirror volume, what is externally mapped to the host is also one volume, but there are two volume storage spaces in the underlying storage pool. When a write I / O reaches the mirror volume module, this module will copy an identical copy of the data and write it into the two storage spaces respectively. This is the so-called mirror volume double-write mode. When reading data, it only needs to be read from one of the storage spaces because the two copies of data are identical. And when creating a mirror volume, it is generally recommended to create the two storage spaces in two different storage pools. In this way, when one of the storage spaces fails, the original data can still be obtained from the other space, and even if the failed space cannot be recovered, it will not cause the loss of the business data of this volume. And if the failed space is restored, the thin volume module will also provide a data resynchronization function, copying the differential data written during the failure period from the good space to the newly restored space. When the differential data synchronization is completed, the data high-availability function can be continued to be guaranteed.
[0019] In the mirror volume function in the related technology, when converting an ordinary volume into a mirror volume, initial data synchronization is required. That is, after executing the command to convert to a mirror volume, an additional storage space of the same size will be allocated in the specified storage pool (the original storage space is called the primary space, and the newly created space is called the secondary space), and a bitmap space will be allocated for this volume in the memory. Each bit of this bitmap manages a fixed-size position of this volume, and each fixed-size data block is called a grain, generally with a size of 256 KB. Initially, all bits of the entire bitmap will be assigned a value of 1, and then starting from the beginning position of the volume, data will be copied from the primary space to the newly created secondary space in grains. And after each position is copied, the bit corresponding to this position in the bitmap will be changed to 0, indicating that the data at this position already has two copies. When the entire bitmap becomes 0, it is considered that the entire mirror volume already has the high-availability function. During the initial synchronization of the mirrored volume, if there is an IO write to the mirrored volume, when the IO reaches the mirrored volume module, it will first read the value of the corresponding bit at that position. When the value is 0, it indicates that the data synchronization at that position has been completed, and then the IO needs to perform double writing. Here, the mirrored volume module will copy an identical data, and then write the two identical data into two storage spaces respectively; if the corresponding bit is 1, it indicates that the data synchronization at that position has not been completed. At this time, the data to be written only needs to be written into the original storage space (i.e., the primary space), and then when the initial synchronization task processes this position, the latest data will be copied to the newly created storage space (i.e., the secondary space). In this way, it can be ensured that the original volume can also normally receive service IOs during the initial synchronization, and after the initial synchronization is completed, the data in the two storage spaces is also the latest and the same.
[0020] When one of the storage spaces fails, the remaining storage space will be switched to the primary space, and the failed space will be switched to the secondary space. At this time, both reads and writes only access the primary space. And when the data at a certain position in the primary space changes, the corresponding bit in the bitmap will be modified from 0 to 1 to mark that the position is different in the two storage spaces.
[0021] When the other storage space resumes, the mirrored volume module will perform data resynchronization according to the values in the bitmap, and resynchronize the latest data at the positions marked as 1 in the primary bitmap to the secondary. Similarly, the bit will be changed to 0 after each position is synchronized. And host IOs can also be normally processed during the resynchronization, and its logic is the same as the initial synchronization. When the bitmap becomes all 0 again, the mirrored volume resumes the highly available state.
[0022] When rolling back an existing mirrored volume, the mirrored volume technology in the related art only synchronizes the latest data of the original volume to the newly added second storage space. If multiple CDPs have been created for the original volume, only the latest generation of data in the primary will be received in the secondary space, and the data in all CDPs will not be synchronized to the secondary. At this time, if the primary space fails and the original secondary is switched to the primary, the mirrored volume at this time cannot provide the data of the existing CDPs before. Taking the example of the secondary space being restored and going online again after a failure, usually only the latest data in the primary space during the restoration of the secondary space failure is synchronized. During this period, the primary space usually saves multiple generations of snapshot data based on Continuous Data Protection (CDP). As a result, the re - online secondary space may lose multiple generations of snapshot data before the latest data. Subsequently, if the primary space fails and the secondary space provides services externally as the primary space, this secondary space will be unable to provide these generations of snapshot data due to data loss, reducing the high availability of the mirrored volume.
[0023] In order to solve the above - mentioned technical problems, the embodiments of the present application provide a mirrored volume data synchronization method, system, electronic device, and storage medium. The method includes: obtaining the application scenario information of the mirrored volume; where the application scenario information includes at least service information; determining the target synchronization policy of the mirrored volume according to the application scenario information of the mirrored volume; in the case where the target synchronization policy is partial synchronization, determining the read - write frequency information of the mirrored volume according to the service information; determining the target synchronization generation value according to the read - write frequency information of the mirrored volume; locating the nearest snapshot data of the corresponding generation in the primary space according to the target synchronization generation value, and using the nearest snapshot data of the corresponding generation as the data to be synchronized; synchronizing the data to be synchronized to the secondary space; where the mirrored volume includes a primary space and a secondary space. The method provided by the above solution determines the target synchronization generation value that matches the application scenario information of the mirrored volume, locates the nearest snapshot data of the corresponding generation in the primary space according to the target synchronization generation value, uses the nearest snapshot data of the corresponding generation as the data to be synchronized, and finally synchronizes the data to be synchronized to the secondary space, so that both the primary space and the secondary space of the mirrored volume retain complete historical snapshot data. Even if the primary space fails, the secondary space can provide historical snapshot data, improving the high availability of the mirrored volume.
[0024] In order to enable those skilled in the art of this technical field to better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the mirrored volume data synchronization method depends, the specific application environment architecture or specific hardware architecture is described herein.
[0026] First, the network structure on which this application is based will be described: The mirror volume data synchronization method, system, electronic device, and storage medium provided in the embodiments of this application are applicable to the primary-secondary space synchronization of snapshot data of a mirror volume. As Figure 1 shown, it is a schematic diagram of the network structure based on the embodiments of this application, mainly including a client and a host. The host is used to send service requests to the host to perform data reading and writing operations on the storage device in the host. When the host responds to the data reading and writing operations initiated by the client, it performs CDP snapshot processing on the storage device and obtains the CDP snapshot based on mirror volume management. The host performs primary-secondary space synchronization of the mirror volume snapshot data based on the mirror volume data synchronization method provided in the embodiments of this application.
[0027] The embodiments of this application provide a mirror volume data synchronization method for primary-secondary space synchronization of snapshot data of a mirror volume. The execution subject of the embodiments of this application is an electronic device, such as a server, desktop computer, laptop computer, tablet computer, and other electronic devices that can be used for mirror volume data synchronization.
[0028] As Figure 2 shown, it is a flowchart of the mirror volume data synchronization method provided in the embodiments of this application. The method includes: Step 201, obtain the application scenario information of the mirror volume.
[0029] Among them, the application scenario information at least includes service information. The service information at least includes service type, creation frequency of snapshot data, and initiation situation of user read-write requests.
[0030] Step 202, determine the target synchronization policy of the mirror volume according to the application scenario information of the mirror volume.
[0031] Among them, the target synchronization policy is at least divided into three types: partial synchronization, full synchronization, and latest synchronization.
[0032] Specifically, in one embodiment, the protection requirements of the user for the historical snapshot data of the mirror volume can be determined according to the application scenario information of the mirror volume; and the target synchronization policy of the mirror volume can be determined according to the protection requirements of the user for the historical snapshot data of the mirror volume.
[0033] Specifically, in the application scenario information of the mirror volume, it is characterized as a scenario with extremely high requirements for high availability and historical data protection. When a certain storage space fails, the other storage space still needs to be able to restore the data at any historical CDP moment. Then, it is determined that the user's requirement for historical snapshot data protection of the mirror volume is a high requirement, and the target synchronization policy of the mirror volume is full synchronization. In the application scenario information of the mirror volume, it is characterized that the user has set a timed CDP policy. For example, a CDP snapshot is automatically taken for the volume every 1 day, and the data is regularly checked every week for tampering. At this time, it is considered that snapshots older than one week are generally less important, and only retaining the snapshots of the most recent week can meet the requirements of historical data protection. Therefore, it is determined that the user's requirement for historical snapshot data protection of the mirror volume is a general requirement, and the target synchronization policy of the mirror volume is partial synchronization. In the application scenario information of the mirror volume, it is characterized as a scenario that pays more attention to the high-availability function of the data, and the loss of snapshot data is not a big deal. It is determined that the user's requirement for historical snapshot data protection of the mirror volume is a low requirement, and the target synchronization policy of the mirror volume is the latest synchronization.
[0034] Step 203, in the case where the target synchronization policy is partial synchronization, determine the read / write frequency information of the mirror volume according to the service information.
[0035] Specifically, the read / write frequency information of the mirror volume can be determined according to the initiation situation of the user's read / write requests characterized by the service information. Among them, the read / write frequency information at least characterizes whether the mirror volume has frequent write operations or frequent read operations.
[0036] Step 204, determine the target synchronization generation value according to the read / write frequency information of the mirror volume.
[0037] Specifically, in the case where the read / write frequency information of the mirror volume characterizes that the mirror volume has frequent write operations, a larger generation value can be selected as the target synchronization generation value. In the case where the read / write frequency information of the mirror volume characterizes that the mirror volume has frequent read operations, a smaller generation value can be selected as the target synchronization generation value.
[0038] Step 205, locate the nearest snapshot data of the corresponding generation in the main space according to the target synchronization generation value, and use the nearest snapshot data of the corresponding generation as the data to be synchronized.
[0039] Exemplarily, taking the target synchronization generation value as 5, the latest snapshot data (the 7th generation snapshot data) and the nearest 5 generations (the 6th generation to the 2nd generation) of snapshot data after the latest snapshot data are used as the data to be synchronized, that is, the first 6 generations of snapshot data are used as the data to be synchronized.
[0040] Step 206, synchronize the data to be synchronized to the secondary space.
[0041] Among them, the mirror volume includes a main space and a secondary space.
[0042] Specifically, the same data synchronization method as that in the initial synchronization stage of the mirror volume and the resynchronization stage after a failure recovery can be adopted to synchronize the data to be synchronized to the secondary space.
[0043] Exemplarily, as Figure 3 shown, it is a schematic diagram of the data structure of a mirror volume provided by an embodiment of the present application. In practical applications, the user can independently select the target synchronization generation value, that is, let the user himself select to synchronize only the latest several generations of data. In scenarios such as the initial synchronization of the mirror volume and the resynchronization after a failure recovery, only the data of the most recent n generations in the primary space will be synchronized to the secondary space. This function is mainly applicable to scenarios where data is regularly protected against tampering, but only recent data is concerned and data from a long time ago is not paid much attention to. For example, if the user sets a timed CDP policy, a CDP snapshot will be automatically taken for the volume every 1 day, but the data will be regularly checked for tampering every week. At this time, it is considered that snapshots more than one week old are generally not very important, and only the snapshots of the most recent week need to be retained to meet the requirements of data protection. Then, when the same requirement for high data availability is needed, when converting this volume into a mirror volume, only the CDP data (snapshot data) of the most recent 7 generations can be selected for synchronization. When a storage space fails, the other storage space can be restored to the data of the most recent 7 generations of CDP. When the target synchronization generation value n = 3, Figure 3 there are N CDP snapshots, corresponding to gen_id: 0 to N - 1 respectively, and the data of the Nth generation represents the latest data, and there is no corresponding CDP for this data in the secondary space. Therefore, when n = 3, the data of the 4 generations from N - 3 to N will be used as the data to be synchronized for copying (N - 3 to N - 1 are the data of 3 CDP (historical snapshot data), and N is the latest data).
[0044] It should be noted that the method provided by the embodiment of the present application is mainly applied to scenarios such as the initial synchronization of the mirror volume and the resynchronization after a failure recovery. In this scenario, the secondary space may lose multiple generations of snapshot data before the latest data. Based on the method provided by the embodiment of the present application, both the primary space and the secondary space of the mirror volume can retain complete historical snapshot data. Even if the primary space fails, the secondary space can provide historical snapshot data, improving the high availability of the mirror volume.
[0045] Based on the above embodiments, as an implementable manner, in one embodiment, when the target synchronization policy is partial synchronization, according to the service information, the read-write frequency information of the mirror volume is determined, including: Step 2031, when the target synchronization policy is partial synchronization, according to the service information, determine the number of write requests and read requests responded by the mirror volume within a fixed time period; Step 2032: Determine the read frequency and write frequency of the mirror volume based on the number of write requests and read requests responded by the mirror volume within a fixed time period.
[0046] Among them, the read-write frequency information includes at least the read frequency and the write frequency. The read frequency is the number of read requests per unit time, and the write frequency is the number of write requests per unit time.
[0047] It should be noted that the number of write requests reflects the activity of data changes, and the number of read requests reflects the access demand for historical data. High-frequency write scenarios require more frequent snapshot protection, while high-frequency read scenarios may be more dependent on the latest data.
[0048] Correspondingly, in one embodiment, the read frequency and write frequency of the mirror volume can be determined according to the read-write frequency information of the mirror volume; the target synchronization generation value can be determined according to the read frequency and write frequency of the mirror volume.
[0049] Among them, the target synchronization generation value is positively correlated with the write frequency and negatively correlated with the read frequency.
[0050] Specifically, for a business scenario with a low write frequency and a high read frequency, a smaller n value (such as n = 3) can be set to synchronize only the latest 3 generations of snapshot data, reducing the occupancy of redundant storage. For a business scenario with a high write frequency and a low read frequency, a larger n value (such as n = 10) can be set to retain more historical snapshot data to meet the frequent rollback requirements. By determining the target synchronization generation value according to the read-write frequency, while improving the high availability of the mirror volume, the utilization rate of storage resources is improved.
[0051] Specifically, in one embodiment, the read-write frequency is mapped to the value range of n through normalization processing, and at the same time, a business weight coefficient adjustment strategy bias is introduced. The specific calculation formula of the target synchronization generation value is as follows:
[0052] Among them, represents the target synchronization generation value, represents the preset minimum target synchronization generation value, represents the preset maximum target synchronization generation value, represents the read frequency of the mirror volume, represents the minimum write frequency of the current application scenario of the mirror volume, represents the maximum write frequency of the current application scenario of the mirror volume, represents the read frequency of the mirror volume, represents the minimum read frequency of the current application scenario of the mirror volume, represents the maximum read frequency of the current application scenario of the mirror volume, represents the influence coefficient of the read frequency on the target synchronization generation value.
[0053] Specifically, the target synchronization generation value is calculated based on the above formula. By converting the read / write frequency into a normalized value, the calculation deviation caused by the frequency unit or magnitude difference is avoided. And, through the influence coefficient the attenuation strength of the read frequency on the n value is controlled, so that the method provided by the embodiments of the present application can be adapted to the diverse business scenario requirements.
[0054] Based on the above embodiments, as an implementable manner, in one embodiment, synchronizing the data to be synchronized to the secondary space includes: Step 2061, dividing the data to be synchronized according to the generation of the data to be synchronized to obtain the data to be synchronized for each generation; Step 2062, synchronizing the data to be synchronized for each generation to the secondary space in the order of the generations.
[0055] It should be noted that for multiple generations of data at the same spatial position in the primary space, how to copy (synchronize) them to another storage space. There are two copy schemes. The first scheme is to copy based on the spatial position grain, that is, traverse the grain. For each grain, read the data of the 0th generation, 1st generation,..., nth generation in the grain respectively, and then write them into the target space (secondary space). Since the newly added storage space has not been used and there is no data on it, the generation of the written data only needs to be the same as the generation read from the original space, that is, the data of the 0th generation in the original space is written into the 0th generation of the target space, and the data of the nth generation in the original space is written into the nth generation of the target space. After all generations of data in the grain are copied, then process the next grain. The other scheme is to copy based on the generation, that is, first traverse the grain. For each grain, read the data of the 0th generation and write it into the 0th generation of the target space, and then process the 0th generation of the next grain. After all the data of the 0th generation in all grains are copied, then process the data of the 1st generation from the beginning, and so on.
[0056] Specifically, the embodiments of the present application choose to use Scheme 2 for the following reasons: (1) From the perspective of implementation logic, all data of the same generation in the same volume is ultimately managed by the storage pool module. In this module, data of different generations is managed in a tree structure. Data of each generation is in the same tree, and data of different generations is in different trees. Therefore, when using Solution 2, when a read I / O reaches the storage pool module, only the information of the tree corresponding to that generation needs to be read to obtain the relevant data of different grains. Because in the storage pool module, snapshot data of the same generation is generally stored centrally, that is, snapshot data storage trees of multiple grains belonging to the same generation are stored centrally. On the contrary, when using Solution 1, it is necessary to read all the trees corresponding to different generations to obtain data of different generations at the same location, which greatly increases the number of data reads and is less efficient. On the other hand, when writing data to the target space, the target space is also organized and managed by the storage pool module. Therefore, when writing data of the same generation centrally, multiple nodes are inserted into the same tree in the storage pool module. On the contrary, in Solution 1, it is necessary to process all the trees of all generations for each grain, which is also very inefficient.
[0057] (2) From the business level, if Solution 1 is used, after all data of all generations of all grains are synchronized, there will be a complete set of data of a certain generation in another storage space. If Solution 2 is used, after synchronizing the data of Generation 0, even if the data of subsequent generations is still in the synchronization process, there is actually already a set of available generation data in the target space. Although it is not the latest, it is a complete and available set of data. Even if the primary space fails at this time, historical data can actually be restored through the secondary space, and all data will not be lost.
[0058] Compared with Solution 1, Solution 2 also has its advantages, that is, the number of bitmap operations is small. Because after all data of all generations of the same grain are copied to the secondary space, the next grain is processed. Therefore, after a certain grain is processed, the corresponding position of the bitmap can be changed to 0, and the bitmap is operated as many times as there are grains. In Solution 2, after all grains of a certain generation of data are copied once, all grains of the next generation are copied. Therefore, the number of its bitmap operations is the number of grains multiplied by the number of generations. However, on the other hand, bitmap data is completely stored in memory, and the overhead of modifying values in memory can be completely ignored. Therefore, Solution 2 is still more advantageous than Solution 1.
[0059] Among them, the specific implementation steps of synchronizing the data to be synchronized in each generation to the secondary space according to the order of generations represented by Solution (2) are as follows: 1) During the initial synchronization phase of the mirrored volume, for an existing normal volume on which several CDPs have been created, if the user clicks the function button to convert the volume to a mirror, the user will be further prompted to select the target synchronization policy. If the user selects partial synchronization, the value of the target synchronization generation value n is determined. Only the data of the last n generations of CDPs in the original space will be in the new storage space of the finally generated mirrored volume; 2) After the user completes the previous step and clicks the OK button, the system will start the task of converting the normal volume to a mirrored volume; 3) First, the system creates a new storage space (auxiliary space) in the new storage pool. The size of the new storage space is the same as that of the original storage space (main space), associates this storage space with the existing storage space, and creates a bitmap for this volume according to the storage space size; 4) Then, the system determines from which generation of data in the original storage space to start copying according to the user's selection in the first step, that is, determines the value of start_gen. If the user selects full synchronization, the system will be set to start copying from the 0th generation of CDP data; if the user selects partial synchronization and determines n, the system will be set to start copying from the generations (latest generation ~ n); if the user selects the latest synchronization, the system will be set to start copying from the latest generation; 5) Record the value of start_gen; 6) Reset the bitmap to all 1s; 7) Starting from the first grain in the main space, read out the data of the start_gen generation in each grain in turn, then write this data to the corresponding generation at the corresponding grain position in the auxiliary space, and modify the bitmap bit corresponding to this grain to 0. Until the data copying of the last grain position is completed; 8) Increment the value of start_gen by 1; 9) If start_gen does not exceed the latest generation value of the volume, that is, there is still data to be synchronized not completed, repeat steps 6 - 8; if it has exceeded, the data synchronization task is completed.
[0060] Specifically, in one embodiment, it is possible to determine whether the data to be synchronized in the earliest generation is incremental data; in the case where it is determined that the data to be synchronized in the earliest generation is incremental data, the snapshot data of the previous generation of the earliest generation is used as the snapshot data to be analyzed; multiple space positions to be supplemented that have not been modified are filtered out from the data to be synchronized in the earliest generation; for any space position to be supplemented, it is determined whether the snapshot data to be analyzed modifies the space position to be supplemented; in the case where it is determined that the snapshot data to be analyzed modifies the space position to be supplemented, the data to be synchronized in the earliest generation is supplemented according to the modification content of the snapshot data to be analyzed for the space position to be supplemented, so that the supplemented data to be synchronized in the earliest generation becomes full - volume data.
[0061] It should be noted that since the auxiliary space initially has no data, a full - volume copy is required when copying the data of the first generation into it. After there is data of one generation in the auxiliary space, only incremental data copies are made for subsequent generations. To implement this function, when the mirror volume module reads the data in the main space, it is first necessary to determine whether the generation read is the first generation in the auxiliary space. If so, when reading the IO from the storage pool module, directly read the data at this position in this generation. That is, after this IO request reaches the storage pool module, it will first check according to the recorded metadata information whether there is any data modification at any space position in this generation. If there is, the data is directly returned to the mirror volume module, that is, the data to be synchronized in the earliest generation is full - volume data. If not, it indicates that the data to be synchronized in the earliest generation is incremental data. Therefore, it is further checked whether there is any data modification at this position (the multiple space positions to be supplemented that have not been modified and filtered out from the data to be synchronized in the earliest generation) in the previous generation. If there is, it is returned to supplement the data to be synchronized in the earliest generation according to the modification content of the snapshot data to be analyzed for the space position to be supplemented, so that the supplemented data to be synchronized in the earliest generation becomes full - volume data.
[0062] Correspondingly, in one embodiment, if the snapshot data to be analyzed does not modify the space position to be supplemented, the snapshot data of the previous generation of the snapshot data to be analyzed is used as the new snapshot data to be analyzed; return to the step of determining whether the snapshot data to be analyzed modifies the space position to be supplemented until the snapshot data to be analyzed modifies the space position to be supplemented or the snapshot data to be analyzed is the first - generation snapshot data of the mirror volume.
[0063] Specifically, if there is no data modification in the previous generation, that is, the snapshot data to be analyzed does not modify the position to be supplemented, then search upward to the previous generation until the 0th generation (the first-generation snapshot data) is reached. In order to implement the above incremental data judgment and incremental data supplementation process in the embodiments of the present application, if the mirror volume module determines that the generation read is not the first generation in the secondary space, when reading an IO from the storage pool module, an additional control field READ_INCREMENT_DATA will be sent. After this IO request arrives at the storage pool module along with this control field, the storage pool module will still first check whether there is data modification at this position in this generation according to the recorded metadata information. If there is, the data will be returned; if not, it will not search for data in the previous generation anymore, but directly return a special return value indicating no differential data to the mirror volume. After receiving this special value, the mirror volume module will directly consider that the synchronization of this position has been completed, and only modify the bitmap information, and then continue to process the next position.
[0064] Based on the above embodiments, as an implementable manner, in one embodiment, the method further includes: Step 301, when the target synchronization policy is full synchronization, use the snapshot data of all generations in the primary space as the data to be synchronized.
[0065] Exemplarily, as Figure 4 shown, it is another schematic diagram of the data structure of the mirror volume provided by the embodiments of the present application. When the target synchronization policy is full synchronization, synchronize the data of all generations in the primary space primary to the secondary space secondary. After the synchronization is completed, whether it is primary or secondary, the corresponding snapshot data is exactly the same. This implementation method is mainly applicable to scenarios with extremely high requirements for high availability and historical protection data. When a storage space fails, the other storage space can still restore the data at any historical CDP moment.
[0066] Correspondingly, in one embodiment, the data to be synchronized can be divided according to the spatial position of the data to be synchronized in the primary space to obtain the data to be synchronized at each spatial position; and synchronize the data to be synchronized at each spatial position to the secondary space in the order of the spatial positions.
[0067] Specifically, since the target synchronization policy of full synchronization is generally applied to the initial synchronization of the mirror volume, in order to achieve fast synchronization, the data synchronization method of the above solution (1) can be selected, that is, copy based on the spatial position grain. That is, traverse the grain, and for each grain, read out the data of the 0th generation, 1st generation, ……, nth generation in the grain respectively, and then write it into the target space (auxiliary space). Since the newly added storage space is unused space and there is no data on it, the generation number of the written data only needs to be the same as that read from the original space. That is, the data of the 0th generation in the original space is written into the 0th generation of the target space, and the data of the nth generation in the original space is written into the nth generation of the target space. After all generations of data of this grain are copied, then process the next grain. The number of operations of the bitmap in this solution is small. Because all generations of data of the same grain are copied to the auxiliary space and then the next grain is processed, the corresponding position of the bitmap can be changed to 0 after a certain grain is processed. The bitmap is operated as many times as there are grains, which improves the data synchronization efficiency to a certain extent.
[0068] Based on the above embodiments, as an implementable manner, in one embodiment, the method further includes: Step 401, when the target synchronization policy is the latest synchronization, use the snapshot data of the latest generation number in the main space as the data to be synchronized.
[0069] Exemplarily, as Figure 5 shown, it is a schematic diagram of the data structure of another mirror volume provided by the embodiment of the present application. When the target synchronization policy is the latest synchronization, only the latest data in the main space is synchronized to the auxiliary space. This implementation method is mainly applicable to scenarios where the high availability function of data is more concerned and the loss of snapshot data is not a big deal. When a certain storage space fails, the other storage space can provide the latest data to ensure that the service can run normally, but all the previously taken CDP snapshots will be lost.
[0070] Based on the above embodiments, as an implementable manner, in one embodiment, the method further includes: Step 501, if the main space fails during the process of synchronizing the latest snapshot data to the auxiliary space in the main space, perform a service rollback on the mirror volume.
[0071] It should be noted that in the related art, if a primary failure occurs during the data synchronization from the primary main space to the secondary auxiliary space, since there is not yet a complete copy of the data in the secondary at this time, the mirror volume cannot be used until the primary is restored. If an irreparable failure occurs in the primary, the data in the volume will never be usable. To solve this technical problem, in the embodiments of the present application, during the process of synchronizing the latest snapshot data from the main space to the auxiliary space, in the case of a failure in the main space, a business rollback is performed on the mirror volume to ensure the data integrity of the mirror volume.
[0072] Specifically, when the main space of the mirror volume fails and becomes inaccessible, different processing will be performed according to the status of the current data synchronization task. The processing logic is as follows: If data synchronization is not in progress between the primary and secondary spaces when the failure occurs, it indicates that the data in the primary and secondary spaces is the same at this time. Before the failure, the host write I / O would perform double writes in both the primary and secondary spaces, and the data in the two spaces would still be consistent after writing. After the failure, the mirror volume module will mark the primary space as unavailable internally, demote it to an auxiliary space, and promote the original auxiliary space to the new primary space. When the host write I / O reaches the mirror volume module and is about to perform double writes, it is found that the new auxiliary space (i.e., the original failed primary space) is unavailable, so the I / O will only be written to the new primary space (i.e., the original auxiliary space). And since the data has only been written to one space at this position, there is a difference in the data between the primary and secondary spaces. Therefore, after this I / O is written, the data at the corresponding position in the bitmap will be changed from 0 to 1 to record the difference at this position.
[0073] Moreover, since the new primary space retains the historical generation data of the original primary space (i.e., the current auxiliary space) at this time, that is, there are still n generations of CDP on the mirror volume at this time, the mirror volume can also use the related functions provided by the CDP module at this time. For example: (1) If the data of this volume is tampered with, the rollback function of CDP can be used to roll back the data of this volume to a certain moment before the tampering; (2) If accessing the data at a certain historical moment of this volume, such as generating an analysis report for the data at a certain day or performing corresponding tests, the function of converting to an entity volume provided by the CDP module can be used to map the historical data at a certain moment in the mirror volume to another volume, and by accessing this volume, the historical data of the mirror volume can be directly obtained without directly rolling back the mirror volume data, thus retaining the latest data of the mirror volume while also being able to access its historical data.
[0074] After the failed space (the original primary space, the current auxiliary space) is restored, the mirror volume module will perform data synchronization again. During data synchronization, according to the information recorded in the bitmap, the data at the positions that have changed during the failure period will be synchronized to the other space.
[0075] Among them, if the data synchronization task from the primary space to the secondary space is in progress when a failure occurs, that is, during the process of synchronizing the latest snapshot data from the primary space to the secondary space, and a failure occurs in the primary space, then not all the data in the primary space exists in the secondary space. There may only be the data of the first few generations that have been copied, and the first half of a certain generation that is currently being copied. At this time, when a failure occurs in the primary space, the secondary space cannot directly process host I / O. Here, the inability to directly process host I / O means that from the perspective of the business application on the server, it cannot directly process I / O because at this time, the business application reads and writes the data at the latest moment on the volume, while the secondary space does not have the complete data at the latest moment. What it may have is only the complete data at a certain historical moment, and this data cannot be directly provided for the business application to use. The business application needs to make corresponding adjustments before it can be used. Therefore, when this scenario occurs, the system will report an alarm message, telling the user that a failure has occurred in the primary space during the data synchronization of the mirrored volume, and the user needs to intervene manually to select the next processing strategy. There are two types of processing strategies: The first is to take no intervention and maintain the status quo. If the user believes that the business function can accept temporarily stopping the service, or the failure occurs during the business idle stage (such as early morning), the user can choose this strategy and wait for the engineer to repair the primary space and then provide services externally. Under this strategy, after a failure occurs, the data in the primary space and the secondary space will not change anymore, and the bitmap information will not be updated either. Therefore, the role transformation between the primary and secondary spaces will not be triggered at this time (that is, the failed primary space will not be demoted to the secondary space, nor will the normal secondary space be promoted to the primary space). When the primary space is repaired, the subsequent data synchronization task can still continue from the interruption point according to the bitmap information until all data synchronization is completed.
[0076] The second processing strategy is to intervene and roll back the business application on the server and the data on the storage secondary space to the data at an available moment (a certain generation of data that has been fully synchronized to the secondary space), that is, perform a business rollback on the mirrored volume and restart the business using the data at that moment. When the data on the storage secondary space is rolled back, the business application will then develop and progress backward based on the data at a certain historical moment.
[0077] The reason this strategy is designed to require intervention rather than automatic configuration is that these operations may change the data on the volume (rolling back to the data at a certain historical moment). On the other hand, the business application on the server needs to cooperate (whether to roll back or maintain the status quo). These operations are all operations that have a significant impact on business data and need to be judged in combination with the actual business scenario when the failure occurs. All of these require the user to make a comprehensive judgment.
[0078] The rollback and startup of business applications are functions provided by the business application software, and the data rollback on the storage secondary space is a function provided by the mirror volume module of the storage software. When this scenario occurs, after the user clicks the function button on the storage software, the mirror volume module will first mark the failed primary space as unavailable and demote it to a secondary space, promote the original normal secondary space to the primary space, and then trigger the data rollback of the current latest and most complete generation on the secondary space (i.e., the previous generation of the generation that was being synchronized when the failure occurred), and reset the bitmap data to all 0s.
[0079] After the business is started up, all the write IOs issued by the host are written singly to the new primary space, and the bitmap at the corresponding position is modified to 1 to record the data differences. When the failed space is restored again, manual intervention is still required to select whether the failed space will continue to act as a secondary space or be promoted back to the primary space role after restoration.
[0080] If the user believes that the data before the failure is more important, then select to promote the restored space to the primary space. At this time, the mirror volume module will mark the failed space as normal and promote it to the primary space, demote the existing primary space to a secondary space, and use the previous generation of the generation that was being synchronized when the failure occurred on the secondary space for data rollback, roll back to the data that is the same as a certain historical generation of the primary space, and then reset the bitmap to 1. Starting from this historical generation, resume the data synchronization from the primary space to the secondary space.
[0081] If the user believes that the data before the failure is no longer needed, but instead the data newly started up is more important, then select to keep the restored space as a secondary space. At this time, the mirror volume module will mark the failed space as normal and perform data rollback on the failed space using the previous generation of the generation that was being synchronized when the failure occurred, but the bitmap information is not reset. After the rollback is completed, the data difference between the primary space and the failed space is only the newly written data after the business is restarted, and this part of the data can be incrementally synchronized to the failed space according to the bitmap information.
[0082] A method for mirror volume data synchronization provided by an embodiment of the present application includes obtaining application scenario information of a mirror volume, where the application scenario information at least includes service information; determining a target synchronization policy of the mirror volume according to the application scenario information of the mirror volume; in the case where the target synchronization policy is partial synchronization, determining read-write frequency information of the mirror volume according to the service information; determining a target synchronization generation value according to the read-write frequency information of the mirror volume; positioning the nearest snapshot data of the corresponding generation in the main space according to the target synchronization generation value, and using the nearest snapshot data of the corresponding generation as the data to be synchronized; synchronizing the data to be synchronized to the secondary space; where the mirror volume includes a main space and a secondary space. The method provided by the above solution determines a target synchronization generation value that matches the application scenario information of the mirror volume, and positions the nearest snapshot data of the corresponding generation in the main space according to the target synchronization generation value, so as to use the nearest snapshot data of the corresponding generation as the data to be synchronized, and finally synchronize the data to be synchronized to the secondary space, so that both the main space and the secondary space of the mirror volume retain complete historical snapshot data. Even if the main space fails, the secondary space can provide historical snapshot data, improving the high availability of the mirror volume. And in the present application, the CDP data synchronization policy of the mirror volume is optional, and the user can flexibly select the target synchronization policy according to the actual application scenario, with stronger usability.
[0083] 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 implemented by means of software plus a 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.
[0084] An embodiment of the present application further provides a mirror volume data synchronization device for executing the mirror volume data synchronization method provided by the above embodiment.
[0085] As Figure 6 shown, it is a schematic structural diagram of the mirror volume data synchronization device provided by an embodiment of the present application. The mirror volume data synchronization device 60 includes: an acquisition module 601, a first determination module 602, a second determination module 603, a third determination module 604, a first synchronization module 605, and a second synchronization module 606.
[0086] Among them, an acquisition module is configured to acquire application scenario information of a mirror volume; wherein, the application scenario information at least includes service information; a first determination module is configured to determine a target synchronization policy of the mirror volume according to the application scenario information of the mirror volume; a second determination module is configured to determine read / write frequency information of the mirror volume according to the service information when the target synchronization policy is partial synchronization; a third determination module is configured to determine a target synchronization generation value according to the read / write frequency information of the mirror volume; a first synchronization module is configured to locate the nearest snapshot data of the corresponding generation in the primary space according to the target synchronization generation value, and use the nearest snapshot data of the corresponding generation as the data to be synchronized; a second synchronization module is configured to synchronize the data to be synchronized to the secondary space.
[0087] Among them, the mirror volume includes a primary space and a secondary space.
[0088] For the description of the features in the corresponding embodiment of the mirror volume data synchronization device, reference can be made to the relevant description in the corresponding embodiment of the mirror volume data synchronization method, which will not be elaborated here one by one.
[0089] An embodiment of the present application further provides a mirror volume data synchronization system for executing the mirror volume data synchronization method provided in the above embodiment.
[0090] As Figure 7 shown, it is a schematic structural diagram of the mirror volume data synchronization system provided by the embodiment of the present application. The mirror volume data synchronization system includes: a primary space, a secondary space, and a mirror volume data synchronization device.
[0091] Among them, the primary space and the secondary space belong to different storage pools; the primary space is used to store snapshot data; the secondary space is used to synchronously store the snapshot data stored in the primary space.
[0092] Based on the mirror volume data synchronization method provided in the above embodiment, the mirror volume data synchronization device synchronizes the data to be synchronized in the primary space to the secondary space.
[0093] For the description of the features in the corresponding embodiment of the mirror volume data synchronization system, reference can be made to the relevant description in the corresponding embodiment of the mirror volume data synchronization method, which will not be elaborated here one by one.
[0094] An embodiment of the present application further provides an electronic device, as Figure 8 shown, it is a schematic structural diagram of the electronic device provided by the embodiment of the present application, including a processor 10 and a memory 20. The memory 20 stores a computer program, and the processor 10 is configured to run the computer program to execute the steps in any one of the above embodiments of the mirror volume data synchronization method.
[0095] Embodiments of the present application also provide a computer-readable storage medium storing a computer program, where the computer program is configured to execute the steps in any of the above embodiments of the mirror volume data synchronization method when running.
[0096] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to, various media capable of storing 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 disc.
[0097] Embodiments of the present application also provide a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the mirror volume data synchronization method.
[0098] Embodiments of the present application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the mirror volume data synchronization method.
[0099] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0100] The above has introduced in detail a mirror volume data synchronization method, system, electronic device, and storage medium provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A method for mirror volume data synchronization, characterized in that Including: Obtain the application scenario information of the mirror volume; wherein, the application scenario information at least includes service information; Determine the target synchronization policy of the mirror volume according to the application scenario information of the mirror volume; When the target synchronization policy is partial synchronization, determine the read-write frequency information of the mirror volume according to the service information; Determine the target synchronization generation value according to the read-write frequency information of the mirror volume; Locate the nearest snapshot data of the corresponding generation in the main space according to the target synchronization generation value, and use the nearest snapshot data of the corresponding generation as the data to be synchronized; Synchronize the data to be synchronized to the secondary space; Wherein, the mirror volume includes the main space and the secondary space.
2. The mirror volume data synchronization method according to claim 1, wherein The determining the target synchronization policy of the mirror volume according to the application scenario information of the mirror volume includes: Determine the historical snapshot data protection requirements of the user for the mirror volume according to the application scenario information of the mirror volume; Determine the target synchronization policy of the mirror volume according to the historical snapshot data protection requirements of the user for the mirror volume.
3. The mirror volume data synchronization method according to claim 1, wherein The determining the read-write frequency information of the mirror volume according to the service information when the target synchronization policy is partial synchronization includes: When the target synchronization policy is partial synchronization, determine the number of write requests and read requests responded by the mirror volume within a fixed time period according to the service information; Determine the read frequency and write frequency of the mirror volume according to the number of write requests and read requests responded by the mirror volume within a fixed time period; Wherein, the read-write frequency information at least includes the read frequency and the write frequency.
4. The mirror volume data synchronization method according to claim 1, wherein The determining the target synchronization generation value according to the read-write frequency information of the mirror volume includes: Determine the read frequency and write frequency of the mirror volume according to the read-write frequency information of the mirror volume; Determine the target synchronization generation value according to the read frequency and write frequency of the mirror volume; Wherein, the target synchronization generation value is positively correlated with the write frequency, and the target synchronization generation value is negatively correlated with the read frequency.
5. The mirror volume data synchronization method according to claim 1, wherein The synchronizing the data to be synchronized to the secondary space includes: Perform data partitioning on the data to be synchronized according to the generation order of the data to be synchronized, so as to obtain the data to be synchronized for each generation; Synchronize the data to be synchronized for each generation to the secondary space in the order of the generations.
6. The mirror volume data synchronization method according to claim 5, wherein The synchronizing the data to be synchronized for each generation to the secondary space in the order of the generations includes: Judge whether the data to be synchronized in the earliest generation is incremental data; When it is determined that the data to be synchronized in the earliest generation is incremental data, use the snapshot data of the previous generation of the earliest generation as the snapshot data to be analyzed; Screen multiple to-be-supplemented space positions that have not been modified in the data to be synchronized in the earliest generation; For any one of the to-be-supplemented space positions, judge whether the snapshot data to be analyzed modifies the to-be-supplemented space position; When it is determined that the snapshot data to be analyzed modifies the space position to be supplemented, supplement the earliest generation of data to be synchronized according to the modification content of the space position to be supplemented by the snapshot data to be analyzed, so that the supplemented earliest generation of data to be synchronized becomes full-volume data.
7. The mirror volume data synchronization method according to claim 6, wherein The method further includes: If the snapshot data to be analyzed does not modify the space position to be supplemented, use the previous-generation snapshot data of the snapshot data to be analyzed as the new snapshot data to be analyzed; Return to the step of determining whether the snapshot data to be analyzed modifies the space position to be supplemented until the snapshot data to be analyzed modifies the space position to be supplemented or the snapshot data to be analyzed is the first-generation snapshot data of the mirror volume.
8. The mirror volume data synchronization method according to claim 1, characterized in that The method further includes: When the target synchronization policy is full synchronization, use all generations of snapshot data in the primary space as the data to be synchronized.
9. The mirror volume data synchronization method according to claim 8, wherein The step of synchronizing the data to be synchronized to the secondary space includes: Perform data partitioning on the data to be synchronized according to the space position of the data to be synchronized in the primary space to obtain the data to be synchronized at each space position; Synchronize the data to be synchronized at each space position to the secondary space in the order of the space positions.
10. The mirror volume data synchronization method according to claim 1, wherein The method further includes: When the target synchronization policy is latest synchronization, use the latest generation of snapshot data in the primary space as the data to be synchronized.
11. The mirror volume data synchronization method according to claim 1, wherein The method further includes: If a failure occurs in the primary space during the process of synchronizing the latest snapshot data in the primary space to the secondary space, perform a service rollback on the mirror volume.
12. A mirror volume data synchronization system, characterized in that It includes: A primary space, a secondary space, and a mirror volume data synchronization device; The primary space and the secondary space belong to different storage pools; The primary space is used to store snapshot data; The secondary space is used to synchronously store the snapshot data stored in the primary space; Based on the mirror volume data synchronization method according to any one of claims 1 to 11, the mirror volume data synchronization device synchronizes the data to be synchronized in the primary space to the secondary space.
13. An electronic device, characterized in that, It includes: A memory for storing a computer program; A processor for implementing the steps of the mirror volume data synchronization method according to any one of claims 1 to 11 when executing the computer program.
14. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the mirror volume data synchronization method according to any one of claims 1 to 11 when executed by a processor.
15. A computer program product, comprising a computer program, characterized in that, The computer program implements the steps of the mirror volume data synchronization method according to any one of claims 1 to 11 when executed by a processor.
Citation Information
Patent Citations
Mirrored volume initial synchronization method and control device
CN101308472A
Continuous data protection system and method combining with snapshot technology
CN105389230A
Storage device, method and system for realizing disaster recovery backup
CN117950915A
Accessing snapshot data image of a data mirroring volume
US20090006745A1
Cited By
Data migration method and device, electronic equipment, storage medium and program product
CN120763145A
A data migration method, device, electronic equipment, storage medium and program product
CN120763145B