CN109885428B - Continuous hop replication method and device - Google Patents

Continuous hop replication method and device Download PDF

Info

Publication number
CN109885428B
CN109885428B CN201910107839.8A CN201910107839A CN109885428B CN 109885428 B CN109885428 B CN 109885428B CN 201910107839 A CN201910107839 A CN 201910107839A CN 109885428 B CN109885428 B CN 109885428B
Authority
CN
China
Prior art keywords
copy
source lun
hop
lun
bitmap
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910107839.8A
Other languages
Chinese (zh)
Other versions
CN109885428A (en
Inventor
上官应兰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Macrosan Technologies Co Ltd
Original Assignee
Macrosan Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Macrosan Technologies Co Ltd filed Critical Macrosan Technologies Co Ltd
Priority to CN201910107839.8A priority Critical patent/CN109885428B/en
Publication of CN109885428A publication Critical patent/CN109885428A/en
Application granted granted Critical
Publication of CN109885428B publication Critical patent/CN109885428B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a device for continuous hop replication, wherein the method comprises the following steps: when copying is triggered on a source LUN of current skip copying, suspending read-write IO operation of the source LUN, updating a first transmission bitmap according to a difference bitmap of the source LUN, generating a first copy view, and recovering the read-write IO operation of the source LUN; detecting whether the source LUN meets a condition for executing copy; if so, acquiring a first transmission bitmap and a first copy view of the source LUN, taking the first transmission bitmap and the first copy view as a transmission bitmap and a copy view of the current copy, emptying the first transmission bitmap, and synchronizing data in the source LUN to a corresponding target LUN; the transmission bitmap is used for marking the position of data to be synchronized to the target LUN in the source LUN, and the copy view is used for acquiring corresponding data in the source LUN at the moment when copying is triggered. Therefore, the utilization rate of the copy link and the efficiency of the continuous hop copy can be improved.

Description

Continuous hop replication method and device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for continuous hop replication.
Background
In the big data era, the data volume is getting larger and more important, and it has become a mainstream way to store data in a special storage device and improve the data reliability by the data protection characteristic of the storage device.
Replication is one of the traditional data protection features and is also a common solution to deal with "hard disasters". Hard disasters, so called thinking, refer to "hard" disasters, which typically mean that production data is physically corrupted or unreadable due to RAID (Redundant Arrays of Independent Drives) failures, earthquakes, fires, and the like. Through the replication technology, a copy data volume can be stored for the production data volume in the disaster recovery center, the copy data volume and the production finished data volume are physically independent, and when the production data volume causes a hard disaster, the copy data volume can be used for data recovery.
The prior art replication scheme includes: single-hop replication and continuous-hop replication, wherein continuous-hop replication is a replication scheme with higher protectiveness, and continuous-hop replication is a scheme for generating multiple copies for a LUN (Logical Unit Number, which is an independently available storage space created based on RAID in general); for example, the LUNA is a production data volume, data in the LUNA is copied to the LUNB according to a preset strategy, the LUNB is immediately triggered to continue copying to the LUNC after copying from the LUNA to the LUNB is completed, the LUNC is immediately triggered to continue copying to the LUND after copying from the LUNB to the LUNC is completed, and the like; in the continuous-hop replication, after the replication of the previous hop is completed, the replication of the current hop is triggered immediately, that is, one replication pair triggers multiple replication, and if a new replication is triggered in the process of one replication, the processing method in the prior art is as follows: new copies are ignored and new copies are made until the next time a new copy is triggered. The defects of the prior art are as follows: after the current ongoing replication is finished, the replication link is always in an idle state before the next new replication is triggered, and the utilization rate of the replication link is low.
Disclosure of Invention
In view of the above, the present invention provides a method and an apparatus for continuous hop replication to solve the problems and deficiencies in the prior art.
The application is realized by the following technical scheme:
in a first aspect, an embodiment of the present application provides a method for continuous hop replication, including:
when copying is triggered on a source LUN of current skip copying, suspending read-write IO operation of the source LUN, updating a first transmission bitmap according to a difference bitmap of the source LUN, generating a first copy view, and recovering the read-write IO operation of the source LUN;
detecting whether the source LUN meets a condition for executing copy;
if so, acquiring a first transmission bitmap and a first copy view of the source LUN, taking the first transmission bitmap and the first copy view as a transmission bitmap and a copy view of the current copy, emptying the first transmission bitmap, and synchronizing data in the source LUN to a corresponding target LUN; the transmission bitmap is used for marking the position of data to be synchronized to the target LUN in the source LUN, and the copy view is used for acquiring corresponding data in the source LUN at the moment when copying is triggered;
if not, the step of detecting whether the source LUN meets the condition of executing the copy is repeatedly executed until the source LUN meets the condition of executing the copy, and then the steps of taking the first transmission bitmap and the first copy view as the transmission bitmap and the copy view of the copy, emptying the first transmission bitmap, and synchronizing the data in the source LUN to the corresponding target LUN are executed.
In a second aspect, an embodiment of the present application provides an apparatus for continuous hop replication, including:
the system comprises a triggering module, a first transmission bitmap and a second transmission bitmap, wherein the triggering module is used for suspending the read-write IO operation of a source LUN when the copying is triggered on the current jump copying source LUN, updating the first transmission bitmap according to a difference bitmap of the source LUN, generating a first copy view and recovering the read-write IO operation of the source LUN;
the detection module is used for detecting whether the source LUN meets the condition of executing the copying;
a synchronization module, configured to obtain a first transmission bitmap and a first copy view of the source LUN, use the first transmission bitmap and the first copy view as a transmission bitmap and a copy view of the current copy, empty the first transmission bitmap, and perform synchronization of data in the source LUN to a corresponding target LUN; the transmission bitmap is used for marking the position of data to be synchronized to the target LUN in the source LUN, and the copy view is used for acquiring corresponding data in the source LUN at the moment when copying is triggered.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the method according to the first aspect.
In a fourth aspect, the present application provides a computer device, including 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 method according to the first aspect.
Compared with the prior art, in the continuous-hop replication, when the replication trigger exists on the source LUN of the current-hop replication, the method and the device for continuous-hop replication update the first transmission bitmap according to the difference bitmap of the source LUN, generate a first replication view, and then detect whether the source LUN meets the condition of executing the replication; if so, acquiring a first transmission bitmap and a first copy view of the source LUN, taking the first transmission bitmap and the first copy view as a transmission bitmap and a copy view of the copy, emptying the first transmission bitmap, and executing the copy to synchronize data in the source LUN to a corresponding target LUN; if not, whether the source LUN meets the condition for copying or not is continuously detected, and once the condition is detected, copying is immediately started. Compared with the prior art, the mode of ignoring the new copy is compared with the mode of ignoring the new copy if the new copy is triggered on the source LUN of the current skip copy in the process of executing the copy by the current skip copy, so that the copy is realized as much as possible, and the positive effects of improving the utilization rate of the copy link and the copy efficiency are further achieved.
Drawings
Fig. 1 is an exemplary diagram of a continuous hop replication provided in an embodiment of the present application;
fig. 2 is a flowchart illustrating a method of continuous hop replication provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an apparatus for continuous hop replication provided in an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In the prior art, in the continuous hop replication, when the previous hop replication is completed, the new replication of the current hop is immediately triggered, and in addition, in the process of the current hop being replicated, if the new replication is triggered on the source LUN of the current hop, the new replication is ignored, so that the utilization rate of the replication link and the continuous hop replication efficiency are influenced; based on this, the embodiment of the application provides a method and a device for continuous hop replication.
Fig. 1 is an exemplary diagram of a continuous hop replication provided in an embodiment of the present application; referring to fig. 1, in this serial-hop copy, data in LUNX is copied into LUNY, and then data in LUNY is copied into LUNZ. The LUNX, LUNY, and LUNZ are different independent storage spaces. The data in the LUNX is production data, the data in the LUNY is copy data, the LUNX and the LUNY form a copy pair, the LUNX in the copy pair is called a source LUN of the copy pair, the LUNY is called a target LUN of the copy pair, and the copy pair is a first-hop copy in the present-hop copy, and multiple copies are triggered in the copy pair. Data in a LUNY is to be copied into a LUNZ, the LUNY and the LUNZ form a copy pair, the LUNY is called a source LUN of the copy pair in the copy pair, the LUNZ is called a target LUN of the copy pair, and the copy pair is the second hop copy in the present hop copy, and multiple copies are also triggered in the copy pair. It can be seen that in the continuous-hop copy, the LUNY is a target LUN copied by the first hop, and is a source LUN copied by the second hop.
For any hop copy in the continuous hop copy, copying the data in the source LUN copied by the hop to a corresponding target LUN, counting the newly written data in the source LUN, and recording difference data through a difference bitmap of the source LUN; when a new copy is triggered, a transmission bitmap is generated according to the difference bitmap, a copy view is generated, which data need to be synchronized to a corresponding target LUN is marked in the transmission bitmap, the copy view is used for acquiring the corresponding data in the source LUN at the moment when the copy is triggered, and then the data in the source LUN can be copied to the target LUN according to the transmission bitmap and the copy view.
If the copy is the first hop copy of the continuous hop copy, the copy triggering mode may be to trigger a new copy every preset time period, for example, trigger a new copy every one hour; or triggering a new copy when detecting that the data variation in the source LUN reaches a preset threshold, for example, triggering a new copy when the data variation exceeds 10 GB; it is also possible to manually trigger a new copy at any time. If the copy is not the first hop copy of the continuous hop copy, the above-mentioned manner of triggering copy may be to trigger a new copy of the current hop immediately when the copy of the previous hop is completed.
Fig. 2 is a flowchart illustrating a method for continuous hop replication in an embodiment of the present application. Referring to fig. 2, the method includes the following steps S101-S104:
s101, when copying is triggered on a source LUN copied in a current hop, suspending read-write IO operation of the source LUN, updating a first transmission bitmap according to a difference bitmap of the source LUN, generating a first copy view, and recovering the read-write IO operation of the source LUN.
In this embodiment of the present application, specifically, the current-hop copy may be a first-hop copy, or may not be the first-hop copy, data written in the source LUN is continuously counted on the source LUN copied by the current-hop copy, and difference data is recorded through a difference bitmap of the source LUN. When the copy is triggered on the source LUN of the current hop copy, suspending the read-write IO operation of the source LUN, updating the first transmission bitmap according to the difference bitmap of the source LUN, generating a first copy view, and then recovering the read-write IO operation of the source LUN.
In this embodiment of the application, by suspending the read/write IO operation of the source LUN, the updated first transmission bitmap and the first copy view correspond to the data plane of the source LUN at the same time, and further, when the copy is performed, the data copied from the source LUN to the corresponding target LUN is complete and available.
In the embodiment of the application, a first transmission bitmap is maintained in the source LUN, and when there is a copy trigger on the source LUN, the first transmission bitmap is updated according to a difference bitmap of the source LUN, and a first copy view is generated. And after the source LUN meets the condition of executing the copying, taking the first transmission bitmap and the first copy view as the transmission bitmap and the copy view of the copying, and synchronizing the data in the source LUN to the corresponding target LUN according to the transmission bitmap and the copy view.
Taking the continuous hop replication shown in fig. 1 as an example, for a LUNX-LUNY replication pair, the replication pair is a first hop replication in the continuous hop replication, the LUNX corresponds to a production data volume, and a new replication from the LUNX to the LUNY is triggered according to a preset replication policy, where the replication policy may trigger a new replication every preset time period, or trigger a new replication when detecting that a data variation in the LUNX reaches a preset threshold; in addition to triggering a new copy according to a preset copy policy, the new copy may be triggered manually at any time. When a new copy of LUNX to LUNY is triggered, suspending the read-write IO operation of LUNX, at the moment, writing new data into LUNX, updating a first transmission bitmap of LUNX according to a difference bitmap of LUNX, generating a first copy view, and then resuming the read-write IO operation of LUNX, at the moment, writing new data on LUNX continuously.
Taking the continuous-hop replication shown in fig. 1 as an example, for a LUNY-LUNZ replication pair, the replication pair is not the first-hop replication in the continuous-hop replication, but the second-hop replication. LUNY is used as a target LUN copied by a first hop, and is also used as a source LUN copied by a second hop, when the copying of the first hop is completed, the changed data in LUNX is completely synchronized into LUNY, at the moment, the new copying from LUNY to LUNZ can be triggered immediately, and the data copied into LUNY by the previous hop is synchronized into LUNZ immediately. When a new copy from LUNY to LUNZ is triggered, the read-write IO operation of LUNY is suspended to avoid the situation that the data on LUNY is changed due to the fact that the new copy from LUNX to LUNY is triggered again, then the first transmission bitmap of LUNY is updated according to the difference bitmap of LUNY, a first copy view is generated, and then the read-write IO operation of LUNY is recovered.
In this embodiment of the application, in the step S101, the manner of generating the first copy view may be: if the source LUN does not have the first copy view currently, directly creating the first copy view; and if the source LUN currently has the first copy view, deleting the existing first copy view, and then recreating the first copy view.
In this embodiment of the application, optionally, in the step S101, the updating the first transmission bitmap according to the difference bitmap of the source LUN specifically includes the following step a 10:
step A10, detecting whether the first transmission bitmap of the source LUN is empty, if yes, using the difference bitmap of the source LUN as the updated first transmission bitmap; and if not, merging the difference bitmap of the source LUN into the first transmission bitmap to obtain the updated first transmission bitmap.
In this embodiment of the present application, specifically, if the first transmission bitmap of the source LUN is empty, which indicates that there is no triggered but unexecuted copy on the source LUN, at this time, the difference bitmap of the source LUN may be used as the updated first transmission bitmap, and then the difference bitmap of the source LUN is regenerated, and an initial value of the newly generated difference bitmap is empty, which is used to continuously record difference data on the source LUN.
In an optional embodiment, the manner of using the difference bitmap of the source LUN as the updated first transmission bitmap may be: and modifying the identifier of the difference bitmap of the source LUN to make the modified identifier consistent with the identifier of the first transmission bitmap, and taking the difference bitmap after the identifier is modified as the updated first transmission bitmap.
Taking the continuous-hop copy shown in fig. 1 as an example, for a LUNX-LUNY copy pair, if the first transmission bitmap of LUNX is empty, it indicates that there is no triggered but not new copy on LUNX, and at this time, the difference bitmap of LUNX may be directly used as the updated first transmission bitmap. LUNY-LUNZ copy is processed in the same manner as above, and will not be described herein.
In this embodiment of the application, specifically, if the first transmission bitmap of the source LUN is not empty, it indicates that there is a triggered but not performed new copy on the source LUN, and the first transmission bitmap marks a position of the data that needs to be copied from the source LUN to a corresponding target LUN corresponding to the triggered but not performed new copy, at this time, the difference bitmap of the source LUN is merged into the first transmission bitmap of the source LUN, so that the merged first transmission bitmap may include a latest difference data position, and the difference bitmap of the source LUN is emptied, so that the difference bitmap may be used to continuously record the difference data on the source LUN.
In an optional embodiment, specifically, the merging the difference bitmap of the source LUN into the first transmission bitmap of the source LUN, and emptying the difference bitmap of the source LUN includes:
mode 1, merging the data in the differential bitmap of the source LUN into the first transmission bitmap of the source LUN, and emptying the differential bitmap of the source LUN after merging;
and 2, modifying the identifier of the difference bitmap of the source LUN into the identifier of the bitmap to be updated, newly generating the difference bitmap of the source LUN, enabling the initial value of the newly generated difference bitmap to be null, merging the bitmap to be updated into the first transmission bitmap of the source LUN in the background, and deleting the bitmap to be updated after merging.
S102, detecting whether the source LUN meets the condition of executing the copy;
specifically, in this embodiment of the application, optionally, in the step S102, the detecting whether the source LUN meets a condition for executing the copy includes:
and if the current hop copy is the first hop copy and the source LUN has no executing copy task, detecting that the source LUN meets the condition of executing copy.
And if the current-hop copy is not the first-hop copy, the source LUN has no executing copy task, and the number of copies completed by the last-hop copy of the current-hop copy is greater than or equal to a preset threshold, detecting that the source LUN meets the condition of executing the copy.
Specifically, if the current-hop copy is a first-hop copy, and whether the source LUN meets a condition for executing the copy is detected, a new copy to a corresponding target LUN is triggered according to a preset copy policy, and at this time, if there is a copy task being executed in the current-hop copy, the source LUN is considered not to meet the condition for executing the new copy; and if the current-hop copying does not have the executing copying task, the source LUN is considered to meet the condition of performing the new copying.
In addition, if the current-hop copy is not a first-hop copy pair, when judging whether the source LUN meets the condition of performing a new copy, the number of copies completed in the previous-hop copy is also judged, and if the difference between the link bandwidths of the current-hop copy and the previous-hop copy is large, the method can be set to trigger one current-hop copy after completing the previous-hop copy for multiple times.
If the current-hop copy is not the first-hop copy, the source LUN of the current-hop copy is also the target LUN of the previous-hop copy, and when detecting whether the source LUN meets the condition of executing copy, if the current-hop copy has a copy task being executed, the source LUN is considered not to meet the condition of executing the new copy; if the current-hop replication does not have the replication task which is being executed, acquiring the number of times of replication completed in the previous-hop replication, further judging whether the number of times of replication completed in the previous-hop replication is greater than or equal to a preset threshold value, and if not, considering that the source LUN does not meet the condition of performing new replication; if so, the source LUN is considered to satisfy the condition of making a new copy.
Specifically, the target LUN of each copy pair records the number of copies completed in the copy pair, and if the current-hop copy is not the first-hop copy, the source LUN of the current-hop copy is also the target LUN of the previous-hop copy, so that the source LUN of the current-hop copy can obtain the number of copies completed in the previous-hop copy.
Specifically, the preset threshold may be preset according to an actual scene. In continuous hop replication, a typical scenario is: the equipment to which the production data volume belongs is located in a machine room A, the target LUN copied by the first hop is deployed in another machine room B in the same city, namely the equipment to which the source LUN copied by the first hop belongs is located in the machine room A, the equipment to which the target LUN belongs is located in the machine room B, for cost consideration, a network between machine rooms in the same city usually adopts a gigabit link, and the timeliness of data copy is determined by a copy strategy on the production data volume; the second-hop copied target LUN is deployed in another machine room C in a different place (in a different city), that is, the device to which the second-hop copied source LUN belongs is located in machine room B, the device to which the target LUN belongs is located in machine room C, and a network between different places of machine rooms generally adopts a wide area network, and the link bandwidth is low, such as a10 Mbps private line or an 8Mbps private line, so the timeliness requirement of data copy is low. In the above scenario, the difference between the link bandwidth copied by the first hop and the link bandwidth copied by the second hop is relatively large, in this case, the rate of copying by the first hop is significantly better than that of copying by the second hop, and the time required for completing copying by the first hop for the same data is much shorter than that required for completing copying by the second hop, at this time, the preset threshold may be set on the source LUN copied by the second hop, for example, set to 4, that is, after completing 4 times of copying by the first hop, 1 time of copying by the second hop is triggered, so that the difference data copied to the target LUN in the last 4 times of copying by the first hop is merged into the first transmission bitmap of the source LUN copied by the second hop, and then a new copy is triggered based on the first transmission bitmap, compared with the prior art, in which the current-hop copy is performed immediately after completing copying by the last hop, and the difference data generated by copying by the last hop each time is copied in the current-hop, the repeated data in the differential data copied by the first hop for multiple times are merged, so that the total amount of the copied data is reduced, and the positive effects of improving the utilization rate of the copied link and the copying efficiency are achieved.
In another continuous-hop replication scenario, if the difference between the link bandwidth of the current-hop replication and the link bandwidth of the previous-hop replication is not large, at this time, the preset threshold on the source LUN of the current-hop replication may be set to 0, that is, in the current-hop replication, a condition that the number of copies completed in the previous-hop replication of the current-hop replication is greater than or equal to the preset threshold is always satisfied, in this case, the number of copies completed in the previous-hop replication will not affect the current-hop replication, as long as the source LUN currently has a new replication that is not executed and does not currently have a replication task that is being executed, a new replication will be executed immediately, and compared with the prior art, in the process that the current-hop replication is executing the replication, if the new replication is triggered on the source LUN of the current-hop replication, a manner of ignoring the new replication is implemented, so as much as possible, and further achieves the positive effects of improving the utilization rate of the copy link and the copy efficiency.
S103, if yes, acquiring a first transmission bitmap and a first copy view of the source LUN, taking the first transmission bitmap and the first copy view as a transmission bitmap and a copy view of the current copy, emptying the first transmission bitmap, and synchronizing data in the source LUN to a corresponding target LUN; the transmission bitmap is used for marking the position of data to be synchronized to the target LUN in the source LUN, and the copy view is used for acquiring corresponding data in the source LUN at the moment when copying is triggered.
In this embodiment of the present application, when the source LUN meets the condition for performing copy, the copy is immediately started to be performed, and the first transmission bitmap and the first copy view are used as the transmission bitmap and the copy view of the copy of this time.
In an optional embodiment, the manner of taking the first transmission bitmap and the first copy view as the transmission bitmap and the copy view of this copy may be: modifying the mark of the first transmission bitmap into the mark of the transmission bitmap copied this time; and modifying the identifier of the first copied bitmap into the identifier of the copied bitmap of the current copy.
After the first transmission bitmap and the first copy view of the source LUN are used as the transmission bitmap and the copy view of the current copy, the data to be synchronized to the corresponding target LUN in the source LUN is marked by the transmission bitmap and the copy view of the current copy, and at this time, the first transmission bitmap is emptied for marking a subsequent triggered new copy.
In an embodiment of the present application, if the current-hop copy is not the first-hop copy, after the step of synchronizing the data in the source LUN to the corresponding target LUN is performed, the method further includes the following step C10:
and step C10, modifying the value of the copy times completed in the last hop copy of the current hop copy to 0.
In this embodiment, specifically, in step S102, when determining whether the source LUN meets a condition for performing a new copy, the number of copies completed in the previous-hop copy of the current-hop copy is also determined, so that when the current-hop copy starts to perform the new copy, the number of copies completed in the previous-hop copy of the current-hop copy needs to be modified to be 0, so as to count the number of copies completed in the previous-hop copy again, and further determine whether to start to perform the next copy.
In an embodiment of the application, in the step S103, after the synchronizing the data in the source LUN to the corresponding target LUN, the method further includes the step D10:
and D10, updating the copy times completed in the current hop of copy.
In this embodiment, specifically, the target LUN of each copy pair records the number of copies completed in the copy pair, where the initial value of the number of copies is 0, and when a copy from the corresponding source LUN to the target LUN is completed once, the number of copies completed in the copy recorded on the target LUN is increased by 1.
S104, if not, the step S101 and the step S103 are repeatedly executed.
In an optional embodiment of the present application, the repeatedly executing to detect whether the source LUN meets the condition for executing the copy includes the following two ways:
and in the mode 1, whether the source LUN meets the condition of carrying out new copying is detected every preset time. For example, every 1 minute.
And 2, judging whether the source LUN meets the condition of performing new copying when the currently executed copying task on the source LUN is completed or the last hop of copying of the source LUN is completed.
To this end, the flow shown in fig. 2 is completed, and as can be seen from the flow shown in fig. 2, in the embodiment of the present application, for continuous-hop replication, when replication is triggered on a source LUN of current-hop replication, first updating a first transmission bitmap to generate a first replication view, and then detecting whether the source LUN meets a condition for performing the replication; if so, acquiring a first transmission bitmap and a first copy view of the source LUN, taking the first transmission bitmap and the first copy view as a transmission bitmap and a copy view of the copy, and executing copy to synchronize data in the source LUN to a corresponding target LUN; if not, when whether the source LUN meets the condition of copying or not is continuously detected, once the condition is detected, the copying is immediately started. Compared with the prior art, the mode of ignoring the new copy is compared with the mode of ignoring the new copy if the new copy is triggered on the source LUN of the current skip copy in the process of executing the copy by the current skip copy, so that the copy is realized as much as possible, and the positive effects of improving the utilization rate of the copy link and the copy efficiency are further achieved. In addition, if the current-hop copy is not a first-hop copy pair, when judging whether the source LUN meets the condition of copy, the number of copies completed in the previous-hop copy is also judged, and if the difference between the link bandwidths of the current-hop copy and the previous-hop copy is large, the method can be set to trigger one current-hop copy after the previous-hop copy is completed for multiple times.
Fig. 3 is a schematic structural diagram of an apparatus for continuous hop replication provided in an embodiment of the present application. Referring to fig. 3, the apparatus includes:
a triggering module 300, configured to suspend, when there is a copy trigger on a current hop-copy source LUN, a read/write IO operation of the source LUN, update a first transmission bitmap according to a difference bitmap of the source LUN, generate a first copy view, and resume the read/write IO operation of the source LUN;
a detecting module 302, configured to detect whether the source LUN meets a condition for performing replication;
a synchronization module 304, configured to obtain a first transmission bitmap and a first copy view of the source LUN, use the first transmission bitmap and the first copy view as a transmission bitmap and a copy view of this copy, empty the first transmission bitmap, and perform synchronization of data in the source LUN to a corresponding target LUN; the transmission bitmap is used for marking the position of data to be synchronized to the target LUN in the source LUN, and the copy view is used for acquiring corresponding data in the source LUN at the moment when copying is triggered.
In an optional embodiment of the present application, the triggering module 300 is specifically configured to:
detecting whether the first transmission bitmap of the source LUN is empty, and if so, taking the difference bitmap of the source LUN as the updated first transmission bitmap; and if not, merging the difference bitmap of the source LUN into the first transmission bitmap to obtain the updated first transmission bitmap.
In an optional embodiment of the present application, the detecting module 302 is specifically configured to:
if the current hop copy is the first hop copy and the source LUN has no executing copy task, detecting that the source LUN meets the condition of executing copy;
and if the current-hop copy is not the first-hop copy, the source LUN has no executing copy task, and the number of copies completed by the last-hop copy of the current-hop copy is greater than or equal to a preset threshold, detecting that the source LUN meets the condition of executing the copy.
In an optional embodiment of the present application, the apparatus further includes:
and the modifying module is used for modifying the value of the copying times finished in the last hop copying of the current hop to 0.
In an optional embodiment of the present application, the apparatus further includes:
and the calculating module is used for updating the copy times finished in the current hop copy.
An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the program, when executed by a processor, implements the steps of the method according to the first aspect, so as to implement that, compared with a prior art method that, if a new copy is triggered during a current copy process, a triggered new copy differential bitmap is merged into a transmission bitmap used by the current copy, and then data to be synchronized during the new copy is merged into the current copy for synchronization, there is no need to increase a duration of the current copy, and a positive effect of high copy efficiency and high data security is achieved.
An embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the program to implement the steps of the method according to the first aspect, so as to implement that, compared with a prior art in which if a new copy is triggered during a current copy process, a triggered new copy differential bitmap is merged into a transmission bitmap used by the current copy, and then data to be synchronized during the new copy is merged into the current copy for synchronization, there is no need to increase the duration of the current copy, and there are positive effects of high copy efficiency and high data security.
The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the controller where the software implementation is located as a logical device.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
Embodiments of the subject matter and the functional operations described in this specification can be implemented in: digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions, encoded on a tangible, non-transitory program carrier for execution by, or to control the operation of, data processing apparatus. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode and transmit information to suitable receiver apparatus for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
Computers suitable for executing computer programs include, for example, general and/or special purpose microprocessors, or any other type of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory and/or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer does not necessarily have such a device. Moreover, a computer may be embedded in another device, e.g., a mobile telephone, a Personal Digital Assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device such as a Universal Serial Bus (USB) flash drive, to name a few.
Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., an internal hard disk or a removable disk), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. In other instances, features described in connection with one embodiment may be implemented as discrete components or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Further, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (8)

1. A method of continuous hop replication, comprising:
when copying is triggered on a source LUN of current skip copying, suspending read-write IO operation of the source LUN, updating a first transmission bitmap according to a difference bitmap of the source LUN, generating a first copy view, and recovering the read-write IO operation of the source LUN;
detecting whether the source LUN meets a condition for executing copy;
if so, acquiring a first transmission bitmap and a first copy view of the source LUN, taking the first transmission bitmap and the first copy view as a transmission bitmap and a copy view of the current copy, emptying the first transmission bitmap, and synchronizing data in the source LUN to a corresponding target LUN; the transmission bitmap is used for marking the position of data to be synchronized to the target LUN in the source LUN, and the copy view is used for acquiring corresponding data in the source LUN at the moment when copying is triggered;
if not, repeatedly executing the step of detecting whether the source LUN meets the condition of executing the copy, and executing the step of taking the first transmission bitmap and the first copy view as the transmission bitmap and the copy view of the copy until the source LUN meets the condition of executing the copy, emptying the first transmission bitmap, and synchronizing the data in the source LUN to the corresponding target LUN;
the detecting whether the source LUN meets the condition of executing copy includes:
if the current hop copy is the first hop copy and the source LUN has no executing copy task, detecting that the source LUN meets the condition of executing copy;
and if the current-hop copy is not the first-hop copy, the source LUN has no executing copy task, and the number of copies completed by the last-hop copy of the current-hop copy is greater than or equal to a preset threshold, detecting that the source LUN meets the condition of executing the copy.
2. The method of claim 1, wherein the updating the first transmission bitmap according to the difference bitmap of the source LUN comprises:
detecting whether the first transmission bitmap of the source LUN is empty, and if so, taking the difference bitmap of the source LUN as the updated first transmission bitmap; and if not, merging the difference bitmap of the source LUN into the first transmission bitmap to obtain the updated first transmission bitmap.
3. The method of claim 1, wherein if the current-hop copy is not a first-hop copy, after performing synchronizing data in the source LUN to a corresponding target LUN, further comprising:
and modifying the value of the copy times completed in the last hop copy of the current hop copy to 0.
4. The method according to claim 1, wherein after the synchronizing the data in the source LUN to the corresponding target LUN, the method further comprises:
and updating the number of copies completed in the current hop copy.
5. An apparatus for continuous hop replication, comprising:
the system comprises a triggering module, a first transmission bitmap and a second transmission bitmap, wherein the triggering module is used for suspending the read-write IO operation of a source LUN when the copying is triggered on the current jump copying source LUN, updating the first transmission bitmap according to a difference bitmap of the source LUN, generating a first copy view and recovering the read-write IO operation of the source LUN;
the detection module is used for detecting whether the source LUN meets the condition of executing the copying;
a synchronization module, configured to obtain a first transmission bitmap and a first copy view of the source LUN, use the first transmission bitmap and the first copy view as a transmission bitmap and a copy view of the current copy, empty the first transmission bitmap, and perform synchronization of data in the source LUN to a corresponding target LUN; the transmission bitmap is used for marking the position of data to be synchronized to the target LUN in the source LUN, and the copy view is used for acquiring corresponding data in the source LUN at the moment when copying is triggered;
the detection module is specifically configured to:
if the current hop copy is the first hop copy and the source LUN has no executing copy task, detecting that the source LUN meets the condition of executing copy;
and if the current-hop copy is not the first-hop copy, the source LUN has no executing copy task, and the number of copies completed by the last-hop copy of the current-hop copy is greater than or equal to a preset threshold, detecting that the source LUN meets the condition of executing the copy.
6. The apparatus of claim 5, wherein the triggering module is specifically configured to:
detecting whether the first transmission bitmap of the source LUN is empty, and if so, taking the difference bitmap of the source LUN as the updated first transmission bitmap; and if not, merging the difference bitmap of the source LUN into the first transmission bitmap to obtain the updated first transmission bitmap.
7. The apparatus as recited in claim 5, further comprising:
and the modifying module is used for modifying the value of the copying times finished in the last hop copying of the current hop to 0.
8. The apparatus of claim 5, further comprising:
and the calculating module is used for updating the copy times finished in the current hop copy.
CN201910107839.8A 2019-02-02 2019-02-02 Continuous hop replication method and device Active CN109885428B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910107839.8A CN109885428B (en) 2019-02-02 2019-02-02 Continuous hop replication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910107839.8A CN109885428B (en) 2019-02-02 2019-02-02 Continuous hop replication method and device

Publications (2)

Publication Number Publication Date
CN109885428A CN109885428A (en) 2019-06-14
CN109885428B true CN109885428B (en) 2021-02-26

Family

ID=66927853

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910107839.8A Active CN109885428B (en) 2019-02-02 2019-02-02 Continuous hop replication method and device

Country Status (1)

Country Link
CN (1) CN109885428B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651301A (en) * 2020-06-08 2020-09-11 上海英方软件股份有限公司 Periodic synchronization system and method based on block replication

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096616A (en) * 2011-02-15 2011-06-15 成都市华为赛门铁克科技有限公司 Logical object data duplication method and related device
CN103814360A (en) * 2013-12-12 2014-05-21 华为技术有限公司 Data replication method and storage system
CN103885717A (en) * 2012-12-19 2014-06-25 杭州宏杉科技有限公司 Data replication method and data replication device
US10042710B2 (en) * 2014-09-16 2018-08-07 Actifio, Inc. System and method for multi-hop data backup

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216843B (en) * 2008-01-17 2010-09-29 四川格瑞特科技有限公司 Multi-point multi-hop data real time backup method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096616A (en) * 2011-02-15 2011-06-15 成都市华为赛门铁克科技有限公司 Logical object data duplication method and related device
CN103885717A (en) * 2012-12-19 2014-06-25 杭州宏杉科技有限公司 Data replication method and data replication device
CN103814360A (en) * 2013-12-12 2014-05-21 华为技术有限公司 Data replication method and storage system
US10042710B2 (en) * 2014-09-16 2018-08-07 Actifio, Inc. System and method for multi-hop data backup

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Oracle MaxRep for SAN用户指南;oracle;《https://docs.oracle.com/cd/E62435_01/E62085_01/E62085_01.pdf》;20140831;第21-27页 *

Also Published As

Publication number Publication date
CN109885428A (en) 2019-06-14

Similar Documents

Publication Publication Date Title
US8788770B2 (en) Multiple cascaded backup process
JP4900811B2 (en) Storage system and storage control method
JP5295263B2 (en) How to determine whether a repository is used to store data that is updated during resynchronization
US7707373B2 (en) Storage system and backup method
CN102792276B (en) Buffer disk in flashcopy cascade
US20130254457A1 (en) Methods and structure for rapid offloading of cached data in a volatile cache memory of a storage controller to a nonvolatile memory
WO2015085529A1 (en) Data replication method, data replication device and storage device
CN106227625B (en) A kind of restoration methods and system of the flash data damaged by power down
CN106844597A (en) The method and its device of a kind of quick deletion dependent snapshot target volume
CN106528338A (en) Remote data replication method, storage equipment and storage system
CN109885428B (en) Continuous hop replication method and device
JP2013045364A5 (en)
WO2014075586A1 (en) Method and device for automatically recovering storage of jbod array
JP6281511B2 (en) BACKUP CONTROL DEVICE, BACKUP CONTROL METHOD, AND PROGRAM
CN104298609B (en) Data copying method and device
US8990528B2 (en) Method for fast format of a fully allocated volume when copied from a space efficient volume
CN108170375B (en) Overrun protection method and device in distributed storage system
JP2006011811A (en) Storage control system and storage control method
US8560789B2 (en) Disk apparatus, data replicating method onto disk apparatus and program recording medium
CN109165117A (en) The method and system of data processing
CN114442944B (en) Data replication method, system and equipment
CN109725855B (en) Method and device for continuous jump replication
CN106844094B (en) File repair method and device
CN114442942B (en) Data migration method, system, equipment and storage medium
WO2015090081A1 (en) Routing information aging method and device, and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant