CN113448774A - Method, system, device and medium for optimizing copy-on-write storage snapshot management - Google Patents

Method, system, device and medium for optimizing copy-on-write storage snapshot management Download PDF

Info

Publication number
CN113448774A
CN113448774A CN202110626989.7A CN202110626989A CN113448774A CN 113448774 A CN113448774 A CN 113448774A CN 202110626989 A CN202110626989 A CN 202110626989A CN 113448774 A CN113448774 A CN 113448774A
Authority
CN
China
Prior art keywords
snapshot
volume
snapshot volume
time
data block
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.)
Granted
Application number
CN202110626989.7A
Other languages
Chinese (zh)
Other versions
CN113448774B (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.)
Shandong Yingxin Computer Technology Co Ltd
Original Assignee
Shandong Yingxin Computer Technology 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 Shandong Yingxin Computer Technology Co Ltd filed Critical Shandong Yingxin Computer Technology Co Ltd
Priority to CN202110626989.7A priority Critical patent/CN113448774B/en
Publication of CN113448774A publication Critical patent/CN113448774A/en
Application granted granted Critical
Publication of CN113448774B publication Critical patent/CN113448774B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Abstract

The invention discloses a method, a system, equipment and a storage medium for optimizing copy-on-write storage snapshot management, wherein the method comprises the following steps: responding to a triggering condition for triggering and setting a snapshot, and creating a snapshot for a data block to be snapshot in an initial source volume to acquire a snapshot volume at the current moment; the method comprises the steps that a plurality of snapshot volumes at different moments are stored in a cascade mode according to a creation time sequence to form a snapshot group, and a copy-on-write relation between an initial source volume and a snapshot volume at the last position of the snapshot group is established; responding to the deletion of a first snapshot volume in the snapshot group, and judging whether the first snapshot volume is a first snapshot volume of the snapshot group; and in response to that the first snapshot volume is not the first snapshot volume of the snapshot group, writing the data of the first snapshot volume to a data block corresponding to a previous cascaded snapshot volume of the first snapshot volume, and forming a new cascade relationship. The present invention can keep all snapshots available when any snapshot is deleted or the source volume is restored to any snapshot.

Description

Method, system, device and medium for optimizing copy-on-write storage snapshot management
Technical Field
The present invention relates to the field of snapshots, and more particularly, to a method, system, computer device, and readable medium for optimizing copy-on-write storage snapshot management.
Background
A snapshot is a fully available copy of a given data set that includes an image of the corresponding data at some point in time (the point in time at which the copy began). The snapshot may be a copy of the data it represents or may be a replica of the data. The snapshot mainly has the function of online data backup and recovery. When the storage device has application failure or file damage, the data can be quickly recovered, and the data can be recovered to the state of an available time point. Current storage snapshot technologies can be broadly divided into two categories, full-volume snapshots and incremental snapshots. The incremental snapshot techniques are mainly COW (Copy-On-Write) and ROW (Redirect-On-Write redirection).
In the prior art, when the number of snapshots is increased, the write amplification is increased, so that the write performance is reduced, and the deletion of one snapshot causes the other snapshots to be unavailable.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, a system, a computer device, and a computer-readable storage medium for optimizing management of copy-on-write storage snapshots, where the method and the system automatically remove dependency relationships between adjacent cascaded snapshots when a snapshot is deleted, and perform processing according to a certain rule in combination with a normal write operation of a source volume when a snapshot is restored, so as to ensure that write performance of the source volume is not degraded in a multi-snapshot scenario as the number of snapshots increases, and when a snapshot is deleted or restored, the use of other snapshots is not affected, and the cascaded and independent relationships of all snapshots are maintained.
Based on the above object, an aspect of the embodiments of the present invention provides a method for optimizing management of a copy-on-write storage snapshot, including the following steps: responding to a triggering condition for triggering and setting a snapshot, and creating a snapshot for a data block to be snapshot in an initial source volume to acquire a snapshot volume at the current moment; the method comprises the steps that a plurality of snapshot volumes at different moments are stored in a cascade mode according to a creation time sequence to form a snapshot group, and a copy-on-write relation between an initial source volume and a snapshot volume at the last position of the snapshot group is established; responding to the deletion of a first snapshot volume in the snapshot group, and judging whether the first snapshot volume is a first snapshot volume of the snapshot group; and in response to that the first snapshot volume is not the first snapshot volume of the snapshot group, writing the data of the first snapshot volume to a data block corresponding to a previous cascaded snapshot volume of the first snapshot volume, and forming a new cascade relationship.
In some embodiments, the forming a new cascade relationship comprises: and reconnecting the snapshot volume in the cascade before the first snapshot volume and the snapshot volume in the cascade after the first snapshot volume.
In some embodiments, the method further comprises: in response to a data block change in the initial source volume, writing a changed data block in a snapshot volume at a last bit of the snapshot group via the copy-on-write relationship.
In some embodiments, the method further comprises: and in response to the source volume at the second moment is restored to the source volume at the first moment, sequentially traversing the changed data on the snapshot volume from the first moment to the second moment and writing the changed data into the source volume at the first moment.
In some embodiments, sequentially traversing the changed data on the snapshot volume from the first time to the second time and writing to the source volume at the second time includes: judging whether the current snapshot volume is the last snapshot volume from the first time to the second time; and in response to that the current snapshot volume is not the last snapshot volume from the first time to the second time, traversing the current snapshot volume and writing the first data block on the current snapshot volume to the source volume restored by the previous snapshot volume.
In some embodiments, the writing the first data block on the current snapshot volume to the source volume restored by the previous snapshot volume includes: and writing a second data block corresponding to the first data block in the source volume corresponding to the current snapshot volume into a next cascaded snapshot volume.
In some embodiments, sequentially traversing the changed data on the snapshot volume from the first time to the second time and writing to the source volume at the second time includes: and in response to that the current snapshot volume is the last snapshot volume from the first time to the second time, determining a position which is not traversed, and writing a first data block of the position in the current snapshot volume into a source volume restored by a previous snapshot volume.
In another aspect of the embodiments of the present invention, a system for optimizing copy-on-write storage snapshot management is provided, including: the creating module is configured to respond to a trigger condition for triggering snapshot setting, and create a snapshot for a data block to be snapshot in the initial source volume to obtain a snapshot volume at the current moment; the system comprises a cascade module, a storage module and a processing module, wherein the cascade module is configured to cascade and store a plurality of snapshot volumes at different moments according to a creation time sequence to form a snapshot group, and establish a copy-on-write relationship between an initial source volume and a snapshot volume at the last position of the snapshot group; the judging module is configured to respond to deletion of a first snapshot volume in the snapshot group and judge whether the first snapshot volume is a first snapshot volume of the snapshot group; and the execution module is configured to respond that the first snapshot volume is not the snapshot volume at the first position of the snapshot group, write the data of the first snapshot volume to the data block corresponding to the snapshot volume in the previous cascade of the first snapshot volume, and form a new cascade relationship.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method as above.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has the following beneficial technical effects: by automatically removing the dependency relationship of adjacent cascade snapshots when deleting the snapshots and combining with the ordinary writing operation of the source volume for processing according to a certain rule when recovering the snapshots, the writing performance of the source volume is ensured not to be reduced along with the increase of the number of the snapshots in a multi-snapshot scene, the use of other snapshots is not influenced when deleting or recovering a certain snapshot, and the cascade and independent relationships of all the snapshots are maintained.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic diagram of an embodiment of a method for optimizing copy-on-write storage snapshot management provided by the present invention;
FIG. 2 is a flow diagram of a source volume creating a corresponding plurality of cascaded snapshots;
FIG. 3 is a block diagram of a whole cascaded snapshot when a delete operation is performed;
FIG. 4 is a block diagram of a whole cascade snapshot during a restore operation;
FIG. 5 is a schematic hardware configuration diagram of an embodiment of a computer apparatus for optimizing copy-on-write storage snapshot management according to the present invention;
FIG. 6 is a schematic diagram of an embodiment of a computer storage medium for optimizing copy-on-write storage snapshot management provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
A first aspect of an embodiment of the present invention provides an embodiment of a method for optimizing management of a copy-on-write storage snapshot. FIG. 1 is a diagram illustrating an embodiment of a method for optimizing copy-on-write storage snapshot management provided by the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
s1, responding to the trigger condition for triggering snapshot setting, creating a snapshot for the data block to be snapshot in the initial source volume to obtain the snapshot volume at the current moment;
s2, cascading and storing a plurality of snapshot volumes at different moments according to the creation time sequence to form a snapshot group, and establishing a copy-on-write relationship between the initial source volume and the snapshot volume at the last position of the snapshot group;
s3, responding to the deletion of the first snapshot volume in the snapshot group, and judging whether the first snapshot volume is the first snapshot volume of the snapshot group; and
s4, responding to the first snapshot volume not being the first snapshot volume of the snapshot group, writing the data of the first snapshot volume to the data block corresponding to the previous cascaded snapshot volume of the first snapshot volume, and forming a new cascade relation.
And responding to a triggering condition for triggering snapshot setting, and creating a snapshot for a data block to be snapshot in the initial source volume to acquire the snapshot volume at the current moment. And when the set triggering condition is met, carrying out snapshot on the corresponding data block in the initial source volume. Fig. 2 is a flowchart illustrating the creation of a plurality of cascaded snapshots by a source volume, where as shown in fig. 2, a source volume S (a, a) makes a snapshot at four times t1, t2, t3, and t4, respectively, and sequentially writes B, C, D, E between times t1 and t2, between times t2 and t3, between times t3 and t4, and after time t4, respectively. T1, T2, T3 and T4 are snapshot volumes at time T1, time T2, time T3 and time T4, respectively, and B is written between time T1 and time T2, so that data block a of source volume S is replaced by B to form a first source volume S1, at which time snapshot volume T1 becomes snapshot volume T1 ', and similarly, C is written between time T2 and time T3, at which time another data block a of source volume S is replaced by C to form a second source volume S2, at which time snapshot volume T2 becomes snapshot volume T2', and so on, T3 'and T4' can be obtained.
And cascading and storing a plurality of snapshot volumes at different moments according to a creation time sequence to form a snapshot group, and establishing a copy-on-write relation between the initial source volume and the snapshot volume at the last position of the snapshot group. In the embodiment of the invention, T1 ', T2', T3 'and T4' are stored in a cascade mode according to the creation time sequence, and each snapshot volume depends on the subsequent snapshot volume, for example, T2 'depends on T1'.
In some embodiments, the method further comprises: in response to a data block change in the initial source volume, writing a changed data block in a snapshot volume at a last bit of the snapshot group via the copy-on-write relationship. Under the condition that one source volume corresponds to a plurality of snapshot volumes, each change of the source volume only needs to keep a copy-on-write relation with the last snapshot volume, and each snapshot in the period does not need to be copied once, so that the problem of write amplification is avoided.
And responding to the deletion of the first snapshot volume in the snapshot group, and judging whether the first snapshot volume is the first snapshot volume of the snapshot group. And in response to that the first snapshot volume is not the first snapshot volume of the snapshot group, writing the data of the first snapshot volume to a data block corresponding to a previous cascaded snapshot volume of the first snapshot volume, and forming a new cascade relationship. When the first snapshot volume is deleted, if the first snapshot volume is the first-ranked snapshot volume, no snapshot volume depends on the first snapshot volume, and the first snapshot volume can be directly deleted; if the first snapshot volume is not the first snapshot volume, the previous snapshot volumes all depend on the data on the first snapshot volume, and at this time, the data volume on the first snapshot is written to the corresponding data block of the previous cascaded snapshot volume, so that the dependency on the first snapshot volume is removed.
In some embodiments, the forming a new cascade relationship comprises: and reconnecting the snapshot volume in the cascade before the first snapshot volume and the snapshot volume in the cascade after the first snapshot volume. After the first snapshot volume is deleted, the adjacent snapshots before and after the snapshot volume are connected again to form a new snapshot chain cascade relation.
FIG. 3 is an architectural diagram illustrating an entire cascaded snapshot when a delete operation is performed. As shown in fig. 3, the first snapshot volume is T2 ', which is not the first snapshot volume, so that the data block a on the T2 ' snapshot volume may be written to the corresponding data block of the previous cascaded snapshot volume T1 ', and the dependency of the snapshot at the time of cascade T1 on the snapshot at the time of T2 is removed, so that the snapshot at the time of T1 cannot be used (data loss) due to deletion of the snapshot at the time of T2, and the independence of the snapshots of the cascaded snapshots is maintained.
Continuing with the above example, when the source volume is restored to the time t3 at the time t5, the changed data on the snapshot volumes at the times t3 and t4 are sequentially traversed and written to the source volume, at this time, due to the fact that the source volume is subjected to a write operation, a copy-on-write operation on the snapshot at the time t4 is triggered, at this time, the current source volume can be restored to the data at the corresponding time by using the snapshots at any time t1, t3, and t4, while the period only relates to the copy-on-write operation on the last snapshot, and it can be ensured that any snapshot is available, and the source volume can be restored to the data at the time.
In some embodiments, the method further comprises: and in response to the source volume at the second moment is restored to the source volume at the first moment, sequentially traversing the changed data on the snapshot volume from the first moment to the second moment and writing the changed data into the source volume at the second moment. For example, when the source volume is restored to the source volume at time t3 at time t5, the snapshot volumes at times t3 and t4 are traversed in sequence, and the changed data in the snapshot volumes at times t3 and t4 are written to the source volume at time t 5.
In some embodiments, sequentially traversing the changed data on the snapshot volume from the first time to the second time and writing to the source volume at the second time includes: judging whether the current snapshot volume is the last snapshot volume from the first time to the second time; and in response to that the current snapshot volume is not the last snapshot volume from the first time to the second time, traversing the current snapshot volume and writing the first data block on the current snapshot volume to the source volume restored by the previous snapshot volume. For example, when the current snapshot volume is T3 ', the data on T3 ' is traversed, and when the data block a is traversed at T3 ', the data block a at the corresponding position of T4 ' is no longer traversed, and the data block a on T3 ' is directly written to the source volume S3. The source volume at this point in the T3' restore is (B, C, A, E).
In some embodiments, the writing the first data block on the current snapshot volume to the source volume restored by the previous snapshot volume includes: and writing a second data block corresponding to the first data block in the source volume corresponding to the current snapshot volume into a next cascaded snapshot volume. Before overwriting data block A to D of the source volume, D is written to the corresponding data block of T4'.
In some embodiments, sequentially traversing the changed data on the snapshot volume from the first time to the second time and writing to the source volume at the second time includes: and in response to that the current snapshot volume is the last snapshot volume from the first time to the second time, determining a position which is not traversed, and writing a first data block of the position in the current snapshot volume into a source volume restored by a previous snapshot volume. For example, the current snapshot volume is T4 ', data on T4 ' is traversed, and data block A on T4 ' is written to (B, C, A, E). The source volume at this point is (B, C, A, A).
FIG. 4 is an architectural diagram illustrating an entire cascaded snapshot when a restore operation is performed. As shown in fig. 4, when the source volume is restored to the snapshot at time T3 at time T5, the data in T3 ' is traversed first in the order from T3 ' to T4 ', when traversing data block a on T3 ', the data block at the corresponding position of T4 ' is not traversed, but the data block a on T3 ' is directly written to the data block (B, C, D, E) to form (B, C, a, E), the source volume (B, C, D, E) triggers a copy-on-write operation, before a is overwritten to D of the source volume, D is written to the corresponding data block of T4 ', and then other data blocks continue to be traversed from T3 ', the 4 th data block on T3 ' is empty, so the 4 th data block of T4 ' is traversed to a, a is written to the corresponding 4 th data block of the source volume (B, C, a, E), and the 4 th data block is also written to the data block a before T4 ' is traversed, so no overwrite is performed any more and the 4 th data block of T4' is still a.
In this way, all write operations to the source volume only trigger copy-on-write to the last cascaded snapshot, write amplification increase due to increase of the number of snapshots is avoided, any snapshot of the cascaded snapshots is deleted, use of other snapshots is not affected, the source volume is restored to any snapshot, use of other snapshots is not affected, and the source volume is restored to the corresponding time, and the snapshots can be repeatedly restored in a cross manner, for example, after the source volume data is restored to the time t3 by using the time t3, the source volume can be restored to the time t4 by using the snapshot at the time t4, and then the source volume can still be restored to the time t3 by using the snapshot at the time t 3.
In the embodiment of the invention, by setting a cascade snapshot mode, when the source volume changes, the copy-on-write operation is triggered only for the last cascade snapshot, so that the increase of write amplification caused by the increase of the number of snapshots is avoided; when one snapshot in the cascade snapshots is deleted, the dependency removal operation is carried out, and the changed data on the snapshot is written into the data block corresponding to the previous snapshot in the cascade snapshots, so that the condition that the cascade snapshot data at the moment before the snapshot is deleted is unavailable due to deletion is avoided; when the snapshot is recovered, according to each data block of the traversal cascade snapshot from front to back, the content of the traversed 1 st data block is written to the source volume, and the copy-on-write operation of the source volume to the last cascade snapshot is triggered at the same time.
It should be particularly noted that, the steps in the embodiments of the method for optimizing management of a snapshot of a copy-on-write storage may be mutually intersected, replaced, added, and deleted, so that these reasonable permutation and combination transformations should also belong to the scope of the present invention, and should not limit the scope of the present invention to the embodiments.
In view of the above, a second aspect of the embodiments of the present invention provides a system for optimizing management of a snapshot of copy-on-write storage, including: the creating module is configured to respond to a trigger condition for triggering snapshot setting, and create a snapshot for a data block to be snapshot in the initial source volume to obtain a snapshot volume at the current moment; the system comprises a cascade module, a storage module and a processing module, wherein the cascade module is configured to cascade and store a plurality of snapshot volumes at different moments according to a creation time sequence to form a snapshot group, and establish a copy-on-write relationship between an initial source volume and a snapshot volume at the last position of the snapshot group; the judging module is configured to respond to deletion of a first snapshot volume in the snapshot group and judge whether the first snapshot volume is a first snapshot volume of the snapshot group; and the execution module is configured to respond that the first snapshot volume is not the snapshot volume at the first position of the snapshot group, write the data of the first snapshot volume to the data block corresponding to the snapshot volume in the previous cascade of the first snapshot volume, and form a new cascade relationship.
In some embodiments, the execution module is configured to: and reconnecting the snapshot volume in the cascade before the first snapshot volume and the snapshot volume in the cascade after the first snapshot volume.
In some embodiments, the system further comprises an alteration module configured to: in response to a data block change in the initial source volume, writing a changed data block in a snapshot volume at a last bit of the snapshot group via the copy-on-write relationship.
In some embodiments, the system further comprises a traversal module configured to: and in response to the source volume at the second moment is restored to the source volume at the first moment, sequentially traversing the changed data on the snapshot volume from the first moment to the second moment and writing the changed data into the source volume at the first moment.
In some embodiments, the traversal module is configured to: judging whether the current snapshot volume is the last snapshot volume from the first time to the second time; and in response to that the current snapshot volume is not the last snapshot volume from the first time to the second time, traversing the current snapshot volume and writing the first data block on the current snapshot volume to the source volume restored by the previous snapshot volume.
In some embodiments, the traversal module is configured to: and writing a second data block corresponding to the first data block in the source volume corresponding to the current snapshot volume into a next cascaded snapshot volume.
In some embodiments, the traversal module is configured to: and in response to that the current snapshot volume is the last snapshot volume from the first time to the second time, determining a position which is not traversed, and writing a first data block of the position in the current snapshot volume into a source volume restored by a previous snapshot volume.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: s1, responding to the trigger condition for triggering snapshot setting, creating a snapshot for the data block to be snapshot in the initial source volume to obtain the snapshot volume at the current moment; s2, cascading and storing a plurality of snapshot volumes at different moments according to the creation time sequence to form a snapshot group, and establishing a copy-on-write relationship between the initial source volume and the snapshot volume at the last position of the snapshot group;
s3, responding to the deletion of the first snapshot volume in the snapshot group, and judging whether the first snapshot volume is the first snapshot volume of the snapshot group; and S4, responding to the first snapshot volume not being the first snapshot volume of the snapshot group, writing the data of the first snapshot volume to the data block corresponding to the previous cascaded snapshot volume of the first snapshot volume, and forming a new cascade relation.
In some embodiments, the forming a new cascade relationship comprises: and reconnecting the snapshot volume in the cascade before the first snapshot volume and the snapshot volume in the cascade after the first snapshot volume.
In some embodiments, the steps further comprise: in response to a data block change in the initial source volume, writing a changed data block in a snapshot volume at a last bit of the snapshot group via the copy-on-write relationship.
In some embodiments, the steps further comprise: and in response to the source volume at the second moment is restored to the source volume at the first moment, sequentially traversing the changed data on the snapshot volume from the first moment to the second moment and writing the changed data into the source volume at the first moment.
In some embodiments, sequentially traversing the changed data on the snapshot volume from the first time to the second time and writing to the source volume at the second time includes: judging whether the current snapshot volume is the last snapshot volume from the first time to the second time; and in response to that the current snapshot volume is not the last snapshot volume from the first time to the second time, traversing the current snapshot volume and writing the first data block on the current snapshot volume to the source volume restored by the previous snapshot volume.
In some embodiments, the writing the first data block on the current snapshot volume to the source volume restored by the previous snapshot volume includes: and writing a second data block corresponding to the first data block in the source volume corresponding to the current snapshot volume into a next cascaded snapshot volume.
In some embodiments, sequentially traversing the changed data on the snapshot volume from the first time to the second time and writing to the source volume at the second time includes: and in response to that the current snapshot volume is the last snapshot volume from the first time to the second time, determining a position which is not traversed, and writing a first data block of the position in the current snapshot volume into a source volume restored by a previous snapshot volume.
Fig. 5 is a schematic hardware structural diagram of an embodiment of the computer apparatus for optimizing management of a copy-on-write storage snapshot according to the present invention.
Taking the apparatus shown in fig. 5 as an example, the apparatus includes a processor 201 and a memory 202, and may further include: an input device 203 and an output device 204.
The processor 201, the memory 202, the input device 203 and the output device 204 may be connected by a bus or other means, and fig. 5 illustrates the connection by a bus as an example.
The memory 202, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for optimizing copy-on-write storage snapshot management in the embodiments of the present application. The processor 201 executes various functional applications of the server and data processing by running the nonvolatile software programs, instructions and modules stored in the memory 202, i.e. implements the method for optimizing copy-on-write storage snapshot management of the above method embodiment.
The memory 202 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the method of optimizing copy-on-write storage snapshot management, and the like. Further, the memory 202 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 202 may optionally include memory located remotely from processor 201, which may be connected to local modules via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 203 may receive information such as a user name and a password that are input. The output device 204 may include a display device such as a display screen.
Program instructions/modules corresponding to one or more methods of optimizing copy-on-write storage snapshot management are stored in memory 202 and, when executed by processor 201, perform the method of optimizing copy-on-write storage snapshot management in any of the above-described method embodiments.
Any embodiment of a computer device implementing the method for optimizing copy-on-write storage snapshot management described above may achieve the same or similar effects as any of the preceding method embodiments corresponding thereto.
The invention also provides a computer readable storage medium storing a computer program which, when executed by a processor, performs the method as above.
Fig. 6 is a schematic diagram of an embodiment of a computer storage medium for managing a snapshot of an optimized copy-on-write storage according to the present invention. Taking the computer storage medium as shown in fig. 6 as an example, the computer readable storage medium 3 stores a computer program 31 which, when executed by a processor, performs the method as described above.
Finally, it should be noted that, as one of ordinary skill in the art can appreciate that all or part of the processes of the methods of the above embodiments can be implemented by a computer program to instruct related hardware, and the program for optimizing the method of managing the copy-on-write storage snapshot can be stored in a computer readable storage medium, and when executed, the program can include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method for optimizing copy-on-write storage snapshot management, comprising the steps of:
responding to a triggering condition for triggering and setting a snapshot, and creating a snapshot for a data block to be snapshot in an initial source volume to acquire a snapshot volume at the current moment;
the method comprises the steps that a plurality of snapshot volumes at different moments are stored in a cascade mode according to a creation time sequence to form a snapshot group, and a copy-on-write relation between an initial source volume and a snapshot volume at the last position of the snapshot group is established;
responding to the deletion of a first snapshot volume in the snapshot group, and judging whether the first snapshot volume is a first snapshot volume of the snapshot group; and
and in response to that the first snapshot volume is not the first snapshot volume of the snapshot group, writing the data of the first snapshot volume to a data block corresponding to a previous cascaded snapshot volume of the first snapshot volume, and forming a new cascade relationship.
2. The method of claim 1, wherein forming the new cascade relationship comprises:
and reconnecting the snapshot volume in the cascade before the first snapshot volume and the snapshot volume in the cascade after the first snapshot volume.
3. The method of claim 1, further comprising:
in response to a data block change in the initial source volume, writing a changed data block in a snapshot volume at a last bit of the snapshot group via the copy-on-write relationship.
4. The method of claim 1, further comprising:
and in response to the source volume at the second moment is restored to the source volume at the first moment, sequentially traversing the changed data on the snapshot volume from the first moment to the second moment and writing the changed data into the source volume at the first moment.
5. The method of claim 4, wherein sequentially traversing the changed data on the snapshot volumes from the first time to the second time and writing to the source volume at the second time comprises:
judging whether the current snapshot volume is the last snapshot volume from the first time to the second time; and
and in response to that the current snapshot volume is not the last snapshot volume from the first time to the second time, traversing the current snapshot volume, and writing the first data block on the current snapshot volume to the source volume restored by the previous snapshot volume.
6. The method of claim 5, wherein writing the first data block on the current snapshot volume to the source volume restored from the previous snapshot volume comprises:
and writing a second data block corresponding to the first data block in the source volume corresponding to the current snapshot volume into a next cascaded snapshot volume.
7. The method of claim 5, wherein sequentially traversing the changed data on the snapshot volumes from the first time to the second time and writing to the source volume at the second time comprises:
and in response to that the current snapshot volume is the last snapshot volume from the first time to the second time, determining a position which is not traversed, and writing a first data block of the position in the current snapshot volume into a source volume restored by a previous snapshot volume.
8. A system for optimizing copy-on-write storage snapshot management, comprising:
the creating module is configured to respond to a trigger condition for triggering snapshot setting, and create a snapshot for a data block to be snapshot in the initial source volume to obtain a snapshot volume at the current moment;
the system comprises a cascade module, a storage module and a processing module, wherein the cascade module is configured to cascade and store a plurality of snapshot volumes at different moments according to a creation time sequence to form a snapshot group, and establish a copy-on-write relationship between an initial source volume and a snapshot volume at the last position of the snapshot group;
the judging module is configured to respond to deletion of a first snapshot volume in the snapshot group and judge whether the first snapshot volume is a first snapshot volume of the snapshot group; and
and the execution module is configured to respond that the first snapshot volume is not the snapshot volume at the first position of the snapshot group, write the data of the first snapshot volume to a data block corresponding to a snapshot volume in the previous cascade of the first snapshot volume, and form a new cascade relationship.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202110626989.7A 2021-06-04 2021-06-04 Method, system, device and medium for optimizing copy-on-write storage snapshot management Active CN113448774B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110626989.7A CN113448774B (en) 2021-06-04 2021-06-04 Method, system, device and medium for optimizing copy-on-write storage snapshot management

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110626989.7A CN113448774B (en) 2021-06-04 2021-06-04 Method, system, device and medium for optimizing copy-on-write storage snapshot management

Publications (2)

Publication Number Publication Date
CN113448774A true CN113448774A (en) 2021-09-28
CN113448774B CN113448774B (en) 2023-01-24

Family

ID=77810877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110626989.7A Active CN113448774B (en) 2021-06-04 2021-06-04 Method, system, device and medium for optimizing copy-on-write storage snapshot management

Country Status (1)

Country Link
CN (1) CN113448774B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115509808A (en) * 2022-09-19 2022-12-23 安徽鼎甲计算机科技有限公司 Data backup method and device, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101419564A (en) * 2008-12-11 2009-04-29 杭州华三通信技术有限公司 Method and device for recovering data by employing snapshot
US20170083250A1 (en) * 2015-09-21 2017-03-23 International Business Machines Corporation Copy-redirect on write
CN106569738A (en) * 2016-09-30 2017-04-19 华为技术有限公司 Method and apparatus for deleting cascading snapshot
CN106844597A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 The method and its device of a kind of quick deletion dependent snapshot target volume
CN109213636A (en) * 2018-09-25 2019-01-15 郑州云海信息技术有限公司 A kind of storage snapshot creation method, device, equipment and storage medium
CN109614055A (en) * 2018-12-21 2019-04-12 杭州宏杉科技股份有限公司 Snapshot creation method, device, electronic equipment and machine readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101419564A (en) * 2008-12-11 2009-04-29 杭州华三通信技术有限公司 Method and device for recovering data by employing snapshot
US20170083250A1 (en) * 2015-09-21 2017-03-23 International Business Machines Corporation Copy-redirect on write
CN106569738A (en) * 2016-09-30 2017-04-19 华为技术有限公司 Method and apparatus for deleting cascading snapshot
CN106844597A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 The method and its device of a kind of quick deletion dependent snapshot target volume
CN109213636A (en) * 2018-09-25 2019-01-15 郑州云海信息技术有限公司 A kind of storage snapshot creation method, device, equipment and storage medium
CN109614055A (en) * 2018-12-21 2019-04-12 杭州宏杉科技股份有限公司 Snapshot creation method, device, electronic equipment and machine readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115509808A (en) * 2022-09-19 2022-12-23 安徽鼎甲计算机科技有限公司 Data backup method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN113448774B (en) 2023-01-24

Similar Documents

Publication Publication Date Title
US11740974B2 (en) Restoring a database using a fully hydrated backup
US9645892B1 (en) Recording file events in change logs while incrementally backing up file systems
CN108376109A (en) Volume and snapshot
US20070208918A1 (en) Method and apparatus for providing virtual machine backup
WO2017107900A1 (en) Virtual machine recovery method and virtual machine management device
US11397538B2 (en) Data migration method and apparatus
EP3796174B1 (en) Restoring a database using a fully hydrated backup
CN109783014B (en) Data storage method and device
CN113886143B (en) Virtual machine continuous data protection method and device and data recovery method and device
CN103049539A (en) Method and device for storing file data in file system
CN110825546A (en) Recovery method, system and equipment terminal for high-availability database cluster
CN113448774B (en) Method, system, device and medium for optimizing copy-on-write storage snapshot management
CN109753381B (en) Continuous data protection method based on object storage
US7580959B2 (en) Apparatus, system, and method for providing efficient disaster recovery storage of data using differencing
CN106599006B (en) Data recovery method and device
CN111143112B (en) Method, apparatus and computer readable storage medium for restoring metadata
CN109325005B (en) Data processing method and electronic equipment
CN111984469A (en) Incremental snapshot capacity expansion method and device
CN114026545A (en) Snapshot for arbitrary point in time replication
CN108089942B (en) Data backup and recovery method and device
KR101969799B1 (en) Electronic device and controlling method thereof
CN110673985A (en) Method for automatically backing up version library, storage medium and server
CN112612648B (en) SQL Server database recovery method, terminal equipment and storage medium
CN116257531B (en) Database space recovery method
CN110362429B (en) Continuous data protection method, system, device and medium for database

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