CN107491529B - Snapshot deleting method and node - Google Patents

Snapshot deleting method and node Download PDF

Info

Publication number
CN107491529B
CN107491529B CN201710712754.3A CN201710712754A CN107491529B CN 107491529 B CN107491529 B CN 107491529B CN 201710712754 A CN201710712754 A CN 201710712754A CN 107491529 B CN107491529 B CN 107491529B
Authority
CN
China
Prior art keywords
snapshot
log
storage node
same
logs
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710712754.3A
Other languages
Chinese (zh)
Other versions
CN107491529A (en
Inventor
赵雨耿
谢晓芹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710712754.3A priority Critical patent/CN107491529B/en
Publication of CN107491529A publication Critical patent/CN107491529A/en
Application granted granted Critical
Publication of CN107491529B publication Critical patent/CN107491529B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/128Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems

Abstract

The embodiment of the application discloses a snapshot deleting method and nodes, relates to the technical field of storage, and divides at least two acquired snapshot logs into at least one snapshot log group through a management node. All the snapshot logs in each snapshot log group have the same attribute, the different snapshot log groups comprise different snapshot logs, the snapshot logs are used for recording the difference between the copy before the object is modified and the modified object, and the copy before the object is modified is the object output after the snapshot of the object is created. The management node sends all the snapshot logs of the snapshot log group to the same storage node, so that frequent access to the storage node is avoided when a plurality of snapshot logs are sent to the same storage node, the burden of frequent sending of the snapshot logs by the management node is reduced, the burden of frequent receiving of the plurality of snapshot logs by the storage node is reduced, and the efficiency of sending the snapshot logs is improved.

Description

Snapshot deleting method and node
Technical Field
The embodiment of the application relates to the technical field of storage, in particular to a snapshot deleting method and a node.
Background
The file system provides a structured data storage and organization. In a file system, a directory is used to represent a data organization structure of the file system, and each sub-directory and file under the directory are respectively an object, and the object comprises at least one of data and metadata. The storage node of the snapshot processing system comprises a data server and a metadata server. Based on the need of data protection, a storage node in the snapshot processing system saves a copy of an object when creating a snapshot of the object, wherein the copy of the object comprises a data copy or a metadata copy. The storage node creates a snapshot log after saving the copy of the object, and saves the snapshot log to a log directory specified by a snapshot processing system, wherein the snapshot log records the difference between the copy of the object and the object at other times, and the difference recorded by the snapshot log comprises a data difference or a metadata difference.
As time accumulates, more snapshots are created by each storage node in the snapshot processing system, and expired snapshots or useless snapshots can be deleted in order to reduce consumption of storage resources of the snapshot processing system. When the snapshot is deleted, the management node acquires the snapshot log of the snapshot to be deleted by accessing the log directory, and the management node sequentially sends each snapshot log to the storage node which creates the snapshot log according to the recording time of all the acquired snapshot logs, so that the storage node deletes the copy of the object corresponding to the snapshot to be deleted according to the received snapshot log after receiving the snapshot log. When the management node sends each snapshot log, the sending resource of a message needs to be occupied, and the multiple snapshot logs are sent to the same storage node according to the time sequence, the storage node is frequently accessed, the service performance of the storage node is reduced, and more sending resources need to be consumed to send the multiple snapshot logs to the same storage node.
Disclosure of Invention
The embodiment of the application provides a snapshot deleting method and nodes, and the problem of low service performance of storage nodes caused by frequent access to the storage nodes in the snapshot deleting process can be solved.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect, a snapshot deleting method is provided, where a management node, after obtaining at least two snapshot logs, divides the obtained at least two snapshot logs into at least one snapshot log group, where all the snapshot logs in each snapshot log group have the same attribute, the snapshot logs included in different snapshot log groups are different, the snapshot logs are used to record a difference between a copy before object modification and a modified object, and the copy before object modification is an object output after creating a snapshot of the object. After at least one snapshot log group is obtained, the management node sends all snapshot logs in the same snapshot log group to the same storage node.
The management node groups the acquired snapshot logs, all the snapshot logs in each snapshot log group have the same attribute, and all the snapshot logs in the same snapshot log group are sent to the same storage node, so that the problem that the management node needs to frequently access the storage node when sending a plurality of snapshot logs to the same storage node according to a time sequence is avoided, the burden of frequently sending the snapshot logs by the management node is reduced, the burden of frequently receiving the snapshot logs by the storage node is reduced, the service performance of the storage node is improved, and the efficiency of sending the snapshot logs is improved.
Optionally, in a possible implementation manner of the present application, the object includes metadata, and accordingly, the difference of the snapshot log records includes a metadata difference, the storage node includes a metadata server, all snapshot logs in the same snapshot log group have the same attribute, objects including all snapshot log records in the same snapshot log group have the same parent node, and metadata of objects having the same parent node are managed by the same metadata server. In this case, the method for dividing the at least two acquired snapshot logs into at least one snapshot log group by the management node includes: the management node determines snapshot logs recording metadata differences and divides the determined snapshot logs recording the metadata differences into at least one snapshot log group, and objects recorded by each snapshot log in the same snapshot log group have the same father node.
Optionally, in another possible implementation manner of the present application, the object includes data, and correspondingly, the difference of the snapshot log records includes a data difference, the storage node includes a data server, all snapshot logs in the same snapshot log group have the same attribute, the object including all snapshot log records in the same snapshot log group belongs to the same logical sector, and here, the data of the object belonging to the same logical sector is managed by the same data server. In this case, the method for dividing the at least two acquired snapshot logs into at least one snapshot log group by the management node includes: the management node determines snapshot logs recording data differences, divides the determined snapshot logs recording the data differences into at least one snapshot log group, and saves objects recorded by each snapshot log in the same snapshot log group in the same logical sector.
Optionally, in another possible implementation manner of the present application, the method that the management node sends all snapshot logs in the same snapshot log group to the same storage node includes: the management node packages all the snapshot logs in each snapshot log group into at least one deletion message and sends the packaged at least one deletion message to the same storage node, wherein each deletion message in the at least one deletion message comprises at least two snapshot logs in each log group.
The management node packages all the snapshot logs in each snapshot log group into at least one deletion message and sends the packaged at least one deletion message to the same storage node, so that the burden of sending the snapshot logs by the management node is effectively reduced, correspondingly, the burden of receiving the snapshot logs by the storage node is also reduced, the service performance of the storage node is improved, and the efficiency of sending the snapshot logs is improved.
In a second aspect, a management node is provided that includes an acquisition unit, a grouping unit, and a transmission unit.
The functions implemented by the unit modules provided by the present application are specifically as follows:
the acquiring unit is configured to acquire at least two snapshot logs. The grouping unit is configured to divide at least two snapshot logs acquired by the acquiring unit into at least one snapshot log group, where all the snapshot logs in the same snapshot log group have the same attribute, the snapshot logs included in different snapshot log groups are different, the snapshot log is used to record a difference between a copy before object modification and a modified object, and the copy before object modification is an object output after creating a snapshot of the object. The sending unit is configured to send all snapshot logs in the same snapshot log group divided by the grouping unit to the same storage node.
Optionally, in a possible implementation manner of the present application, the object includes metadata, the difference of the snapshot log records includes a metadata difference, the storage node includes a metadata server, all snapshot logs in the same snapshot log group have the same attribute, and objects including all snapshot log records in the same snapshot log group have the same parent node. In this case, the management node provided in this embodiment of the present application further includes a determining unit, where the determining unit is configured to determine, from the at least two snapshot logs acquired by the acquiring unit, a snapshot log that records a metadata difference. Correspondingly, the grouping unit is further configured to divide the snapshot log of the record metadata difference determined by the determining unit into at least one snapshot log group, and objects recorded by each snapshot log in the same snapshot log group have the same parent node.
Optionally, in another possible implementation manner of the present application, the object includes data, the difference of the snapshot log records includes a data difference, the storage node includes a data server, all snapshot logs in the same snapshot log group have the same attribute, and the object including all snapshot log records in the same snapshot log group belongs to the same logical sector. In this case, the management node in the embodiment of the present application further includes a determining unit, where the determining unit is configured to determine, from the at least two snapshot logs acquired by the acquiring unit, a snapshot log in which a difference in data is recorded. Correspondingly, the grouping unit is further configured to divide the snapshot log of the recorded data difference determined by the determining unit into at least one snapshot log group, and an object recorded by each snapshot log in the same snapshot log group is stored in the same logical sector.
Optionally, in another possible implementation manner of the present application, the management node provided in this embodiment of the present application further includes an encapsulating unit, where the encapsulating unit is configured to encapsulate all snapshot logs in each snapshot log group divided by the grouping unit into at least one deletion message, and each deletion message in the at least one deletion message includes at least two snapshot logs in each log group. Correspondingly, the sending unit is further configured to send the at least one deletion message encapsulated by the encapsulating unit to the same storage node.
In a third aspect, a management node is provided, which includes: one or more processors, memory, a communication interface. Wherein the memory, communication interface are coupled with the one or more processors; the management node communicates with at least one storage node via a communication interface, the storage being configured to store computer program code, the computer program code comprising instructions, which, when executed by the one or more processors, cause the management node to perform the snapshot deletion method as described above in the first aspect and its various possible implementations.
Specifically, the processor is configured to obtain at least two snapshot logs, and divide the obtained at least two snapshot logs into at least one snapshot log group, where all the snapshot logs in the same snapshot log group have the same attribute, the snapshot logs included in different snapshot log groups are different, the snapshot log is used to record a difference between a copy before object modification and a modified object, and the copy before object modification is an object output after creating a snapshot of the object. The communication interface is used for sending all the snapshot logs in the same snapshot log group to the same storage node.
Optionally, in a possible implementation manner of the present application, the object includes metadata, the difference of the snapshot log records includes a metadata difference, the storage node includes a metadata server, all snapshot logs in the same snapshot log group have the same attribute, and objects including all snapshot log records in the same snapshot log group have the same parent node. In this case, the processor is specifically configured to determine a snapshot log that records a metadata difference from among the at least two obtained snapshot logs, and to divide the determined snapshot log that records the metadata difference into at least one snapshot log group, where objects recorded by each snapshot log in the same snapshot log group have the same parent node.
Optionally, in another possible implementation manner of the present application, the object includes data, the difference of the snapshot log records includes a data difference, the storage node includes a data server, all snapshot logs in the same snapshot log group have the same attribute, and the object including all snapshot log records in the same snapshot log group belongs to the same logical sector. In this case, the processor is specifically configured to determine a snapshot log of the recorded data difference from the at least two acquired snapshot logs, and to divide the determined snapshot log of the recorded data difference into at least one snapshot log group, where an object recorded by each snapshot log in the same snapshot log group is saved in the same logical sector.
Optionally, in another possible implementation manner of the present application, the processor is further configured to encapsulate all snapshot logs in each snapshot log group into at least one deletion message, where each deletion message in the at least one deletion message includes at least two snapshot logs in each log group. Correspondingly, the communication interface is specifically configured to send at least one deletion message to the same storage node.
In a fourth aspect, there is also provided a computer-readable storage medium having instructions stored therein; when run on a management node, causes the management node to perform the snapshot deletion method as described above in the first aspect and its various possible implementations.
In a fifth aspect, there is also provided a computer program product containing instructions that, when run on a management node, cause the management node to perform the snapshot deletion method as described in the first aspect and its various possible implementations.
In the present application, the names of the above-mentioned management nodes do not limit the devices or functional modules themselves, and in actual implementation, the devices or functional modules may appear by other names. Insofar as the functions of the respective devices or functional modules are similar to those of the present application, they fall within the scope of the claims of the present application and their equivalents.
For a detailed description of the second, third, fourth, fifth and their various implementations in this application, reference may be made to the detailed description of the first aspect and its various implementations; moreover, the beneficial effects of the second aspect, the third aspect, the fourth aspect, the fifth aspect and various implementation manners thereof may refer to the beneficial effect analysis of the first aspect and various implementation manners thereof, and are not described herein again.
In a sixth aspect, a snapshot deleting method is provided, in which a storage node creates a transaction for deleting a snapshot to be deleted after receiving at least one snapshot log having the same attribute, and then the storage node runs the created transaction for deleting the snapshot to be deleted, and deletes a copy of each snapshot log record in the at least one snapshot log. Here, the snapshot log is used to record a difference between a copy before object modification and a modified object, and the copy before object modification is an object output after creating a snapshot of the object.
The storage node in the embodiment of the application can delete the copies of the objects recorded by all the snapshot logs in the snapshot log group only by creating and operating one transaction for deleting the snapshot to be deleted, so that the deleting efficiency of the snapshot to be deleted is improved, and the service performance of the storage node is also improved.
Optionally, in a possible implementation manner of the present application, after a transaction for deleting a snapshot to be deleted is created by a storage node, the storage node performs a locking operation on the created transaction for deleting the snapshot to be deleted, confirms a waiting locking linked list, and stores each snapshot log in at least one snapshot log to the waiting locking linked list. In this way, the method that the storage node runs the created transaction for deleting the snapshot to be deleted and deletes the copy of the object recorded in each snapshot log in at least one snapshot log includes: the storage node inquires the to-be-locked linked list and deletes the copy of the object recorded by each snapshot log of the at least one snapshot log in the to-be-locked linked list; after deleting the copy of the object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list, the storage node performs an unlocking operation on the created transaction for deleting the snapshot to be deleted, and deletes each snapshot log of the at least one snapshot log in the waiting locking linked list.
And the storage node performs locking operation on the created transaction for deleting the snapshot to be deleted, so that the security of the transaction is ensured. After the created transaction for deleting the snapshot to be deleted is locked, the storage node stores each snapshot log in the at least one snapshot log to the waiting locking linked list, so that the storage node can delete the copies of the objects recorded by all the snapshot logs in the waiting locking linked list in a centralized manner, and the deleting efficiency of the snapshot to be deleted is improved.
Optionally, in another possible implementation manner of the present application, after the storage node creates a transaction for deleting the snapshot to be deleted, the storage node merges and stores the metadata or the data of the object recorded by the at least one snapshot log.
Optionally, in another possible implementation manner of the present application, after a storage node creates a transaction for deleting a snapshot to be deleted, the storage node performs a locking operation on the created transaction for deleting the snapshot to be deleted, and confirms a waiting locking linked list; the storage node stores each snapshot log in the at least one snapshot log to the waiting locking linked list; the storage node runs the transaction for deleting the snapshot to be deleted, inquires the waiting locking linked list and deletes the copy of the object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list; and the storage node merges and stores the metadata or the data of the object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list.
The storage node merges and stores the metadata or the data of the object recorded by the at least one snapshot log, so that the data storage efficiency is improved, and the service performance of the storage node is also improved.
In a seventh aspect, a storage node is provided, which includes a receiving unit, a transaction creating unit, and a transaction executing unit.
The functions implemented by the unit modules provided by the present application are specifically as follows:
the receiving unit is configured to receive at least one snapshot log, where the at least one snapshot log has the same attribute, the snapshot log is used to record a difference between a copy of the object before modification and the modified object, and the copy of the object before modification is an object output after creating a snapshot of the object. The transaction creating unit is configured to create a transaction for deleting the snapshot to be deleted. The transaction running unit is configured to run the transaction created by the transaction creating unit and used to delete the snapshot to be deleted, and delete the copy of the object recorded in each snapshot log in the at least one snapshot log received by the receiving unit.
Optionally, in a possible implementation manner of the present application, the storage node further includes a locking unit, where the locking unit is configured to, after the transaction creating unit creates a transaction for deleting a snapshot to be deleted, perform a locking operation on the created transaction for deleting the snapshot to be deleted, and confirm the waiting locking linked list. In addition, the storage node provided in the embodiment of the present application further includes a storage unit, where the storage unit is configured to store each snapshot log in the at least one snapshot log received by the receiving unit to a waiting locking linked list confirmed by the locking unit. Correspondingly, the transaction running unit is further configured to query the waiting locking linked list, delete duplicates of objects recorded by all snapshot logs in the waiting locking linked list, and perform an unlocking operation on the created transaction for deleting the snapshot to be deleted after deleting duplicates of objects recorded by all snapshot logs in the waiting locking linked list, so as to delete all snapshot logs in the waiting locking linked list.
Optionally, in another possible implementation manner of the present application, the storage node further includes a processing unit, where the processing unit is configured to, after the transaction creating unit creates a transaction for deleting a snapshot to be deleted, merge and store metadata or data of an object recorded in at least one snapshot log received by the receiving unit.
Optionally, in another possible implementation manner of the present application, the storage node further includes a locking unit, a storage unit, and a processing unit. The locking unit is used for performing locking operation on the created transaction for deleting the snapshot to be deleted and confirming the waiting locking linked list. The storage unit is configured to store each snapshot log in the at least one snapshot log received by the receiving unit to the waiting locking linked list confirmed by the locking unit. The transaction operation unit is further configured to operate a transaction for deleting the snapshot to be deleted, query the waiting locking linked list, and delete the duplicates of the objects recorded in all the snapshot logs in the waiting locking linked list. The processing unit is specifically configured to merge and store metadata or data of objects to be recorded by all snapshot logs in the locking linked list.
In an eighth aspect, there is provided a storage node comprising: one or more processors, memory, a communication interface. Wherein the memory, communication interface are coupled with the one or more processors; the storage node communicates with the management node through a communication interface; the memory is used for storing computer program code comprising instructions which, when executed by the one or more processors, the storage node performs the snapshot deletion method as described above in the sixth aspect and its various possible implementations.
Specifically, the communication interface is configured to receive at least one snapshot log, where the at least one snapshot log has the same attribute, the snapshot log is configured to record a difference between a copy of the object before modification and the modified object, and the copy of the object before modification is an object output after creating the snapshot of the object. The processor is configured to create a transaction for deleting a snapshot to be deleted, run the created transaction for deleting the snapshot to be deleted, and delete a copy of an object recorded in each snapshot log in at least one snapshot log received by the communication interface.
Optionally, in a possible implementation manner of the present application, the processor is further configured to, after creating a transaction for deleting a snapshot to be deleted, perform a locking operation on the created transaction for deleting the snapshot to be deleted, and confirm the waiting locking linked list. Correspondingly, the memory is configured to store each snapshot log in the at least one snapshot log received by the communication interface to the waiting locking linked list confirmed by the processor. Correspondingly, the processor is specifically configured to query the waiting locking linked list, delete duplicates of objects recorded by all snapshot logs in the waiting locking linked list, and perform an unlocking operation on the created transaction for deleting the snapshot to be deleted after deleting duplicates of objects recorded by all snapshot logs in the waiting locking linked list, so as to delete all snapshot logs in the waiting locking linked list.
Optionally, in another possible implementation manner of the present application, the processor is further configured to merge and store metadata or data of the object of the received at least one snapshot log record after creating a transaction for deleting the snapshot to be deleted.
Optionally, in another possible implementation manner of the present application, the processor is further configured to perform a locking operation on a created transaction for deleting a snapshot to be deleted, confirm a waiting locking linked list, store each snapshot log in at least one received snapshot log to the waiting locking linked list confirmed by the processor, run the transaction for deleting the snapshot to be deleted, query the waiting locking linked list, delete duplicates of objects recorded in all snapshot logs in the waiting locking linked list, and merge and store metadata or data of the objects recorded in all snapshot logs in the waiting locking linked list.
In a ninth aspect, there is also provided a computer-readable storage medium having instructions stored therein; when run on a storage node, cause the storage node to perform the snapshot deletion method as described above in the sixth aspect and its various possible implementations.
In a tenth aspect, there is also provided a computer program product containing instructions which, when run on a storage node, cause the storage node to perform the snapshot deletion method as described in the above sixth aspect and its various possible implementations.
In the present application, the names of the storage nodes mentioned above do not limit the devices or the functional modules themselves, and in actual implementation, the devices or the functional modules may appear by other names. Insofar as the functions of the respective devices or functional modules are similar to those of the present application, they fall within the scope of the claims of the present application and their equivalents.
For a detailed description of the seventh aspect, the eighth aspect, the ninth aspect, the tenth aspect, and various implementations thereof in the present application, reference may be made to the detailed description of the sixth aspect and various implementations thereof; moreover, for the beneficial effects of the seventh aspect, the eighth aspect, the ninth aspect, the tenth aspect and various implementation manners thereof, reference may be made to beneficial effect analysis in the sixth aspect and various implementation manners thereof, and details are not repeated here.
These and other aspects of the present application will be more readily apparent from the following description.
According to the snapshot deleting method and the node, the management node divides at least two acquired snapshot logs into at least one snapshot log group, wherein all the snapshot logs in each snapshot log group have the same attribute, the different snapshot log groups comprise different snapshot logs, the snapshot logs are used for recording the difference between a copy before object modification and an object after modification, and the copy before object modification is an object output after the snapshot of the object is created. The management node sends all the snapshot logs of the snapshot log group to the same storage node, so that frequent access to the storage node is avoided when a plurality of snapshot logs are sent to the same storage node, the burden of frequent sending of the snapshot logs by the management node is reduced, the burden of frequent receiving of the plurality of snapshot logs by the storage node is reduced, the service performance of the storage node is improved, and the efficiency of sending the snapshot logs is improved.
Drawings
Fig. 1a is a schematic structural diagram of a snapshot processing system according to an embodiment of the present application;
FIG. 1b is a schematic structural diagram of a logical partition of a memory array according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a data organization structure of a snapshot processing system according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating an index of metadata of an object of a snapshot processing system according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of another snapshot processing system according to an embodiment of the present application;
fig. 5a is a first schematic structural diagram of a management node according to an embodiment of the present application;
fig. 5b is a schematic structural diagram of a storage node according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a snapshot deletion method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a management node according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a storage node according to an embodiment of the present application.
Detailed Description
In the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
The snapshot deletion method provided in the embodiment of the present application is described below by taking a snapshot processing system as an example.
In a snapshot processing system, the snapshot processing system includes a storage node and a storage array. The number of the storage nodes is not limited, and the storage nodes are divided into a metadata server and a data server according to the data service function. The storage array is made up of a plurality of disks (disks). The storage array is used to store metadata and data. The storage nodes communicate with a storage array.
The data storage mode in the snapshot processing system mainly comprises file storage, object storage and block storage, and the three storage modes are all applicable to a basic architecture. Referring to fig. 1a, fig. 1a is a schematic structural diagram of a snapshot processing system according to an embodiment of the present disclosure. As shown in fig. 1a, the snapshot processing system includes a metadata server 11 and a data server 12 and a storage array 13. In the snapshot processing system shown in fig. 1a, the metadata server 11 directly obtains the basic configuration information or the status information of each data server 12 in the snapshot processing system, or the metadata server 11 obtains the basic configuration information or the status information of each data server 12 through any data server 12. In the snapshot processing system, the number of the metadata servers 11 and the data servers 12 is not limited. In the present embodiment, the storage array 13 is composed of the disks of the metadata server 11 and the disks of the data server 12. In other implementations, the storage array 13 may be composed of disks of other storage nodes, and the configuration of the storage array is not limited by this embodiment.
As shown in fig. 1a, a user communicates with various servers through a client 10. For example, the client 10 sends a data access request to the metadata server 11 in a signaling interactive manner, the metadata server 11 returns status information of the data server 12 to the client 10 after querying, and the client 10 communicates with the data server 12 to access the data server 12 after receiving the status information about the data server 12 returned by the metadata server 11.
In addition to one basic architecture of the snapshot processing system shown in fig. 1a, there are a number of other implementations of the architecture of the snapshot processing system. If the snapshot processing system is organized according to logical nodes, the snapshot processing system includes four logical nodes, i.e., a protocol server, a metadata server (MDS), a Data Server (DS), and a management node, in addition to the storage array. When the snapshot processing system is actually deployed, the four logical nodes, i.e., the protocol server, the MDS, the DS, and the management node, may be located on the same physical machine, or may be deployed independently or in combination, and a specific actual deployment manner is not limited by the embodiment of the present application. The protocol Server is used for providing Network File service functions such as a standard Network File System (NFS) and a Server Message Block (SMB) for users. The MDS is responsible for providing metadata-related services such as path analysis, file searching and file creation. The DS is used to store data. In the snapshot processing system, any node in the snapshot processing system may be configured as a management node, or a dedicated node may be configured separately as a management node. Similarly, in the snapshot processing system, any node in the snapshot processing system may be configured as the protocol server, or a dedicated node may be configured separately as the protocol server.
Generally, a metadata server or a data server in the snapshot processing system is accessed by loading a user program on a Protocol Client (PC). The protocol client is responsible for establishing an access interface of data in the snapshot processing system, and is connected with the protocol server through a front-end network, for example, the protocol server is connected with the protocol client through Fast Ethernet (FE), and each node included in the snapshot processing system is connected through a back-end network. The front-end network is used for request and data interaction between user services and the snapshot processing system, and the back-end network is used for request and data interaction between nodes in the snapshot processing system.
In order to improve the reliability of data and improve the utilization rate of a storage space, a storage array is logically divided into a plurality of logical sectors, and each logical sector is formed by combining a plurality of independent disks (disks) to form a single data redundancy protection group. Alternatively, the data redundancy protection group may be represented by a Network Logical Unit Number (NLUN). In a snapshot processing system, data is subjected to algorithm processing according to a preset algorithm, for example, the data is subjected to algorithm processing through algorithms such as a redundancy algorithm, erasure code calculation and the like, so as to obtain a corresponding logical sector, and then the data is stored in a data redundancy protection group corresponding to the logical sector. One logical sector is formed by combining a plurality of hard disks, and each logical sector corresponds to one hard disk for storing data when storing data. The logical sectors are managed by the data server, and therefore data stored using the same logical sectors are managed by the same data server. The data stored by using different logical sectors may be managed by the same data server, or may be managed by different data servers, which is not limited in this application.
Illustratively, the method for storing data in the storage array by the data server according to erasure code calculation is as follows: the data server divides data into a plurality of data blocks, performs erasure code calculation on all the data blocks to obtain check data of the data, respectively stores all the data blocks and the check data in a magnetic disk, and combines all hard disks storing the data blocks and the check data into a data redundancy protection group which is used as a logic sector. And when the erasure code calculation method is implemented, the number of the check data is limited. In this way, when the number of disks in the logical sector which is less than or equal to the number of the check data fails, the snapshot processing system can recover and reconstruct the data according to other disks which do not fail in the logical sector except the failed disks.
In a snapshot processing system, all disks in a storage array are divided into a plurality of disk groups, each including at least one disk. The snapshot processing system combines a plurality of magnetic disks in the storage array into a plurality of logical sectors, and all the magnetic disks of each logical sector are respectively positioned in different magnetic disk groups. Referring to fig. 1b, fig. 1b is a schematic structural diagram of a logical partition of a memory array according to an embodiment of the present disclosure. As shown in FIG. 1b, the snapshot processing system divides all the disks in the storage array into a first disk group 131, a second disk group 132, and a third disk group 133. Each disk group comprises N (N is more than or equal to 1) disks. The logical sectors of the snapshot processing system configuration shown in fig. 1b include logical sector NLUN0 and logical sector NLUN 1. NLUN0 and NLUN1 are the identities of two logical sectors, respectively. The identification of the logical sectors may be letters, numbers or other symbols. The disks constituting the logical sector NLUN0 are disk 1 of the first disk group 131, disk 1 of the second disk group 132, and disk 1 of the third disk group 133. The disks constituting logical sector NLUN1 are disk N of first disk group 131, disk 3 of second disk group 132, and disk 2 of third disk group 133. Data is divided into a plurality of data blocks when stored. In fig. 1b, a certain data is divided into a data block 1# and a data block 2#, when the data is stored, erasure code calculation is performed according to the data block 1# and the data block 2#, so as to obtain 1 piece of check data P #, and all the data blocks (the data block 1# and the data block 2#) and the check data P # are respectively stored in one disk of the logical sector NLUN 0. Similarly, another data is divided into a data block 3# and a data block 4#, erasure code calculation is performed according to the data block 3# and the data block 4#, so as to obtain 1 check data S #, and all the data blocks (the data block 3# and the data block 4#) and the check data S # are respectively stored in one disk of the logical sector NLUN 1. The other data is divided into a data block 5# and a data block 6#, erasure code calculation is performed according to the data block 5# and the data block 6#, and 1 piece of check data K # is obtained, and all the data blocks (the data block 5# and the data block 6#) and the check data K # are respectively stored in one disk of the logical sector NLUN 0. The logical sector NLUN0 is shared by data divided into data block 5#, data block 6#, and another data divided into data block 1# and data block 2#, and all data sharing the logical sector NLUN0 are managed by the same data server.
The snapshot processing system provides a structured data storage and organization. The data organization structure of the snapshot processing system is represented as a tree-structured directory tree. The directory tree comprises a root directory, subdirectories and files under the subdirectories, wherein the subdirectories can contain not only the files but also the subdirectories at the next level, and the like form the directory tree of the multilevel directory structure. In the directory tree, except for the root directory, each directory or file has its own parent directory. Each directory has its own subdirectory, except for files. Each directory and each file in the directory tree respectively correspond to one node, the node where the root directory is located is a root node, the node where the file is located is a leaf node, and the node where the subdirectory is located is an intermediate node. Except for the root node, each leaf node or intermediate node in the directory tree has a parent node to which the leaf node or intermediate node belongs. Except for leaf nodes, the root node and each intermediate node have their own child nodes. All child directories and files belonging to the same parent directory have the same parent node corresponding to the same parent directory.
In the snapshot processing system, a directory and each subdirectory and file under the directory are respectively an object, and the object comprises data or metadata. Referring to fig. 2, fig. 2 is a schematic diagram of a data organization structure of a snapshot processing system according to an embodiment of the present application. As shown in fig. 2, the data organization structure of the snapshot processing system is a directory structure, and the directory structure includes a root directory "/", two subdirectories Dir1 and Dir2 under the root directory "/", a File1 under the root directory "/", a subdirectory Dir3 under the subdirectory Dir1, two File files 2 and File3 under the subdirectory Dir1, a File4 under the subdirectory Dir2, and two File files 5 and File6 under the subdirectory Dir 3. The nodes corresponding to root directory "/" are the same parent nodes of child directory Dir1, child directory Dir2 and File 1. The nodes corresponding to the child directory Dir1 are the same parent nodes of the child directory Dir3, the File2 and the File 3. The node corresponding to the child directory Dir2 is the parent node of the File 4. The node corresponding to the subdirectory Dir3 is the same parent node of the File5 and the File 6.
The storage manner of metadata of the snapshot processing system is described below by taking the data organization structure of the snapshot processing system shown in fig. 2 as an example.
Referring to fig. 3, fig. 3 is a schematic diagram illustrating an index of metadata of an object of a snapshot processing system according to an embodiment of the present application. Based on the directory structure shown in fig. 2, fig. 3 shows an index form of metadata of each object when it is stored in the snapshot processing system. As shown in fig. 3, the metadata of each object includes an identifier of the object and node information, and the node information stores a corresponding relationship between the object and the metadata of each sub-directory or file in the directory corresponding to the object. Each subdirectory or file under the directory corresponding to the object can be indexed through the node information of the object. The identification of the object is represented by a Dentry (directory entry) parameter, and the node information is represented by an Inode (node) parameter. Metadata of all objects having the same parent node is stored in a directory list of the same parent node, the directory list of the same parent node including metadata of each object having the same parent node, the metadata of each object including identification and node information of the object. The value of the Dentry parameter may be the name or number of the object.
For example, based on the directory structure shown in fig. 2, the parent nodes of the child directory Dir1, the child directory Dir2 and the File1 shown in fig. 2 are root nodes corresponding to the root directory "/". Therefore, as shown in fig. 3, the snapshot processing system stores the correspondence between the root node and the directory list of the root node, where the directory list of the root node includes the identifiers of the directory Dir1, the subdirectory Dir2, and the File1, and the identifiers of the subdirectory Dir1, the subdirectory Dir2, and the File1 are represented by the values of directory entry (Dentry) parameters. And the directory list of the root node further includes node information of the subdirectory Dir1, the subdirectory Dir2 and the File1, wherein the node information of the subdirectory Dir1, the subdirectory Dir2 and the File1 is represented by values of Inode (node) parameters. Thus, the metadata of the three objects under the root node is indexed by the directory list of the root node.
For another example, based on the directory structure shown in fig. 2, since the parent nodes of the subdirectory Dir3, the File2 and the File3 shown in fig. 2 are all nodes corresponding to the subdirectory Dir1, as shown in fig. 3, the snapshot processing system stores the correspondence between the subdirectory Dir1 and the directory list of the subdirectory Dir1, where the directory list of the subdirectory Dir1 includes the identifications of the subdirectory Dir3, the File2 and the File3, and the identifications of the subdirectory Dir3, the File2 and the File3 are expressed by the value of a directory entry (Dentry) parameter. And the directory list of the subdirectory Dir1 further includes node information of the subdirectory Dir3, the File2 and the File3, wherein the node information of the subdirectory Dir3, the File2 and the File3 is represented by values of Inode (node) parameters. Since the child directory Dir1 is the same parent node of the child directory Dir3, the File2 and the File3, the metadata of the three objects (the child directory Dir3, the File2 and the File3) under the child directory Dir1 is indexed by the directory list of the child directory Dir 1. The storage manner of metadata based on other objects shown in fig. 2 is the same as the storage manner of metadata in the directory list of the root node or the directory list of the subdirectory Dir1, and is not described herein again.
In particular implementations, the metadata for each object having the same parent node is stored in the directory list of the same parent node. The directory list of the same parent node is maintained by a metadata server that manages the same parent node. For example, as can be seen from fig. 2, the parent nodes of File5 and File6 are both subdirectory Dir3, and the metadata of File5 and the metadata of File6 are both stored in the directory list of subdirectory Dir3, so that the directory list corresponding to subdirectory Dir3 is indexed by subdirectory Dir3, and the metadata of File5 and the metadata of File6 are confirmed by the directory list corresponding to subdirectory Dir 3. The metadata of the object having different parent nodes may be managed by different metadata servers, or may be managed by the same metadata server, which is not limited in this embodiment.
The node information of the metadata of each object contains basic attributes of the object in addition to the root directory. The basic properties of the object include information of the size, creation time, type, and the like of the data.
Fig. 4 is a schematic structural diagram of another snapshot processing system according to an embodiment of the present application. As shown in fig. 4, the snapshot processing system includes MDSs 41, DSs 42, and management node 43, in addition to storage array 40. The MDS41, the DS 42 and the management node 43 may be deployed on the same device, or may be deployed independently or in combination, which is not specifically limited in this embodiment of the present application. The snapshot deleting method provided in the embodiment of the present application is described below by taking the MDS41, the DS 42 and the management node 43 in fig. 4 as an example of their independent deployment. In the present application, the MDS41 and the DS 42 each establish a communication connection with the management node 43. In other implementations, MDS41 and DS 42 establish a communication connection with each other.
In this embodiment of the present application, each of the MDS41, the DS 42 and the management node 43 may be a physical machine, may also be a virtual machine, and may also be any other device for providing an object storage service, which is not specifically limited in this embodiment of the present application.
In addition, the snapshot processing system provided by the embodiment of the application further includes a protocol server, and the protocol server establishes communication connection with other storage nodes respectively and also establishes communication connection with a protocol client through a network. The protocol server may be any node in the snapshot processing system, or may be a dedicated node configured separately, which is not specifically limited in this embodiment of the present application. Here, the protocol client and the protocol server can both refer to the above description, and detailed description is not repeated here.
The existing snapshot deleting method comprises the following steps: the management node 43 sequentially transmits a plurality of snapshot logs to the storage node that created the snapshot log according to the recording time of the snapshot log. The method for sending the snapshot log is complex and low in efficiency. When the plurality of snapshot logs are sent to the same storage node, the storage node needs to be frequently accessed, and the service performance of the storage node is reduced.
In the snapshot deleting method provided by the application, the management node 43 groups the obtained snapshot logs to obtain at least one snapshot log group, all the snapshot logs in each snapshot log group have the same attribute, and the objects recorded in the snapshot logs having the same attribute in the same snapshot log group are managed by the same storage node. Therefore, after the management node 43 divides all the acquired snapshot logs into at least one snapshot log group, the management node 43 sends the snapshot log group, and all the snapshot logs in each snapshot log group are sent to the same storage node, thereby avoiding frequent access to the storage node when sending a plurality of snapshot logs to the same storage node according to the time sequence, reducing the burden of the management node 43 on sending the snapshot logs frequently, reducing the burden of the storage node on receiving a plurality of snapshot logs frequently, improving the service performance of the storage node, and improving the efficiency of sending the snapshot logs.
Referring to fig. 5a, fig. 5a is a schematic structural diagram of a management node 43 according to an embodiment of the present disclosure. As shown in fig. 5a, the management node 43 provided in the embodiment of the present application includes: a communication interface 51, a communication interface 52 and a control module 53. The communication interface 51 and the communication interface 52 are connected to a control module 53, respectively. In the management node 43, a communication interface 51 is used for communicating with a client or other storage node, for example, the communication interface 51 is used for communicating with the MDS41 or the DS 42 shown in fig. 4. The communication interface 52 is used to communicate with the storage array. Communication interface 51 and communication interface 52 communicate via a communication network, such as an ethernet, a Wireless Local Area Network (WLAN), or the like.
After determining that the snapshot is to be deleted, the control module 53 obtains the snapshot log of the snapshot to be deleted from the log directory specified by the snapshot processing system. The control module 53 is further configured to send the snapshot log to the storage node that created the snapshot log.
As shown in fig. 5a, the control module 53 includes a processor 531 and a memory 532. The processor 531 is connected to the memory 532. The communication interface 51, the communication interface 52, the processor 531, and the memory 532 may be connected by a system bus 54. The memory 532 may be separate and coupled to the processor 531 via the system bus 54. The memory 532 may also be integrated with the processor 531.
The processor 531 is configured to obtain a snapshot log of a snapshot to be deleted from a log directory specified by the snapshot processing system. The processor 531 is further configured to send the snapshot log to a storage node that creates the snapshot log.
The memory 532 is used for temporarily storing information received by the management node 43. The memory 532 is also used for storing software programs and application modules, and the processor 531 executes various functional applications and data processing of the management node 43 by running the software programs and application modules stored in the memory 532.
The memory 532 mainly includes a program storage area 5321. The program storage area 5321 may store an operating system, an application program required for at least one function, such as sending a delete message, and the like.
The processor 531 may be any computing device, such as a general purpose Central Processing Unit (CPU), a microprocessor, a programmable controller, an Application-Specific Integrated Circuit (ASIC), or one or more Integrated circuits for controlling the execution of programs according to the above schemes. Processor 531 is the control center of management node 43. The processor 531 connects various parts of the management node 43 using various interfaces and lines, performs various functions of the management node 43 and processes data by running or executing software programs and/or application modules stored in the memory 532, thereby monitoring the management node 43 as a whole. In a specific implementation, the processor may include one or more CPUs, for example, the processor in fig. 5a includes CPU 0 and CPU 1.
Memory 532 may include Volatile Memory (Volatile Memory), such as Random-Access Memory (RAM); the Memory 532 may also include non-volatile Memory (non-volatile Memory), such as Read-Only Memory (ROM), Flash Memory (Flash Memory), a Hard Disk Drive (HDD), a Solid-State Drive (SSD), a magnetic Disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a network device, but is not limited to such.
The system bus 54 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like.
The system bus 54 may be divided into an address bus, a data bus, a control bus, and the like. For clarity of illustration in the embodiments of the present application, the various buses are illustrated in FIG. 5a as system bus 54.
The role of each part of the management node 43 in the present application is described in detail below in connection with the structure of the management node 43 shown in fig. 4 and 5 a.
In the present application, interface 51 is used to communicate with MDS41 or DS 42, e.g., with MDS41 or DS 42, to determine the identity of the snapshot to be deleted, and to send the snapshot log group to MDS41 or DS 42.
In this application, the processor 531 is configured to access a log directory specified by the snapshot processing system, and obtain a snapshot log stored in the log directory according to an identifier of a snapshot to be deleted.
The processor 531 is further configured to divide all the acquired snapshot logs into at least one snapshot log group. All the snapshot logs in the same snapshot log group have the same attribute, the different snapshot log groups comprise different snapshot logs, the snapshot logs are used for recording the difference between the copy of the object and the object at other moments, and the copy of the object is the copy of the object output after the snapshot of the object is created. And the objects recorded in the snapshot logs with the same attribute in the same snapshot log group are managed by the same storage node.
The processor 531 is further configured to send each snapshot log group of the at least one snapshot log group. And all the snapshot logs in each snapshot log group are sent to the same storage node.
According to the snapshot deleting method provided by the application, the processor 531 of the management node 43 groups the acquired snapshot logs to acquire at least one snapshot log group, all the snapshot logs in each snapshot log group have the same attribute, and the objects recorded in the snapshot logs with the same attribute in the same snapshot log group are managed by the same storage node. Therefore, after the processor 531 of the management node 43 divides all the acquired snapshot logs into at least one snapshot log group, the management node 43 sends each snapshot log group, and all the snapshot logs in each snapshot log group are sent to the same storage node, thereby avoiding frequent access to the storage node when sending a plurality of snapshot logs to the same storage node, reducing the burden of the management node 43 on sending the snapshot logs frequently, reducing the burden of the storage node on receiving a plurality of snapshot logs frequently, improving the service performance of the storage node, and improving the efficiency of sending the snapshot logs.
In a snapshot processing system, a storage node creates a snapshot of an object and saves a copy of the object, based on the need for data protection. When creating a snapshot, the storage node generates an identification of the snapshot. The copy of the object includes a data copy or a metadata copy. If the object needing to create the snapshot is metadata, the metadata server generates an identifier of the snapshot, queries the identifier of the object, saves the corresponding relation between the identifier of the snapshot and the identifier of the parent node of the object, and then saves a copy of the metadata. If the object needing to create the snapshot is data, the data server generates the identification of the snapshot, saves the corresponding relation between the logical sector where the data is located and the identification of the snapshot, and then the data server saves the copy of the data.
After the copy of the object is saved, the storage node creates a snapshot log and saves the snapshot log to a log directory specified by a snapshot processing system. For example, after creating a snapshot log of data, the data server saves the snapshot log to a log directory specified by the snapshot processing system. Or after the metadata server creates the snapshot log of the metadata, the snapshot log is saved to a log directory specified by the snapshot processing system. The log directory for storing the snapshot log of the data and the log directory for storing the snapshot log of the metadata may be the same log directory or different log directories. The management node 43 or the storage node of the snapshot processing system further stores a correspondence between the snapshot log and the identifier of the snapshot, so as to confirm a plurality of snapshot logs of the snapshot.
The snapshot log records differences between the copy of the object and the object at other times, i.e. data differences or metadata differences. For example, the snapshot log records a difference between the copy of the object at the current snapshot time and the copy of the object at the mth snapshot time before the current snapshot time, where M is an integer greater than zero. Or the snapshot log records the difference between the copy of the object at the current snapshot time and the object modified after the current snapshot time. It will be readily appreciated that modifications made to the object refer to modifying the data or metadata of the object.
If the difference between the copy of the object at the current snapshot time and the object modified after the current snapshot time is recorded through the snapshot log, the specific implementation manner is as follows: a storage node generates an identification of a snapshot for an object, when the object needs to be modified, copies the object to generate a copy of the object, saves the copy of the object, and then the storage node modifies the object. After the modification is finished, the storage device creates a snapshot log for recording the difference between the copy of the object and the modified object. Typically, the snapshot log is saved in a designated log directory. When the object needs to be modified, the content to be modified of the object can also be copied to generate a copy of the content to be modified of the object. Specifically, a copy of the object or a copy of the content to be modified by the object is generated, which is not limited in this embodiment of the application.
If the object needed to create the snapshot is data, the snapshot log records the data differences. The snapshot log of the recorded data differences includes: identification of the object, identification of the logical sector in which the object is stored, offset address (offset), and modified data length (length), etc. The offset address is used for indicating that the storage node modifies the starting address of the object, and the modified data length is used for indicating that the storage node modifies the data length of the object. Optionally, the snapshot log of the recorded data differences may further include an identification of a parent node of the object.
If the object needed to create the snapshot is metadata, then the difference in snapshot log records is a metadata difference. The snapshot log of the record metadata differences includes: an identification of an object and an identification of a parent node of the object.
In an example, referring to fig. 3, when a storage node needs to modify metadata of a File3 in a subdirectory Dir1 at a certain time, a snapshot is created for the metadata of the File3, an identifier of the snapshot is generated, a correspondence between the identifier of the snapshot and an identifier of a parent node (i.e., a subdirectory Dir1) of the File3 is saved, then the storage node copies and saves a piece of content to be modified in the metadata of the File3 as a copy File3 ', then modifies the content to be modified in the metadata of the File3, and the File3 after modifying the metadata is changed into a File 3'. At this time, in the snapshot processing system, the directory list of the subdirectory Dir1 includes metadata of the subdirectory Dir3, metadata of the File2, metadata of the File3 ', and a copy File 3' of the content to be modified of the File 3.
After modifying the metadata of the File3, the storage node creates a snapshot log for recording differences between the metadata of the copy File3 'and File 3' of the content to be modified of the File 3. The snapshot log includes an identification of File3 and an identification of subdirectory Dir 1.
In another example, referring to fig. 1b, when the data including the data block 1# needs to be modified, the storage node first copies a copy of the data to be modified in the data block 1# to save the data block 1# a, uses the original data block 1# as the copy 1# of the data block 1# and modifies the data to be modified in the data block 1# a, and the modified data block 1# a is called 1 #'. At this time, in this system, the storage node stores data block 1 '#anddata block 1 #'.
After modifying the data of data block 1# a, the storage node creates a snapshot log for recording the difference between data block 1# and data block 1 #'. The snapshot log includes an identification of an object to which the data block 1# belongs, an identification of a logical sector storing the data block 1#, an offset address (offset), a modified data length (length), and the like. In addition, the snapshot log may also include an identification of the parent node of the object to which data block 1# belongs.
As can be seen from the above description, the storage node creates a snapshot log for the modification of each object at different times.
After the snapshot log is saved in the log directory specified by the snapshot processing system, if a certain storage node needs to delete the snapshot, the storage node sets a deletion flag for the snapshot to be deleted, and the management node 43 determines the identifier of the snapshot to be deleted according to the deletion flag. Specifically, the storage node stores the correspondence between the identifier of the snapshot to be deleted and the deletion flag, and the management node 43 determines the identifier of the snapshot to be deleted according to the deletion flag, and further determines the snapshot to be deleted.
The management node 43 acquires the snapshot log of the snapshot to be deleted after determining the snapshot to be deleted, and sends the snapshot log of the snapshot to be deleted to the storage node, so that the storage node creates and runs a transaction for deleting the snapshot to be deleted, thereby completing the deletion of the snapshot to be deleted. Specifically, when the snapshot to be deleted is deleted, the storage node deletes some information created when the snapshot is deleted, for example, a copy of an object saved when the snapshot is deleted. Optionally, some information created by the storage node when the snapshot is deleted further includes other related information generated when the snapshot is deleted and a corresponding relationship between the information and the identifier of the snapshot to be deleted.
In the existing snapshot deleting method, the management node 43 sends snapshot logs to the storage node according to a time sequence, and the storage node respectively creates and runs a transaction for deleting a snapshot to be deleted after obtaining each snapshot log. Specifically, the storage node executes a created transaction for deleting the snapshot to be deleted first, and executes another created transaction for deleting the snapshot to be deleted after the transaction is completed, so as to delete the corresponding snapshot to be deleted. For example: after receiving the two snapshot logs, the storage node creates a transaction for deleting the snapshot to be deleted for one of the snapshot logs; the storage node runs the transaction and deletes some information created when the snapshot is deleted; the storage node acquires data or metadata of the object recorded in one of the snapshot logs and stores the acquired data or metadata to a storage array or other storage media; the storage node then creates and runs a transaction to another snapshot log for deleting the snapshot to be deleted. After the storage node receives the snapshot logs each time, the transaction for deleting the snapshot to be deleted needs to be created and operated for the plurality of snapshot logs respectively, so that the efficiency of snapshot deletion and data storage is reduced, and the service performance of the storage node is reduced.
In the snapshot deleting method provided by the application, the management node 43 sends all snapshot logs in the same snapshot log group to the same storage node, and the storage node creates a transaction for deleting the snapshot to be deleted after acquiring at least one snapshot log in the same snapshot log group. If the object recorded by the snapshot log is metadata, the storage node creates a transaction for deleting the snapshot to be deleted, deletes the copy of the metadata of all the objects in the directory list of the same father node corresponding to the identifier of the snapshot to be deleted, acquires the metadata of all the objects in the directory list of the same father node corresponding to the identifier of the snapshot to be deleted, and stores the metadata of all the objects in the directory list of the same father node corresponding to the identifier of the snapshot to be deleted to a storage array or other storage media. If the object recorded by the snapshot log is data, the storage node creates a transaction for deleting the snapshot to be deleted, deletes the copy of all data with the same logical sector as the object recorded by the snapshot log, acquires all data with the same logical sector as the object recorded by the snapshot log, and saves all the data with the same logical sector as the object recorded by the snapshot log to a storage array or other storage media. The storage node in the embodiment of the application can realize the duplicate deletion of the objects recorded by all the snapshot logs in the snapshot log group and the merged storage of the metadata or the data of a plurality of objects by only creating and operating one transaction for deleting the snapshot to be deleted, so that the deletion efficiency of the snapshot to be deleted is improved, the data storage efficiency is improved, and the service performance of the storage node is also improved.
Optionally, after the storage node deletes the copy of the object, the storage node obtains metadata of all objects in the directory list of the same parent node corresponding to the identifier of the snapshot to be deleted, or obtains all data having the same logical sector as the object recorded in the snapshot log. Here, the metadata of all objects in the directory list of the same parent node corresponding to the identifier of the snapshot to be deleted, which is acquired by the storage node, or all data having the same logical sector as the object recorded by the snapshot log do not include a copy of the object.
And if the storage node acquires the metadata of all the objects in the directory list of the same father node corresponding to the identity of the snapshot to be deleted before deleting the copy of the object, the metadata of all the objects in the directory list of the same father node corresponding to the identity of the snapshot to be deleted acquired by the storage node includes the copy of the object. In this case, the storage node acquires copies of metadata of all objects in the directory list of the same parent node corresponding to the identifier of the snapshot to be deleted, and deletes copies of metadata of all objects in the directory list of the same parent node corresponding to the identifier of the snapshot to be deleted. Similarly, if the storage node acquires all data having the same logical sector as the object recorded in the snapshot log before deleting the copy of the object, all the data acquired by the storage node having the same logical sector as the object recorded in the snapshot log includes the copy of the object. In this case, the storage node acquires all data having the same logical sector as the object of the snapshot log record and deletes a copy of all data having the same logical sector as the object of the snapshot log record.
In conjunction with fig. 4, MDS41 and DS 42 in fig. 4 are storage nodes in the embodiment of the present application.
Referring to fig. 5b, fig. 5b is a structural diagram of a storage node according to an embodiment of the present disclosure. As shown in fig. 5b, the storage node provided in the embodiment of the present application includes: a communication interface 61, a communication interface 62 and a control module 63. The communication interface 61 and the communication interface 62 are connected to a control module 63, respectively. In the storage node, the communication interface 61 is used for communication with the management node 43 or other storage nodes, for example, the communication interface 61 is used for communication with the MDS41 or the DS 42 shown in fig. 4. The communication interface 62 is used to communicate with the storage array. The communication interface 61 and the communication interface 62 communicate through a communication network such as ethernet, WLAN, or the like.
The control module 63 is configured to create and run a transaction for deleting a snapshot to be deleted, and delete a copy of an object recorded in each snapshot log in at least one snapshot log. The control module 63 is further configured to merge and store metadata or data of at least one object recorded in the snapshot log.
As shown in fig. 5b, the control module 63 includes a processor 631 and a memory 632. The processor 631 is coupled to the memory 632. The communication interface 61, the communication interface 62, the processor 631, and the memory 632 may be connected by a system bus 64. The memory 632 may be separate and coupled to the processor 631 via the system bus 64. The memory 632 may also be integrated with the processor 631.
The processor 631 is configured to create and execute a transaction for deleting a snapshot to be deleted, and delete a copy of an object recorded in each snapshot log in at least one snapshot log.
The memory 632 is used to incorporate metadata or data for objects that store at least one snapshot log record. The memory 632 is also used to store software programs and application modules, and the processor 631 executes various functional applications and data processing of the storage node by operating the software programs and application modules stored in the memory 632.
The memory 632 mainly includes a program storage area 6321. The storage program area 6321 may store, among other things, an operating system, application programs required for at least one function, such as sending a response message, and the like.
The processor 631 may be any computing device, which may be a CPU, microprocessor, programmable controller, ASIC, or one or more integrated circuits for controlling the execution of the programs of the above schemes. Processor 631 is the control center for the storage nodes. The processor 631 connects various portions of the storage node using various interfaces and lines, performs various functions of the storage node and processes data by running or executing software programs and/or application modules stored in the memory 632, thereby monitoring the storage node as a whole. In a specific implementation, the processor may include one or more CPUs, for example, the processor in fig. 5b includes CPU 0 and CPU 1.
Memory 632 may include Volatile Memory (Volatile Memory), e.g., RAM; the memory 632 may also include non-volatile memory (non-volatile memory), such as, but not limited to, ROM, flash memory, HDD, SSD, magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a network device.
The system bus 64 may be a PCI bus or an EISA bus, etc.
The system bus 64 may be divided into an address bus, a data bus, a control bus, and the like. For clarity of illustration in the embodiments of the present application, the various buses are illustrated in FIG. 5b as system bus 64.
The function of each part of the storage node in the present application is described in detail below in conjunction with the structure of the storage node shown in fig. 4 and 5 b.
In the present application, the communication interface 61 is configured to communicate with the management node 43 and receive at least one snapshot log having the same attribute.
In this application, the processor 631 is configured to create and execute a transaction for deleting a snapshot to be deleted, and delete a copy of an object recorded in each snapshot log in at least one snapshot log. Processor 631 is further configured to perform a locking operation on a transaction that has been created to delete a snapshot to be deleted, and validate the pending locked list.
The memory 632 is configured to store each snapshot log of the at least one snapshot log received by the communication interface 61 to the waiting locking linked list.
The processor 631 is further configured to query the waiting locking linked list storing at least one snapshot log received by the communication interface 61, delete duplicates of objects recorded by all snapshot logs in the waiting locking linked list, and further configured to perform an unlocking operation on the created transaction for deleting the snapshot to be deleted after deleting duplicates of objects recorded by all snapshot logs in the waiting locking linked list, and delete all snapshot logs in the waiting locking linked list.
The memory 632 is also used for merging and storing the metadata or data of the object recorded by at least one snapshot log after the processor 631 deletes the transaction of the snapshot to be deleted.
In the snapshot deleting method provided by the application, after the communication interface 61 of the storage node obtains at least one snapshot log in the same snapshot log group, the processor 631 of the storage node creates a transaction for deleting the snapshot to be deleted, and runs the created transaction for deleting the snapshot to be deleted, so as to delete the copy of the object recorded by each snapshot log in the at least one snapshot log. After the processor 631 creates a transaction to delete a snapshot to be deleted, the memory 632 of the storage node merges and stores data or metadata of the object of at least one snapshot log record to a storage array or other storage medium. The storage node in the embodiment of the application can realize the duplicate deletion of the objects recorded by all the snapshot logs in the snapshot log group and the merged storage of the metadata or the data of a plurality of objects by only creating and operating one transaction for deleting the snapshot to be deleted, so that the deletion efficiency of the snapshot to be deleted is improved, the data storage efficiency is improved, and the service performance of the storage node is also improved.
The snapshot deletion method provided by the present application is described in detail below with reference to the storage form of the storage array shown in fig. 1b, the data organization structure of the snapshot processing system shown in fig. 2, the index form of the metadata of the snapshot processing system shown in fig. 3, the schematic structural diagram of the snapshot processing system shown in fig. 4, the schematic structural diagram of the management node 43 shown in fig. 5a, and the schematic structural diagram of the storage node shown in fig. 5 b.
Specifically, please refer to fig. 6, where fig. 6 is a schematic flowchart of a snapshot deleting method according to an embodiment of the present application. As shown in fig. 6, in the snapshot deleting method provided in this embodiment, steps S600, S601, and S602 are executed by the management node 43 shown in fig. 4 or fig. 5a, and specifically may be executed by the control module 53 in the management node 43 or the processor 531 in the control module 53 shown in fig. 5 a. In addition, the steps S603, S604, S605, S606, and S607 are executed by the storage node shown in fig. 5b, that is, the MDS 42 or the DS 43 in fig. 4, and may be specifically executed by the control module 63 in the storage node shown in fig. 5b or the processor 631 in the control module 63 shown in fig. 5 b.
As shown in fig. 6, the snapshot deleting method provided in the embodiment of the present application specifically includes the following steps.
S600, the management node 43 obtains at least two snapshot logs.
Specifically, after the management node 43 periodically or the number of snapshots to be deleted reaches a certain threshold or the management node 43 receives a snapshot processing message carrying an identifier of the snapshot to be deleted, a snapshot log corresponding to the snapshot to be deleted in the snapshot processing system is queried.
Optionally, the management node 43 periodically or periodically queries whether a snapshot to be deleted exists in the storage node, where the snapshot to be deleted refers to a snapshot with a deletion flag set. If a snapshot with a deletion flag set exists in a certain storage node, the management node 43 acquires a snapshot log corresponding to the snapshot with the deletion flag set from a log directory specified by the snapshot processing system. If there is no snapshot with the deletion flag set at the query time of the management node 43, the management node 43 does not perform any processing and waits for a next cycle or a next query time.
Optionally, after receiving the snapshot processing message carrying the identifier of the snapshot to be deleted, which is sent by the storage node, the management node 43 obtains the snapshot log corresponding to the identifier of the snapshot to be deleted from the log directory specified by the snapshot processing system.
Optionally, when the number of snapshots to be deleted in the storage node reaches a certain threshold, a snapshot processing message carrying the identifier of the snapshot to be deleted is sent to the management node 43.
As can be seen from the foregoing description, one snapshot corresponds to at least one snapshot log, and therefore, after acquiring an identifier of a snapshot to be deleted, the management node 43 may acquire at least two snapshot logs corresponding to the snapshots to be deleted.
S601, the management node 43 divides all the acquired snapshot logs into at least one snapshot log group, where all the snapshot logs in the same snapshot log group have the same attribute, and the snapshot logs included in different snapshot log groups are different.
As can be known from the foregoing description, the difference of the snapshot log records includes a data difference or a metadata difference, and therefore, after obtaining at least two snapshot logs, the management node 43 first divides the obtained at least two snapshot logs into a snapshot log recording the data difference and a snapshot log recording the metadata difference, and then further divides the snapshot log recording the data difference and the snapshot log recording the metadata difference respectively.
As can be seen from fig. 1b, the data in the snapshot processing system is stored according to the logical sectors, and the data stored in different logical sectors is different, so the method for further dividing the snapshot log recording the data difference by the management node 43 is as follows: the management node 43 further divides the snapshot log recording the data difference into at least one snapshot log group according to the identification of the logical sector, that is, into at least one snapshot log group for recording the data difference, where the object recorded in each snapshot log group for recording the data difference belongs to the same logical sector and has the same identification of the logical sector. Data of objects belonging to the same logical sector are managed by the same data server.
As shown in fig. 3, the metadata of each object having the same parent node is obtained by the same parent node index, and therefore, the management node 43 further divides the snapshot log recording the metadata difference into: the management node 43 further divides the snapshot log recording the metadata difference into at least one snapshot log group according to the identification of the parent node of the child object, that is, into at least one snapshot log group for recording the metadata difference, and each object recorded in each snapshot log group for recording the metadata difference has the same parent node. Metadata of objects having the same parent node is managed by the same metadata server.
S602 and the management node 43 send all snapshot logs in the same snapshot log group to the same storage node.
Specifically, after acquiring at least one snapshot log group for recording data differences in S601, the management node 43 sends each snapshot log group for recording data differences to one DS, and all snapshot logs in the same snapshot log group are sent to the same DS. The DS herein refers to a DS in which a snapshot to be deleted is recorded.
Similarly, after acquiring at least one snapshot log group for recording metadata differences in S601, the management node 43 sends each snapshot log group for recording metadata differences to one MDS, and all snapshot logs in the same snapshot log group are sent to the same MDS. The MDS here refers to an MDS that records a snapshot to be deleted.
Regardless of whether the management node 43 sends the snapshot log group to the DS or the MDS, the manner in which the management node 43 sends the snapshot log group may be: the management node 43 packages all the snapshot logs in the same snapshot log group into at least one deletion message according to a preset message length, wherein the snapshot logs included in different deletion messages are different; the management node 43 sends at least one deletion message encapsulated by all the snapshot logs in the same snapshot log group to the same storage node.
Optionally, the management node 43 may also send at least one deletion message encapsulated by all snapshot logs of each snapshot log group in the multiple snapshot log groups to the same storage node.
In the process that the management node 43 sends each snapshot log group, the management node 43 may determine a storage node according to the same attribute of all snapshot logs of each snapshot log group, and send a deletion message to the storage node, or determine a storage node according to a certain preset identifier, and send a deletion message to the storage node, which is not specifically limited in this embodiment of the present application. The preset identification is used for indicating the storage nodes which receive all the snapshot logs of the same snapshot log group.
In the snapshot deleting method provided by the application, the management node 43 groups the obtained snapshot logs to obtain at least one snapshot log group, all the snapshot logs in each snapshot log group have the same attribute, and the objects recorded in the snapshot logs having the same attribute in the same snapshot log group are managed by the same storage node. Therefore, after the management node 43 divides all the acquired snapshot logs into at least one snapshot log group, the management node 43 sends the snapshot log group, and all the snapshot logs in each snapshot log group are sent to the same storage node, thereby avoiding frequent access to the storage node when sending a plurality of snapshot logs to the same storage node according to the time sequence, reducing the burden of the management node 43 on sending the snapshot logs frequently, reducing the burden of the storage node on receiving a plurality of snapshot logs frequently, and improving the efficiency of sending the snapshot logs.
And a certain storage node receiving the deletion message can acquire all the snapshot logs in the same snapshot log group according to the deletion message. After the storage node acquires at least one snapshot log in the same snapshot log group, the copy deletion of the objects recorded by all the snapshot logs in the snapshot log group is realized. In the embodiment of the present application, the processing process of each snapshot log group by each storage node is the same, and for convenience of understanding, the processing process of one snapshot log group by one storage node is taken as an example in the embodiment of the present application for description. As shown in fig. 6, after S602, the snapshot deleting method further includes the following steps:
s603, the storage node obtains at least one snapshot log included in a snapshot log group sent by the management node 43, where the at least one snapshot log has the same attribute.
Specifically, the storage node receives at least one deletion message sent by the management node 43, where each deletion message in the at least one deletion message includes at least one snapshot log in a log group. After receiving at least one deletion message, the storage node decapsulates each received deletion message and reads the decapsulated deletion message to obtain all snapshot logs included in one snapshot log group.
S604, the storage node creates and runs a transaction for deleting the snapshot to be deleted.
S605, the storage node deletes the copy of the object recorded by each snapshot log in at least one snapshot log acquired by the storage node.
Specifically, the storage node performs a locking operation on the created transaction for deleting the snapshot to be deleted according to the at least one obtained snapshot log, confirms the waiting locking linked list, and stores each snapshot log in the at least one snapshot log to the waiting locking linked list.
And the storage node inquires the waiting locking linked list and deletes the copy of the object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list. Since each snapshot log of the at least one snapshot log in the waiting locking linked list has the same attribute, and objects recorded in all the snapshot logs with the same attribute are managed by the same storage node, the storage node queries and deletes a copy of an object recorded in each snapshot log of the at least one snapshot log in the waiting locking linked list.
In addition, after the created transaction for deleting the snapshot to be deleted is executed, the storage node also stores the combination of the metadata or the data of the object recorded by the at least one snapshot log. As shown in fig. 6, after S604, the snapshot deleting method further includes the following steps:
and S606, merging and storing the metadata or the data of the object recorded by the at least one snapshot log by the storage node.
Specifically, the storage node performs a locking operation on the created transaction for deleting the snapshot to be deleted according to the at least one obtained snapshot log, and stores each snapshot log in the at least one snapshot log to a waiting locking linked list.
And the storage node runs the created transaction for deleting the snapshot to be deleted, queries the waiting locking linked list, and merges and stores the metadata or the data of the object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list. Since each snapshot log of the at least one snapshot log in the waiting locking linked list has the same attribute, and objects recorded in all the snapshot logs with the same attribute are managed by the same storage node, the storage node queries and stores metadata or data combination of the objects recorded in each snapshot log of the at least one snapshot log in the waiting locking linked list.
After the storage node in this embodiment executes S604, S605 may be executed first, and then S606 is executed, or S606 may be executed first, and then S605 is executed, or S605 and S606 may be executed simultaneously, which is not specifically limited in this embodiment of the present application. In fig. 6, the storage node executes S605 first and then S606, for example.
After the storage nodes delete the copies of the objects and merge and store the metadata or data of the objects to be recorded by all the snapshot logs in the waiting locking linked list, unlocking the created transaction for deleting the snapshot to be deleted, so as to create and run another transaction for deleting the snapshot in the subsequently received snapshot logs in other snapshot log groups.
S607, the storage node transmits a response message to the management node 43.
The management node 43 in the embodiment of the present application groups the acquired snapshot logs first and then transmits the acquired snapshot logs, which effectively reduces the number of times that the management node 43 transmits the snapshot logs, reduces the burden that the management node 43 frequently transmits the snapshot logs, reduces the occupancy rate of transmission resources, reduces the burden that the storage node frequently receives a plurality of snapshot logs, and improves the efficiency of transmitting the snapshot logs. After the storage node acquires the data or metadata of the object recorded by each snapshot log, all the acquired data is stored at the same time, that is, a plurality of transactions for deleting the copies of the object are combined into one transaction, and the copies of the objects recorded by the plurality of snapshot logs can be deleted only by one transaction, so that the performance of the task of deleting the copies of the object is improved, and the service performance of the storage node is improved.
The embodiment of the present application provides a management node 43, where the management node 43 is configured to perform the steps performed by the management node 43 in the snapshot deleting method. The management node 43 provided in the embodiment of the present application may include modules corresponding to the respective steps.
In the embodiment of the present application, the management node 43 may perform the division of the functional modules according to the above method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The division of the modules in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 7 shows a possible structural diagram of the management node 700 involved in the above-described embodiment, in the case of dividing each functional module by corresponding functions. As shown in fig. 7, the management node 700 includes an acquisition unit 70, a grouping unit 71, and a transmission unit 72, a determination unit 73, and an encapsulation unit 74. The obtaining unit 70 is configured to support the management node 700 to perform S600 in the embodiment shown in fig. 6, and/or other processes for the techniques described herein; grouping unit 71 is used to support the management node 700 to perform S601 in the embodiment shown in fig. 6, and/or other processes for the techniques described herein; the sending unit 72 is configured to support the management node 700 to perform S602 in the embodiment shown in fig. 6 and/or other processes for the technology described herein; the determining unit 73 is configured to determine a snapshot log that records a metadata difference from the at least two snapshot logs acquired by the acquiring unit 70, or determine a snapshot log that records a data difference from the at least two snapshot logs acquired by the acquiring unit 70, and/or other processes used in the technology described herein; an encapsulating unit 74 for encapsulating all snapshot logs in each snapshot log group divided by the grouping unit 71 into at least one deletion message, and/or other processes for the techniques described herein. All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again. Of course, the management node 700 provided in the embodiment of the present application includes, but is not limited to, the above modules, for example, the management node 700 may further include a receiving unit and a storing unit. The receiving unit is used for communicating with other devices, such as a storage device. The memory unit may be used for storing the program code of the management node 700.
In the case of an integrated unit, the obtaining unit 70, the grouping unit 71, the determining unit 73, and the encapsulating unit 74 in the embodiment of the present application may be the processor 531 in fig. 5a, the sending unit 72 and the receiving unit may be the communication interface 51 in fig. 5a, and the storage unit may be the memory 532 in fig. 5 a.
When the management node 700 operates, the management node 700 performs the snapshot deletion method of the embodiment shown in fig. 6. For the snapshot deletion method, reference may be made to the related description of steps S600, S601, and S602 in the embodiment shown in fig. 6, and details are not repeated here.
In other implementations, the obtaining unit 70, the grouping unit 71, the determining unit 73 and the encapsulating unit 74 may be integrated together or implemented in any combination, and the specific implementation is not limited by the embodiments of the present application.
Another embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored, and when the instructions are executed on the management node 700, the management node 700 executes steps S600, S601, and S602 in the snapshot deleting method shown in fig. 6.
In another embodiment of the present application, there is also provided a computer program product comprising computer executable instructions stored in a computer readable storage medium; the computer-executable instructions may be read by at least one processor of the management node 700 from a computer-readable storage medium, and the execution of the computer-executable instructions by the at least one processor causes the management node 700 to perform steps S600, S601, and S602 of executing the management node in the snapshot deletion method illustrated in fig. 6.
The embodiment of the application provides a storage node, and the storage node is used for executing the steps executed by the storage node in the snapshot deleting method. The storage node provided by the embodiment of the application may include modules corresponding to the respective steps.
In the embodiment of the present application, the storage node may be divided into the functional modules according to the above method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The division of the modules in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 8 shows a schematic diagram of a possible structure of the storage node 800 in the above embodiment, in the case of dividing each functional module by corresponding functions. As shown in fig. 8, the storage node 800 includes a receiving unit 80, a transaction creating unit 81, a transaction executing unit 82, a locking unit 83, a storage unit 84, and a processing unit 85. The receiving unit 80 is configured to support the storage node 800 to perform S603 in the embodiment shown in fig. 6, and/or other processes for the techniques described herein; transaction creation unit 81 and transaction execution unit 82 are used to support the storage node 800 to perform S604 in the embodiment shown in fig. 6, and/or other processes for the techniques described herein; the locking unit 83 is configured to, after the transaction creating unit 81 creates a transaction for deleting the snapshot to be deleted, perform locking operation on the created transaction for deleting the snapshot to be deleted, and confirm a waiting locking linked list and the like; the storage unit 84 is configured to store each snapshot log of the at least one snapshot log received by the receiving unit 80 to the waiting locking linked list confirmed by the locking unit 83, and/or other processes for the technology described herein; the processing unit 85 is configured to support the storage node 800 to execute S606 in the embodiment shown in fig. 6, and merge and store the metadata or data of the object waiting for each snapshot log record of at least one snapshot log in the locking linked list. All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again. Of course, the storage node 800 provided in the embodiment of the present application includes, but is not limited to, the above modules, for example, the storage node 800 may further include a sending unit. A sending unit is used to communicate with other devices, such as management node 700, and to support the storage node 800 to perform S607 in the embodiment shown in fig. 6, and/or other processes for the techniques described herein.
In the case of an integrated unit, the transaction creating unit 81, the transaction executing unit 82, the locking unit 83, and the processing unit 85 in this embodiment may be the processor 631 in fig. 5b, the receiving unit 80 and the sending unit may be the communication interface 61 in fig. 5b, and the storage unit 84 may be the memory 632 in fig. 5 b.
When the storage node 800 is running, the storage node 800 performs the snapshot deletion method of the embodiment shown in fig. 6. For a specific snapshot deleting method, reference may be made to the related description of steps S603, S604, S605, S606, and S607 in the embodiment shown in fig. 6, and details are not repeated here.
Accordingly, another embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored, and when the instructions are executed on the storage node 800, the storage node 800 executes steps S603, S604, S605, S606, and S607 of the snapshot deleting method shown in fig. 6.
In another embodiment of the present application, there is also provided a computer program product comprising computer executable instructions stored in a computer readable storage medium; the computer-executable instructions may be read by at least one processor of the storage node 800 from a computer-readable storage medium, and the execution of the computer-executable instructions by the at least one processor causes the storage node 800 to perform steps S603, S604, S605, S606, S607 of executing the storage node in the snapshot deletion method illustrated in fig. 6.
According to the snapshot deleting method and the node, the at least two acquired snapshot logs are divided into at least one snapshot log group through the management node. All the snapshot logs in each snapshot log group have the same attribute, the different snapshot log groups comprise different snapshot logs, the snapshot logs are used for recording the difference between the copy before the object is modified and the modified object, and the copy before the object is modified is the object output after the snapshot of the object is created. Therefore, the management node sends all the snapshot logs of the same snapshot log group to the same storage node, so that the storage node is prevented from being frequently accessed when a plurality of snapshot logs are sent to the same storage node, the burden of frequently sending the snapshot logs by the management node is reduced, the burden of frequently receiving the snapshot logs by the storage node is reduced, the service performance of the storage node is improved, and the efficiency of sending the snapshot logs is improved.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware or any combination thereof. When implemented using a software program, may take the form of a computer program product, either entirely or partially. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, e.g., the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. 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, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (20)

1. A snapshot deletion method, comprising:
the management node acquires at least two snapshot logs;
the management node divides the at least two acquired snapshot logs into at least one snapshot log group, wherein all the snapshot logs in the same snapshot log group have the same attribute, the snapshot logs in different snapshot log groups are different, the snapshot logs are used for recording the difference between a copy before object modification and an object after modification, and the copy before object modification is an object output after creating a snapshot of the object;
and the management node sends all the snapshot logs in the same snapshot log group to the same storage node.
2. The snapshot deletion method of claim 1, wherein the object comprises metadata, the difference of the snapshot log records comprises a metadata difference, the storage node comprises a metadata server, all snapshot logs in the same snapshot log group have the same attribute, the object comprising all snapshot log records in the same snapshot log group has the same parent node, and the management node divides the at least two obtained snapshot logs into at least one snapshot log group, comprising:
the management node determines a snapshot log recording metadata differences;
and the management node divides the determined snapshot log for recording the metadata difference into at least one snapshot log group, and objects recorded by each snapshot log in the same snapshot log group have the same father node.
3. The snapshot deletion method according to claim 1, wherein the object includes data, the difference of the snapshot log records includes a data difference, the storage node includes a data server, all snapshot logs in the same snapshot log group have the same attribute, the object including all snapshot log records in the same snapshot log group belongs to the same logical sector, and the dividing, by the management node, of the at least two obtained snapshot logs into at least one snapshot log group includes:
the management node determines a snapshot log recording data differences;
and the management node divides the determined snapshot log for recording the data difference into at least one snapshot log group, and the object recorded by each snapshot log in the same snapshot log group is stored in the same logical sector.
4. The snapshot deletion method of any one of claims 1 to 3, wherein the sending, by the management node, all snapshot logs in the same snapshot log group to the same storage node comprises:
the management node packages all the snapshot logs in each snapshot log group into at least one deletion message, wherein each deletion message in the at least one deletion message comprises at least two snapshot logs in each log group;
and the management node sends the at least one deletion message to the same storage node so as to send all the snapshot logs in the same snapshot log group to the same storage node.
5. A snapshot deletion method, comprising:
the storage node receives at least one snapshot log, wherein the at least one snapshot log has the same attribute, the snapshot log is used for recording the difference between a copy of an object before modification and the modified object, and the copy of the object before modification is an object output after the snapshot of the object is created;
the storage node creates a transaction for deleting the snapshot to be deleted;
and the storage node operates the transaction for deleting the snapshot to be deleted and deletes the copy of the object recorded by each snapshot log in the at least one snapshot log.
6. The snapshot deletion method of claim 5, wherein after the storage node creates a transaction for deleting the snapshot to be deleted, further comprising:
the storage node performs locking operation on the created transaction for deleting the snapshot to be deleted, and confirms a waiting locking linked list;
the storage node stores each snapshot log in the at least one snapshot log to the waiting locking linked list;
the step of running the transaction for deleting the snapshot to be deleted by the storage node and deleting the copy of the object recorded by each snapshot log in the at least one snapshot log includes:
the storage node inquires the to-be-locked linked list and deletes the copy of the object recorded by each snapshot log in the at least one snapshot log in the to-be-locked linked list;
after deleting the copy of the object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list, the storage node performs an unlocking operation on the created transaction for deleting the snapshot to be deleted, and deletes each snapshot log of the at least one snapshot log in the waiting locking linked list.
7. The snapshot deletion method of claim 5 or 6, wherein after the storage node creates a transaction for deleting the snapshot to be deleted, further comprising:
and the storage node merges and stores the metadata or the data of the object recorded by the at least one snapshot log.
8. The snapshot deletion method of claim 5, wherein after the storage node creates a transaction for deleting the snapshot to be deleted, further comprising:
the storage node performs locking operation on the created transaction for deleting the snapshot to be deleted, and confirms a waiting locking linked list;
the storage node stores each snapshot log in the at least one snapshot log to the waiting locking linked list;
the storage node runs the transaction for deleting the snapshot to be deleted, queries the waiting locking linked list, and deletes the copy of the object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list;
and the storage node merges and stores the metadata or the data of the object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list.
9. A management node, comprising:
the acquisition unit is used for acquiring at least two snapshot logs;
the grouping unit is configured to divide the at least two snapshot logs acquired by the acquiring unit into at least one snapshot log group, where all the snapshot logs in the same snapshot log group have the same attribute, and the snapshot logs included in different snapshot log groups are different, the snapshot log is used to record a difference between a copy before object modification and an object after modification, and the copy before object modification is an object output after creating a snapshot of the object;
and the sending unit is used for sending all the snapshot logs in the same snapshot log group divided by the grouping unit to the same storage node.
10. The management node of claim 9, wherein the object includes metadata, the differences in snapshot log records include metadata differences, the storage node includes a metadata server, all snapshot logs in the same snapshot log group have the same attributes, the object including all snapshot log records in the same snapshot log group has the same parent node;
the management node further comprises a determination unit,
the determining unit is configured to determine a snapshot log that records a metadata difference from the at least two snapshot logs acquired by the acquiring unit;
the grouping unit is further configured to divide the snapshot log with the difference in the recording metadata determined by the determining unit into at least one snapshot log group, where objects recorded by each snapshot log in the same snapshot log group have the same parent node.
11. The management node of claim 9, wherein the objects comprise data, the differences in snapshot log records comprise data differences, the storage node comprises a data server, all snapshot logs in the same snapshot log group have the same attributes, the objects comprising all snapshot log records in the same snapshot log group belong to the same logical sector,
the management node further comprises a determination unit,
the determining unit is configured to determine a snapshot log that records a data difference from the at least two snapshot logs acquired by the acquiring unit;
the grouping unit is further configured to divide the snapshot log of the recorded data difference determined by the determining unit into the at least one snapshot log group, and an object recorded by each snapshot log in the same snapshot log group is stored in the same logical sector.
12. The management node according to any of claims 9-11, wherein said management node further comprises an encapsulation unit,
the packaging unit is configured to package all snapshot logs in each snapshot log group divided by the grouping unit into at least one deletion message, where each deletion message in the at least one deletion message includes at least two snapshot logs in each log group;
the sending unit is further configured to send the at least one deletion message encapsulated by the encapsulating unit to the same storage node, so as to send all snapshot logs in the same snapshot log group to the same storage node.
13. A storage node, comprising:
a receiving unit, configured to receive at least one snapshot log, where the at least one snapshot log has the same attribute, and the snapshot log is used to record a difference between a copy before object modification and a modified object, and the copy before object modification is an object output after creating a snapshot of the object;
the system comprises a transaction creating unit, a snapshot deleting unit and a snapshot creating unit, wherein the transaction creating unit is used for creating a transaction for deleting a snapshot to be deleted;
and the transaction operation unit is used for operating the transaction which is created by the transaction creation unit and used for deleting the snapshot to be deleted, and deleting the copy of the object recorded by each snapshot log in the at least one snapshot log received by the receiving unit.
14. The storage node of claim 13, wherein the storage node further comprises a locking unit,
the locking unit is used for performing locking operation on the created transaction for deleting the snapshot to be deleted after the transaction creating unit creates the transaction for deleting the snapshot to be deleted, and confirming a waiting locking linked list;
the storage node further comprises a storage unit,
the storage unit is configured to store each snapshot log in the at least one snapshot log received by the receiving unit to the waiting locking linked list confirmed by the locking unit;
the transaction running unit is further configured to query the waiting locking linked list, delete a duplicate of an object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list, and perform an unlocking operation on the created transaction for deleting the snapshot to be deleted after deleting the duplicate of the object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list, so as to delete each snapshot log of the at least one snapshot log in the waiting locking linked list.
15. The storage node according to claim 13 or 14, wherein the storage node further comprises a processing unit,
and the processing unit is configured to merge and store the metadata or the data of the object recorded by the at least one snapshot log received by the receiving unit after the transaction creating unit creates the transaction for deleting the snapshot to be deleted.
16. The storage node of claim 13, wherein the storage node further comprises a locking unit, a storage unit, and a processing unit,
the locking unit is used for performing locking operation on the created transaction for deleting the snapshot to be deleted and confirming a waiting locking linked list;
the storage unit is configured to store each snapshot log in the at least one snapshot log received by the receiving unit to the waiting locking linked list confirmed by the locking unit;
the transaction operation unit is further configured to operate the transaction for deleting the snapshot to be deleted, query the waiting locking linked list, and delete the copy of the object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list;
and the processing unit is used for merging and storing the metadata or the data of the object recorded by each snapshot log of the at least one snapshot log in the waiting locking linked list.
17. A management node, characterized in that the management node comprises: one or more processors, memory, communication interfaces;
the memory, the communication interface, and the one or more processors; the memory for storing computer program code comprising instructions which, when executed by the one or more processors, cause the management node to perform the snapshot deletion method of any one of claims 1-4.
18. A storage node, comprising: one or more processors, memory, communication interfaces;
the memory, the communication interface, and the one or more processors; the memory is configured to store computer program code comprising instructions which, when executed by the one or more processors, cause the storage node to perform the snapshot deletion method of any one of claims 5-8.
19. A computer-readable storage medium having instructions stored therein, which when run on a management node, cause the management node to perform the snapshot deletion method of any one of claims 1-4.
20. A computer-readable storage medium having instructions stored therein, which when run on a storage node, cause the storage node to perform the snapshot deletion method of any one of claims 5-8.
CN201710712754.3A 2017-08-18 2017-08-18 Snapshot deleting method and node Active CN107491529B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710712754.3A CN107491529B (en) 2017-08-18 2017-08-18 Snapshot deleting method and node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710712754.3A CN107491529B (en) 2017-08-18 2017-08-18 Snapshot deleting method and node

Publications (2)

Publication Number Publication Date
CN107491529A CN107491529A (en) 2017-12-19
CN107491529B true CN107491529B (en) 2020-05-08

Family

ID=60646669

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710712754.3A Active CN107491529B (en) 2017-08-18 2017-08-18 Snapshot deleting method and node

Country Status (1)

Country Link
CN (1) CN107491529B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920095B (en) * 2018-06-06 2021-06-29 深圳市脉山龙信息技术股份有限公司 Data storage optimization method and device based on CRUSH
CN109062672A (en) * 2018-08-21 2018-12-21 郑州云海信息技术有限公司 A kind of method, apparatus and storage medium handling disk tree node
CN111240890B (en) * 2018-11-29 2023-05-26 阿里巴巴集团控股有限公司 Data processing method, snapshot processing device and computing equipment
US11080257B2 (en) * 2019-05-13 2021-08-03 Snowflake Inc. Journaled tables in database systems
CN110531936B (en) * 2019-08-29 2021-05-28 西安交通大学 Distributed erasure code mixed storage forest type storage structure and method based on multiple storage media
CN111125024B (en) * 2019-11-29 2022-05-24 浪潮电子信息产业股份有限公司 Method, device, equipment and storage medium for deleting distributed system files
CN115599811A (en) * 2021-07-09 2023-01-13 华为技术有限公司(Cn) Data processing method and device and computing system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102594849A (en) * 2011-01-06 2012-07-18 阿里巴巴集团控股有限公司 Data backup and recovery method and device, virtual machine snapshot deleting and rollback method and device
CN102737098A (en) * 2011-03-29 2012-10-17 日本电气株式会社 Distributed file system
CN103685350A (en) * 2012-09-04 2014-03-26 阿里巴巴集团控股有限公司 Synchronous method and equipment for memory system
CN104375877A (en) * 2014-10-15 2015-02-25 国云科技股份有限公司 Virtual machine online snapshot generating and deleting method
CN105190533A (en) * 2013-03-15 2015-12-23 亚马逊科技公司 In place snapshots
CN105190623A (en) * 2013-03-15 2015-12-23 亚马逊科技公司 Log record management
CN105468473A (en) * 2014-07-16 2016-04-06 北京奇虎科技有限公司 Data migration method and data migration apparatus
CN106951375A (en) * 2016-01-06 2017-07-14 北京忆恒创源科技有限公司 The method and device of snapped volume is deleted within the storage system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9881040B2 (en) * 2015-08-20 2018-01-30 Vmware, Inc. Tracking data of virtual disk snapshots using tree data structures

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102594849A (en) * 2011-01-06 2012-07-18 阿里巴巴集团控股有限公司 Data backup and recovery method and device, virtual machine snapshot deleting and rollback method and device
CN102737098A (en) * 2011-03-29 2012-10-17 日本电气株式会社 Distributed file system
CN103685350A (en) * 2012-09-04 2014-03-26 阿里巴巴集团控股有限公司 Synchronous method and equipment for memory system
CN105190533A (en) * 2013-03-15 2015-12-23 亚马逊科技公司 In place snapshots
CN105190623A (en) * 2013-03-15 2015-12-23 亚马逊科技公司 Log record management
CN105468473A (en) * 2014-07-16 2016-04-06 北京奇虎科技有限公司 Data migration method and data migration apparatus
CN104375877A (en) * 2014-10-15 2015-02-25 国云科技股份有限公司 Virtual machine online snapshot generating and deleting method
CN106951375A (en) * 2016-01-06 2017-07-14 北京忆恒创源科技有限公司 The method and device of snapped volume is deleted within the storage system

Also Published As

Publication number Publication date
CN107491529A (en) 2017-12-19

Similar Documents

Publication Publication Date Title
CN107491529B (en) Snapshot deleting method and node
US20180011874A1 (en) Peer-to-peer redundant file server system and methods
US6782389B1 (en) Distributing files across multiple, permissibly heterogeneous, storage devices
US8200788B2 (en) Slice server method and apparatus of dispersed digital storage vaults
US8321487B1 (en) Recovery of directory information
CN106484820B (en) Renaming method, access method and device
WO2016180055A1 (en) Method, device and system for storing and reading data
US9177034B2 (en) Searchable data in an object storage system
US11082494B2 (en) Cross storage protocol access response for object data stores
US20150381727A1 (en) Storage functionality rule implementation
CN105022779A (en) Method for realizing HDFS file access by utilizing Filesystem API
TWI571754B (en) Method for performing file synchronization control, and associated apparatus
CN115840662A (en) Data backup system and device
WO2023241116A1 (en) Data processing method and related apparatus
CN116910051B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN113254415B (en) Method and device for processing read request of distributed file system
US20240061820A1 (en) Identifying renames and deletions in a storage system
WO2024001280A1 (en) Data flow perception method and related apparatus
CN117290298A (en) Data processing method and related device
CN116719482A (en) Data migration method and device, storage medium and electronic equipment
CN116339928A (en) Transaction processing system and device
Artiaga Amouroux File system metadata virtualization

Legal Events

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