CN109582496B - Method and device for creating consistent snapshot group and computer readable storage medium - Google Patents
Method and device for creating consistent snapshot group and computer readable storage medium Download PDFInfo
- Publication number
- CN109582496B CN109582496B CN201811252833.1A CN201811252833A CN109582496B CN 109582496 B CN109582496 B CN 109582496B CN 201811252833 A CN201811252833 A CN 201811252833A CN 109582496 B CN109582496 B CN 109582496B
- Authority
- CN
- China
- Prior art keywords
- snapshot
- storage volume
- storage
- group
- volumes
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/16—Error detection or correction of the data by redundancy in hardware
- G06F11/20—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
- G06F11/2053—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
- G06F11/2056—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant by mirroring
- G06F11/2064—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant by mirroring while ensuring consistency
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/82—Solving problems relating to consistency
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to data processing and discloses a method for creating a consistent snapshot group, which comprises the following steps: when a consistent snapshot creation instruction sent by a first client is received, determining a storage volume group corresponding to the consistent snapshot creation instruction, wherein the storage volume group comprises a plurality of storage volumes; simultaneously executing locking operation on a plurality of storage volumes, and after the locking operation is completed, sequentially establishing snapshot volumes for the plurality of storage volumes; when snapshot operation of one storage volume is completed and the snapshot volume is successfully created, unlocking operation is executed for the storage volume; if all storage volumes in the storage volume group are detected to be successfully created, a plurality of created snapshot volumes are formed into a consistent snapshot group. The invention also provides a device for creating the consistent snapshot group and a computer readable storage medium. The invention solves the technical problem that the read-write operation request of the system is blocked when the consistency snapshot group is created.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and apparatus for creating a consistent snapshot group, and a computer readable storage medium.
Background
The accelerated development of information technology makes the scale of key business data of enterprises expand increasingly, and enterprises not only require larger and larger storage capacity, but also require higher and higher data security. As the demand for storage applications increases, users need to backup and protect data online. The snapshot technology is a method for effectively protecting online data, and can quickly realize online data backup. A snapshot is a fully available copy of the original volume that includes an image of the original volume at some point in time. The designated data set is referred to as an original volume and the image at a point in time is referred to as a snapshot volume.
In some cases, data in multiple storage volumes may be backed up as a storage volume group, where consistency of the backups of the storage volumes may be considered, for example, in order to meet the data protection requirements of the consistency group, a group snapshot operation may be performed. In the existing snapshot group creating scheme, in order to ensure that data of a plurality of storage volumes in the storage volume group are in the same state, each storage volume does not execute new data writing or data changing operation, and the like, execution is resumed after the consistent snapshot group is created, which easily causes the read-write operation request of the whole system to be blocked.
Disclosure of Invention
The invention provides a method and a device for creating a consistency snapshot group and a computer readable storage medium, and mainly aims to solve the technical problem that a system read-write operation request is blocked when the consistency snapshot group is created.
In order to achieve the above object, the present invention further provides a method for creating a consistent snapshot group, where the method includes:
When a consistent snapshot creation instruction sent by a first client is received, determining a storage volume group corresponding to the consistent snapshot creation instruction, wherein the storage volume group comprises a plurality of storage volumes;
simultaneously executing locking operation on the plurality of storage volumes, and after the locking operation is completed, sequentially establishing snapshot volumes for the plurality of storage volumes;
When snapshot operation of one storage volume is completed and the snapshot volume is successfully created, unlocking operation is executed for the storage volume;
And if all the storage volumes in the storage volume group are detected to be successfully created, forming a consistent snapshot group by the created plurality of snapshot volumes.
Optionally, after the step of performing a locking operation on the plurality of storage volumes and sequentially creating snapshot volumes for the plurality of storage volumes after the locking operation is completed, the method further includes the steps of:
When the snapshot operation failure of the storage volume is detected, terminating the snapshot operation, and deleting the created snapshot volume;
And determining the volume name of the storage volume with snapshot operation failure, and sending the volume name to the first client.
Optionally, after the step of performing a locking operation on the plurality of storage volumes and sequentially creating snapshot volumes for the plurality of storage volumes after the locking operation is completed, the method further includes the steps of:
When a read operation request sent by a second client is received, determining a storage volume corresponding to the read operation request;
and reading corresponding data from the storage volume according to the read operation request, and sending the data to the second client.
Optionally, after the step of performing a locking operation on the plurality of storage volumes and sequentially creating snapshot volumes for the plurality of storage volumes after the locking operation is completed, the method further includes the steps of:
When a write operation request sent by a second client is received, determining a storage volume corresponding to the write operation request;
judging whether the storage volume is currently in a locking state or not;
If the storage volume is in the locking state currently, writing the data corresponding to the writing operation request into a writing task queue of a cache area;
And if the storage volume is in the unlocking state currently, writing the data corresponding to the writing operation request into the storage volume.
Optionally, the method further comprises the steps of:
After the consistency snapshot group is established, checking whether an unfinished write operation request exists in a write task queue in the cache area;
If yes, acquiring a write operation request in the write task queue, and writing corresponding data into the storage volume according to the write operation request.
In addition, to achieve the above object, the present invention also provides a device for creating a consistent snapshot group, the device including a memory and a processor, the memory storing a snapshot group creation program executable on the processor, the snapshot group creation program implementing the following steps when executed by the processor:
When a consistent snapshot creation instruction sent by a first client is received, determining a storage volume group corresponding to the consistent snapshot creation instruction, wherein the storage volume group comprises a plurality of storage volumes;
simultaneously executing locking operation on the plurality of storage volumes, and after the locking operation is completed, sequentially establishing snapshot volumes for the plurality of storage volumes;
When snapshot operation of one storage volume is completed and the snapshot volume is successfully created, unlocking operation is executed for the storage volume;
And if all the storage volumes in the storage volume group are detected to be successfully created, forming a consistent snapshot group by the created plurality of snapshot volumes.
Optionally, the snapshot group creation program may be further executed by the processor, so as to implement the following steps after performing a locking operation on the plurality of storage volumes and after the step of sequentially creating snapshot volumes for the plurality of storage volumes after the locking operation is completed:
When a read operation request sent by a second client is received, determining a storage volume corresponding to the read operation request;
and reading corresponding data from the storage volume according to the read operation request, and sending the data to the second client.
Optionally, the snapshot group creation program may be further executed by the processor, so as to implement the following steps after performing a locking operation on the plurality of storage volumes and after the step of sequentially creating snapshot volumes for the plurality of storage volumes after the locking operation is completed:
When a write operation request sent by a second client is received, determining a storage volume corresponding to the write operation request;
judging whether the storage volume is currently in a locking state or not;
If the storage volume is in the locking state currently, writing the data corresponding to the writing operation request into a writing task queue of a cache area;
And if the storage volume is in the unlocking state currently, writing the data corresponding to the writing operation request into the storage volume.
Optionally, the snapshot group creation program may be further executed by the processor to implement the following steps:
After the consistency snapshot group is established, checking whether an unfinished write operation request exists in a write task queue in the cache area;
If yes, acquiring a write operation request in the write task queue, and writing corresponding data into the storage volume according to the write operation request.
In addition, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a snapshot group creation program executable by one or more processors to implement the steps of the consistent snapshot group creation method as described above.
When a consistent snapshot creation instruction sent by a first client is received, determining a storage volume group corresponding to the consistent snapshot creation instruction, wherein the storage volume group comprises a plurality of storage volumes; simultaneously executing locking operation on a plurality of storage volumes, and after the locking operation is completed, sequentially establishing snapshot volumes for the plurality of storage volumes; when snapshot operation of one storage volume is completed and the snapshot volume is successfully created, unlocking operation is executed for the storage volume; if all storage volumes in the storage volume group are detected to successfully create the snapshot volumes, the created plurality of snapshot volumes form a consistent snapshot group. According to the scheme, when consistent snapshots are played for the storage volume group, a single storage volume which has completed snapshot playing operation is unlocked immediately without waiting for other storage volumes to complete snapshot playing operation and then unlocked, so that the storage volume which has completed snapshot playing can respond to read-write operation requests immediately, and the read-write operation requests are prevented from being blocked while the consistency of the snapshot volume group is ensured.
Drawings
FIG. 1 is a flowchart illustrating a method for creating a consistent snapshot group according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating an internal structure of a device for creating consistent snapshot groups according to an embodiment of the present invention;
Fig. 3 is a schematic block diagram of a snapshot group creation program in a consistent snapshot group creation device according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides a method for creating a consistent snapshot group. Referring to fig. 1, a flowchart of a method for creating a consistent snapshot group according to an embodiment of the present invention is shown. The method may be performed by an apparatus, which may be implemented in software and/or hardware.
In this embodiment, the method for creating the consistent snapshot group includes:
Step S10, when a consistent snapshot creation instruction sent by a first client is received, a storage volume group corresponding to the consistent snapshot creation instruction is determined, wherein the storage volume group comprises a plurality of storage volumes.
In one system, a complete storage space may be divided into multiple storage volumes, where different storage volumes may be used to store different traffic data, and more than two storage volumes may form a storage volume group. And as the system operates, new service data is written into each storage volume or existing service data is changed. If a user is interested in a system at a certain time point and wants to analyze service data in a plurality of storage volumes in a storage volume group, the system at the certain time point can be backed up on site to create a consistent snapshot group. I.e., snapshot a plurality of storage volumes in a storage volume group at the same point in time.
A snapshot refers to a mirror image of a particular file system that has read-only properties for a particular time. Taking a snapshot at a point in time, the data from accessing the snapshot is the data of the system at that point in time. Based on such a principle, the information already stored in the parent image is not stored in the snapshot volume that is initially created, and after the snapshot time point, no physical data duplication occurs, only metadata of the physical location of the original data is duplicated. Thus, snapshot creation is very fast and can be accomplished instantaneously. Then, the original volume data changes are tracked, once the original volume data blocks are updated for the first time, the original volume data blocks are read out and written into the snapshot volume, and then the original volume is covered with new data blocks.
And step S20, locking operation is simultaneously executed on the plurality of storage volumes, and snapshot volumes are built for the plurality of storage volumes in sequence after the locking operation is completed.
In step S30, when the snapshot making operation of one storage volume is completed and the snapshot volume is successfully created, an unlocking operation is performed for the storage volume.
In step S40, if it is detected that all storage volumes in the storage volume group successfully create snapshot volumes, the created plurality of snapshot volumes form a consistent snapshot group.
The method comprises the steps that a user selects a plurality of storage volumes to be backed up to form a storage volume group through a client, a consistent snapshot creation instruction is sent to a server, when the server receives the creation instruction of the consistent snapshot group, the storage volume group corresponding to the consistent snapshot group creation instruction is determined, and in addition, the storage volumes contained in the storage volume group are determined. And then locking the plurality of storage volumes, starting the creation of the snapshot volumes after the locking operation is finished, and sequentially creating the snapshot volumes for the plurality of storage volumes in the storage volume group, wherein the time point of the created snapshot volumes is the time point after the locking operation is finished. In order to maintain consistency of the snapshot volume groups, after locking operation is performed on the storage volumes, the storage volumes can not perform read-write operation, and other users can not write new data into the storage volumes. And then creating snapshot volumes for all storage volumes in the storage volume group in turn, unlocking the storage volume after the snapshot is detected to be played by one storage volume, and recovering the operation state before locking the unlocked storage volume, wherein the storage volume can normally receive the access of a user and respond to the read-write operation request.
Further, in order to ensure consistency of time points of the created plurality of snapshot volumes, after the step of performing locking operation on the plurality of storage volumes and sequentially creating snapshot volumes for the plurality of storage volumes after the locking operation is completed, the method further includes the steps of:
When the snapshot operation failure of the storage volume is detected, terminating the snapshot operation, and deleting the created snapshot volume;
And determining the volume name of the storage volume with snapshot operation failure, and sending the volume name to the first client.
In the process of snapshot of the storage volumes, if snapshot of the storage volumes fails, the current snapshot operation is terminated, at this time, the storage volumes which have been successfully snapshot in the storage volume group are unlocked, the running state before locking is restored, the access of the user is normally accepted, and the read-write operation request is responded, so that the data on the storage volumes may have changed relative to the snapshot time point. Since the snapshot operation of a portion of the storage volumes fails, the consistency of the snapshot volumes cannot be maintained, and thus the snapshot volumes that have been created need to be deleted. And determining the volume name of the storage volume with the snapshot failure, and feeding back the volume name to the first client for the user to find the reason of the snapshot failure. It should be noted that, the first client here is a client that sends a consistent snapshot creation instruction, and the second client hereinafter is a client that sends a write operation request to the server in the process of creating a consistent snapshot group.
Further, since all storage volumes in the storage volume group have been locked before snapshot is taken, if a write operation request is received before the storage volume is unlocked, it is necessary to detect the state of the storage volume corresponding to the write operation request and process the write operation request according to the state of the storage volume. Specifically, after the step of performing the locking operation on the plurality of storage volumes and sequentially creating snapshot volumes for the plurality of storage volumes after the locking operation is completed, the method further includes the steps of:
When a write operation request sent by a second client is received, determining a storage volume corresponding to the write operation request;
judging whether the storage volume is currently in a locking state or not;
If the storage volume is in the locking state currently, writing the data corresponding to the writing operation request into a writing task queue of a cache area;
And if the storage volume is in the unlocking state currently, writing the data corresponding to the writing operation request into the storage volume.
Further, the method comprises the following steps:
After the consistency snapshot group is established, checking whether an unfinished write operation request exists in a write task queue in the cache area;
If yes, acquiring a write operation request in the write task queue, and writing corresponding data into the storage volume according to the write operation request.
In the scheme, in the process of creating the consistent snapshot group, if a write operation request aiming at a storage volume in a locking state is received, the requests are requested, and after the establishment of the consistent snapshot group is completed, corresponding data is written into the storage volume in time according to the write operation request in a cache.
In contrast, for a read request, since the read operation does not change the data stored in the storage volume, the read request may be normally responded to even when the storage volume is in the locked state. Thus, after the step of performing a locking operation on the plurality of storage volumes and sequentially creating snapshot volumes for the plurality of storage volumes after the locking operation is completed, the method further comprises the steps of:
When a read operation request sent by a second client is received, determining a storage volume corresponding to the read operation request;
and reading corresponding data from the storage volume according to the read operation request, and sending the data to the second client.
According to the method for creating the consistent snapshot group, when a consistent snapshot creation instruction sent by a first client is received, a storage volume group corresponding to the consistent snapshot creation instruction is determined, wherein the storage volume group comprises a plurality of storage volumes; simultaneously executing locking operation on a plurality of storage volumes, and after the locking operation is completed, sequentially establishing snapshot volumes for the plurality of storage volumes; when snapshot operation of one storage volume is completed and the snapshot volume is successfully created, unlocking operation is executed for the storage volume; if all storage volumes in the storage volume group are detected to successfully create the snapshot volumes, the created plurality of snapshot volumes form a consistent snapshot group. According to the scheme, when consistent snapshots are played for the storage volume group, a single storage volume which has completed snapshot playing operation is unlocked immediately without waiting for other storage volumes to complete snapshot playing operation and then unlocked, so that the storage volume which has completed snapshot playing can respond to read-write operation requests immediately, and the read-write operation requests are prevented from being blocked while the consistency of the snapshot volume group is ensured.
The invention also provides a device for creating the consistent snapshot group. Referring to fig. 2, an internal structure diagram of a device for creating consistent snapshot groups according to an embodiment of the invention is shown. In this embodiment, the creation device 1 of the consistency snapshot group may be a PC (Personal Computer ), or may be a terminal device such as a smart phone, a tablet computer, a portable computer, or the like. The creation means 1 of the consistency snapshot group comprises at least a memory 11, a processor 12, a network interface 13 and a communication bus.
The memory 11 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the creation means 1 of the consistency snapshot group, e.g. a hard disk of the creation means 1 of the consistency snapshot group. The memory 11 may also be an external storage device of the creation apparatus 1 of the consistency snapshot group in other embodiments, for example, a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like provided on the creation apparatus 1 of the consistency snapshot group. Further, the memory 11 may also include both the internal storage unit and the external storage device of the creation apparatus 1 of the consistency snapshot group. The memory 11 may be used not only for storing application software installed in the creation apparatus 1 of the consistent snapshot group and various types of data, for example, code of the snapshot group creation program 01 or the like, but also for temporarily storing data that has been output or is to be output.
Processor 12 may in some embodiments be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip for executing program code or processing data stored in memory 11, such as executing snapshot group creation program 01, etc.
The network interface 13 may optionally comprise a standard wired interface, a wireless interface (e.g. WI-FI interface), typically used to establish a communication connection between the apparatus 1 and other electronic devices.
The communication bus is used to enable connected communication between these components.
Optionally, the device 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or a display unit, as appropriate, for displaying information processed in the creation means 1 of the consistency snapshot group and for displaying a visual user interface.
Fig. 2 shows only the creation means 1 of a consistent snapshot group with components 11-13 and snapshot group creation program 01, it being understood by a person skilled in the art that the structure shown in fig. 1 does not constitute a limitation of the creation means 1 of a consistent snapshot group, and may comprise fewer or more components than shown, or may combine certain components, or a different arrangement of components.
In the embodiment of the apparatus 1 shown in fig. 2, a snapshot group creation program 01 is stored in the memory 11; the processor 12 implements the following steps when executing the snapshot group creation program 01 stored in the memory 11:
when a consistent snapshot creation instruction sent by a first client is received, a storage volume group corresponding to the consistent snapshot creation instruction is determined, wherein the storage volume group comprises a plurality of storage volumes.
In one system, a complete storage space may be divided into multiple storage volumes, where different storage volumes may be used to store different traffic data, and more than two storage volumes may form a storage volume group. And as the system operates, new service data is written into each storage volume or existing service data is changed. If a user is interested in a system at a certain time point and wants to analyze service data in a plurality of storage volumes in a storage volume group, the system at the certain time point can be backed up on site to create a consistent snapshot group. I.e., snapshot a plurality of storage volumes in a storage volume group at the same point in time.
A snapshot refers to a mirror image of a particular file system that has read-only properties for a particular time. Taking a snapshot at a point in time, the data from accessing the snapshot is the data of the system at that point in time. Based on such a principle, the information already stored in the parent image is not stored in the snapshot volume that is initially created, and after the snapshot time point, no physical data duplication occurs, only metadata of the physical location of the original data is duplicated. Thus, snapshot creation is very fast and can be accomplished instantaneously. Then, the original volume data changes are tracked, once the original volume data blocks are updated for the first time, the original volume data blocks are read out and written into the snapshot volume, and then the original volume is covered with new data blocks.
And simultaneously executing locking operation on the plurality of storage volumes, and after the locking operation is completed, sequentially establishing snapshot volumes for the plurality of storage volumes.
When a snapshot operation of one storage volume is completed and the snapshot volume is successfully created, an unlocking operation is performed for the storage volume.
And if all the storage volumes in the storage volume group are detected to be successfully created, forming a consistent snapshot group by the created plurality of snapshot volumes.
The method comprises the steps that a user selects a plurality of storage volumes to be backed up to form a storage volume group through a client, a consistent snapshot creation instruction is sent to a server, when the server receives the creation instruction of the consistent snapshot group, the storage volume group corresponding to the consistent snapshot group creation instruction is determined, and in addition, the storage volumes contained in the storage volume group are determined. And then locking the plurality of storage volumes, starting the creation of the snapshot volumes after the locking operation is finished, and sequentially creating the snapshot volumes for the plurality of storage volumes in the storage volume group, wherein the time point of the created snapshot volumes is the time point after the locking operation is finished. In order to maintain consistency of the snapshot volume groups, after locking operation is performed on the storage volumes, the storage volumes can not perform read-write operation, and other users can not write new data into the storage volumes. And then creating snapshot volumes for all storage volumes in the storage volume group in turn, unlocking the storage volume after the snapshot is detected to be played by one storage volume, and recovering the operation state before locking the unlocked storage volume, wherein the storage volume can normally receive the access of a user and respond to the read-write operation request.
Further, in order to ensure consistency of time points of the created plurality of snapshot volumes, the snapshot group creation program 01 may be further executed by the processor 12, so as to implement the following steps after the steps of performing locking operation on the plurality of storage volumes and sequentially creating snapshot volumes for the plurality of storage volumes after the locking operation is completed:
When the snapshot operation failure of the storage volume is detected, terminating the snapshot operation, and deleting the created snapshot volume;
And determining the volume name of the storage volume with snapshot operation failure, and sending the volume name to the first client.
In the process of snapshot of the storage volumes, if snapshot of the storage volumes fails, the current snapshot operation is terminated, at this time, the storage volumes which have been successfully snapshot in the storage volume group are unlocked, the running state before locking is restored, the access of the user is normally accepted, and the read-write operation request is responded, so that the data on the storage volumes may have changed relative to the snapshot time point. Since the snapshot operation of a portion of the storage volumes fails, the consistency of the snapshot volumes cannot be maintained, and thus the snapshot volumes that have been created need to be deleted. And determining the volume name of the storage volume with the snapshot failure, and feeding back the volume name to the first client for the user to find the reason of the snapshot failure. It should be noted that, the first client here is a client that sends a consistent snapshot creation instruction, and the second client hereinafter is a client that sends a write operation request to the server in the process of creating a consistent snapshot group.
Further, since all storage volumes in the storage volume group have been locked before snapshot is taken, if a write operation request is received before the storage volume is unlocked, it is necessary to detect the state of the storage volume corresponding to the write operation request and process the write operation request according to the state of the storage volume. Specifically, the snapshot group creation program 01 may be further executed by the processor 12 to implement the following steps after the steps of performing a locking operation on the plurality of storage volumes and sequentially creating snapshot volumes for the plurality of storage volumes after the locking operation is completed:
When a write operation request sent by a second client is received, determining a storage volume corresponding to the write operation request;
judging whether the storage volume is currently in a locking state or not;
If the storage volume is in the locking state currently, writing the data corresponding to the writing operation request into a writing task queue of a cache area;
And if the storage volume is in the unlocking state currently, writing the data corresponding to the writing operation request into the storage volume.
Further, the snapshot group creation program 01 may also be executed by the processor 12 to implement the following steps:
After the consistency snapshot group is established, checking whether an unfinished write operation request exists in a write task queue in the cache area;
If yes, acquiring a write operation request in the write task queue, and writing corresponding data into the storage volume according to the write operation request.
In the scheme, in the process of creating the consistent snapshot group, if a write operation request aiming at a storage volume in a locking state is received, the requests are requested, and after the establishment of the consistent snapshot group is completed, corresponding data is written into the storage volume in time according to the write operation request in a cache.
In contrast, for a read request, since the read operation does not change the data stored in the storage volume, the read request may be normally responded to even when the storage volume is in the locked state. Thus, the snapshot group creation program 01 is further executable by the processor 12 to perform the following steps after the step of performing a locking operation on the plurality of storage volumes and, after the locking operation is completed, sequentially creating snapshot volumes for the plurality of storage volumes:
When a read operation request sent by a second client is received, determining a storage volume corresponding to the read operation request;
and reading corresponding data from the storage volume according to the read operation request, and sending the data to the second client.
When a consistent snapshot creation instruction sent by a first client is received, the creation device of the consistent snapshot group determines a storage volume group corresponding to the consistent snapshot creation instruction, wherein the storage volume group comprises a plurality of storage volumes; simultaneously executing locking operation on a plurality of storage volumes, and after the locking operation is completed, sequentially establishing snapshot volumes for the plurality of storage volumes; when snapshot operation of one storage volume is completed and the snapshot volume is successfully created, unlocking operation is executed for the storage volume; if all storage volumes in the storage volume group are detected to successfully create the snapshot volumes, the created plurality of snapshot volumes form a consistent snapshot group. According to the scheme, when consistent snapshots are played for the storage volume group, a single storage volume which has completed snapshot playing operation is unlocked immediately without waiting for other storage volumes to complete snapshot playing operation and then unlocked, so that the storage volume which has completed snapshot playing can respond to read-write operation requests immediately, and the read-write operation requests are prevented from being blocked while the consistency of the snapshot volume group is ensured.
Alternatively, in other embodiments, the snapshot group creation program may be further divided into one or more modules, where one or more modules are stored in the memory 11 and executed by one or more processors (the processor 12 in this embodiment) to complete the present invention, and the modules referred to herein are a series of instruction segments of a computer program capable of performing a specific function, for describing the execution of the snapshot group creation program in the consistent snapshot group creation device.
For example, referring to fig. 3, a program module schematic diagram of a snapshot group creation program in an embodiment of a consistent snapshot group creation device of the present invention, in which a snapshot group creation program 01 may be divided into a storage volume determination module 10, a storage volume locking module 20, a storage volume unlocking module 30, and a snapshot group creation module 40, by way of example:
The storage volume determination module 10 is configured to: when a consistent snapshot creation instruction sent by a first client is received, determining a storage volume group corresponding to the consistent snapshot creation instruction, wherein the storage volume group comprises a plurality of storage volumes;
The storage volume locking module 20 is for: simultaneously executing locking operation on the plurality of storage volumes, and after the locking operation is completed, sequentially establishing snapshot volumes for the plurality of storage volumes;
the storage volume unlocking module 30 is configured to: when snapshot operation of one storage volume is completed and the snapshot volume is successfully created, unlocking operation is executed for the storage volume;
the snapshot group creation module 40 is configured to: and if all the storage volumes in the storage volume group are detected to be successfully created, forming a consistent snapshot group by the created plurality of snapshot volumes.
The functions or operation steps implemented when the program modules such as the storage volume determining module 10, the storage volume locking module 20, the storage volume unlocking module 30, and the snapshot group creating module 40 are executed are substantially the same as those of the foregoing embodiments, and will not be described in detail herein.
In addition, an embodiment of the present invention also proposes a computer-readable storage medium having stored thereon a snapshot group creation program executable by one or more processors to implement the following operations:
When a consistent snapshot creation instruction sent by a first client is received, determining a storage volume group corresponding to the consistent snapshot creation instruction, wherein the storage volume group comprises a plurality of storage volumes;
simultaneously executing locking operation on the plurality of storage volumes, and after the locking operation is completed, sequentially establishing snapshot volumes for the plurality of storage volumes;
When snapshot operation of one storage volume is completed and the snapshot volume is successfully created, unlocking operation is executed for the storage volume;
And if all the storage volumes in the storage volume group are detected to be successfully created, forming a consistent snapshot group by the created plurality of snapshot volumes.
The computer-readable storage medium of the present invention is substantially the same as the above-described embodiments of the apparatus and method for creating a consistent snapshot group, and will not be described in detail herein.
It should be noted that, the foregoing reference numerals of the embodiments of the present invention are merely for describing the embodiments, and do not represent the advantages and disadvantages of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (5)
1. A method of creating a consistent snapshot group, the method comprising:
When a consistent snapshot creation instruction sent by a first client is received, determining a storage volume group corresponding to the consistent snapshot creation instruction, wherein the storage volume group comprises a plurality of storage volumes;
Simultaneously executing locking operation on the plurality of storage volumes, starting the creation of snapshot volumes after the locking operation is completed, and sequentially building the snapshot volumes for the plurality of storage volumes;
when a read operation request sent by a second client is received, determining a storage volume corresponding to the read operation request, reading corresponding data from the storage volume according to the read operation request, sending the data to the second client, when a write operation request sent by the second client is received, determining the storage volume corresponding to the write operation request, judging whether the storage volume is currently in a locking state, if the storage volume is currently in the locking state, writing the data corresponding to the write operation request into a write task queue of a cache area, and if the storage volume is currently in an unlocking state, writing the data corresponding to the write operation request into the storage volume;
When snapshot operation of one storage volume is completed and the snapshot volume is successfully created, unlocking operation is executed for the storage volume;
When the snapshot operation failure of the storage volume is detected, terminating the snapshot operation, deleting the created snapshot volume, determining the volume name of the storage volume with the snapshot operation failure, and sending the volume name to the first client;
And if all the storage volumes in the storage volume group are detected to be successfully created, forming a consistent snapshot group by the created plurality of snapshot volumes.
2. The method of creating a consistent snapshot group of claim 1, further comprising the steps of:
After the consistency snapshot group is established, checking whether an unfinished write operation request exists in a write task queue in the cache area;
If yes, acquiring a write operation request in the write task queue, and writing corresponding data into the storage volume according to the write operation request.
3. A device for creating a consistent snapshot group, the device comprising a memory and a processor, the memory having stored thereon a snapshot group creation program executable on the processor, the snapshot group creation program when executed by the processor performing the steps of:
When a consistent snapshot creation instruction sent by a first client is received, determining a storage volume group corresponding to the consistent snapshot creation instruction, wherein the storage volume group comprises a plurality of storage volumes;
Simultaneously executing locking operation on the plurality of storage volumes, starting the creation of snapshot volumes after the locking operation is completed, and sequentially building the snapshot volumes for the plurality of storage volumes;
when a read operation request sent by a second client is received, determining a storage volume corresponding to the read operation request, reading corresponding data from the storage volume according to the read operation request, sending the data to the second client, when a write operation request sent by the second client is received, determining the storage volume corresponding to the write operation request, judging whether the storage volume is currently in a locking state, if the storage volume is currently in the locking state, writing the data corresponding to the write operation request into a write task queue of a cache area, and if the storage volume is currently in an unlocking state, writing the data corresponding to the write operation request into the storage volume;
When snapshot operation of one storage volume is completed and the snapshot volume is successfully created, unlocking operation is executed for the storage volume;
When the snapshot operation failure of the storage volume is detected, terminating the snapshot operation, deleting the created snapshot volume, determining the volume name of the storage volume with the snapshot operation failure, and sending the volume name to the first client;
And if all the storage volumes in the storage volume group are detected to be successfully created, forming a consistent snapshot group by the created plurality of snapshot volumes.
4. The consistent snapshot group creation apparatus of claim 3, wherein the snapshot group creation program is further executable by a processor to implement the steps of:
After the consistency snapshot group is established, checking whether an unfinished write operation request exists in a write task queue in the cache area;
If yes, acquiring a write operation request in the write task queue, and writing corresponding data into the storage volume according to the write operation request.
5. A computer-readable storage medium, having stored thereon a snapshot group creation program executable by one or more processors to implement the steps of the consistent snapshot group creation method of any of claims 1-2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811252833.1A CN109582496B (en) | 2018-10-25 | 2018-10-25 | Method and device for creating consistent snapshot group and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811252833.1A CN109582496B (en) | 2018-10-25 | 2018-10-25 | Method and device for creating consistent snapshot group and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109582496A CN109582496A (en) | 2019-04-05 |
CN109582496B true CN109582496B (en) | 2024-05-28 |
Family
ID=65920731
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811252833.1A Active CN109582496B (en) | 2018-10-25 | 2018-10-25 | Method and device for creating consistent snapshot group and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109582496B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110069926B (en) * | 2019-04-11 | 2022-10-25 | 南京邮电大学 | Malicious code positioning method, storage medium and terminal for Android repackaging application |
CN110008065A (en) * | 2019-04-11 | 2019-07-12 | 苏州浪潮智能科技有限公司 | A kind of consistency group snapshot management method and relevant apparatus |
CN110888603B (en) * | 2019-11-27 | 2024-01-16 | 深圳前海环融联易信息科技服务有限公司 | High concurrency data writing method, device, computer equipment and storage medium |
CN113835835B (en) * | 2021-09-18 | 2024-02-13 | 广东浪潮智慧计算技术有限公司 | Method, device and computer readable storage medium for creating consistency group |
CN114138182B (en) * | 2021-10-27 | 2023-12-22 | 济南浪潮数据技术有限公司 | Cross-storage online cloning method, system and device for distributed cloud hard disk |
CN114138557B (en) * | 2021-11-26 | 2022-05-27 | 北京大道云行科技有限公司 | Consistency test method and device for rollback data of stored snapshot |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106371767A (en) * | 2016-08-31 | 2017-02-01 | 华为技术有限公司 | Method, device and system for processing consistency business |
CN106648830A (en) * | 2016-11-18 | 2017-05-10 | 国云科技股份有限公司 | Method for performing online snapshot on virtual machine disk |
CN106919471A (en) * | 2015-12-25 | 2017-07-04 | 中国电信股份有限公司 | For the method and system that snapshot is set up |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140129844A1 (en) * | 2006-01-26 | 2014-05-08 | Unisys Corporation | Storage security using cryptographic splitting |
-
2018
- 2018-10-25 CN CN201811252833.1A patent/CN109582496B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106919471A (en) * | 2015-12-25 | 2017-07-04 | 中国电信股份有限公司 | For the method and system that snapshot is set up |
CN106371767A (en) * | 2016-08-31 | 2017-02-01 | 华为技术有限公司 | Method, device and system for processing consistency business |
CN106648830A (en) * | 2016-11-18 | 2017-05-10 | 国云科技股份有限公司 | Method for performing online snapshot on virtual machine disk |
Also Published As
Publication number | Publication date |
---|---|
CN109582496A (en) | 2019-04-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109582496B (en) | Method and device for creating consistent snapshot group and computer readable storage medium | |
US11016856B2 (en) | User authorization for file level restoration from image level backups | |
CN111241061B (en) | Writing method of state database, data processing device and storage medium | |
CN109597707B (en) | Clone volume data copying method, device and computer readable storage medium | |
CN110753084B (en) | Uplink data reading method, cache server and computer readable storage medium | |
CN109564566B (en) | Discovery of calling applications for controlling file hydration behavior | |
CN103248667A (en) | Resource access method and system for distributed system | |
US10007785B2 (en) | Method and apparatus for implementing virtual machine introspection | |
CN114021089A (en) | Directory access control method, device, equipment and readable storage medium | |
CN105867962A (en) | System upgrading method and device | |
WO2017024519A1 (en) | Startup method of smart terminal system, device and smart terminal | |
US9904602B1 (en) | Secure search | |
CN115221156A (en) | Database cluster capacity expansion method and device, computer equipment and storage medium | |
CN111090701B (en) | Service request processing method, device, readable storage medium and computer equipment | |
CN112506928A (en) | Method and device for verifying validity of backup data | |
WO2020140615A1 (en) | Backup and recovery method for application system, device and computer-readable storage medium | |
CN109739857B (en) | Data distributed writing method and device under high concurrency, terminal and storage medium | |
CN105453057A (en) | Storing difference information in a backup system | |
CN114546705B (en) | Operation response method, operation response device, electronic apparatus, and storage medium | |
CN115630020A (en) | Method and device for multiplexing safety scanning result and electronic equipment | |
CN112764973B (en) | Data disaster tolerance method and device, electronic equipment and readable storage medium | |
CN115185946A (en) | Multi-tenant system, multi-tenant management method, computer device, and storage medium | |
CN113094367A (en) | Data processing method and device and server | |
CN109582638B (en) | Snapshot volume data copying method, device and computer readable storage medium | |
JP6999044B2 (en) | LAN booting environment infrastructure A device for file security and centralization, a computer-readable recording medium on which a method for this and a program for performing this method are recorded. |
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 |