Writable snapshot implementation method and device, equipment and readable storage medium

An implementation method and snapshot technology, applied in the storage field, can solve the problems of reducing the application scenario of snapshot data, inconvenient editing of snapshot data, and reducing the flexibility of snapshot data application.

Inactive Publication Date: 2020-01-07
北京浪潮数据技术有限公司
4 Cites 2 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0003] Currently, commonly used snapshots are read-only snapshots, that is, the snapshot data is a copy of the read-only snapshot attributes. Operations such as adding, deleting, and modifying internal data can only be performed after the snapshot is rolled...
View more

Abstract

The invention discloses a writable snapshot implementation method and device, equipment and a computer readable storage medium, and the method is applied to a distributed storage system and comprisesthe steps: receiving a writable snapshot obtaining instruction sent by a user; analyzing the writable snapshot acquisition instruction, and if the writable snapshot acquisition instruction is a writable snapshot creation instruction, creating a read-only snapshot as a target read-only snapshot; if the instruction is the read-only to writable instruction, obtaining a read-only snapshot from the distributed storage system and taking the read-only snapshot as a target read-only snapshot; creating a hidden volume invisible to the user according to the writable snapshot acquisition instruction; andperforming associated binding on the hidden volume and the target read-only snapshot to obtain a writable snapshot. According to the technical scheme disclosed by the invention, the read-only snapshot and the hidden volume invisible to the user are associated and bound to finally implement the read-write operation on the snapshot on the hidden volume, so that the writable snapshot has editable attributes, the application flexibility of snapshot data is improved, and the application scene of the snapshot data is conveniently expanded.

Application Domain

Input/output to record carriers

Technology Topic

Distributed memory systemsComputer hardware +2

Image

  • Writable snapshot implementation method and device, equipment and readable storage medium
  • Writable snapshot implementation method and device, equipment and readable storage medium
  • Writable snapshot implementation method and device, equipment and readable storage medium

Examples

  • Experimental program(1)

Example Embodiment

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
[0042] see figure 1 , which shows a flow chart of a writable snapshot implementation method provided by the embodiment of the present application, which is applied to a distributed storage system and may include:
[0043] S11: Receive a writable snapshot acquisition instruction sent by a user.
[0044] When the user initiates a writable snapshot acquisition instruction, the bottom server receives the writable snapshot acquisition instruction sent by the user.
[0045] S12: Analyzing the writable snapshot acquisition instruction.
[0046] S13: If the instruction is created for a writable snapshot, create a read-only snapshot, and use the read-only snapshot as a target read-only snapshot.
[0047] S14: If it is a read-only to writable instruction, obtain a read-only snapshot from the distributed storage system, and use the read-only snapshot as a target read-only snapshot.
[0048] Analyze the writable snapshot acquisition instruction sent by the user. If the writable snapshot acquisition instruction is specifically a writable snapshot creation instruction through parsing, create a read-only snapshot, and use the created read-only snapshot as the target read-only snapshot, where , in order to make the writable snapshot acquisition process go on normally, the name of the read-only snapshot created according to the writable snapshot creation instruction (that is, the target read-only snapshot) is different from the name of the existing read-only snapshot in the distributed storage system ; If the writable snapshot acquiring instruction is specifically converted from read-only to writable, the read-only snapshot is acquired from the distributed storage system, and the acquired read-only snapshot is used as the target read-only snapshot.
[0049] S15: Create a hidden volume invisible to the user according to the writable snapshot acquisition instruction.
[0050] After receiving the writable snapshot acquisition instruction sent by the user, a corresponding hidden volume is created according to the writable snapshot acquisition instruction.
[0051] Wherein, the hidden volume is invisible to the user, that is, the user cannot query the hidden volume through the client interface, so that what the user sees subsequently is only a writable snapshot that can perform read and write operations.
[0052] S16: Associate and bind the hidden volume with the target read-only snapshot to obtain a writable snapshot.
[0053]After obtaining the target read-only snapshot, associate and bind the created hidden volume with the obtained target read-only snapshot to obtain a writable snapshot. Specifically, in combination with the above steps, it can be seen that after parsing the writable snapshot acquisition command sent by the user, if the command is a writable snapshot creation command, a read-only snapshot is created and a hidden volume invisible to the user is created, and then only The read-only snapshot is associated with the hidden volume to obtain a writable snapshot; if it is a read-only to writable command, a hidden volume invisible to the user is created, and a read-only snapshot is obtained from the distributed storage system. Then, the The obtained read-only snapshot is associated and bound with the hidden volume to obtain a writable snapshot.
[0054] After the writable snapshot is obtained, subsequent read and write operations on the writable snapshot are finally implemented on the hidden volume (including subsequent write operations are mapped to the hidden volume). Therefore, from the user level, the Writable snapshots have the property of being editable, thus indirectly realizing the reading and writing of snapshots.
[0055] It can be known from the above implementation process that, compared with the current mainstream read-only snapshots, the writable snapshots obtained in this application not only have basic features such as disaster recovery and backup, but also have editable features.
[0056] It should be noted that this application can be implemented in C++ language, and of course, it can also be implemented in other languages, which is not limited in this application.
[0057] In the above technical solution disclosed in this application, by associating read-only snapshots with hidden volumes invisible to users, the read and write operations on snapshots are finally implemented on hidden volumes, so that writable snapshots have editable attributes , so as to improve the flexibility of the application of the snapshot data, and facilitate the expansion of the application scenarios of the snapshot data.
[0058] A writable snapshot implementation method provided in the embodiment of the present application may further include: before associating and binding the hidden volume with the target read-only snapshot:
[0059] Set the lock flag in the property information of the target read-only snapshot.
[0060] Before associating and binding the hidden volume with the target read-only snapshot, a lock flag can also be added to the attribute information of the target read-only snapshot (that is, the writable snapshot is locked by the lock flag), wherein the added lock flag On the one hand, it can distinguish the types of snapshots. On the other hand, it can alert and remind users when they are about to delete writable snapshots, so as to prevent users from deleting writable snapshots when they are performing read and write operations. Writable snapshots are used for protection.
[0061] The implementation method of a writable snapshot provided by the embodiment of the present application may further include:
[0062] If no IO operation is performed on the writable snapshot, reverse conversion is performed on the writable snapshot to obtain the target read-only snapshot.
[0063] After associating and binding the hidden volume with the target read-only snapshot to obtain a writable snapshot, if no IO operation is performed on the writable snapshot, the writable snapshot can be reverse-converted, that is, the target-only snapshot in the writable snapshot can be released. The read-snapshot is bound with the hidden volume's association to get the target read-only snapshot. That is to say, the writable snapshot obtained in this application also has the function of reverse conversion to obtain a read-only snapshot.
[0064] It should be noted that since no IO operation is performed on the writable snapshot, the reverse conversion of the writable snapshot in the above case will not cause data loss.
[0065] The implementation method of a writable snapshot provided by the embodiment of the present application may further include:
[0066] If the IO operation is performed on the writable snapshot, the step of reverse converting the writable snapshot is not performed.
[0067] After associating and binding the hidden volume with the target read-only snapshot to obtain a writable snapshot, if an IO operation is performed on the writable snapshot, the data of the IO operation is not actually mapped to the target read-only snapshot. Therefore, in order To avoid data loss, the step of reverse converting the writable snapshot is not performed. In this case, not all writable snapshots have the function of reverse conversion to obtain a read-only snapshot.
[0068] That is to say, in order to prevent data loss, the writable snapshot in this application can only realize one-way conversion.
[0069] The implementation method of a writable snapshot provided by the embodiment of the present application may further include:
[0070] Clone the writable snapshot and read the data to obtain a clone volume containing all the data of the current writable snapshot;
[0071] Among them, reading data may include:
[0072] Read data from the hidden volume. If there is no data in the hidden volume, read data from the corresponding location of the target read-only snapshot. If there is no data in the corresponding location of the target read-only snapshot, read the data from the corresponding location of the writable snapshot. Read data from the corresponding location on the source volume.
[0073] For writable snapshots, when the snapshot is rolled back, only the data information at the time of snapshot creation is retained in the read-only snapshot, and the data of subsequent IO operations is not synchronized to the read-only snapshot. Therefore, the volume information after rollback It does not contain the IO data after creating a writable snapshot. Based on this, you can clone the writable snapshot in the writable snapshot and read the data to obtain a clone volume containing all the data in the current writable snapshot. , that is, mount the hidden volume information of the writable snapshot to the clone volume to obtain the complete data of the current writable snapshot.
[0074] Wherein, the above-mentioned process of reading data is specifically as follows: first read data from the hidden volume, if there is an area without data in the hidden volume, then read the data from the corresponding position in the target read-only snapshot (that is, with no data in the hidden volume) If there is no data in these locations in the target read-only snapshot, read the data from the corresponding location of the source volume of the writable snapshot (that is, the location with no data in the target read-only snapshot If there is no data in the corresponding location of the source volume of the writable snapshot, it means that there is indeed no data in the location. At this time, there will be no data in the corresponding positions in the cloned volume.
[0075] By cloning volumes, snapshot data can be mapped and mounted, and hidden volumes in writable snapshots can be visualized, thereby enriching the features of writable snapshots and expanding the application scenarios of writable snapshots.
[0076] It should be noted that hidden volumes, cloned volumes, and read-only snapshots are not limited to the same storage pool.
[0077] see figure 2 , which shows a schematic diagram of the relationship between the source volume, the read-only snapshot and the writable snapshot provided by the embodiment of the present application. The read-only snapshot can be obtained on the basis of the source volume, and the read-only snapshot can be converted into a writable snapshot. And both read-only snapshots and writable snapshots can be cloned to obtain clone volumes, and writable snapshots can also be obtained on the basis of source volumes, and both writable snapshots and read-only snapshots can be recovered to obtain source volumes. Moreover, the writable snapshot in this application can support management operations including the following content: (1) create: directly create a writable snapshot; (2) delete: delete a writable snapshot; (3) list display: display current snapshot information, Among them, the writable snapshot has an exclusive identifier; (4) Restoring the source volume: snapshot rollback operation, excluding the information after reading and writing of the snapshot; (5) Clone volume: mounting of the writable snapshot, including the information after reading and writing of the snapshot; (6) Clear: delete the snapshot; (7) Convert read-only to writable: convert the read-only snapshot to a writable snapshot; (8) Snapshot attribute query: query the snapshot attribute by command line.
[0078] The embodiment of the present application also provides a writable snapshot implementation device, which is applied to a distributed storage system. For details, see image 3 , which shows a schematic structural diagram of an apparatus for implementing a writable snapshot provided in an embodiment of the present application, which may include:
[0079] A receiving module 31, configured to receive a writable snapshot acquisition instruction sent by a user;
[0080] The parsing module 32 is used to parse the writable snapshot acquisition instruction, if it is a writable snapshot creation instruction, then create a read-only snapshot, and use the read-only snapshot as the target read-only snapshot; if it is a read-only to writable instruction, then Obtain a read-only snapshot from the distributed storage system, and use the read-only snapshot as the target read-only snapshot;
[0081] The creating module 33 is used to create a hidden volume invisible to the user according to the writable snapshot acquisition instruction;
[0082] The association binding module 34 is configured to associate and bind the hidden volume with the target read-only snapshot to obtain a writable snapshot.
[0083] An implementation device for writable snapshot provided in the embodiment of this application may also include:
[0084] The module for setting the lock flag is used for setting the lock flag in the attribute information of the read-only snapshot before associating and binding the hidden volume with the target read-only snapshot.
[0085] An implementation device for writable snapshot provided in the embodiment of this application may also include:
[0086] The reverse conversion module is used to reverse convert the writable snapshot to obtain the target read-only snapshot if no IO operation is performed on the writable snapshot after associating and binding the hidden volume and the read-only snapshot to obtain the writable snapshot snapshot.
[0087] An implementation device for writable snapshot provided in the embodiment of this application may also include:
[0088] Do not execute the reverse conversion module, which is used to associate and bind the hidden volume with the target read-only snapshot to obtain a writable snapshot, if the IO operation is performed on the writable snapshot, the step of reverse conversion of the writable snapshot is not performed .
[0089] An implementation device for writable snapshot provided in the embodiment of this application may also include:
[0090] The cloning module is used for associating and binding the hidden volume with the target read-only snapshot to obtain a writable snapshot, then cloning the writable snapshot and reading data to obtain all the data contained in the current writable snapshot the cloned volume;
[0091] Among them, the clone module can include:
[0092] The reading unit is used to read data from the hidden volume. If there is an area without data in the hidden volume, read data from the corresponding position of the target read-only snapshot. If there is no data in the corresponding position of the target read-only snapshot, Then read data from the corresponding location of the source volume of the writable snapshot.
[0093] The embodiment of the present application also provides a writable snapshot implementation device, see Figure 4 , which shows a schematic structural diagram of a writable snapshot implementation device provided in an embodiment of the present application, which may include:
[0094] Memory 41, used to store computer programs;
[0095] The processor 42 is used to execute the computer program stored in the memory 41 to implement the following steps at all times:
[0096] Receive the writable snapshot acquisition instruction sent by the user; parse the writable snapshot acquisition instruction, if it is a writable snapshot creation instruction, create a read-only snapshot, and use the read-only snapshot as the target read-only snapshot; if it is a read-only conversion write command, obtain a read-only snapshot from the distributed storage system, and use the read-only snapshot as the target read-only snapshot; create a hidden volume that is invisible to the user according to the writable snapshot acquisition command; combine the hidden volume with the target read-only snapshot Associated bindings for writable snapshots.
[0097]The embodiment of the present application also provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps are as follows:
[0098] Receive the writable snapshot acquisition instruction sent by the user; parse the writable snapshot acquisition instruction, if it is a writable snapshot creation instruction, create a read-only snapshot, and use the read-only snapshot as the target read-only snapshot; if it is a read-only conversion write command, obtain a read-only snapshot from the distributed storage system, and use the read-only snapshot as the target read-only snapshot; create a hidden volume that is invisible to the user according to the writable snapshot acquisition command; combine the hidden volume with the target read-only snapshot Associating and binding to obtain a writable snapshot; wherein, the read-only snapshot is a read-only snapshot created according to a writable snapshot acquisition instruction or a read-only snapshot existing in the distributed storage system before receiving the writable snapshot acquisition instruction.
[0099] The computer-readable storage medium may include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc., which can store program codes. medium.
[0100] It should be noted that, for descriptions of relevant parts of the device, device, and computer-readable storage medium for realizing a writable snapshot provided in the embodiment of the present application, please refer to the corresponding Part of the detailed description will not be repeated here.
[0101] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is a relationship between these entities or operations. There is no such actual relationship or order between them. Furthermore, the terms "comprising", "comprising" or any other variation thereof are intended to cover a non-exclusive inclusion such that elements inherent in a process, method, article, or apparatus including a series of elements are included. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element. In addition, the part of the technical solution provided by the embodiment of the present application that is consistent with the realization principle of the corresponding technical solution in the prior art is not described in detail, so as to avoid redundant description.
[0102] The above description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the application. Therefore, the present application will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products