CN114138188B - Method, system and device for shrinking volume of data volume and readable storage medium - Google Patents
Method, system and device for shrinking volume of data volume and readable storage medium Download PDFInfo
- Publication number
- CN114138188B CN114138188B CN202111342925.0A CN202111342925A CN114138188B CN 114138188 B CN114138188 B CN 114138188B CN 202111342925 A CN202111342925 A CN 202111342925A CN 114138188 B CN114138188 B CN 114138188B
- Authority
- CN
- China
- Prior art keywords
- volume
- data
- shrinking
- snapshot
- data volume
- 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 66
- 230000008569 process Effects 0.000 claims abstract description 27
- 238000004064 recycling Methods 0.000 claims abstract description 19
- 238000011084 recovery Methods 0.000 claims description 24
- 238000011038 discontinuous diafiltration by volume reduction Methods 0.000 claims description 20
- 230000004048 modification Effects 0.000 claims description 8
- 238000012986 modification Methods 0.000 claims description 8
- 230000006870 function Effects 0.000 claims description 6
- 238000005516 engineering process Methods 0.000 abstract description 27
- 238000012545 processing Methods 0.000 abstract description 7
- 238000004891 communication Methods 0.000 description 8
- 230000008602 contraction Effects 0.000 description 6
- 230000009471 action Effects 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012217 deletion Methods 0.000 description 3
- 230000037430 deletion Effects 0.000 description 3
- 238000005096 rolling process Methods 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 238000004321 preservation Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0619—Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Retry When Errors Occur (AREA)
Abstract
The invention provides a method, a system and a device for shrinking volume of a data volume and a readable storage medium, and belongs to the technical field of data processing. The method comprises the following steps: first, a specified capacity, i.e., a capacity after the data volume is contracted, needs to be input. And then, confirming whether the data exists in the part of the data volume exceeding the designated capacity, if not, directly carrying out the volume shrinking operation of the data volume, if so, creating a volume shrinking snapshot of the data volume, then carrying out the volume shrinking operation of the data volume, storing the data deleted in the volume shrinking process through the volume shrinking snapshot, and simultaneously storing the data in a data volume recycling station. When the data of the data volume is restored, the data volume is restored to the state before the volume shrinkage by performing a rollback operation on the corresponding data volume shrinkage snapshot in the volume recycle bin. The invention utilizes the volume snapshot technology, improves the fault tolerance of the volume shrinking operation, effectively prevents the loss of data, and further improves the reliability of the volume shrinking operation by combining with the recycle bin technology of the volume.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, a system, an apparatus, and a readable storage medium for shrinking a volume of a data volume.
Background
In the cloud computing era, the application of distributed block storage is more and more widespread, and the distributed block storage is that the block data clusters provided by a software defined storage system are integrated, unified block data access can be provided for the outside through a virtual bottom node storage space, and the aggregation capability of high bandwidth and high IOPS is achieved through an IP network. The distributed block storage is widely applied in the fields of IT enterprises, cloud computing, big data, virtualization and the like, improves the resource utilization rate of the system, and reduces the cost on the premise of ensuring the service level; meanwhile, the service has higher agility, and the online time of the new service is shortened.
In cloud scenarios, applications have an oversubscribed limit on the total capacity of data volumes employing distributed storage, in particular, creating a volume with a total capacity exceeding the limit does not allow creation of a new volume, even though the actual total volume used by the volume does not exceed the limit. By scaling the volume, the volume is scaled to (or near) the volume's actual usage volume, and a new volume can be created to solve the above-described problem.
However, during the volume shrinking process, the data exceeding the specified volume in the data volume is directly deleted and cannot be recovered after the deletion, so that once the volume shrinking operation is performed under the condition of errors, the data is likely to be lost, and serious consequences are caused.
Disclosure of Invention
In view of the above problems, the present invention aims to provide a method, a system, a device and a readable storage medium for shrinking a volume of data, which utilize a volume snapshot technology to improve the fault tolerance of the volume shrinking operation, effectively prevent the loss of data, and combine with a recycle bin technology of the volume to further improve the reliability of the volume shrinking operation.
The invention aims to achieve the aim, and the aim is achieved by the following technical scheme: a method of shrinking a volume of data, comprising:
setting capacity after capacity shrinking for the data volume, and recording the capacity as specified capacity;
judging whether data exists in the part of the data volume exceeding the designated capacity;
if not, directly carrying out the capacity shrinking operation of the data volume;
if yes, firstly creating a volume shrinkage snapshot of the data volume, and displaying the created volume shrinkage snapshot in a volume recycling station; then carrying out the capacity shrinking operation of the data volume;
when the user needs to restore the data volume of the volume shrink, the volume shrink snapshot in the volume recycle bin is utilized to restore the data deleted in the process of the volume shrink of the data volume.
Further, the determining whether the portion of the data volume exceeding the specified capacity has data specifically includes: by traversing the object_map of the data volume, it is determined whether or not there is data in a portion of the data volume exceeding a specified capacity.
Further, the creating a volume-shrinking snapshot of the data volume specifically includes:
creating a volume shrinkage snapshot of the data volume, and recording the state before volume shrinkage of the data volume;
and filling the data exceeding the specified capacity in the data volume into the volume-shrinking snapshot.
Further, the volume snapshot to be created is displayed in a volume recycle bin, comprising:
by adding the reclamation mark restore_snap to the thumbnail snapshot of the data volume, the thumbnail snapshot to which the reclamation mark restore_snap is added is displayed only in the volume reclamation station.
Further, the recovering the deleted data in the data rolling process by utilizing the rolling snapshot in the recycle bin includes:
and selecting a volume shrinkage snapshot corresponding to the data volume in the volume recycling station, starting a preset data recovery function to roll back the volume shrinkage snapshot, and recovering the data volume to a state before volume shrinkage.
Further, the displaying the created volume shrink snapshot in a volume recycle bin further includes:
and setting the storage time for the volume-shrinking snapshot, and when the storage time of the volume-shrinking snapshot exceeds the storage time, automatically clearing the volume-shrinking snapshot and releasing the storage space in the volume recycling station.
Further, the method also comprises the following steps:
when the user carries out the first modification and writing operation on the data volume after the volume reduction, the data in the data volume after the volume reduction is backed up to the volume reduction snapshot, and then the modification and writing operation is carried out.
Correspondingly, the invention also discloses a volume shrinking system of the data volume, which comprises the following steps:
the setting unit is used for setting the capacity of the data volume after the capacity is contracted and recording the capacity as the designated capacity;
a judging unit for judging whether or not there is data in a portion of the data volume exceeding the specified capacity;
the operation unit is used for performing the volume shrinking operation of the data volume;
the volume-shrinking snapshot creation unit is used for creating volume-shrinking snapshots of the data volume and displaying the created volume-shrinking snapshots in the volume recycling station;
and the data recovery unit is used for recovering the data deleted in the data volume shrinking process by utilizing the volume shrinking snapshot in the recycle bin when the user needs to recover the data volume shrinking.
Correspondingly, the invention discloses a volume shrinking device of a data volume, which comprises the following components:
a memory for storing a volume reduction program of the data volume;
a processor for implementing the steps of the method for shrinking a volume of a data volume as defined in any one of the preceding claims when executing the program for shrinking a volume of the data volume.
Accordingly, the present invention discloses a readable storage medium, on which a volume reduction program of a data volume is stored, which when executed by a processor, implements the steps of the volume reduction method of the data volume as described in any one of the above.
Compared with the prior art, the invention has the beneficial effects that: the invention discloses a method, a system, a device and a readable storage medium for volume reduction of a data volume, which can effectively prevent data loss in the process of volume reduction by adopting a volume snapshot technology and a volume recycle bin technology. In the process of data volume shrinkage, when the situation that data in the data volume needs to be deleted occurs, a user is prompted to create a volume shrinkage snapshot, and the created volume shrinkage snapshot is displayed in a volume recycle bin. When the user needs to recover the data of the volume shrink, the data deleted in the volume shrink process can be recovered by executing a rollback operation on the volume shrink snapshot in the recycle bin.
The invention uses the volume snapshot technology, can improve the fault tolerance of volume shrinking operation, prevent data loss, and combines the recycle bin technology of the volume, so that the volume shrinking snapshot is different from the traditional volume snapshot, and prevents the volume snapshot from being deleted by mistake when the volume snapshot is operated, thereby further improving the reliability of volume shrinking operation.
It can be seen that the present invention has outstanding substantial features and significant advances over the prior art, as well as the benefits of its implementation.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the drawings provided without invasive labor for those skilled in the art.
FIG. 1 is a flow chart of a method of an embodiment of the present invention.
Fig. 2 is a system configuration diagram of an embodiment of the present invention.
In the figure, 1 is a setting unit; 2 is a judging unit; 3 is an operation unit; 4, creating a unit for the volume-shrinking snapshot; and 5 is a data recovery unit.
Detailed Description
The core of the present invention is to provide a method for shrinking volume of data volume, in the prior art, the data exceeding the designated volume in the data volume can be deleted directly in the shrinking process of the data volume, and the data cannot be recovered after the deletion, so once the data volume shrinking operation is executed under the condition of error, the data is likely to be lost, and serious consequences are generated.
In the method for shrinking the volume of the data volume, the specified volume, namely the volume after the volume is shrunk, is required to be input. Then, traversing the object_map of the data volume, confirming whether the part of the data volume exceeding the specified capacity has data or not, if the part of the data volume exceeding the specified capacity does not have data, directly performing the capacity shrinking operation of the data volume, if the part of the data volume does not have data, creating a capacity shrinking snapshot of the data volume, performing the capacity shrinking operation of the data volume, storing the data deleted in the capacity shrinking process of the data volume through the capacity shrinking snapshot of the data volume, and simultaneously storing the data in a data volume recycling station. When the data of the data volume is restored, the data volume is restored to the state before the volume shrinkage by performing a rollback operation on the corresponding data volume shrinkage snapshot in the volume recycle bin. Therefore, the invention utilizes the volume snapshot technology, improves the fault tolerance of the volume shrinking operation, effectively prevents the loss of data, and further improves the reliability of the volume shrinking operation by combining the recycle bin technology of the volume.
In order to provide a better understanding of the present invention, the present invention will be described in further detail with reference to the drawings and the detailed description. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by one of ordinary skill in the art without undue burden on the person of ordinary skill in the art based on embodiments of the present invention, are within the scope of the present invention.
Embodiment one:
as shown in fig. 1, this embodiment provides a method for shrinking a volume of a data volume, including the following steps:
s1: the capacity after the capacity reduction is set for the data volume and is recorded as the designated capacity.
S2: the object_map of the data volume is traversed.
S3: judging whether the part of the data volume exceeding the designated capacity has data or not according to the traversing result, if so, turning to the step S4, and if not, turning to the step S6.
S4: a scaled snapshot of the data volume is created.
Firstly, creating a volume shrinkage snapshot of a data volume, and recording the state before volume shrinkage of the data volume; then, data exceeding a specified capacity in the data volume is filled into the volume-shrinking snapshot.
S5: the created volume snapshot is displayed in a volume recycle bin.
The method specifically comprises the following steps: by adding the reclamation mark restore_snap to the thumbnail snapshot of the data volume, the thumbnail snapshot to which the reclamation mark restore_snap is added is displayed only in the volume reclamation station. In addition, in order to clear the storage space regularly, the storage time is set for the volume-shrinking snapshot, and when the storage time of the volume-shrinking snapshot exceeds the storage time, the volume-shrinking snapshot is automatically cleared, and the storage space in the volume recycling station is released.
S6: and performing the capacity shrinking operation of the data volume.
For the data deleted in the process of recovering the volume of the data by using the volume shrinkage snapshot in the recycle bin when the user needs to recover the volume of the data by creating the volume shrinkage snapshot, the specific data recovery flow includes: first, a volume-shrinking snapshot corresponding to a data volume is selected in a volume recycle bin. Then, a preset data recovery function is started to roll back the shrink snapshot, and the data volume is recovered to a state before shrink.
In addition, when the user carries out the first modification and writing operation on the data volume after the volume reduction, the data in the data volume after the volume reduction is backed up to the volume reduction snapshot, and then the modification and writing operation is carried out.
The embodiment provides a volume shrinking method of a data volume, which can effectively prevent data loss in the process of data volume shrinking by adopting a volume snapshot technology and a volume recycling station technology. In the process of data volume contraction, when the condition that data in a data volume needs to be deleted occurs, a user is prompted to create a volume contraction snapshot, and the created volume contraction snapshot is displayed in a volume recycle bin. When the user needs to recover the data of the volume shrink, the data deleted in the volume shrink process can be recovered by executing a rollback operation on the volume shrink snapshot in the recycle bin. The method uses the volume snapshot technology, can improve the fault tolerance of volume shrinking operation, prevent data loss, and simultaneously combines the volume recycle bin technology to distinguish the volume shrinking snapshot from the traditional volume snapshot, thereby preventing the volume snapshot from being deleted by mistake when operating, and further improving the reliability of volume shrinking operation.
Embodiment two:
based on the first embodiment, the embodiment also discloses a method for shrinking the volume of the data volume, which comprises the following steps:
first, a specified capacity, i.e., a capacity after the data volume is contracted, needs to be input. Then, traversing the object_map of the data volume, confirming whether the data exists in the part of the data volume exceeding the specified capacity, if the data does not exist, not having the risk of data loss, directly performing the capacity shrinking operation of the data volume, if the data exists, creating a capacity shrinking snapshot of the data volume, and then performing the capacity shrinking operation of the data volume.
The method specifically comprises the following steps of creating a volume-shrinking snapshot of a data volume:
1. a snapshot of the volume of the data volume is created and the state of the data volume before the volume is contracted is recorded.
2. And filling the volume-shrinking snapshot of the data volume, and filling the data exceeding the specified capacity in the data volume into the snapshot.
3. The flag (RESIZE_SNAP) is added to the reduced volume snapshot of the data volume, and the snapshot with the added flag (RESIZE_SNAP) will only be displayed in the volume recycle bin. And for the common snapshot query command of the data volume, the data volume is not displayed.
4. And setting the preservation time for the volume-shrinking snapshot, and automatically clearing the volume-shrinking snapshot and releasing the storage space when the time of the volume-shrinking snapshot exceeds the preservation time.
5. And executing the capacity shrinking operation of the data volume, deleting the data exceeding the specified capacity in the data volume, and modifying the capacity information of the data volume.
6. When the data volume after the volume reduction is modified for the first time, the data in the data volume needs to be backed up to the volume reduction snapshot.
And finally, when the data recovery of the data volume is carried out, selecting a corresponding data volume shrinkage snapshot in the recovery station, and clicking the data recovery. At this time, the volume reduction snapshot of the data volume will be rolled back, and the data volume will be restored to the state before the volume reduction by using the rolling back technique of the volume snapshot, and the data deleted during the volume reduction will also be restored.
The embodiment provides a volume shrinking method of a data volume, which adopts a volume snapshot technology and a volume recycling station technology to prevent data loss in the process of data volume shrinking. In the process of data volume shrinkage, when the situation that data in the data volume needs to be deleted occurs, a user is prompted to create a volume shrinkage snapshot, and the created volume shrinkage snapshot is displayed in a volume recycle bin. When the user needs to recover the data of the volume shrink, the data deleted in the volume shrink process can be recovered by executing a rollback operation on the volume shrink snapshot in the recycle bin. The method uses the volume snapshot technology, can improve the fault tolerance of volume shrinking operation, prevent data loss, and simultaneously combines the recycle bin technology of the volume to make the volume shrinking snapshot different from the traditional volume snapshot, prevent the volume snapshot from being deleted by mistake when operating, and further improve the reliability of volume shrinking operation.
Embodiment III:
based on the first embodiment, as shown in fig. 2, the invention also discloses a volume shrinking system of the data volume, which comprises: a setting unit 1, a judging unit 2, an operating unit 3, a thumbnail snapshot creating unit 4, and a data restoring unit 5.
A setting unit 1 for setting the capacity after the capacity reduction for the data volume, which is denoted as the designated capacity.
A judging unit 2 for judging whether or not there is data in a portion of the data volume exceeding the specified capacity. The judging unit 2 is specifically configured to: by traversing the object_map of the data volume, it is determined whether or not there is data in a portion of the data volume exceeding the specified capacity.
An operation unit 3 for performing a volume reduction operation of the data volume.
And the volume-shrinking snapshot creation unit 4 is used for creating volume-shrinking snapshots of the data volume and displaying the created volume-shrinking snapshots in the volume recycling station. The thumbnail snapshot creation unit 4 specifically is configured to: creating a volume shrinkage snapshot of the data volume, and recording the state before volume shrinkage of the data volume; filling data exceeding a specified capacity in the data volume into the volume-shrinking snapshot; by adding a recovery mark RESIZE_SNAP to the volume-shrinking snapshot of the data volume, the volume-shrinking snapshot added with the recovery mark RESIZE_SNAP is only displayed in a volume recovery station; and setting the storage time for the volume-shrinking snapshot, and when the storage time of the volume-shrinking snapshot exceeds the storage time, automatically clearing the volume-shrinking snapshot and releasing the storage space in the volume recycling station.
And the data recovery unit 5 is used for recovering the data deleted in the data volume shrinking process by utilizing the volume shrinking snapshot in the recycle bin when the user needs to recover the data volume shrinking. The data recovery unit 5 is specifically configured to: and selecting a volume shrinkage snapshot corresponding to the data volume in the volume recycling station, starting a preset data recovery function to roll back the volume shrinkage snapshot, and recovering the data volume to a state before volume shrinkage.
The embodiment provides a volume shrinking system of a data volume, which can improve the fault tolerance of volume shrinking operation and prevent data loss by using a volume snapshot technology, and meanwhile, the volume shrinking snapshot of the volume is different from a traditional volume snapshot by combining a recycle bin technology of the volume, so that false deletion caused by operating the volume snapshot is prevented, and the reliability of the volume shrinking operation is further improved.
Embodiment four:
the embodiment discloses a volume shrinking device of a data volume, which comprises a processor and a memory; the processor executes the volume shrinking program of the data volume stored in the memory to realize the following steps:
1. the designated capacity is input, namely the capacity after the data volume is contracted.
2. The object_map of the data volume is traversed.
3. Judging whether data exists in the part of the data volume exceeding the designated capacity, if not, directly carrying out the capacity shrinking operation of the data volume, if so, firstly creating a capacity shrinking snapshot for the data volume, and recording the state before the capacity shrinking of the data volume; filling the volume-shrinking snapshot of the data volume, and filling the data exceeding the specified capacity in the data volume into the snapshot; finally, a flag (RESIZE_SNAP) is added to the volume snapshot of the data volume so that the volume snapshot will only be displayed in the volume recycle bin.
4. When the data recovery of the data volume is carried out, selecting a corresponding data volume snapshot in the recovery station, and carrying out rollback operation on the selected volume snapshot.
Further, the volume shrinking device of the data volume in this embodiment may further include:
the input interface is used for acquiring the volume shrinking program of the externally imported data volume, storing the acquired volume shrinking program of the data volume into the memory, and acquiring various instructions and parameters transmitted by the external terminal equipment and transmitting the various instructions and parameters into the processor so that the processor can utilize the various instructions and parameters to expand corresponding processing. In this embodiment, the input interface may specifically include, but is not limited to, a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk reading interface, and the like.
And the output interface is used for outputting various data generated by the processor to the terminal equipment connected with the output interface so that other terminal equipment connected with the output interface can acquire various data generated by the processor. In this embodiment, the output interface may specifically include, but is not limited to, a USB interface, a serial interface, and the like.
And the communication unit is used for establishing remote communication connection between the volume shrinking device of the data volume and the external server so that the volume shrinking device of the data volume can mount the image file to the external server. In this embodiment, the communication unit may specifically include, but is not limited to, a remote communication unit based on a wireless communication technology or a wired communication technology.
And the keyboard is used for acquiring various parameter data or instructions input by a user by knocking the key cap in real time.
And the display is used for running the related information of the short-circuit positioning process of the power supply line of the server to display in real time.
A mouse may be used to assist a user in inputting data and to simplify user operations.
The embodiment provides a volume shrinking device for a data volume, which can effectively prevent data loss in the process of volume shrinking by adopting a volume snapshot technology and a volume recycling station technology. In the process of data volume contraction, when the condition that data in a data volume needs to be deleted occurs, a user is prompted to create a volume contraction snapshot, and the created volume contraction snapshot is displayed in a volume recycle bin. When the user needs to recover the data of the volume shrink, the data deleted in the volume shrink process can be recovered by executing a rollback operation on the volume shrink snapshot in the recycle bin.
Fifth embodiment:
the present embodiment also discloses a readable storage medium, where the readable storage medium includes Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art. The readable storage medium stores a volume reduction program of a data volume, which when executed by a processor, performs the steps of:
1. the designated capacity is input, namely the capacity after the data volume is contracted.
2. The object_map of the data volume is traversed.
3. Judging whether data exists in the part of the data volume exceeding the designated capacity, if not, directly carrying out the capacity shrinking operation of the data volume, if so, firstly creating a capacity shrinking snapshot for the data volume, and recording the state before the capacity shrinking of the data volume; filling the volume-shrinking snapshot of the data volume, and filling the data exceeding the specified capacity in the data volume into the snapshot; finally, a flag (RESIZE_SNAP) is added to the volume snapshot of the data volume so that the volume snapshot will only be displayed in the volume recycle bin.
4. When the data recovery of the data volume is carried out, selecting a corresponding data volume snapshot in the recovery station, and carrying out rollback operation on the selected volume snapshot.
In summary, the invention utilizes the volume snapshot technology to improve the fault tolerance of the volume shrinking operation, effectively prevent the loss of data, and further improve the reliability of the volume shrinking operation by combining the recycle bin technology of the volume.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the method disclosed in the embodiment, since it corresponds to the system disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of function in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided herein, it should be understood that the disclosed systems, and methods may be implemented in other ways. For example, the system embodiments described above are merely illustrative, e.g., the division of the elements is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, system or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each module may exist alone physically, or two or more modules may be integrated in one unit.
Similarly, each processing unit in the embodiments of the present invention may be integrated in one functional module, or each processing unit may exist physically, or two or more processing units may be integrated in one functional module.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The method, system, device and readable storage medium for shrinking the volume of data volume provided by the invention are described in detail above. The principles and embodiments of the present invention have been described herein with reference to specific examples, the description of which is intended only to facilitate an understanding of the method of the present invention and its core ideas. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.
Claims (8)
1. A method for shrinking a volume of data, comprising:
setting capacity after capacity shrinking for the data volume, and recording the capacity as specified capacity;
judging whether data exists in the part of the data volume exceeding the designated capacity;
if not, directly carrying out the capacity shrinking operation of the data volume;
if yes, firstly creating a volume shrinkage snapshot of the data volume, and displaying the created volume shrinkage snapshot in a volume recycling station; then carrying out the capacity shrinking operation of the data volume;
when a user needs to recover the data volume of the volume shrink, recovering the deleted data in the process of volume shrink of the data volume by utilizing the volume shrink snapshot in the volume recovery station;
the judging whether the part of the data volume exceeding the designated capacity has data or not specifically comprises the following steps:
judging whether data exists in the part of the data volume exceeding the specified capacity by traversing the object_map of the data volume;
the method for recovering the deleted data in the data volume shrinking process by utilizing the volume shrinking snapshot in the volume recycling station comprises the following steps:
and selecting a volume shrinkage snapshot corresponding to the data volume in the volume recycling station, starting a preset data recovery function to roll back the volume shrinkage snapshot, and recovering the data volume to a state before volume shrinkage.
2. The method for shrinking a volume of a data volume according to claim 1, wherein the creating a snapshot of the volume of the data volume specifically comprises:
creating a volume shrinkage snapshot of the data volume, and recording the state before volume shrinkage of the data volume;
and filling the data exceeding the specified capacity in the data volume into the volume-shrinking snapshot.
3. The method of claim 2, wherein displaying the created volume shrink snapshot in a volume recycle bin comprises:
by adding the reclamation mark restore_snap to the thumbnail snapshot of the data volume, the thumbnail snapshot to which the reclamation mark restore_snap is added is displayed only in the volume reclamation station.
4. The method of claim 1, wherein the displaying the created volume shrink snapshot in a volume recycle bin, further comprises:
and setting the storage time for the volume-shrinking snapshot, and when the storage time of the volume-shrinking snapshot exceeds the storage time, automatically clearing the volume-shrinking snapshot and releasing the storage space in the volume recycling station.
5. The method of volume reduction of a data volume of claim 1, further comprising: when the user carries out the first modification and writing operation on the data volume after the volume reduction, the data in the data volume after the volume reduction is backed up to the volume reduction snapshot, and then the modification and writing operation is carried out.
6. A system for shrinking a volume of data, comprising:
the setting unit is used for setting the capacity of the data volume after the capacity is contracted and recording the capacity as the designated capacity;
a judging unit for judging whether or not there is data in a portion of the data volume exceeding the specified capacity;
the operation unit is used for performing the volume shrinking operation of the data volume;
the volume-shrinking snapshot creation unit is used for creating volume-shrinking snapshots of the data volume and displaying the created volume-shrinking snapshots in the volume recycling station;
the data recovery unit is used for recovering the deleted data in the data volume shrinking process by utilizing the volume shrinking snapshot in the volume recovery station when the user needs to recover the data volume shrinking;
the judging unit is specifically configured to: judging whether data exists in the part of the data volume exceeding the specified capacity by traversing the object_map of the data volume;
the data recovery unit is specifically configured to: and selecting a volume shrinkage snapshot corresponding to the data volume in the volume recycling station, starting a preset data recovery function to roll back the volume shrinkage snapshot, and recovering the data volume to a state before volume shrinkage.
7. A device for shrinking a volume of data, comprising:
a memory for storing a volume reduction program of the data volume;
a processor for implementing the steps of the method for scaling a data volume according to any of claims 1 to 5 when executing the scaling procedure of the data volume.
8. A readable storage medium, characterized by: the readable storage medium has stored thereon a volume reduction program for a data volume, which when executed by a processor, implements the steps of the volume reduction method for a data volume according to any of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111342925.0A CN114138188B (en) | 2021-11-12 | 2021-11-12 | Method, system and device for shrinking volume of data volume and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111342925.0A CN114138188B (en) | 2021-11-12 | 2021-11-12 | Method, system and device for shrinking volume of data volume and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114138188A CN114138188A (en) | 2022-03-04 |
CN114138188B true CN114138188B (en) | 2023-08-25 |
Family
ID=80393773
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111342925.0A Active CN114138188B (en) | 2021-11-12 | 2021-11-12 | Method, system and device for shrinking volume of data volume and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114138188B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109445713A (en) * | 2018-11-09 | 2019-03-08 | 郑州云海信息技术有限公司 | A kind of storage state recording method, system and the associated component of metadata volume |
CN109614226A (en) * | 2018-11-20 | 2019-04-12 | 武汉烽火信息集成技术有限公司 | A kind of stateful application memory management method based on Kubernetes |
CN111984469A (en) * | 2020-08-07 | 2020-11-24 | 苏州浪潮智能科技有限公司 | Incremental snapshot capacity expansion method and device |
CN112269546A (en) * | 2020-10-23 | 2021-01-26 | 苏州浪潮智能科技有限公司 | Mirror image volume reduction method and related device |
CN112269531A (en) * | 2020-10-10 | 2021-01-26 | 苏州浪潮智能科技有限公司 | Source roll capacity reduction method, device, equipment and medium |
-
2021
- 2021-11-12 CN CN202111342925.0A patent/CN114138188B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109445713A (en) * | 2018-11-09 | 2019-03-08 | 郑州云海信息技术有限公司 | A kind of storage state recording method, system and the associated component of metadata volume |
CN109614226A (en) * | 2018-11-20 | 2019-04-12 | 武汉烽火信息集成技术有限公司 | A kind of stateful application memory management method based on Kubernetes |
CN111984469A (en) * | 2020-08-07 | 2020-11-24 | 苏州浪潮智能科技有限公司 | Incremental snapshot capacity expansion method and device |
CN112269531A (en) * | 2020-10-10 | 2021-01-26 | 苏州浪潮智能科技有限公司 | Source roll capacity reduction method, device, equipment and medium |
CN112269546A (en) * | 2020-10-23 | 2021-01-26 | 苏州浪潮智能科技有限公司 | Mirror image volume reduction method and related device |
Also Published As
Publication number | Publication date |
---|---|
CN114138188A (en) | 2022-03-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105630632B (en) | The method and virtual machine administration device that a kind of virtual machine recovers | |
CN102411523B (en) | Method and device for storing file backups and backup method for file systems | |
CN102902762B (en) | A kind of methods, devices and systems of deleting duplicated data | |
CN113886143B (en) | Virtual machine continuous data protection method and device and data recovery method and device | |
US10509767B2 (en) | Systems and methods for managing snapshots of a file system volume | |
CN113626256A (en) | Virtual machine disk data backup method, device, terminal and storage medium | |
CN113190384B (en) | Data recovery control method, device, equipment and medium based on erasure codes | |
CN104965835B (en) | A kind of file read/write method and device of distributed file system | |
CN112380067A (en) | Metadata-based big data backup system and method under Hadoop environment | |
CN114138549A (en) | Data backup and recovery method based on kubernets system | |
CN112925759A (en) | Data file processing method and device, storage medium and electronic device | |
CN110865903B (en) | Node abnormal reconnection multiplexing method and system based on erasure code distributed storage | |
CN102567472B (en) | Built-in database based high-efficient data deleting and restoring method | |
CN115328704A (en) | File backup method, file recovery method, device, equipment and storage medium | |
EP3449372B1 (en) | Fault-tolerant enterprise object storage system for small objects | |
CN110941591A (en) | File deletion method, device and equipment and readable storage medium | |
CN103744751A (en) | Storage device configuration information continuous optimization backup system and application method thereof | |
CN114138188B (en) | Method, system and device for shrinking volume of data volume and readable storage medium | |
CN108959614A (en) | A kind of snapshot management method, system, device, equipment and readable storage medium storing program for executing | |
CN105278877A (en) | Object storage method and device | |
CN103645967B (en) | A kind of read-only materialized view rollback method and device | |
CN109669815A (en) | A kind of method and system restored by the long-range Mapping implementation Backup Data of LUN | |
CN110515769A (en) | A kind of backup processing method, device and electronic equipment and readable storage medium storing program for executing | |
CN115905114A (en) | Batch updating method and system of metadata, electronic equipment and readable storage medium | |
CN114003172B (en) | Storage capacity correction method, storage capacity correction device, computer equipment and storage medium |
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 |