A method, device, equipment and storage medium for implementing write-time redirection snapshot

CN117170582BActive Publication Date: 2026-09-18ZHENGZHOU YUNHAI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311078763.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-25
Publication Date
2026-09-18
Estimated Expiration
2043-08-25

AI Technical Summary

Technical Problem

[0005]有鉴于此,本发明的目的在于提供一种写时重定向快照实现方法、装置、设备、存储介质,能够解决由于元数据指针表拷贝带来的快照源卷写性能下降问题,提升快照源卷的写性能

Benefits of technology

[0036]Therefore, this application discloses a write-on-redirect snapshot implementation method, including: creating a snapshot volume of the source volume based on a snapshot creation instruction, and creating a shared metadata pointer table in the metadata management partition to store the logical address-host physical address mapping relationship of the source volume and the logical address-host physical address mapping relationship of the snapshot volume; when the source volume or the snapshot volume receives a write operation instruction sent by the host, updating the logical address-host physical address mapping relationship in the shared metadata pointer table based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address; when the source volume or the snapshot volume receives a read operation instruction sent by the host, reading the corresponding target read data from the host physical address of the source volume or the snapshot volume according to the corresponding logical address-host physical address mapping relationship in the shared metadata pointer table and returning it to the host. As can be seen, by creating a shared metadata pointer table in the metadata management partition to store the logical address and host physical address mapping relationship between the source volume and the corresponding snapshot volume, each snapshot's source volume and snapshot volume have exactly one metadata pointer table. In this way, when a write operation is performed on the source volume, the metadata pointer table will not be copied, thus optimizing the problem of decreased write performance of the snapshot source volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117170582B_ABST
    Figure CN117170582B_ABST
Patent Text Reader

Abstract

The application discloses a write-time redirection snapshot implementation method and device, equipment and a storage medium, and relates to the technical field of snapshots, and comprises the following steps: creating a snapshot volume of a source volume based on a snapshot creation instruction, and creating a shared metadata pointer table of logical address and host physical address mapping relationships of the source volume and the snapshot volume in a metadata management partition; updating the logical address and host physical address mapping relationships in the shared metadata pointer table based on the write-in logical address and the corresponding host physical address of the target write-in data in a write operation instruction; and reading the target read-in data according to the logical address and host physical address mapping relationships in the shared metadata pointer table and returning the target read-in data to a host end. There is only one copy of the metadata pointer table of the source volume and the snapshot volume of each snapshot, and when a write operation is performed on the source volume, the copy action of the metadata pointer table will not be performed, so that the problem of write performance decline of the snapshot source volume is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of snapshot technology, and in particular to a method, apparatus, device, and storage medium for implementing write-time redirection snapshots. Background Technology

[0002] Storage snapshots primarily address data recovery in case of data loss. This technology preserves the current state of the storage device, allowing restoration to the state before file loss. A snapshot is not a copy; it's a reference or pointer to the data stored on the storage device—essentially, saved metadata. This metadata allows indexing the actual data, making it fast because it doesn't copy the original. A snapshot can be a copy of the data it represents or a replica of the data. There are two types of snapshots: full snapshots and incremental snapshots. COW (Copy On Write) snapshots and ROW (Redirect On Write) snapshots are two examples of incremental snapshots.

[0003] When creating a snapshot using Copy-on-Write (COW) technology, the storage subsystem establishes a copy of the metadata pointer table. If someone attempts to rewrite the original data on the source data block, the original data must first be copied to the new data block before the rewrite can be performed. Because each rewrite actually involves two write operations, it degrades the write performance of the source data volume. The copying of the metadata pointer tables between the source volume and the snapshot volume also reduces the write performance of the source volume. The implementation principle of Row-on-Write (ROW) snapshots is very similar to COW, the difference being that ROW redirects the new data to a reserved snapshot volume during the first write operation to the original data volume, while non-COW typically overwrites the original data with the new data. Although ROW solves the problem of COW snapshots writing twice, the copying of the metadata pointer tables between the source volume and the snapshot volume still degrades the write performance of the source volume.

[0004] In summary, how to solve the problem of decreased write performance of snapshot source volumes caused by copying metadata pointer tables and improve the write performance of snapshot source volumes are technical problems that need to be solved in this field. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a method, apparatus, device, and storage medium for implementing write-time redirection snapshots, which can solve the problem of degraded write performance of the snapshot source volume caused by copying the metadata pointer table and improve the write performance of the snapshot source volume. The specific solution is as follows:

[0006] Firstly, this application discloses a write-time redirection snapshot implementation method, including:

[0007] A snapshot volume of the source volume is created based on the snapshot creation instruction, and a shared metadata pointer table is created in the metadata management partition to store the mapping relationship between the logical address and the host physical address of the source volume and the mapping relationship between the logical address and the host physical address of the snapshot volume.

[0008] When the source volume or the snapshot volume receives a write operation instruction sent by the host, the logical address and host physical address mapping relationship in the shared metadata pointer table are updated based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address.

[0009] When the source volume or the snapshot volume receives a read operation instruction sent by the host, it reads the corresponding target read data from the host physical address of the source volume or the snapshot volume according to the corresponding logical address and host physical address mapping relationship in the shared metadata pointer table and returns it to the host.

[0010] Optionally, before creating the snapshot volume of the source volume based on the snapshot creation instruction, the method further includes:

[0011] Create a source volume in the thin pool and construct a mapping relationship between the logical address of the source volume and the host physical address;

[0012] A metadata management partition is created in the thin pool to store the shared metadata pointer table.

[0013] Optionally, creating a snapshot volume of the source volume based on snapshot creation instructions includes:

[0014] Obtain the snapshot creation instruction at the current moment, and create a snapshot volume of the source volume based on the snapshot creation instruction to generate the corresponding data volume pair;

[0015] The source volume and the snapshot volume in the data volume pair are divided into addresses according to a preset address space size to obtain the corresponding divided space addresses.

[0016] Optionally, creating a shared metadata pointer table in the metadata management partition to store the mapping relationship between the logical address and the host physical address of the source volume and the mapping relationship between the logical address and the host physical address of the snapshot volume includes:

[0017] A shared metadata pointer table is created based on the partitioned space address corresponding to the source volume and the snapshot volume in the data volume pair at the corresponding snapshot time.

[0018] Optionally, when the source volume or the snapshot volume receives a write operation instruction sent by the host, updating the logical address to host physical address mapping relationship in the shared metadata pointer table based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address includes:

[0019] Obtain the write operation instruction sent by the host, and determine whether the data volume to be executed corresponding to the write operation instruction is the source volume or the snapshot volume;

[0020] If the data volume to be executed corresponding to the write operation instruction is the source volume, then based on the target time when the host sends the write operation instruction, the first target shared metadata pointer table corresponding to the source volume at the target time is determined from the metadata management partition.

[0021] Update the logical address and host physical address mapping relationship in the first target shared metadata pointer table based on the write logical address and corresponding host physical address of the target write data in the write operation instruction;

[0022] If the data volume to be executed in the write operation instruction is the snapshot volume, then based on the target time when the host issues the write operation instruction, the second target shared metadata pointer table corresponding to the snapshot volume at the target time is determined from the metadata management partition.

[0023] The logical address and host physical address mapping relationship in the second target shared metadata pointer table is updated based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address.

[0024] Optionally, the write-time redirection snapshot implementation method further includes:

[0025] When a snapshot volume deletion instruction is received, the host physical address corresponding to the target snapshot volume is released based on the shared metadata pointer table and the logical address information of the target snapshot volume contained in the snapshot volume deletion instruction, and the mapping relationship between the logical address and the host physical address of the target snapshot volume in the shared metadata pointer table is deleted.

[0026] Optionally, the write-time redirection snapshot implementation method further includes:

[0027] When a data recovery instruction is received, the recovery time contained in the data recovery instruction is obtained, and the corresponding source volume is recovered according to the snapshot volume information corresponding to the recovery time in the shared metadata pointer table.

[0028] Secondly, this application discloses a write-time redirection snapshot implementation apparatus, comprising:

[0029] The table creation module is used to create a snapshot volume of the source volume based on the snapshot creation command, and to create a shared metadata pointer table in the metadata management partition to store the mapping relationship between the logical address and the host physical address of the source volume and the mapping relationship between the logical address and the host physical address of the snapshot volume.

[0030] The write instruction mapping module is used to update the logical address and host physical address mapping relationship in the shared metadata pointer table based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address when the source volume or the snapshot volume receives a write operation instruction sent by the host.

[0031] The read instruction mapping module is used to read the corresponding target read data from the host physical address of the source volume or the snapshot volume according to the corresponding logical address and host physical address mapping relationship in the shared metadata pointer table when the source volume or the snapshot volume receives a read operation instruction sent by the host and return it to the host.

[0032] Thirdly, this application discloses an electronic device, including:

[0033] Memory, used to store computer programs;

[0034] A processor for executing the computer program to implement the steps of the aforementioned disclosed write-time redirection snapshot implementation method.

[0035] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed write-time redirection snapshot implementation method.

[0036] Therefore, this application discloses a write-on-redirect snapshot implementation method, including: creating a snapshot volume of the source volume based on a snapshot creation instruction, and creating a shared metadata pointer table in the metadata management partition to store the logical address-host physical address mapping relationship of the source volume and the logical address-host physical address mapping relationship of the snapshot volume; when the source volume or the snapshot volume receives a write operation instruction sent by the host, updating the logical address-host physical address mapping relationship in the shared metadata pointer table based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address; when the source volume or the snapshot volume receives a read operation instruction sent by the host, reading the corresponding target read data from the host physical address of the source volume or the snapshot volume according to the corresponding logical address-host physical address mapping relationship in the shared metadata pointer table and returning it to the host. As can be seen, by creating a shared metadata pointer table in the metadata management partition to store the logical address and host physical address mapping relationship between the source volume and the corresponding snapshot volume, each snapshot's source volume and snapshot volume have exactly one metadata pointer table. In this way, when a write operation is performed on the source volume, the metadata pointer table will not be copied, thus optimizing the problem of decreased write performance of the snapshot source volume. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0038] Figure 1 This is a flowchart of a write-time redirection snapshot implementation method disclosed in this application;

[0039] Figure 2 This is a mapping diagram in a shared metadata pointer table disclosed in this application;

[0040] Figure 3 This application discloses a specific method for implementing write-time redirection snapshots.

[0041] Figure 4 This application discloses a specific mapping update graph in the shared metadata pointer table during write instructions.

[0042] Figure 5 This application discloses another specific mapping update graph for the shared metadata pointer table during write instructions;

[0043] Figure 6 This is a schematic diagram of a write-time redirection snapshot implementation device disclosed in this application;

[0044] Figure 7 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0046] Storage snapshots primarily address data recovery in case of data loss. This technology preserves the current state of the storage device, allowing restoration to the state before file loss. A snapshot is not a copy; it's a reference or pointer to the data stored on the storage device—essentially, saved metadata. This metadata allows indexing into the actual data, making it very fast since it doesn't copy the original. A snapshot can be a copy of the data it represents or a replica of the data. There are two types of snapshots: full snapshots and incremental snapshots. COW (Cost Per Hour) snapshots and ROW (Row of Hour) snapshots are two examples of incremental snapshot types.

[0047] When creating a snapshot using Copy-on-Write (COW) technology, the storage subsystem establishes a copy of the metadata pointer table. If someone attempts to rewrite the original data on the source data block, the original data must first be copied to the new data block before the rewrite can be performed. Because each rewrite actually involves two write operations, it degrades the write performance of the source data volume. The copying of the metadata pointer tables between the source volume and the snapshot volume also reduces the write performance of the source volume. The implementation principle of Row-on-Write (ROW) snapshots is very similar to COW, the difference being that ROW redirects the new data to a reserved snapshot volume during the first write operation to the original data volume, while non-COW typically overwrites the original data with the new data. Although ROW solves the problem of COW snapshots writing twice, the copying of the metadata pointer tables between the source volume and the snapshot volume still degrades the write performance of the source volume.

[0048] To address this issue, this application provides a write-time redirection snapshot implementation scheme that can solve the problem of decreased write performance of the snapshot source volume caused by copying the metadata pointer table and improve the write performance of the snapshot source volume.

[0049] Reference Figure 1 As shown, this embodiment of the invention discloses a method for implementing write-time redirection snapshots, including:

[0050] Step S11: Create a snapshot volume of the source volume based on the snapshot creation instruction, and create a shared metadata pointer table in the metadata management partition to store the mapping relationship between the logical address and the host physical address of the source volume and the mapping relationship between the logical address and the host physical address of the snapshot volume.

[0051] In this embodiment, when a snapshot creation instruction is received at a certain moment, a snapshot volume of the source volume is created based on the currently received snapshot creation instruction. The source volume is a volume in the storage system used to store or read data. Then, a shared metadata pointer table is further created in the metadata management partition to store the logical address and host physical address mapping relationship of the source volume and the logical address and host physical address mapping relationship of the snapshot volume.

[0052] In this embodiment, before creating the snapshot volume of the source volume based on the snapshot creation instruction, the method further includes: creating the source volume in the thin pool and constructing a mapping relationship between the logical address and the host physical address of the source volume; creating a metadata management partition in the thin pool to store the shared metadata pointer table. It can be understood that a thin pool is created in the storage system, and then, during initialization, source volumes and a metadata management partition are created in the thin pool. The metadata management partition is used to store the shared metadata pointer table of all volumes on the thin pool. When creating the source volume, a mapping relationship between the logical address and the host physical address is constructed. The host physical address is the actual data storage address, and the logical address is the relative address given in the access instruction. The host physical address needs to be calculated or transformed by the addressing mode after obtaining the logical address. That is, each host physical address and logical address has a corresponding logical mapping relationship. Then, the constructed mapping relationship between the logical address and the host physical address of the source volume is stored in the metadata management partition. For example, a source volume A is created on a thin pool, and source volume A is mapped to a host, forming a mapping relationship so that users can perform I / O (Input / Output) read and write operations on source volume A on the host.

[0053] In this embodiment, creating a snapshot volume of the source volume based on the snapshot creation instruction includes: obtaining the snapshot creation instruction at the current time; creating a snapshot volume of the source volume based on the snapshot creation instruction to generate a corresponding data volume pair; and partitioning the source volume and the snapshot volume in the data volume pair according to a preset address space size to obtain the corresponding partitioned space address. Specifically, at time T0, a ROW snapshot is created for source volume A based on the snapshot creation instruction, and a snapshot volume RA is created on the thin pool on the storage side. The created source volume A and snapshot volume RA are the data volume pair, and a shared metadata pointer table is created. It should be noted that in the traditional ROW snapshot implementation, when creating a snapshot, ROW copies a metadata mapping table as the snapshot metadata pointer table, and the pointer records of the two tables are the same. In this embodiment, it is not necessary to copy the metadata pointer table of the source volume. Instead, a shared metadata pointer table is created on the metadata management partition meta_data, which stores the pointer records of both the source volume and the corresponding snapshot volume. Furthermore, each volume in the data volume pair is divided into several grains according to a specified size. Specifically, the source volume or snapshot volume is divided into several grains according to an address space of 100.

[0054] In this embodiment, creating a shared metadata pointer table in the metadata management partition to store the mapping relationship between the logical address and the host physical address of the source volume and the mapping relationship between the logical address and the host physical address of the snapshot volume includes: creating a shared metadata pointer table at the corresponding snapshot time according to the partitioned space address corresponding to the source volume and the snapshot volume in the data volume pair. It can be understood that in the metadata management partition, the mapping relationship between the logical address and the host physical address of the source volume is stored in the shared metadata pointer table. Specifically, the logical addresses of source volume A are L0, L1, L2, L3, and the host physical addresses are P0, P1, P2, P3, where the mapping relationship between the logical address and the host physical address of source volume A is: L0-P0, L1-P1, L2-P2, L3-P3. Accordingly, the mapping relationship between the logical address and host physical address of the snapshot volume corresponding to the source volume in the data volume pair is stored in the shared metadata pointer table. Specifically, the logical addresses of the snapshot volume RA are L0, L1, L2, L3, and the host physical addresses are P0, P1, P2, P3. The mapping relationship between the logical address and host physical address of the snapshot volume RA is: L0-P0, L1-P1, L2-P2, L3-P3. The specific mapping relationship between the logical address and host physical address of the source volume and the snapshot volume is as follows: Figure 2 As shown. In creating the shared metadata pointer table, each grain will have a sub-metadata pointer table corresponding to a separate area within the same shared metadata pointer table. The sub-metadata pointer table for each grain is as follows:

[0055] Table 1

[0056]

[0057]

[0058] Step S12: When the source volume or the snapshot volume receives a write operation instruction sent by the host, update the logical address and host physical address mapping relationship in the shared metadata pointer table based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address.

[0059] In this embodiment, when the source volume or snapshot volume receives a write operation instruction sent by the host, the shared metadata pointer table is updated based on the write logical address of the target write data in the write operation instruction and the host physical address where the write data is actually written. Specifically, the update changes the mapping relationship between the write address and the host physical address of the source volume or snapshot volume to the mapping relationship between the write address and the host physical address where the target write data is actually written. That is, the corresponding pointer flag changes in the shared metadata pointer table, so that the write operation of the source volume or snapshot volume only requires one specific write-time redirection operation, without copying the metadata pointer table.

[0060] Step S13: When the source volume or the snapshot volume receives a read operation instruction sent by the host, the corresponding target read data is read from the host physical address of the source volume or the snapshot volume according to the corresponding logical address and host physical address mapping relationship in the shared metadata pointer table and returned to the host.

[0061] In this embodiment, when the source volume or snapshot volume receives a read operation command sent by the host, it reads the corresponding target data from the host physical address of the source volume or snapshot volume according to the mapping relationship between the logical address and the host physical address in the shared metadata pointer table of the metadata management partition in the thin pool, and returns it to the host. Read operations on the source volume and snapshot volume by the host do not involve updating the shared metadata pointer table.

[0062] In this embodiment, when a snapshot volume deletion command is received, the host physical address corresponding to the target snapshot volume is released based on the shared metadata pointer table and the logical address information of the target snapshot volume contained in the snapshot volume deletion command. The mapping relationship between the logical address and the host physical address of the target snapshot volume in the shared metadata pointer table is also deleted. It can be understood that when a snapshot volume deletion command is received, in addition to executing the snapshot volume deletion process and releasing the host physical address space corresponding to the snapshot volume, it is also necessary to release the address mapping relationship in the shared metadata pointer table of the snapshot volume in the meta_data of the metadata management partition in the storage pool.

[0063] In this embodiment, when a data recovery instruction is received, the recovery time contained in the data recovery instruction is obtained, and data recovery is performed on the corresponding source volume according to the snapshot volume information corresponding to the recovery time in the shared metadata pointer table. Upon receiving a data recovery instruction, the recovery time contained in the data recovery instruction is obtained, and data recovery is performed on the source volume in the data volume pair to which the snapshot volume belongs, using the snapshot volume information corresponding to the recovery time in the shared metadata pointer table.

[0064] Therefore, this application discloses a write-on-redirect snapshot implementation method, including: creating a snapshot volume of the source volume based on a snapshot creation instruction, and creating a shared metadata pointer table in the metadata management partition to store the logical address-host physical address mapping relationship of the source volume and the logical address-host physical address mapping relationship of the snapshot volume; when the source volume or the snapshot volume receives a write operation instruction sent by the host, updating the logical address-host physical address mapping relationship in the shared metadata pointer table based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address; when the source volume or the snapshot volume receives a read operation instruction sent by the host, reading the corresponding target read data from the host physical address of the source volume or the snapshot volume according to the corresponding logical address-host physical address mapping relationship in the shared metadata pointer table and returning it to the host. As can be seen, by creating a shared metadata pointer table in the metadata management partition to store the logical address and host physical address mapping relationship between the source volume and the corresponding snapshot volume, each snapshot's source volume and snapshot volume have exactly one metadata pointer table. In this way, when a write operation is performed on the source volume, the metadata pointer table will not be copied, thus optimizing the problem of decreased write performance of the snapshot source volume.

[0065] Reference Figure 3 As shown, this embodiment of the invention discloses a specific method for implementing write-time redirection snapshots. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:

[0066] Step S21: Create a snapshot volume of the source volume based on the snapshot creation instruction, and create a shared metadata pointer table in the metadata management partition to store the mapping relationship between the logical address and the host physical address of the source volume and the mapping relationship between the logical address and the host physical address of the snapshot volume.

[0067] For a more detailed description of the processing steps in step S21, please refer to the aforementioned disclosed embodiments; they will not be repeated here.

[0068] Step S22: Obtain the write operation instruction sent by the host, and determine whether the data volume to be executed corresponding to the write operation instruction is the source volume or the snapshot volume.

[0069] In this embodiment, the write operation command sent by the user through the host is first obtained, and it is determined whether the data volume targeted by the write operation command is the source volume or the snapshot volume, so that the write operation is performed on the corresponding data volume and not on other data volumes.

[0070] Step S23: If the data volume to be executed corresponding to the write operation instruction is the source volume, then based on the target time when the host issues the write operation instruction, determine the first target shared metadata pointer table corresponding to the source volume at the target time from the metadata management partition; update the mapping relationship between the logical address and the host physical address in the first target shared metadata pointer table based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address.

[0071] In this embodiment, if the data volume to be executed corresponding to the write operation instruction is determined to be the source volume, then based on the target time when the host issues the write operation instruction, the first target shared metadata pointer table corresponding to the source volume at the target time is determined from the shared metadata pointer tables corresponding to multiple data volume pairs stored in the metadata management partition. This first target shared metadata pointer table, in addition to recording the address mapping information of the source volume, also records the address mapping information of the snapshot volume in the data volume pair where the source volume resides. After determining the first target shared metadata pointer table, the logical address and host physical address mapping relationship in the first target shared metadata pointer table is updated based on the write logical address of the target data to be written in the write operation instruction and the corresponding host physical address. Specifically, as shown... Figure 4 As shown, at time T1, when the host performs I / O write to L0 of source volume A, it determines that the data source written in the write instruction is source volume A, the target data to be written is h, and the physical address for writing the data changes from P0 to P4. Therefore, the mapping relationship between the logical address L0 of the source volume and the physical address P0 of the host is updated to the mapping relationship between the logical address L0 and the physical address P4 of the host, while the mapping relationship of the corresponding snapshot volume RA remains unchanged. In the traditional ROW snapshot implementation, before the host I / O is executed, it is necessary to determine whether the grain has been copied. If it has not been copied, metadata processing is required first, that is, copying the sub-metadata pointer table information of the grain to the snapshot volume. In this embodiment, it is not necessary to copy the sub-metadata pointer table of the grain where the source volume L0 is located to the snapshot volume. The metadata management partition meta_data data on the thin pool is directly modified, and the sub-metadata pointer table in the shared metadata pointer table is refreshed as shown in the table below:

[0072] Table 2

[0073]

[0074]

[0075] Write operations to the source volume involve only one update to the shared metadata pointer table (the change in the data flag bit and the change in the source volume logical address L0 pointing to the physical address P4 at time T1). Source volume data write operations involve only one data write operation redirected to location P4. This reduces the need for copying the sub-metadata pointer table of the grain containing L0 on source volume A to the snapshot volume RA, as is done in traditional ROW snapshot processes, further minimizing the performance impact of write operations on source volume A.

[0076] Step S24: If the data volume to be executed in the write operation instruction is the snapshot volume, then based on the target time when the host issues the write operation instruction, determine the second target shared metadata pointer table corresponding to the snapshot volume at the target time from the metadata management partition; update the logical address and host physical address mapping relationship in the second target shared metadata pointer table based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address.

[0077] In this embodiment, if the data volume to be executed corresponding to the write operation instruction is determined to be a snapshot volume, then based on the target time when the host issues the write operation instruction, the second target shared metadata pointer table corresponding to the snapshot volume at the target time is determined from the shared metadata pointer tables corresponding to multiple data volume pairs stored in the metadata management partition. This second target shared metadata pointer table, in addition to recording the address mapping information of the snapshot volume, also records the address mapping information of the source volume in the data volume pair where the snapshot volume resides. After determining the second target shared metadata pointer table, the logical address and host physical address mapping relationship in the second target shared metadata pointer table is updated based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address. Specifically, as shown... Figure 5 As shown, when the host performs I / O writes to snapshot volume RA at time T2, it is not necessary to copy the shared metadata pointer table of the snapshot volume to the source volume. When the host performs I / O writes to L3 of snapshot volume RA at time T2, it is determined that the data source written in the write instruction is snapshot volume RA, the target data to be written is f, and the physical address of the data to be written changes from P3 to P5. Therefore, the mapping relationship between the logical address L3 of the source volume and the physical address P3 of the host is updated to the mapping relationship between logical address L3 and the physical address P5 of the host, while the corresponding mapping relationship of the source volume A remains unchanged. In this embodiment, it is not necessary to copy the sub-metadata pointer table of the grain where snapshot volume L3 is located to the snapshot volume. The metadata management partition meta_data on the thin pool is directly modified, and the sub-metadata pointer table in the shared metadata pointer table is refreshed as shown in Table 3 below:

[0078] Table 3

[0079]

[0080]

[0081] Step S25: When the source volume or the snapshot volume receives a read operation instruction sent by the host, the corresponding target read data is read from the host physical address of the source volume or the snapshot volume according to the corresponding logical address and host physical address mapping relationship in the shared metadata pointer table and returned to the host.

[0082] In this embodiment, when the source volume or snapshot receives a read operation instruction for L0 from the host, according to the address mapping relationship stored in the shared metadata pointer table, the source volume A reads data directly from P4 and returns, and the snapshot volume RA reads data directly from P0 and returns. When the source volume or snapshot receives a read operation instruction for L3 from the host, according to the address mapping relationship stored in the shared metadata pointer table, the source volume A reads data directly from P3 and returns, and the snapshot volume RA reads data directly from P5 and returns.

[0083] Therefore, by creating a separate snapshot metadata management partition on the storage pool, responsible for storing pointers to the data on the source volume and snapshot volume of the snapshot, and ensuring that there is only one copy of the shared metadata pointer table for each snapshot's source volume and snapshot volume, the metadata pointer table is not copied when a write operation is performed on the source volume. This means that the snapshot metadata pointer table of the grain where the source volume's I / O resides does not need to be copied to the snapshot volume; the metadata data on the thin pool is directly modified, and the snapshot metadata pointer table is refreshed. This optimizes the performance degradation issue of snapshot source volume writes. Experimental data comparison tests also demonstrate the effectiveness of this method. After creating a normal ROW snapshot, the write performance of the snapshot source volume decreases by about 10% compared to when there is no snapshot. This decrease is mainly due to the overhead caused by copying the shared metadata pointer table. After creating an optimized ROW snapshot, the write performance of the snapshot source volume decreases by less than 5% compared to when there is no snapshot.

[0084] Reference Figure 6 As shown, this embodiment of the invention also discloses a write-time redirection snapshot implementation apparatus, comprising:

[0085] Table creation module 11 is used to create a snapshot volume of the source volume based on the snapshot creation instruction, and to create a shared metadata pointer table in the metadata management partition to store the mapping relationship between the logical address and the host physical address of the source volume and the mapping relationship between the logical address and the host physical address of the snapshot volume.

[0086] The write instruction mapping module 12 is used to update the logical address and host physical address mapping relationship in the shared metadata pointer table based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address when the source volume or the snapshot volume receives a write operation instruction sent by the host.

[0087] The read instruction mapping module 13 is used to read the corresponding target read data from the host physical address of the source volume or the snapshot volume according to the corresponding logical address and host physical address mapping relationship in the shared metadata pointer table when the source volume or the snapshot volume receives a read operation instruction sent by the host and return it to the host.

[0088] Therefore, this application discloses a method for creating a snapshot volume based on a snapshot creation command, and creating a shared metadata pointer table in the metadata management partition to store the logical address to host physical address mapping relationship of the source volume and the logical address to host physical address mapping relationship of the snapshot volume. When the source volume or the snapshot volume receives a write operation command sent by the host, the logical address to host physical address mapping relationship in the shared metadata pointer table is updated based on the write logical address of the target write data in the write operation command and the corresponding host physical address. When the source volume or the snapshot volume receives a read operation command sent by the host, the corresponding target read data is read from the host physical address of the source volume or the snapshot volume according to the corresponding logical address to host physical address mapping relationship in the shared metadata pointer table and returned to the host. It is evident that by creating a shared metadata pointer table in the metadata management partition to store the logical address to host physical address mapping relationship of the source volume and the corresponding snapshot volume, each snapshot's source volume and snapshot volume metadata pointer table have one and only one copy. Thus, when a write operation is performed on the source volume, the metadata pointer table is not copied, optimizing the performance degradation problem of snapshot source volume writes.

[0089] Furthermore, embodiments of this application also disclose an electronic device, Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0090] Figure 7This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the write-time redirection snapshot implementation method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0091] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0092] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0093] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0094] The operating system 221 manages and controls the various hardware devices and computer programs 222 on the electronic device 20 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system 221 can be Windows Server, Netware, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the write-time redirection snapshot implementation method disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the electronic device from external devices, as well as data collected by its own input / output interface 25.

[0095] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned write-time redirection snapshot implementation method. The specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0096] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0097] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can implement the described functions using different methods for each specific application, but such implementation should not be considered beyond the scope of this application. The steps of the methods or algorithms described in connection with the embodiments disclosed herein can be implemented directly in hardware, software modules executed by a processor, or a combination of both. Software modules can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.

[0098] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0099] The above provides a detailed description of the write-time redirection snapshot implementation method, apparatus, device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for implementing write-time redirection snapshots, characterized in that, include: Obtain the snapshot creation instruction at the current moment, create a snapshot volume of the source volume based on the snapshot creation instruction to generate the corresponding data volume pair, and create a shared metadata pointer table in the metadata management partition to store the mapping relationship between the logical address and the host physical address of the source volume and the mapping relationship between the logical address and the host physical address of the snapshot volume. The shared metadata pointer table stores pointer records of the source volume and the corresponding snapshot volume. When the source volume or the snapshot volume receives a write operation instruction sent by the host, the logical address and host physical address mapping relationship in the shared metadata pointer table are updated based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address. When the source volume or the snapshot volume receives a read operation instruction sent by the host, it reads the corresponding target read data from the host physical address of the source volume or the snapshot volume according to the corresponding logical address and host physical address mapping relationship in the shared metadata pointer table and returns it to the host. When the source volume or the snapshot volume receives a write operation instruction sent by the host, updating the logical address to host physical address mapping relationship in the shared metadata pointer table based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address includes: Obtain the write operation instruction sent by the host, and determine whether the data volume to be executed corresponding to the write operation instruction is the source volume or the snapshot volume; If the data volume to be executed corresponding to the write operation instruction is the source volume, then based on the target time when the host sends the write operation instruction, the first target shared metadata pointer table corresponding to the source volume at the target time is determined from the shared metadata pointer table corresponding to the multiple data volume pairs stored in the metadata management partition. The logical address and host physical address mapping relationship in the first target shared metadata pointer table is updated based on the write logical address and the corresponding host physical address of the target write data in the write operation instruction, while the mapping relationship of the corresponding snapshot volume remains unchanged. If the data volume to be executed in the write operation instruction is the snapshot volume, then based on the target time when the host issues the write operation instruction, the second target shared metadata pointer table corresponding to the snapshot volume at the target time is determined from the shared metadata pointer table corresponding to the multiple data volume pairs stored in the metadata management partition. The logical address and host physical address mapping relationship in the second target shared metadata pointer table is updated based on the write logical address and the corresponding host physical address of the target write data in the write operation instruction, while the corresponding source volume mapping relationship remains unchanged.

2. The write-time redirection snapshot implementation method according to claim 1, characterized in that, Before creating the snapshot volume of the source volume based on the snapshot creation instruction, the method further includes: Create a source volume in the thin pool and construct a mapping relationship between the logical address of the source volume and the host physical address; A metadata management partition is created in the thin pool to store the shared metadata pointer table.

3. The write-time redirection snapshot implementation method according to claim 2, characterized in that, The snapshot volume created based on the snapshot creation instruction includes: The source volume and the snapshot volume in the data volume pair are divided into addresses according to a preset address space size to obtain the corresponding divided space addresses.

4. The write-time redirection snapshot implementation method according to claim 3, characterized in that, The step of creating a shared metadata pointer table in the metadata management partition to store the logical address-to-host physical address mapping relationship of the source volume and the logical address-to-host physical address mapping relationship of the snapshot volume includes: A shared metadata pointer table is created based on the partitioned space address corresponding to the source volume and the snapshot volume in the data volume pair at the corresponding snapshot time.

5. The write-time redirection snapshot implementation method according to claim 1, characterized in that, Also includes: When a snapshot volume deletion instruction is received, the host physical address corresponding to the target snapshot volume is released based on the shared metadata pointer table and the logical address information of the target snapshot volume contained in the snapshot volume deletion instruction, and the mapping relationship between the logical address and the host physical address of the target snapshot volume in the shared metadata pointer table is deleted.

6. The write-time redirection snapshot implementation method according to any one of claims 1 to 5, characterized in that, Also includes: When a data recovery instruction is received, the recovery time contained in the data recovery instruction is obtained, and the corresponding source volume is recovered according to the snapshot volume information corresponding to the recovery time in the shared metadata pointer table.

7. A write-time redirection snapshot implementation apparatus, characterized in that, include: The table creation module is used to obtain the snapshot creation instruction at the current moment, create a snapshot volume of the source volume based on the snapshot creation instruction, generate the corresponding data volume pair, and create a shared metadata pointer table in the metadata management partition to store the mapping relationship between the logical address and the host physical address of the source volume and the mapping relationship between the logical address and the host physical address of the snapshot volume. The shared metadata pointer table stores pointer records of the source volume and the corresponding snapshot volume. The write instruction mapping module is used to update the logical address and host physical address mapping relationship in the shared metadata pointer table based on the write logical address of the target write data in the write operation instruction and the corresponding host physical address when the source volume or the snapshot volume receives a write operation instruction sent by the host. The read instruction mapping module is used to read the corresponding target read data from the host physical address of the source volume or the snapshot volume according to the corresponding logical address and host physical address mapping relationship in the shared metadata pointer table when the source volume or the snapshot volume receives a read operation instruction sent by the host and return it to the host. The write instruction mapping module is specifically used to obtain the write operation instruction sent by the host, and determine whether the data volume to be executed corresponding to the write operation instruction is the source volume or the snapshot volume; if the data volume to be executed corresponding to the write operation instruction is the source volume, then based on the target time when the host sends the write operation instruction, the first target shared metadata pointer table corresponding to the source volume at the target time is determined from the shared metadata pointer table corresponding to the multiple data volume pairs stored in the metadata management partition; The logical address and host physical address mapping relationship in the first target shared metadata pointer table is updated based on the write logical address and the corresponding host physical address of the target write data in the write operation instruction, while the mapping relationship of the corresponding snapshot volume remains unchanged. If the data volume to be executed in the write operation instruction is the snapshot volume, then based on the target time when the host issues the write operation instruction, the second target shared metadata pointer table corresponding to the snapshot volume at the target time is determined from the shared metadata pointer table corresponding to the multiple data volume pairs stored in the metadata management partition. The logical address and host physical address mapping relationship in the second target shared metadata pointer table is updated based on the write logical address and the corresponding host physical address of the target write data in the write operation instruction, while the corresponding source volume mapping relationship remains unchanged.

8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the write-time redirection snapshot implementation method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, Used for storing computer programs; wherein, when the computer program is executed by a processor, it implements the steps of the write-time redirection snapshot implementation method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for implementing incremental snapshots-on-write

    CN102012852A

  • Data filtering method, and device and data reading system

    CN105938457A