Search

CN-121996473-A - Snapshot processing method and device

CN121996473ACN 121996473 ACN121996473 ACN 121996473ACN-121996473-A

Abstract

The application relates to a snapshot processing method and device. The method comprises the steps of deleting target application layer snapshots in response to a snapshot deleting instruction of the target application layer snapshots of the cascade snapshots, wherein each application layer snapshot of the cascade snapshots is associated with one data snapshot, the reference relation among different application layer snapshots is determined based on the reference relation among data snapshots of the cascade snapshots, the application layer snapshots are data snapshot indexes, the target data snapshots corresponding to the target application layer snapshots are determined according to the mapping relation between the application layer snapshots and the data snapshots, and the target data snapshots are processed according to snapshot reference information of the target data snapshots. By adopting the method, the snapshot processing efficiency can be improved.

Inventors

  • HU GUOYU
  • JI MIN
  • HE ZHEN
  • GAO YANMIN
  • CUI FANG

Assignees

  • 天津中科曙光存储科技有限公司

Dates

Publication Date
20260508
Application Date
20241028

Claims (10)

  1. 1. A snapshot processing method, the method comprising: Deleting the target application layer snapshot in response to a snapshot deleting instruction of the target application layer snapshot aiming at the cascade snapshot, wherein each application layer snapshot of the cascade snapshot is associated with one data snapshot, the reference relation among different application layer snapshots is determined based on the reference relation among the data snapshots of the cascade snapshot, and the application layer snapshots are data snapshot indexes; determining a target data snapshot corresponding to the target application layer snapshot according to a mapping relation between the application layer snapshot and the data snapshot; and processing the target data snapshot according to the snapshot reference information of the target data snapshot.
  2. 2. The method of claim 1, wherein the snapshot reference information includes a current snapshot reference number of the target data snapshot; the processing the target data snapshot according to the snapshot reference information of the target data snapshot includes: subtracting the times generated by referencing the target data snapshot by the target application layer snapshot from the current snapshot referencing times of the target data snapshot to obtain new snapshot referencing times of the target data snapshot; And deleting the target data snapshot under the condition that the new snapshot reference times are set values.
  3. 3. The method of claim 2, wherein the deleting the target data snapshot comprises: Judging whether a first reference snapshot referencing the target data snapshot exists in each data snapshot according to the referencing relation among the data snapshots of the cascade snapshot; If yes, deleting the data which does not have a reference relation with the first reference snapshot in the target data snapshot; And if not, deleting the target data snapshot.
  4. 4. The method of claim 3, wherein the deleting data in the target data snapshot that does not have a reference relationship with the first reference snapshot comprises: determining the current snapshot reference times of the second reference snapshot under the condition that the target data snapshot references the second reference snapshot in the data snapshots; under the condition that the current snapshot reference times of the second reference snapshot are the set values, fusion processing is carried out on the target data snapshot and the second reference snapshot, and fusion snapshots are obtained; And deleting the data which does not have a reference relation with the first reference snapshot in the fusion snapshot.
  5. 5. The method of claim 1, wherein after processing the target data snapshot, the method further comprises: Based on the reference relation among the data snapshots of the cascade snapshot, the snapshot reference information of other data snapshots except the target data snapshot is updated, and the container reference information of each data container storing the data snapshot is updated, wherein the container reference information of each data container is determined based on the snapshot reference information of the data snapshot stored in the data container.
  6. 6. The method according to claim 1, wherein the method further comprises: Responding to a snapshot construction instruction aiming at the cascade snapshot, determining an upper-level application layer snapshot of a new application layer snapshot to be created, and creating the new application layer snapshot; determining a target data container where a first data snapshot corresponding to the upper-level application layer snapshot is located; and determining the data snapshot corresponding to the new application layer snapshot according to the snapshot types of the target data container and the new application layer snapshot, wherein the snapshot types comprise writable snapshots or read-only snapshots.
  7. 7. The method of claim 6, wherein determining the data snapshot corresponding to the new application layer snapshot based on the snapshot types of the target data container and the new application layer snapshot comprises: Creating a next level data container of the target data container under the condition that the snapshot type of the new application layer snapshot is a writable snapshot; Determining a basic data snapshot from the data snapshots stored in the target data container according to snapshot reference information of the data snapshots stored in the target data container; and based on the basic data snapshot, creating a data snapshot corresponding to the new application layer snapshot in the next-stage data container.
  8. 8. The method of claim 6, wherein determining the data snapshot corresponding to the new application layer snapshot based on the snapshot types of the target data container and the new application layer snapshot comprises: If the snapshot type of the new application layer snapshot is a read-only snapshot, creating a second data snapshot with a reference relationship with the first data snapshot in the target data container; mapping the upper level application layer snapshot to the second data snapshot and mapping the new application layer snapshot to the first data snapshot.
  9. 9. The method according to claim 1, wherein the method further comprises: Responsive to a snapshot rollback instruction from a first application layer snapshot to a second application layer snapshot, determining a rollback data snapshot corresponding to the second application layer snapshot; Creating a third data snapshot with a reference relation with the rollback data snapshot in a data container where the rollback data snapshot is located, and mapping the second application layer snapshot to the third data snapshot; creating a new data container containing the rollback data snapshot; And deleting the data snapshot corresponding to the first application layer snapshot, and mapping the first application layer snapshot to the rollback data snapshot in the new data container.
  10. 10. A snapshot processing device, the device comprising: The system comprises a first processing module, a second processing module and a third processing module, wherein the first processing module is used for responding to a snapshot deleting instruction of a target application layer snapshot aiming at a cascade snapshot and deleting the target application layer snapshot, each application layer snapshot of the cascade snapshot is associated with one data snapshot, the reference relation between different application layer snapshots is determined based on the reference relation between data snapshots of the cascade snapshot, and the application layer snapshots are index of the data snapshots; the snapshot determining module is used for determining a target data snapshot corresponding to the target application layer snapshot according to the mapping relation between the application layer snapshot and the data snapshot; and the second processing module is used for processing the target data snapshot according to the snapshot reference information of the target data snapshot.

Description

Snapshot processing method and device Technical Field The present application relates to the field of computer technologies, and in particular, to a snapshot processing method and apparatus. Background In order to ensure the reliability of data in a storage system, a snapshot technology for data, that is, a data snapshot of source data at a certain moment is copied, and a dependency relationship between the source data and the data snapshot is constructed. However, in the existing snapshot processing method, under the condition that multiple layers of cascaded snapshots exist, mutual dependency relationship exists among the data snapshots, and at this time, if the data snapshots of the middle layer in the cascaded snapshots are to be deleted, operations such as relatively complex metadata migration are involved, so that snapshot processing efficiency is reduced. Disclosure of Invention In view of the foregoing, it is desirable to provide a snapshot processing method and apparatus capable of improving snapshot processing efficiency. In a first aspect, the present application provides a snapshot processing method, including: Deleting the target application layer snapshot in response to a snapshot deleting instruction of the target application layer snapshot aiming at the cascade snapshot, wherein each application layer snapshot of the cascade snapshot is associated with one data snapshot, the referential relationship among different application layer snapshots is determined based on the referential relationship among all data snapshots of the cascade snapshot, and the application layer snapshots are data snapshot indexes; Determining a target data snapshot corresponding to the target application layer snapshot according to the mapping relation between the application layer snapshot and the data snapshot; and processing the target data snapshot according to the snapshot reference information of the target data snapshot. In the embodiment of the application, the cascade snapshot is constructed by adopting the application layer snapshot for indexing the data snapshot, the original deleting operation directly aiming at the data snapshot is converted into the deleting operation for the index identification, and the reference relation of the data snapshot is adjusted, so that the data migration is not needed, and the efficiency of snapshot processing can be improved on the basis of ensuring the snapshot processing reliability. In one embodiment, the snapshot reference information comprises the current snapshot reference times of the target data snapshot, and the processing of the target data snapshot according to the snapshot reference information of the target data snapshot comprises the following steps: Subtracting the times generated by the target application layer snapshot referencing the target data snapshot from the current snapshot referencing times of the target data snapshot to obtain new snapshot referencing times of the target data snapshot, and deleting the target data snapshot under the condition that the new snapshot referencing times are set values. In the embodiment of the application, the rationality of deleting the data snapshot can be ensured by calculating the new snapshot reference times and comparing the new snapshot reference times with the set value so as to judge whether the target data snapshot needs to be deleted or not. In one embodiment, deleting the target data snapshot includes: Judging whether a first reference snapshot referencing the target data snapshot exists in each data snapshot according to the reference relation among the data snapshots of the cascade snapshots, if so, deleting the data which do not have the reference relation with the first reference snapshot in the target data snapshot, and if not, deleting the target data snapshot. In the embodiment of the application, by judging whether the first reference snapshot with the reference relation with the target data snapshot exists or not, and further deleting the target data snapshot in different modes, the deletion of the data referenced in the target data snapshot can be avoided, and the reliability of deleting the data snapshot is further ensured. In one embodiment, deleting data in the target data snapshot that does not have a reference relationship with the first reference snapshot includes: under the condition that the target data snapshot references the second reference snapshot in the data snapshots, determining the current snapshot reference times of the second reference snapshot, under the condition that the current snapshot reference times of the second reference snapshot are set values, carrying out fusion processing on the target data snapshot and the second reference snapshot to obtain a fusion snapshot, and deleting data which have no reference relation with the first reference snapshot in the fusion snapshot. In the embodiment of the application, under the condition that the second reference snapshot also ha