A snapshot deletion method and device, electronic equipment and storage medium

By determining the protection capacity of the snapshot volume and performing data replication and attribute information modification in the ROW snapshot mechanism, the problem of long snapshot deletion time is solved, and efficient snapshot deletion is achieved.

CN119166051BActive Publication Date: 2025-12-19NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411190671.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2025-12-19
Estimated Expiration
2044-08-27

AI Technical Summary

Technical Problem

The existing ROW snapshot mechanism suffers from poor snapshot deletion performance when writing a large amount of data and copying the data to the source data volume.

Method used

When a snapshot deletion command is received, it is determined whether the protection capacity of the snapshot volume exceeds the preset threshold. If so, the data that has not been redirected in the source data volume is copied to the snapshot volume to generate a full data snapshot volume, which is then configured as the target source data volume. The identity conversion is achieved by changing the attribute information.

Benefits of technology

It effectively reduces the amount of data that needs to be copied, reduces write amplification, and improves the performance of snapshot deletion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166051B_ABST
    Figure CN119166051B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a snapshot deletion method and device, electronic equipment and storage medium. The method comprises: in response to receiving a snapshot deletion instruction, determining whether the protection capacity of a write snapshot volume exceeds a preset threshold; the snapshot volume is generated based on a write-time redirection (ROW) snapshot of a source data volume; if yes, copying first data in the source data volume to the snapshot volume to obtain a full data snapshot volume; the first data is data in the source data volume whose pointer has not been redirected; deleting the source data volume and configuring the full data snapshot volume as a target source data volume. The present scheme reduces the amount of data that needs to be copied, reduces the write amplification in data processing, and improves the performance of snapshot deletion.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer storage, in particular to a snapshot deletion method and device, electronic equipment and storage medium. BACKGROUND

[0002] In the storage field, in order to ensure the safety of data storage, snapshot technology is often used. According to the definition of SNIA (Storage Networking Industry Association, global network storage industry association), a snapshot is a complete available copy of a specified data set (such as a storage volume). With the innovation of storage technology, and with the development of write-intensive storage systems and distributed storage systems, ROW (Redirect-On-Write, write-time redirection) snapshot technology is widely used.

[0003] In the existing ROW snapshot mechanism, the source data volume only saves the original data, that is, the data content before the snapshot is generated. When the ROW snapshot is created, a snapshot volume is generated, new data is written into the snapshot volume, and the pointer in the mapping table of the source data volume is updated to redirect to the snapshot volume pointer. Based on the ROW snapshot deletion, the data on the snapshot volume needs to be copied to the source data volume, and then the snapshot volume deletion is performed.

[0004] In actual application process, the existing ROW snapshot mechanism has a problem: if a snapshot is generated and a large amount of data is written, that is, the snapshot protection capacity is large, then it will take a long time to copy the data to the source data volume before deleting the snapshot, and the snapshot deletion performance is worse. SUMMARY

[0005] The purpose of the embodiments of the present application is to provide a snapshot deletion method, device, electronic equipment and storage medium, so as to effectively reduce the amount of data to be copied when deleting a snapshot, reduce the write amplification in data processing, and improve the performance of snapshot deletion. The specific technical solutions are as follows:

[0006] The first aspect of the present application provides a snapshot deletion method, the method comprising:

[0007] In response to receiving a snapshot deletion instruction, it is determined whether the protection capacity of the write snapshot volume exceeds a preset threshold; the snapshot volume is generated based on the ROW snapshot of the source data volume;

[0008] If yes, the first data in the source data volume is copied to the snapshot volume to obtain a full data snapshot volume; the first data is the data in the source data volume whose pointer is not redirected;

[0009] The source data volume is deleted, and the full data snapshot volume is configured as a target source data volume.

[0010] Optionally, the step of configuring the full data snapshot volume as the target source data volume comprises:

[0011] changing the attribute information of the full data snapshot volume based on the attribute information of the source data volume, and determining the full data snapshot volume after the attribute information is changed as the target source data volume.

[0012] Optionally, the attribute information comprises one or more of the following: an identification ID of the data volume, a storage pool to which the data volume belongs.

[0013] Optionally, the method further comprises:

[0014] if the protection capacity of the snapshot volume is less than or equal to the preset threshold, copying second data in the snapshot volume to the source data volume; the second data is data written into the snapshot volume after the snapshot is created.

[0015] Optionally, the preset threshold is related to the capacity of the source data volume.

[0016] The preset threshold is a first percentage of the capacity of the source data volume, and the interval of the first percentage is 50%-100%.

[0017] Optionally, the snapshot deletion instruction is a deletion instruction for a target snapshot; the target snapshot is an Nth snapshot created based on ROW for the source data volume.

[0018] The method further comprises:

[0019] if it is determined that the protection capacity of the snapshot volume of the target snapshot exceeds the preset threshold, the following steps are performed:

[0020] copying the first data in the source data volume to the snapshot volume of the target snapshot, and copying third data in an ith snapshot snapshot volume created before the target snapshot to the snapshot volume of the target snapshot, to obtain a full data snapshot volume of the Nth snapshot; the third data is data whose pointer is not redirected; wherein i is a positive integer greater than or equal to 1 and less than N;

[0021] deleting the source data volume, and configuring the full data snapshot volume of the Nth snapshot as the target source data volume.

[0022] In a second aspect, the present application provides a snapshot deletion device, the device comprising:

[0023] a judgment module configured to, in response to receiving a snapshot deletion instruction, judge whether the protection capacity of a snapshot volume exceeds a preset threshold; the snapshot volume is generated by creating a snapshot based on write-time redirection (ROW) for the source data volume.

[0024] The first copying module is configured to copy first data in the source data volume to the snapshot volume to obtain a full data snapshot volume if the determination result of the judging module is yes; the first data is data in the source data volume for which a pointer is not redirected.

[0025] The configuration module is configured to delete the source data volume and configure the full data snapshot volume as a target source data volume.

[0026] Optionally, the configuration module is specifically configured to:

[0027] change attribute information of the full data snapshot volume based on attribute information of the source data volume, and determine the full data snapshot volume after the attribute information is changed as the target source data volume.

[0028] Optionally, the attribute information includes one or more of the following: an identification ID of the data volume, and a storage pool to which the data volume belongs.

[0029] Optionally, the apparatus further includes:

[0030] The second copying module is configured to copy second data in the snapshot volume to the source data volume if the determination result of the judging module is no; the second data is data written in the snapshot volume after the snapshot is created.

[0031] Optionally, the preset threshold is related to a capacity of the source data volume.

[0032] The preset threshold is a first percentage of the capacity of the source data volume, and the first percentage is in a range of 50% to 100%.

[0033] Optionally, the snapshot deletion instruction is a deletion instruction for a target snapshot; and the target snapshot is an Nth snapshot created based on ROW for the source data volume.

[0034] The apparatus further includes:

[0035] The third copying module is configured to copy the first data in the source data volume to a snapshot volume of the target snapshot, and copy third data in an ith snapshot data volume created before the target snapshot to the snapshot volume of the target snapshot to obtain a full data snapshot volume of the Nth snapshot; the third data is data for which a pointer is not redirected; wherein i is a positive integer greater than or equal to 1 and less than N.

[0036] The second configuration module is configured to delete the source data volume and configure the full data snapshot volume of the Nth snapshot as a target source data volume.

[0037] In a third aspect, the present application provides an electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus.

[0038] The memory is configured to store a computer program.

[0039] The processor is configured to execute the program stored in the memory to implement the steps of any of the snapshot deletion methods.

[0040] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any of the snapshot deletion methods.

[0041] In a fifth aspect, the present application provides a computer program product comprising instructions which, when executed on a computer, cause the computer to perform any of the snapshot deletion methods.

[0042] The embodiments of the present application have the following beneficial effects:

[0043] The snapshot deletion method, the snapshot deletion device, the electronic device and the storage medium provided by the embodiments of the present application are adopted, the storage system receives a snapshot deletion instruction, judges whether the protection capacity of a snapshot volume exceeds a preset threshold, the snapshot volume is generated based on a snapshot of a source data volume created by a write-time redirection (ROW), if yes, the first data in the source data volume is copied to the snapshot volume to obtain a full data snapshot volume, the first data is data in the source data volume whose pointer is not redirected, the source data volume is deleted, and the full data snapshot volume is configured as a target source data volume.

[0044] Thus, in the storage system using the ROW snapshot technology, when the snapshot deletion is performed, the protection capacity of the snapshot volume is judged, if the protection capacity is large, the data in the source data volume whose pointer is not redirected is copied to the snapshot volume, and the full data snapshot volume is configured as the target source data, that is, the source data volume containing full data, which is equivalent to executing the snapshot deletion instruction. Compared with the snapshot deletion scheme in the related art, the amount of data to be copied is greatly reduced. Since the processing amount and time required for configuring the full data snapshot volume as the target source data are much smaller than the processing amount and time required for copying the data, in the scenario of writing more data after the snapshot, the existing mechanism of deleting the snapshot and performing data copying only once is continued, the amount of data to be copied is effectively reduced, the write amplification in data processing is reduced, and the performance of snapshot deletion is improved.

[0045] Of course, implementing any product or method of the present application does not necessarily require all the advantages described above to be achieved at the same time. BRIEF DESCRIPTION OF DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced. Obviously, the accompanying drawings in the following description only represent some of the embodiments of the present application, and all other embodiments obtained by those of ordinary skill in the art based on the accompanying drawings also belong to the scope of protection of the present application.

[0047] Figure 1 A schematic diagram of a snapshot deletion scheme in the related art;

[0048] Figure 2 A schematic diagram of a snapshot deletion method provided by the embodiments of the present application;

[0049] Figure 3 A schematic diagram of a snapshot deletion method provided by the embodiments of the present application;

[0050] Figure 4 Another schematic diagram of a snapshot deletion method provided by the embodiments of the present application;

[0051] Figure 5 A schematic diagram of continuous multiple snapshot writing data provided by the embodiments of the present application;

[0052] Figure 6 A schematic diagram of the storage location of continuous multiple snapshot writing data in the storage space provided by the embodiments of the present application;

[0053] Figure 7 Another schematic diagram of the storage location of continuous multiple snapshot writing data in the storage space provided by the embodiments of the present application

[0054] Figure 8 A schematic diagram of a snapshot deletion device provided by the embodiments of the present application;

[0055] Figure 9 A schematic diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0056] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments only represent some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application also belong to the scope of protection of the present application.

[0057] In order to facilitate the understanding of the present application, the related technical terms are introduced.

[0058] Snapshot: A fully usable copy of a specified set of data, including an image of the data at a specific point in time (the point at which the copy began). A snapshot can be a copy of the data it represents, or a replica of the data. In more specific technical terms, a snapshot is a reference or pointer to data stored on a storage device. A snapshot is similar to a detailed data address directory, but in a computer, a snapshot is treated as a complete data backup.

[0059] The primary function of snapshot technology is online data recovery. When storage devices fail or are damaged, it enables immediate data recovery, restoring the storage to its state at the snapshot point in time. It also provides an alternative data access channel; while the source data is being processed online, users can choose to access the snapshot data and apply the snapshot to testing and other tasks. Therefore, snapshots are an indispensable feature for all storage systems, regardless of their level or complexity, as long as they are used in online systems. Snapshots play an increasingly important role in backup and data protection.

[0060] ROW: Write-on-Redirect snapshot technology redirects write requests to the data volume to the storage space reserved for the snapshot after the snapshot is created, directly writing new data to the snapshot volume instead of overwriting the original data in the source data volume.

[0061] Source data volume: The volume containing the source data for which a snapshot operation needs to be performed.

[0062] Snapshot volume: A logical copy of the data created after a snapshot is taken of the source data volume.

[0063] Snapshot volume protection capacity: The capacity of a snapshot volume for newly written data compared to the source data volume.

[0064] See Figure 1 This is a schematic diagram of a snapshot deletion scheme in related technologies. To intuitively represent the capacity of the source data volume, a table is used to represent the storage space, assuming that the storage space corresponding to each table has the same capacity. For example... Figure 1 As shown, the source data volume stores nine data sets, numbered 1-9, each of the same size. After a snapshot is created, based on the write-on-redirect mechanism, newly written data is redirected to the snapshot volume, as shown below. Figure 1 As shown, six copies of data were written after the snapshot, numbered 11-16. Suppose that a snapshot deletion command is to be executed, the data is copied to the source data volume before deleting the snapshot. That is, the six newly written copies of data are copied to their corresponding positions in the source data volume, and then the snapshot volume is deleted.

[0065] It can be seen that, under the current ROW snapshot deletion mechanism, if the protection capacity is higher, more data needs to be copied to the source data volume when deleting the snapshot. Since the data that needs to be copied back to the source data volume has been written once, and needs to be written again in the process of moving to the source data volume, this process will cause write amplification. The more data that needs to be copied, the greater the write amplification, and the worse the deletion performance.

[0066] To solve the above technical problems, the embodiments of the present application provide a snapshot deletion method, device, electronic equipment and storage medium. Referring to Figure 2 A flowchart of the snapshot deletion method provided by the embodiments of the present application is shown in Figure 2 As shown in the figure, the method comprises the following steps:

[0067] S201: In response to receiving a snapshot deletion instruction, it is judged whether the protection capacity of the snapshot volume exceeds a preset threshold; the snapshot volume is generated based on the write-time redirection to create a snapshot of the source data volume. If yes, execute S202.

[0068] The snapshot deletion method provided by the embodiments of the present application can be applied to the controller in the storage system.

[0069] Those skilled in the art can understand that the object of the snapshot is LUN (Logical Unit Number, logical unit number). LUN is an independent logical unit in a storage device, which can be identified and accessed by an operating system or an application program. A storage device can contain multiple LUNs, and each LUN can be regarded as an independent storage volume or logical disk.

[0070] The snapshot deletion method provided by the embodiments of the present application is applicable to the ROW snapshot mechanism, that is, the snapshot volume is generated based on the ROW mechanism to create a snapshot of the source data volume.

[0071] The source data volume involved in the embodiments of the present application can be in the form of a source LUN. The source LUN includes a Meta Volume (metadata volume) and a Data Volume (data volume). Among them, the Meta Volume records the storage location of the source data in the source LUN. The Data Volume records the business data stored in the source LUN.

[0072] Meta Volume Data Volume G0 Data0 G1 Data1 G2 Data2 G3 Data3

[0073] Table 1

[0074] As an example, refer to Table 1, which is a schematic table of Meta Volume and Data Volume in a source data volume. The G0-G3 contained in the Meta Volume can also be understood as logical addresses of data storage, and the Data0-Data3 contained in the Data Volume represent data stored at the logical addresses.

[0075] After the snapshot of the source LUN is created, a logically generated data copy, i.e., a snapshot volume, is generated. In the embodiments of the present application, the snapshot volume is in the form of a snapshot LUN. The snapshot LUN includes a Snapshot Meta Volume (snapshot metadata volume) and a Snapshot Data Volume (snapshot data volume).

[0076] After the snapshot is created, the Snapshot Meta Volume and the Snapshot Data Volume are empty and do not contain any data. As shown in Table 2, the elements contained in the Snapshot Meta Volume and the Snapshot Data Volume are all Null (empty).

[0077] Snapshot Meta Volume Snapshot Data Volume Null Null Null Null Null Null Null Null

[0078] Table 2

[0079] In addition, when the snapshot is created, a copy of the source data mapping table is copied as a snapshot data mapping table, and the pointer records of the two tables are the same at this time. Refer to Table 3, which is a schematic table of a source data mapping table. The mapping table is used to record the change of data at a certain time point. In Table 3, G0-G3 represent addresses, Time0-Time3 represent time points, and 0 indicates that the data corresponding to the address at the time point has not been changed.

[0080] Address / time Time0 Time1 Time2 Time3 G0 0 0 0 0 G1 0 0 0 0 G2 0 0 0 0 G3 0 0 0 0

[0081] Table 3

[0082] If the application server issues a write request to modify the data "Data1" to "DataX" at Time1, it can be known from Table 1 that the address corresponding to "Data1" is "G1", i.e., the data corresponding to the address G1 is overwritten at Time1. Since the write is redirected to the snapshot volume, the data corresponding to G1 in the source data volume is not changed. However, the source data mapping table is updated to Table 4. The "1" in Table 4 indicates that the data corresponding to the address is redirected when the write is performed at the time point.

[0083] Address / time Time0 Time1 Time2 Time3 G0 0 0 0 0 G1 0 1 0 0 G2 0 0 0 0 G3 0 0 0 0

[0084] Table 4

[0085] Correspondingly, the data "DataX" is written in the snapshot volume, as shown in Table 5. In Table 5, L0, that is, the newly written data DataX, is redirected to the address.

[0086] Snapshot Meta Volume Snapshot Data Volume L0 DataX Null Null Null Null Null Null

[0087] Table 5

[0088] In the above example, G1, that is, the redirected pointer, the pointer can also be understood as an address. Correspondingly, G0, G2, and G3, that is, the pointers that are not redirected, can be understood as follows: the data corresponding to G0, G2, and G3 respectively has not been overwritten, and no changes have occurred.

[0089] In an embodiment of the present application, when the storage system receives a snapshot deletion instruction, it is determined whether the protection capacity of the snapshot volume exceeds a preset threshold. The preset threshold is determined according to the capacity of the source data volume, for example, the preset threshold is a specific percentage of the capacity of the source data volume.

[0090] In an embodiment of the present application, the preset threshold is a first percentage of the capacity of the source data volume, and the interval of the first percentage can be set to be greater than 50% and less than or equal to 100%. Based on this interval, the amount of data that needs to be copied during the deletion of the snapshot can be reduced compared to related art.

[0091] In an embodiment of the present application, after the snapshot is generated, if the size of the data written in the snapshot volume exceeds the preset threshold, the data written in the snapshot volume needs to be copied to the source data volume in a large amount. In this case, S202 is executed.

[0092] S202: copying first data in the source data volume to the snapshot volume to obtain a full data snapshot volume; the first data is data in the source data volume whose pointer is not redirected.

[0093] According to the description of the ROW mechanism in the foregoing, after the snapshot is created, the write request to the source data volume is redirected to the reserved storage space of the snapshot volume, and the data is directly written to the snapshot volume.

[0094] When the protection capacity of the snapshot volume exceeds the preset threshold, if the existing mechanism of ROW is still followed, the data written in the snapshot volume needs to be copied to the source data volume, and a large amount of data needs to be copied. Therefore, in an embodiment of the present application, the first data in the source data volume is copied to the snapshot volume, thereby reducing the data that needs to be copied.

[0095] The first data is data in the source data volume whose pointer is not redirected. Since, under the ROW mechanism, when the data in the source data volume is overwritten, the pointer of the data is redirected to the reserved space of the snapshot volume, it can also be understood that, for the first data, no overwriting is performed.

[0096] To intuitively show the amount of data that needs to be copied, the following examples are given.

[0097] As an example, the capacity of the source data volume is 36M, and 30M of original data has been written. After the snapshot is created, 25M of data is newly written into the snapshot volume. Among them, 20M of data belongs to the modification of the original data, i.e., the overwrite write; 5M of data belongs to the newly added data, which does not involve the modification of the original data. Then the 20M of data is the data corresponding to the redirected pointer in the source data mapping table, and the remaining 30M-20M=10M of data belongs to the data corresponding to the non-redirected pointer in the source data mapping table. Using the scheme of the present application, since the amount of data newly written into the snapshot volume is large, which exceeds the preset threshold, the above-mentioned 10M of data is copied to the snapshot volume. If the existing ROW mechanism is used, all data (25M) newly written into the snapshot volume after the snapshot is created needs to be copied to the source data volume.

[0098] After the first data in the source data volume is copied to the snapshot volume, the snapshot volume contains the data in the source data volume that has not changed, the data newly written into the snapshot volume, and thus contains the full amount of data. The snapshot volume obtained after the copying is completed is recorded as the full amount of data snapshot volume.

[0099] Those skilled in the art can understand that the full amount of data refers to the data that should be obtained after executing the data write instruction on the basis of the original data, which does not contain the data in the original data that is overwritten.

[0100] In addition, those skilled in the art can understand that copying the first data in the source data to the snapshot volume means copying the first data to the idle storage space in the storage space allocated for the snapshot volume. Thus, the storage space allocated for the snapshot volume contains the above-mentioned full amount of data.

[0101] S203: deleting the source data volume and configuring the full amount of data snapshot volume as the target source data volume.

[0102] The purpose of deleting the snapshot is to synchronize the data changes after the snapshot is created to the source data volume, i.e., to obtain the source data volume of the full amount of data. After performing the S202 step, the full amount of data snapshot volume is obtained, which is not the source data volume. Therefore, the identity of the full amount of data snapshot volume needs to be changed, i.e., the full amount of data snapshot volume is changed to the source data volume.

[0103] Specifically, in the storage system, the source data volume and the snapshot volume have respective attribute information, and the storage system identifies the identity of the data volume through the attribute information. If the attribute information of the full data snapshot volume is changed to the attribute information corresponding to the source data volume, the full data snapshot volume can realize the conversion of the identity, that is, the storage system can regard the full data snapshot volume with the changed attribute information as the source data volume containing full data, denoted as a target source data volume.

[0104] Through the above attribute information changing manner, the full data snapshot volume can be configured as the target source data volume.

[0105] As an example, the attribute information of the source data volume is denoted as first attribute information, and the attribute information of the full data snapshot volume is denoted as second attribute information. The second attribute information is changed to the first attribute information, and then the full data snapshot volume after the attribute information changing can be regarded as the target source data volume.

[0106] Since the target source data volume is obtained by replacing the attribute information, the source data volume needs to be deleted, and thus the snapshot is deleted.

[0107] That is, the target source data volume obtained by using the snapshot deletion method provided in the embodiments of the present application is the same as the source data volume obtained by using the snapshot deletion method of the related art, but the data to be copied is greatly reduced.

[0108] For ease of understanding, the embodiments of the present application will be described below in conjunction with the accompanying drawings. Figure 3 Further description will be made. Figure 3 A schematic diagram of the snapshot deletion method provided in the embodiments of the present application is shown in Table 1. In order to intuitively reflect the capacity of the source data volume, the storage space is represented by a table. It is assumed that the capacity of the storage space corresponding to each table is the same, and the size of each piece of data written in each storage space is also the same. As shown in Table 1, the source data volume stores nine pieces of data, denoted as 1-9. Figure 3 As shown in Table 2, based on the write-time redirection mechanism, the newly written data is redirected to the snapshot volume. As shown in Table 2, the newly written data is six pieces of data, denoted as 11-16. Figure 3 It is assumed that the snapshot deletion instruction is to be executed. Before the snapshot is deleted, the first data is copied to the snapshot volume, and the first data refers to the data (i.e., the data denoted as 7-9 in Table 1) that is not redirected by the pointer. Figure 3 Based on the attribute information of the source data volume, the attribute information corresponding to the snapshot volume is replaced, the identity of the snapshot volume is changed to the source data volume, the source data volume containing full data is obtained, and then the original source data volume is deleted, which is equivalent to deleting the snapshot.

[0109] The snapshot deletion method provided in the embodiment of the application is used, the storage system receives a snapshot deletion instruction, judges whether the protection capacity of the snapshot volume exceeds a preset threshold; the preset threshold is related to the capacity of the source data volume; the snapshot volume is generated based on the snapshot of the source data volume by using the write-time redirection (ROW); if yes, the first data in the source data volume is copied to the snapshot volume to obtain a full-data snapshot volume; the first data is the data in the source data volume whose pointer is not redirected; the source data volume is deleted, and the full-data snapshot volume is configured as a target source data volume.

[0110] Therefore, in the storage system using the ROW snapshot technology, when the snapshot is deleted, the protection capacity of the snapshot volume is judged, if the protection capacity is large, the data in the source data volume whose pointer is not redirected is copied to the snapshot volume, and the full-data snapshot volume is configured as the target source data, that is, the source data volume containing full data, which is equivalent to executing the snapshot deletion instruction. Compared with the snapshot deletion scheme in the related art, the amount of data to be copied is greatly reduced. Since the processing amount and time required for configuring the full-data snapshot volume as the target source data are much smaller than the processing amount and time required for copying the data, in the scenario of writing more data after the snapshot, the existing mechanism of deleting the snapshot and performing data copying only once is continued, the amount of data to be copied is effectively reduced, the write amplification in data processing is reduced, and the performance of snapshot deletion is improved.

[0111] In an embodiment of the application, the step S203 specifically includes:

[0112] The attribute information of the full-data snapshot volume is changed based on the attribute information of the source data volume, and the full-data snapshot volume after the attribute information is changed is determined as the target source data volume. The attribute information of the source data volume is recorded as first attribute information, and the attribute information of the full-data snapshot volume is recorded as second attribute information.

[0113] Specifically, the first attribute information of the source data volume used to represent identity information is saved first. As an example, the attribute information includes the identification (ID) of the data volume and the storage pool to which the data volume belongs.

[0114] In this step, only the first attribute information of the source data volume is saved, and the first attribute information is not effective, so it will not affect the existing source data volume.

[0115] After the first attribute information of the source data volume is saved, the source data volume can be deleted.

[0116] In addition, in this embodiment, it is also feasible to perform the replacement of the attribute information first and then delete the source data volume, and no order limitation is made in this regard.

[0117] The second attribute information of the full-data snapshot volume is changed based on the first attribute information to obtain the target source data volume.

[0118] In this step, the second attribute information of the full data snapshot volume is updated by using the first attribute information of the backup saved source data volume. Specifically, the identification ID of the source data volume is replaced by the identification ID of the full data snapshot volume, and the storage pool identification to which the source data volume belongs is replaced by the storage pool identification to which the full data snapshot volume belongs.

[0119] After the update is completed, the information of the source data volume is inherited, the full data snapshot volume is changed into the source data volume containing full data, and for the storage system and the user, the snapshot volume can be considered as being deleted.

[0120] It should be noted that for different storage systems, the attribute information used to identify the identity of the data volume can be different, and accordingly, the replaced attribute information can also be different in the process of changing the full data snapshot volume into the target source data volume. The embodiments of the present application do not strictly limit this. Any way of replacing the identity of the snapshot volume based on the attribute information of the data volume and changing it into the source data volume is within the protection scope of the present application.

[0121] It can be seen that the embodiments of the present application also provide a process of replacing the source data volume with the snapshot volume. After the first attribute data in the source data volume is copied to the snapshot volume, the above process is executed to obtain the source data volume containing full data, which is equivalent to deleting the snapshot volume and saving the source data volume.

[0122] Since the processing amount and time required for changing the attribute information of the snapshot volume are much smaller than the processing amount and time required for copying data, in the scenario of writing more data after the snapshot, the existing mechanism of deleting the snapshot and only copying data once is continued, which effectively reduces the amount of data to be copied, reduces the write amplification in data processing, and improves the performance of snapshot deletion.

[0123] In an embodiment of the present application, referring to Figure 4 After S201 is executed, if the judgment result is no, S401 is executed.

[0124] S401: copying the second data in the snapshot volume to the source data volume; the second data is the data written in the snapshot volume after the snapshot is created.

[0125] Specifically, if the protection capacity written in the snapshot volume does not exceed the preset threshold, the existing deletion mechanism can be executed to copy the data written in the snapshot volume to the source data volume and delete the snapshot volume.

[0126] It can be seen that the application proposes a mechanism for judging the snapshot protection capacity to perform different snapshot deletion processes when the ROW snapshot is deleted. By judging the snapshot protection capacity and using different snapshot data processing methods, the amount of data that needs to be copied is effectively reduced during snapshot deletion, and the snapshot deletion performance is significantly improved and the data write amplification is reduced.

[0127] In an embodiment of the application, if multiple snapshots are created based on the ROW for the source data volume, when the target snapshot needs to be deleted, it is judged whether the protection capacity of the snapshot volume of the target snapshot exceeds the preset threshold. If not, the snapshot deletion is implemented according to the existing mechanism; if yes, the following steps are performed:

[0128] The first data in the source data volume is copied to the snapshot volume of the target snapshot, and the third data in the snapshot data volume of the i-th snapshot created before the target snapshot is copied to the snapshot volume of the target snapshot to obtain the full data snapshot volume of the N-th snapshot. The third data is the data whose pointer is not redirected. i is a positive integer greater than or equal to 1 and less than N;

[0129] The source data volume is deleted, and the full data snapshot volume of the N-th snapshot is configured as the target source data volume.

[0130] Specifically, the target snapshot is the N-th snapshot created based on the ROW for the source data volume. The essence of deleting the target snapshot is to retain the full latest data before creating the N+1-th snapshot. Therefore, for the i-th snapshot created before the target snapshot, if the data written in the snapshot volume of the i-th snapshot is still the latest data, this part of data also needs to be copied to the snapshot volume of the target snapshot to ensure that the snapshot volume of the target snapshot is a full data snapshot volume.

[0131] After creating the i-th snapshot, for the data a written in the snapshot volume of the i-th snapshot, if the data a is overwritten after creating the subsequent snapshot, according to the ROW mechanism, the pointer of the data a pointing to the snapshot volume of the i-th snapshot is redirected. Therefore, for the data whose pointer is not redirected in the snapshot volume of the i-th snapshot, this part of data is still the latest data, which needs to be copied to the snapshot volume of the target snapshot.

[0132] It should be noted that in the embodiment of the application, writing data into the snapshot volume of a snapshot means writing data into the storage space allocated for the snapshot. After creating each snapshot, the storage system will allocate storage space for the snapshot.

[0133] The following will be illustrated by way of example with reference to the accompanying drawings.

[0134] Referring to Figure 5 The schematic diagram of continuous multiple snapshot data writing provided by the embodiment of the application is as follows:Figure 5 As shown, the source data volume contains data a-i, after creating the 1st snapshot, data e1 and f1 are written, wherein data e1 is an overwrite write to data e, and data f1 is an overwrite write to data f, so the pointers to data e and f are redirected, and the redirected pointers point to the storage locations of data e1 and data f1 respectively. After creating the 2nd snapshot, data e2, f2, h2 and i2 are written, wherein data e2 is an overwrite write to data e1, data f2 is an overwrite write to data f1, data h2 is an overwrite write to data h, and data i2 is an overwrite write to data i; after creating the 3rd snapshot, data d3, e3, g3, h3 and i3 are written, wherein data d3 is an overwrite write to data d, data e3 is an overwrite write to data e2, data g3 is an overwrite write to data g, data h3 is an overwrite write to data h2, and data i3 is an overwrite write to data i2.

[0135] In the embodiment of the present application, the full data corresponding to the 3rd snapshot includes data a, b, c, d3, e3, f2, g3, h3 and i3.

[0136] For the convenience of understanding, refer to Figure 6 A schematic diagram of the storage locations of the data written by the continuous multiple snapshots in the embodiment of the present application is shown in Figure 6 In the example shown, the 1st storage space is the storage space allocated by the storage system for the source data volume, which stores data a-i, wherein the address offset corresponding to data e and f is 0x12 and 0x16 respectively. The 2nd storage space is the storage space allocated by the storage system for the 1st snapshot, which stores data e1 and f1 written after creating the 1st snapshot, and the address offset corresponding to data e1 and f1 is 0x104 and 0x108 respectively. As shown, taking data e as an example, the address offset 0x12 corresponding to data e is redirected to 0x104, that is, the address corresponding to 0x104 stores the overwrite write data e1 of data e. The 3rd storage space is the storage space allocated by the storage system for the 2nd snapshot, which stores data e2, f2, h2 and i2 written after creating the 2nd snapshot, and the address offset corresponding to data e2, f2, h2 and i2 is 0x116, 0x124, 0x130 and 0x138 respectively. The 4th storage space is the storage space allocated by the storage system for the 3rd snapshot, which stores data d3, e3, g3, h3 and i3 written after creating the 3rd snapshot, and the address offset corresponding to data d3, e3, g3, h3 and i3 is 0x236, 0x240, 0x244, 0x248 and 0x256 respectively.

[0137] The storage locations of the data shown in the figure are only examples, and when writing data to the ith storage space, it is only required to ensure that the free storage location of the storage space is written.

[0138] As can be seen, Figure 5 andFigure 6 In the embodiment shown, the data e1 and f1 written after the first snapshot are overwritten in the subsequent snapshots, that is, address redirection occurs, so e1 and f1 are not the latest data; among the data e2, f2, h2 and i2 written after the second snapshot, the data e2, h2 and i2 are overwritten in the subsequent snapshots, and the data f2 is not overwritten, that is, the data f2 is the data whose pointer is not redirected.

[0139] Therefore, when the third snapshot is deleted, since the amount of data written after the third snapshot exceeds the preset threshold, the deletion mechanism provided in the present application is performed. Specifically, the determined full amount of data includes the data whose pointer is not redirected in the source data volume (data a, b and c) and the data whose pointer is not redirected in the snapshot volume corresponding to the second snapshot (data f2), and therefore, these data need to be copied to the fourth storage space (that is, the storage space allocated for the third snapshot).

[0140] Referring to Figure 7 Another schematic diagram of the storage positions of the data written in the continuous multiple snapshots in the storage space provided in the embodiment of the present application is shown, the data whose pointer is not redirected is copied to the fourth storage space, and the fourth storage space is the snapshot volume containing the full amount of data, which includes data a, b, c, d3, e3, f2, g3, h3 and i3.

[0141] Subsequently, the snapshot volume containing the full amount of data is changed in identity and used as the source data volume, and the deletion operation for the third snapshot is completed.

[0142] As can be seen, in the embodiment of the present application, for the scenario of continuous multiple snapshots, when the Nth snapshot is deleted, if the amount of data written after the Nth snapshot is large, the data whose pointer is not redirected in the source data volume and the previously created snapshots is copied to the snapshot volume corresponding to the Nth snapshot, to ensure that the obtained snapshot volume is the snapshot volume containing the full amount of the latest data. As can be seen, the present solution is also applicable to the scenario of continuous multiple snapshots.

[0143] Based on the same inventive concept, the embodiment of the present application also provides a snapshot deletion device, as shown in Figure 8 As shown, the device includes the following modules:

[0144] The judgment module 801 is configured to, in response to receiving a snapshot deletion instruction, judge whether the protection capacity of the snapshot volume written exceeds a preset threshold; the snapshot volume is generated based on the ROW of the source data volume;

[0145] The first copying module 802 is configured to copy first data in the source data volume to the snapshot volume to obtain a full data snapshot volume if the result of the judgment of the judgment module is yes; the first data is data in the source data volume for which a pointer is not redirected.

[0146] The configuration module 803 is configured to delete the source data volume and configure the full data snapshot volume as a target source data volume.

[0147] Therefore, in a storage system using the ROW snapshot technology, when a snapshot is deleted, the protection capacity of the snapshot volume is judged, if the protection capacity is large, the data in the source data volume for which a pointer is not redirected is copied to the snapshot volume, and the full data snapshot volume is configured as a target source data, that is, a source data volume containing full data, which is equivalent to executing a delete instruction of the snapshot. Compared with the snapshot deletion scheme in the related art, the amount of data that needs to be copied is greatly reduced. Since the processing amount and time required for configuring the full data snapshot volume as the target source data are much smaller than the processing amount and time required for copying the data, in the scenario of writing more data after the snapshot, the existing mechanism of deleting the snapshot and performing data copying only once in the ROW is continued, the amount of data that needs to be copied is effectively reduced, the write amplification in data processing is reduced, and the performance of snapshot deletion is improved.

[0148] In an embodiment of the present application, the configuration module is specifically configured to:

[0149] change attribute information of the full data snapshot volume based on attribute information of the source data volume, and determine that the full data snapshot volume after the attribute information is changed is the target source data volume.

[0150] In an embodiment of the present application, the attribute information includes one or more of the following: an identification ID of the data volume, and a storage pool to which the data volume belongs.

[0151] In an embodiment of the present application, the apparatus further includes:

[0152] The second copying module is configured to copy second data in the snapshot volume to the source data volume if the result of the judgment of the judgment module is no; the second data is data written in the snapshot volume after the snapshot is created.

[0153] In an embodiment of the present application, the preset threshold is related to the capacity of the source data volume.

[0154] The preset threshold is a first percentage of the capacity of the source data volume, and the interval of the first percentage is 50%-100%.

[0155] In one embodiment of the present application, the snapshot deletion instruction is a deletion instruction for a target snapshot; the target snapshot is an Nth snapshot created based on ROW for a source data volume;

[0156] The apparatus further includes:

[0157] The third copying module is configured to copy the first data in the source data volume into a snapshot volume of the target snapshot, and copy third data in a snapshot data volume of an ith snapshot created before the target snapshot into the snapshot volume of the target snapshot to obtain a full-amount data snapshot volume of the Nth snapshot; the third data is data whose pointer is not redirected; i is a positive integer greater than or equal to 1 and less than N;

[0158] The second configuration module is configured to delete the source data volume and configure the full-amount data snapshot volume of the Nth snapshot as a target source data volume.

[0159] The embodiments of the present application further provide an electronic device, as shown in the accompanying drawings, which comprises a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902 and the memory 903 complete mutual communication through the communication bus 904. Figure 9

[0160] The memory 903 is configured to store a computer program.

[0161] The processor 901 is configured to execute the program stored in the memory 903 to implement the following steps:

[0162] In response to receiving a snapshot deletion instruction, it is judged whether the protection capacity of a snapshot volume exceeds a preset threshold value; the snapshot volume is generated by creating a snapshot based on write-time redirection ROW for the source data volume;

[0163] If yes, first data in the source data volume is copied into the snapshot volume to obtain a full-amount data snapshot volume; the first data is data whose pointer is not redirected in the source data volume;

[0164] The source data volume is deleted, and the full-amount data snapshot volume is configured as a target source data volume.

[0165] ​Thus, in the storage system using the ROW snapshot technology, when the snapshot is deleted, the protection capacity of the snapshot volume is determined, if the protection capacity is large, the data in the source data volume whose pointer is not redirected is copied to the snapshot volume, and the full data snapshot volume is configured as the target source data, that is, the source data volume containing the full data, which is equivalent to executing the snapshot deletion instruction. Compared with the snapshot deletion scheme in the related art, the amount of data to be copied is greatly reduced. Since the processing amount and time required for configuring the full data snapshot volume as the target source data are much smaller than the processing amount and time required for copying the data, in the scenario of writing more data after the snapshot, the existing snapshot deletion mechanism of the ROW only performs one data copy, effectively reducing the amount of data to be copied, reducing the write amplification in data processing, and improving the performance of snapshot deletion.

[0166] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0167] The communication interface is used for communication between the above electronic device and other devices.

[0168] The memory can include a Random Access Memory (RAM) and can also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0169] The above processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0170] In a further embodiment provided in the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any of the snapshot deletion methods described above.

[0171] In a further embodiment provided in the present application, a computer program product containing instructions, which when executed on a computer, causes the computer to perform any of the snapshot deletion methods described in the above embodiments.

[0172] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium, or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (for example, floppy disk, hard disk, magnetic tape), optical media (for example, DVD), or semiconductor media (for example, solid state disk (SSD)) and the like.

[0173] It should be noted that, in this document, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0174] Each of the embodiments in the specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the device, electronic device, computer storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the related parts can be referred to the part of the method embodiments.

[0175] The above only describes the preferred embodiments of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A snapshot deletion method characterized by, The method comprises: In response to receiving a snapshot deletion instruction, determining whether the protection capacity of the snapshot volume exceeds a preset threshold; the snapshot volume is generated based on a write-time redirection (ROW) to create a snapshot of a source data volume; the protection capacity is the capacity of newly written data in the snapshot volume compared with the source data volume; If yes, copying first data in the source data volume to the snapshot volume to obtain a full-data snapshot volume; the first data is data in the source data volume whose pointer is not redirected; Deleting the source data volume and configuring the full-data snapshot volume as a target source data volume.

2. The method of claim 1, wherein the step of configuring the full-data snapshot volume as a target source data volume comprises: Changing attribute information of the full-data snapshot volume based on attribute information of the source data volume to determine that the full-data snapshot volume after the attribute information is changed is the target source data volume.

3. The method of claim 2, wherein the attribute information comprises one or more of the following: an identification (ID) of the data volume, a storage pool to which the data volume belongs. The method further comprises: If the protection capacity of the snapshot volume is less than or equal to the preset threshold, copying second data in the snapshot volume to the source data volume; the second data is data written in the snapshot volume after the snapshot is created.

4. The method according to any one of claims 1 to 3, characterized in that, The preset threshold is related to the capacity of the source data volume; The preset threshold is a first percentage of the capacity of the source data volume, and the first percentage is in the range of 50%-100%.

5. The method of claim 1, wherein, 6. The method of claim 1, wherein the snapshot deletion instruction is a deletion instruction for a target snapshot; the target snapshot is an Nth snapshot created based on a ROW for a source data volume. The method further comprises: If it is determined that the protection capacity of the snapshot volume of the target snapshot exceeds the preset threshold, the following steps are performed: Copying the first data in the source data volume to the snapshot volume of the target snapshot and copying third data in an ith snapshot data volume created before the target snapshot to the snapshot volume of the target snapshot to obtain a full-data snapshot volume of the Nth snapshot; the third data is data whose pointer is not redirected; wherein i is a positive integer greater than or equal to 1 and less than N; Deleting the source data volume and configuring the full-data snapshot volume of the Nth snapshot as a target source data volume. The apparatus comprises: A determination module configured to, in response to receiving a snapshot deletion instruction, determine whether the protection capacity of a snapshot volume exceeds a preset threshold; the snapshot volume is generated based on a write-time redirection (ROW) to create a snapshot of a source data volume; the protection capacity is the capacity of newly written data in the snapshot volume compared with the source data volume; A first copying module configured to, if the determination result of the determination module is yes, copy first data in the source data volume to the snapshot volume to obtain a full-data snapshot volume; the first data is data in the source data volume whose pointer is not redirected; 7. A snapshot deletion apparatus characterized by comprising: A configuration module configured to delete the source data volume and configure the full-data snapshot volume as a target source data volume. ​ ​ ​ 8. The apparatus of claim 7, wherein, The configuration module is specifically configured to: Change the attribute information of the full data snapshot volume based on the attribute information of the source data volume, and determine the full data snapshot volume after the attribute information is changed as a target source data volume.

9. An electronic device, comprising: The memory is configured to store a computer program. The processor is configured to execute the program stored on the memory to implement the method steps in any one of claims 1-6. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps in any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, ​

Citation Information

Patent Citations

  • Data snapshot method and device, computer equipment and storage medium

    CN111966531A

  • Systems, methods, and computer program products providing an elastic snapshot repository

    US20160342609A1