CN112269531B - Source roll capacity reduction method, device, equipment and medium - Google Patents

Source roll capacity reduction method, device, equipment and medium Download PDF

Info

Publication number
CN112269531B
CN112269531B CN202011079507.2A CN202011079507A CN112269531B CN 112269531 B CN112269531 B CN 112269531B CN 202011079507 A CN202011079507 A CN 202011079507A CN 112269531 B CN112269531 B CN 112269531B
Authority
CN
China
Prior art keywords
data
source volume
deleted
volume
snapshot
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011079507.2A
Other languages
Chinese (zh)
Other versions
CN112269531A (en
Inventor
王鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202011079507.2A priority Critical patent/CN112269531B/en
Publication of CN112269531A publication Critical patent/CN112269531A/en
Application granted granted Critical
Publication of CN112269531B publication Critical patent/CN112269531B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method, a device, equipment and a medium for shrinking a source volume in a storage snapshot, wherein the method comprises the following steps: changing the data copying sequence from the source volume to the target volume in the storage snapshot into data copying from the last position data in the source volume to the forward direction; when a source volume capacity reduction instruction is acquired, judging whether bitmap data corresponding to-be-deleted block data corresponding to the source volume capacity reduction instruction is first bitmap data or not, wherein the first bitmap data represents that the to-be-deleted block data is copied from a source volume to a target volume; if the bitmap data corresponding to the block data to be deleted is first bitmap data, deleting the block data to be deleted in the source volume so as to reduce the volume of the source volume; and deleting the bitmap data corresponding to the block data to be deleted, and marking the storage snapshot as a contracted capacity. Therefore, the original volume can be reduced, the purpose of using the snapshot to protect the data can be achieved, and the system performance is not influenced.

Description

Source roll capacity reduction method, device, equipment and medium
Technical Field
The present application relates to the field of storage technologies, and in particular, to a method, an apparatus, a device, and a medium for source volume reduction in a storage snapshot.
Background
Snapshot is a point-in-time based data protection technique. When a snapshot is created for a volume, the target volume in the snapshot relationship has the same data in the source volume at the time the snapshot was created. When the data of the source volume is modified, the data in the target volume still remains unchanged, so that the purpose of protecting the data is achieved.
The volume reduction technology can reduce the volume of an existing volume, thereby achieving the purpose of releasing the storage space. A prerequisite for a snapshot relationship to be created between two volumes is that the capacities of the two volumes must be equally large. After creating the snapshot relationship, the storage system generates a bitmap for managing the snapshot relationship. A bitmap (bitmap) is used to manage an array structure of operations to copy data from a source volume to a target volume in a snapshot relationship. Each element in the array is 1bit in size and is used to mark whether a block of fixed-size (e.g., 256 KB) data in the source volume has been copied from the source volume to the target volume. If the bitmap is copied, setting the bit corresponding to the bitmap to be 1, and if the bitmap is copied, setting the bitmap to be 0.
When creating the snapshot relationship, if the source volume performs a capacity reduction operation, the data of the reduced area is discarded, and if the data of the reduced area is not copied to the target volume, the data of the target volume and the source volume are inconsistent. In addition, the data copy operation of the snapshot is based on the bitmap, when the source volume is subjected to capacity reduction, the size of the bitmap is not changed, bit of some bitmaps does not have corresponding disk spaces in the source volume, and the background copy operation is caused to have problems, so that the purpose of using the snapshot to protect the data cannot be achieved, the capacity reduction of the source volume is difficult, and the system performance is influenced.
Disclosure of Invention
In view of this, an object of the present application is to provide a method, an apparatus, a device, and a medium for capacity reduction of a source volume in a storage snapshot, which can perform capacity reduction on the source volume in the storage snapshot, and achieve the purpose of protecting data using the snapshot, without affecting system performance. The specific scheme is as follows:
in a first aspect, the present application discloses a method for source volume capacity reduction in a storage snapshot, including:
the data copying sequence from the source volume to the target volume in the storage snapshot is changed into data copying from the last position data in the source volume to the front;
when a source volume capacity reduction instruction is acquired, judging whether bitmap data corresponding to-be-deleted block data corresponding to the source volume capacity reduction instruction is first bitmap data or not, wherein the first bitmap data represents that the to-be-deleted block data is copied from a source volume to a target volume;
if the bitmap data corresponding to the block data to be deleted is first bitmap data, deleting the block data to be deleted in the source volume so as to reduce the volume of the source volume;
deleting the bitmap data corresponding to the block data to be deleted, and marking the storage snapshot as a contracted volume.
Optionally, before determining whether bitmap data corresponding to-be-deleted block data corresponding to the source volume reduction instruction is first bitmap data, the method further includes:
judging whether the host computer is performing data read-write operation on the source volume;
if the host computer is performing data read-write operation on the source volume, suspending the data read-write operation;
correspondingly, after the step of marking the storage snapshot as being condensed, the method further includes:
and recovering the data read-write operation.
Optionally, before determining whether bitmap data corresponding to-be-deleted block data corresponding to the source volume reduction instruction is first bitmap data, the method further includes:
judging whether a background has data copy operation from the source volume to the target volume;
and if the data copy operation from the source volume to the target volume does not exist in the background, controlling the background to start the data copy operation from the source volume to the target volume.
Optionally, after the marking the storage snapshot as condensed capacity, the method further includes:
and updating the snapshot progress of the storage snapshot.
Optionally, the updating the snapshot progress of the storage snapshot includes:
determining the ratio of the number of the first bitmap data in the bitmap data corresponding to the reduced source volume to the total number of the bitmap data corresponding to the reduced source volume as the new progress of the stored snapshot;
and updating the snapshot progress of the storage snapshot by using the new progress of the storage snapshot.
Optionally, after the marking the storage snapshot as condensed capacity, the method further includes:
and when a snapshot restart instruction corresponding to the stored snapshot is acquired, returning snapshot restart failure information and snapshot re-creation prompt information.
Optionally, after determining whether the bitmap data corresponding to the to-be-deleted block data corresponding to the source volume reduction instruction is the first bitmap data, the method further includes:
if the bitmap data corresponding to the block data to be deleted corresponding to the source volume capacity reduction instruction is second bitmap data, copying the data block to be deleted from the source volume to the target volume, wherein the second bitmap data represents that the block data to be deleted has not been copied from the source volume to the target volume;
and deleting the data to be deleted in the source volume.
In a second aspect, the present application discloses a source volume capacity reduction apparatus in a storage snapshot, including:
the information modification module is used for modifying the data copying sequence from the source volume to the target volume in the storage snapshot into data copying from the last position data in the source volume to the forward direction;
the system comprises a judging module and a processing module, wherein the judging module is used for judging whether bitmap data corresponding to-be-deleted block data corresponding to a source volume capacity reduction instruction is first bitmap data or not when the source volume capacity reduction instruction is acquired, and the first bitmap data represents that the to-be-deleted block data is copied from a source volume to a target volume;
a first data deleting module, configured to delete the to-be-deleted block data in the source volume to perform capacity reduction on the source volume when the bitmap data corresponding to the to-be-deleted block data is first bitmap data;
the second data deleting module is used for deleting the bitmap data corresponding to the block data to be deleted;
and the information marking module is used for marking the storage snapshot as the contracted volume.
In a third aspect, the present application discloses an electronic device, comprising:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the source volume capacity reduction method in the storage snapshot disclosed above.
In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the source volume capacity reduction method in a storage snapshot disclosed in the foregoing.
Therefore, the data copying sequence from the source volume to the target volume in the storage snapshot is firstly changed into data copying from the last position data in the source volume to the front; when a source volume capacity reduction instruction is acquired, judging whether bitmap data corresponding to-be-deleted block data corresponding to the source volume capacity reduction instruction is first bitmap data or not, wherein the first bitmap data represents that the to-be-deleted block data is copied from a source volume to a target volume; if the bitmap data corresponding to the block data to be deleted is first bitmap data, deleting the block data to be deleted in the source volume so as to reduce the volume of the source volume; and deleting the bitmap data corresponding to the block data to be deleted, and marking the storage snapshot as a contracted capacity. Because the position where data is not written is preferentially deleted during volume contraction, data written to the volume in real service is usually written from front to back, that is, the more the area at the back position in the source volume is, the more likely no data exists, the more likely the data is deleted during contraction. The data copying sequence from the source volume to the target volume in the storage snapshot is firstly changed into data copying from the last position data in the source volume, so that the probability that the data at the deleted position is stored in the target volume when the source volume is reduced is higher, the time consumed for copying the data to be deleted to the target volume is reduced, when a source volume capacity reduction instruction is received, whether the data to be deleted in the source volume corresponding to the source volume capacity reduction instruction is copied from the source volume to the target volume is judged, and the data to be deleted in the source volume is deleted when the fast data to be deleted is copied from the source volume to the target volume, so that the data deleted in the source volume reduction process can be stored in the target volume, the purpose of protecting the data in the source volume by using the snapshot is achieved, and the bitmap data corresponding to the data to be deleted in the bitmap data are deleted after the data to be deleted in the source volume is deleted, so that the bitmap data can have corresponding spaces in the source volume, disk error performance is prevented from being influenced when the data to be deleted in the source volume is copied, and a background system can not be influenced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only the embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a method for source volume capacity reduction in storage snapshots disclosed herein;
FIG. 2 is a flowchart of a particular method for source volume reduction in storage snapshots disclosed herein;
FIG. 3 is a schematic structural diagram of a source volume capacity reduction apparatus in a storage snapshot disclosed in the present application;
fig. 4 is a schematic structural diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, an embodiment of the present application discloses a method for reducing a volume of a source volume in a storage snapshot, where the method includes:
step S11: and modifying the data copying sequence from the source volume to the target volume in the storage snapshot into data copying from the last position data in the source volume to the forward direction.
In a specific implementation process, the data copying sequence from the source volume to the target volume in the storage snapshot needs to be modified to data copying from the last position data in the source volume to the forward direction.
In volume capacity reduction, the position where data is not written is preferentially deleted, while in actual service, data written to a volume is mostly written from front to back, that is, the more backward area in the source volume is, the more likely there is no data, and the more likely it is deleted in capacity reduction. In order to ensure consistency of snapshot data, when the source volume is deleted some data, the data should be copied to the target volume before being deleted. In view of the above, it is desirable to modify the background copy of snapshots. The original way is to read data from the start location of the source volume according to the bitmap and then copy to the target volume. The modification is to read data forward from the last location of the source volume as a bitmap and then copy to the target volume. Therefore, the data at the later position of the source volume is preferentially copied to the target volume, and if the source volume capacity reduction operation is executed at the moment, the time for copying the deleted data to the target volume is greatly reduced.
Step S12: when a source volume reduction instruction is acquired, judging whether bitmap data corresponding to-be-deleted block data corresponding to the source volume reduction instruction is first bitmap data, wherein the first bitmap data represents that the to-be-deleted block data is copied from the source volume to the target volume.
When a source volume reduction instruction is acquired, it needs to be determined whether bitmap data corresponding to block data to be deleted corresponding to the source volume reduction instruction is first bitmap data, where the first bitmap data indicates that the block data to be deleted has been copied from the source volume to the target volume, and the first bitmap data may be specifically 1.
Step S13: and if the bitmap data corresponding to the block data to be deleted is the first bitmap data, deleting the block data to be deleted in the source volume so as to reduce the volume of the source volume.
It can be understood that, if the bitmap data corresponding to the block data to be deleted is the first bitmap data, the block data to be deleted in the source volume is deleted, so as to perform capacity reduction on the source volume.
If the bitmap data corresponding to the block data to be deleted is the first bitmap data, it indicates that the block data to be deleted has been copied from the source volume to the target volume, so that the block data to be deleted in the source volume can be deleted, so as to achieve the purpose of performing capacity reduction on the source volume.
That is, when the source volume needs to be reduced, it needs to first determine whether the block data to be deleted in the reduced volume space has been copied to the target volume, and when the block data to be deleted has been copied from the source volume to the target volume, the block data to be deleted in the source volume can be deleted. Therefore, the deleted data can be guaranteed to be stored in the target volume, and the purpose of creating the snapshot to protect the data in the source volume is achieved.
Step S14: deleting the bitmap data corresponding to the block data to be deleted, and marking the storage snapshot as a contracted volume.
After the block data to be transmitted in the source volume is deleted, the bitmap data corresponding to the block data to be deleted is also deleted, and the storage snapshot is marked as a contracted capacity.
After the block data to be deleted in the source volume is deleted, the bitmap data corresponding to the block data to be deleted does not have a corresponding storage space in the source volume, so that the bitmap data corresponding to the block data to be deleted needs to be deleted, and the problem of background copy operation caused by the fact that bit bits of certain bitmap data do not have a disk space corresponding to the source volume is avoided.
Therefore, the data copying sequence from the source volume to the target volume in the storage snapshot is firstly changed into the data copying from the last position data in the source volume to the forward direction; when a source volume capacity reduction instruction is acquired, judging whether bitmap data corresponding to-be-deleted block data corresponding to the source volume capacity reduction instruction is first bitmap data or not, wherein the first bitmap data represents that the to-be-deleted block data is copied from a source volume to a target volume; if the bitmap data corresponding to the block data to be deleted is first bitmap data, deleting the block data to be deleted in the source volume so as to reduce the volume of the source volume; and deleting the bitmap data corresponding to the block data to be deleted, and marking the storage snapshot as a contracted capacity. Because the position where data is not written is preferentially deleted during volume contraction, data written to the volume in real service is usually written from front to back, that is, the more the area at the back position in the source volume is, the more likely no data exists, the more likely the data is deleted during contraction. The data copying sequence from the source volume to the target volume in the storage snapshot is firstly changed into data copying from the last position data in the source volume, so that the probability that the data at the deleted position is stored in the target volume when the source volume is reduced is higher, the time consumed for copying the data to be deleted to the target volume is reduced, when a source volume capacity reduction instruction is received, whether the data to be deleted in the source volume corresponding to the source volume capacity reduction instruction is copied from the source volume to the target volume is judged, and the data to be deleted in the source volume is deleted when the fast data to be deleted is copied from the source volume to the target volume, so that the data deleted in the source volume reduction process can be stored in the target volume, the purpose of protecting the data in the source volume by using the snapshot is achieved, and the bitmap data corresponding to the data to be deleted in the bitmap data are deleted after the data to be deleted in the source volume is deleted, so that the bitmap data can have corresponding spaces in the source volume, disk error performance is prevented from being influenced when the data to be deleted in the source volume is copied, and a background system can not be influenced.
Referring to fig. 2, an embodiment of the present application discloses a specific method for source volume capacity reduction in a storage snapshot, where the method includes:
step S21: and modifying the data copying sequence from the source volume to the target volume in the storage snapshot into data copying from the last position data in the source volume to the front.
Step S22: when a source volume capacity reduction instruction is acquired, judging whether bitmap data corresponding to-be-deleted block data corresponding to the source volume capacity reduction instruction is first bitmap data, wherein the first bitmap data represents that the to-be-deleted block data is copied from the source volume to the target volume.
When a source volume reduction instruction is acquired, judging whether bitmap data corresponding to-be-deleted block data corresponding to the source volume reduction instruction is first bitmap data or not so as to determine whether to directly delete the to-be-deleted block data or not.
In a specific implementation process, before determining whether bitmap data corresponding to-be-deleted block data corresponding to the source volume reduction instruction is first bitmap data, the method further includes: judging whether the host computer is performing data read-write operation on the source volume; and if the host is performing data read-write operation on the source volume, suspending the data read-write operation. That is, before starting to perform capacity reduction on the source volume, it needs to first determine whether the source volume has host IO (Input/Output), and if so, suspend the host IO.
In practical application, before determining whether bitmap data corresponding to-be-deleted block data corresponding to the source volume reduction instruction is first bitmap data, the method further includes: judging whether a background has data copy operation from the source volume to the target volume; and if the data copy operation from the source volume to the target volume does not exist in the background, controlling the background to start the data copy operation from the source volume to the target volume. If the snapshot has a background copy operation, the snapshot does not need to be disabled, and the background copy does not conflict with the source volume. If not, the background copy operation can be started, so that the changed background copy mode can be matched, and the volume reduction speed of the source volume is greatly improved.
Step S23: and if the bitmap data corresponding to the block data to be deleted is the first bitmap data, deleting the block data to be deleted in the source volume so as to reduce the volume of the source volume.
It can be understood that, when the bitmap data corresponding to the block data to be deleted is the first bitmap data, the block data to be deleted in the source volume may be deleted, so as to perform capacity reduction on the source volume.
If the bitmap data corresponding to the block data to be deleted corresponding to the source volume capacity reduction instruction is second bitmap data, copying the data block to be deleted from the source volume to the target volume, wherein the second bitmap data represents that the block data to be deleted has not been copied from the source volume to the target volume; and deleting the data to be deleted in the source volume. Wherein the second bitmap data may be 0.
Step S24: deleting the bitmap data corresponding to the block data to be deleted, and marking the storage snapshot as a contracted volume.
If the source volume has host IO when starting to perform source volume reduction, suspending the host IO first, and accordingly after marking the storage snapshot as reduced, further including: and recovering the data read-write operation.
Step S25: and updating the snapshot progress of the storage snapshot.
After marking the source volume as condensed, the snapshot progress of the storage snapshot also needs to be updated. Specifically, the ratio of the number of the first bitmap data in the bitmap data corresponding to the reduced source volume to the total number of the bitmap data corresponding to the reduced source volume is determined as the new progress of the stored snapshot; and updating the snapshot progress of the storage snapshot by using the new progress of the storage snapshot. For example, the bitmap data corresponding to the reduced source volume is 100 bitmap data in total, wherein the bitmap data includes 50 first bitmap data, and the new progress of storing the snapshot is 50%.
Step S26: and when a snapshot restart instruction corresponding to the stored snapshot is acquired, returning snapshot restart failure information and snapshot re-creation prompt information.
It is also desirable to mark the storage snapshot as being condensed in order to distinguish it from unshrinded snapshots. The normal unshrinkable snapshot can be restarted after the copying is completed, and the data in the target volume can be updated to the data in the source volume at the current moment when the snapshot is restarted. The capacity of the original volume is reduced, but the capacity of the target volume is not changed, so that the capacities of the two volumes are inconsistent, and the snapshot cannot be started again after being copied. Therefore, when a user starts a snapshot, the system can detect whether the snapshot is marked as contracted capacity or not, and if the snapshot is marked, the system can remind the user of failed starting. If the user needs to snapshot the scaled source volume again, a new snapshot needs to be created again.
Specifically, after the storage snapshot is marked as the contracted volume, when a snapshot restart instruction corresponding to the storage snapshot is acquired, snapshot restart failure information and snapshot re-creation prompt information are returned.
Referring to fig. 3, an embodiment of the present application discloses a source volume capacity reduction apparatus in a storage snapshot, including:
the information modification module 11 is configured to modify a data copy sequence from the source volume to the target volume in the storage snapshot to data copy from the last position data in the source volume to the previous position;
a determining module 12, configured to determine, when a source volume scaling instruction is obtained, whether bitmap data corresponding to block data to be deleted corresponding to the source volume scaling instruction is first bitmap data, where the first bitmap data indicates that the block data to be deleted has been copied from the source volume to the target volume;
a first data deleting module 13, configured to delete the to-be-deleted block data in the source volume to perform capacity reduction on the source volume when the bitmap data corresponding to the to-be-deleted block data is first bitmap data;
the second data deleting module 14 is configured to delete the bitmap data corresponding to the block data to be deleted;
and an information marking module 15, configured to mark the storage snapshot as a contracted volume.
Therefore, the data copying sequence from the source volume to the target volume in the storage snapshot is firstly changed into the data copying from the last position data in the source volume to the forward direction; when a source volume capacity reduction instruction is acquired, judging whether bitmap data corresponding to-be-deleted block data corresponding to the source volume capacity reduction instruction is first bitmap data or not, wherein the first bitmap data represents that the to-be-deleted block data is copied from a source volume to a target volume; if the bitmap data corresponding to the block data to be deleted is first bitmap data, deleting the block data to be deleted in the source volume so as to reduce the volume of the source volume; deleting the bitmap data corresponding to the block data to be deleted, and marking the storage snapshot as a contracted volume. Because the position where data is not written is preferentially deleted during volume contraction, data written to the volume in real service is usually written from front to back, that is, the more the area at the back position in the source volume is, the more likely no data exists, the more likely the data is deleted during contraction. The data copying sequence from the source volume to the target volume in the storage snapshot is firstly changed into data copying from the last position data in the source volume, so that the probability that the data at the deleted position is stored in the target volume when the source volume is reduced is higher, the time consumed for copying the data to be deleted to the target volume is reduced, when a source volume capacity reduction instruction is received, whether the data to be deleted in the source volume corresponding to the source volume capacity reduction instruction is copied from the source volume to the target volume is judged, and the data to be deleted in the source volume is deleted when the fast data to be deleted is copied from the source volume to the target volume, so that the data deleted in the source volume reduction process can be stored in the target volume, the purpose of protecting the data in the source volume by using the snapshot is achieved, and the bitmap data corresponding to the data to be deleted in the bitmap data are deleted after the data to be deleted in the source volume is deleted, so that the bitmap data can have corresponding spaces in the source volume, disk error performance is prevented from being influenced when the data to be deleted in the source volume is copied, and a background system can not be influenced.
Specifically, the determining module 12 is further configured to:
judging whether the host computer is performing data read-write operation on the source volume;
if the host computer is performing data read-write operation on the source volume, suspending the data read-write operation;
correspondingly, the snapshot storage capacity reduction device further comprises:
and the reading operation recovery module is used for recovering the data reading and writing operation after the storage snapshot is marked as the reduced capacity.
Specifically, the determining module 12 is further configured to:
judging whether a background has data copy operation from the source volume to the target volume;
and if the data copy operation from the source volume to the target volume does not exist in the background, controlling the background to start the data copy operation from the source volume to the target volume.
Further, the apparatus for storing snapshot capacity reduction further includes:
and the progress updating module is used for updating the snapshot progress of the storage snapshot.
Specifically, the progress updating module is configured to determine a ratio of the number of the first bitmap data in the bitmap data corresponding to the reduced volume source volume to the total number of the bitmap data corresponding to the reduced volume source volume as a new progress of the snapshot storage; and updating the snapshot progress of the storage snapshot by using the new progress of the storage snapshot.
Further, the apparatus for storing snapshot capacity reduction further includes:
and the information sending module is used for returning snapshot restart failure information and snapshot recreating prompt information when a snapshot restart instruction corresponding to the stored snapshot is acquired.
Further, the snapshot storage capacity reduction apparatus further includes:
a data copying module, configured to copy, when bitmap data corresponding to-be-deleted block data corresponding to the source volume capacity reduction instruction is second bitmap data, the to-be-deleted block data from the source volume to the target volume, where the second bitmap data indicates that the to-be-deleted block data has not been copied from the source volume to the target volume;
correspondingly, the first data deleting module 13 is configured to delete the data to be deleted in the source volume.
Referring to fig. 4, a schematic structural diagram of an electronic device 20 provided in the embodiment of the present application is shown, where the electronic device 20 may implement the steps of the source volume reduction method in the storage snapshot disclosed in the foregoing embodiment.
In general, the electronic device 20 in the present embodiment includes: a processor 21 and a memory 22.
The processor 21 may include one or more processing cores, such as a four-core processor, an eight-core processor, and so on. The processor 21 may be implemented by at least one hardware of a DSP (digital signal processing), an FPGA (field-programmable gate array), and a PLA (programmable logic array). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a GPU (graphics processing unit) which is responsible for rendering and drawing images to be displayed on the display screen. In some embodiments, the processor 21 may include an AI (artificial intelligence) processor for processing a calculation operation related to machine learning.
Memory 22 may include one or more computer-readable storage media, which may be non-transitory. Memory 22 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 22 is at least used for storing the following computer program 221, wherein after being loaded and executed by the processor 21, the computer program can implement the steps of the source volume capacity reduction method in the storage snapshot disclosed in any one of the foregoing embodiments.
In some embodiments, the electronic device 20 may further include a display 23, an input/output interface 24, a communication interface 25, a sensor 26, a power supply 27, and a communication bus 28.
Those skilled in the art will appreciate that the configuration shown in FIG. 4 is not limiting to electronic device 20 and may include more or fewer components than those shown.
Further, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program, where the computer program is executed by a processor to implement the source volume capacity reduction method in the storage snapshot disclosed in any of the foregoing embodiments.
For a specific process of the source volume contraction method in the storage snapshot, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not described here again.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
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. A software module may reside 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, herein, relational terms such as first and second, and the like may be 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. Also, 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 other 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 a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The source volume capacity reduction method, apparatus, device, and medium in the storage snapshot provided by the present application are introduced in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understanding the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for source volume capacity reduction in a storage snapshot, comprising:
changing the data copying sequence from the source volume to the target volume in the storage snapshot into data copying from the last position data in the source volume to the forward direction;
when a source volume capacity reduction instruction is acquired, judging whether bitmap data corresponding to-be-deleted block data corresponding to the source volume capacity reduction instruction is first bitmap data or not, wherein the first bitmap data represents that the to-be-deleted block data is copied from a source volume to a target volume;
if the bitmap data corresponding to the block data to be deleted is first bitmap data, deleting the block data to be deleted in the source volume so as to reduce the capacity of the source volume;
deleting the bitmap data corresponding to the block data to be deleted, and marking the storage snapshot as a contracted volume.
2. The method according to claim 1, wherein before determining whether bitmap data corresponding to block data to be deleted corresponding to the source volume reduction instruction is first bitmap data, the method further comprises:
judging whether the host computer is performing data read-write operation on the source volume;
if the host computer is performing data read-write operation on the source volume, suspending the data read-write operation;
correspondingly, after the step of marking the storage snapshot as being condensed, the method further includes:
and recovering the data read-write operation.
3. The method according to claim 1, wherein before determining whether bitmap data corresponding to block data to be deleted corresponding to the source volume reduction instruction is first bitmap data, the method further comprises:
judging whether a background has data copy operation from the source volume to the target volume;
and if the data copy operation from the source volume to the target volume does not exist in the background, controlling the background to start the data copy operation from the source volume to the target volume.
4. The method of claim 1, wherein after marking the storage snapshot as condensed, further comprising:
and updating the snapshot progress of the storage snapshot.
5. The method according to claim 4, wherein the updating the snapshot progress of the storage snapshot comprises:
determining the ratio of the number of the first bitmap data in the bitmap data corresponding to the reduced source volume to the total number of the bitmap data corresponding to the reduced source volume as the new progress of the stored snapshot;
and updating the snapshot progress of the storage snapshot by using the new progress of the storage snapshot.
6. The method of claim 1, wherein after marking the storage snapshot as condensed, further comprising:
and when a snapshot restart instruction corresponding to the stored snapshot is acquired, returning snapshot restart failure information and snapshot re-creation prompt information.
7. The method according to any one of claims 1 to 6, wherein after determining whether bitmap data corresponding to block data to be deleted corresponding to the source volume reduction instruction is first bitmap data, the method further comprises:
copying the block data to be deleted from the source volume to the target volume if the bitmap data corresponding to the block data to be deleted corresponding to the source volume capacity reduction instruction is second bitmap data, wherein the second bitmap data represents that the block data to be deleted has not been copied from the source volume to the target volume;
and deleting the block data to be deleted in the source volume.
8. A source volume reduction apparatus in a storage snapshot, comprising:
the information modification module is used for modifying the data copying sequence from the source volume to the target volume in the storage snapshot into data copying from the last position data in the source volume to the forward direction;
the system comprises a judging module and a processing module, wherein the judging module is used for judging whether bitmap data corresponding to-be-deleted block data corresponding to a source volume capacity reduction instruction is first bitmap data or not when the source volume capacity reduction instruction is acquired, and the first bitmap data represents that the to-be-deleted block data is copied from a source volume to a target volume;
a first data deleting module, configured to delete the to-be-deleted block data in the source volume to perform capacity reduction on the source volume when the bitmap data corresponding to the to-be-deleted block data is first bitmap data;
the second data deleting module is used for deleting the bitmap data corresponding to the block data to be deleted;
and the information marking module is used for marking the storage snapshot as the contracted volume.
9. An electronic device, comprising:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor, configured to execute the computer program to implement the source volume reduction method in the storage snapshot of any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements a source volume capacity reduction method in a storage snapshot as claimed in any one of claims 1 to 7.
CN202011079507.2A 2020-10-10 2020-10-10 Source roll capacity reduction method, device, equipment and medium Active CN112269531B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011079507.2A CN112269531B (en) 2020-10-10 2020-10-10 Source roll capacity reduction method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011079507.2A CN112269531B (en) 2020-10-10 2020-10-10 Source roll capacity reduction method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN112269531A CN112269531A (en) 2021-01-26
CN112269531B true CN112269531B (en) 2023-01-10

Family

ID=74338814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011079507.2A Active CN112269531B (en) 2020-10-10 2020-10-10 Source roll capacity reduction method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112269531B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138188B (en) * 2021-11-12 2023-08-25 苏州浪潮智能科技有限公司 Method, system and device for shrinking volume of data volume and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1658168A (en) * 2004-02-19 2005-08-24 华为技术有限公司 Method for writing data on source film in pistolgraph process
CN105224422A (en) * 2015-10-20 2016-01-06 浙江大华技术股份有限公司 A kind of data back up method and equipment
CN106844597A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 The method and its device of a kind of quick deletion dependent snapshot target volume
CN110287064A (en) * 2019-07-02 2019-09-27 成都易我科技开发有限责任公司 A kind of restoring method of data in magnetic disk, device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1658168A (en) * 2004-02-19 2005-08-24 华为技术有限公司 Method for writing data on source film in pistolgraph process
CN105224422A (en) * 2015-10-20 2016-01-06 浙江大华技术股份有限公司 A kind of data back up method and equipment
CN106844597A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 The method and its device of a kind of quick deletion dependent snapshot target volume
CN110287064A (en) * 2019-07-02 2019-09-27 成都易我科技开发有限责任公司 A kind of restoring method of data in magnetic disk, device and electronic equipment

Also Published As

Publication number Publication date
CN112269531A (en) 2021-01-26

Similar Documents

Publication Publication Date Title
US8266365B2 (en) Ruggedized memory device
KR101636870B1 (en) Method and apparatus for generating minimal boot image
JP4385215B2 (en) Disk array device having snapshot simulation function
US8219767B2 (en) Information processing apparatus and data recovering method
US20110093437A1 (en) Method and system for generating a space-efficient snapshot or snapclone of logical disks
US11030092B2 (en) Access request processing method and apparatus, and computer system
JP2006268139A (en) Data reproduction device, method and program and storing system
JP2009157756A (en) Information processing apparatus and data recovering method
KR20170125698A (en) Generalized write operations verification method
CN109213450B (en) Associated metadata deleting method, device and equipment based on flash memory array
CN112269531B (en) Source roll capacity reduction method, device, equipment and medium
CN111651239A (en) Virtual machine cloning method, device, equipment and medium
US7257030B2 (en) Operating a storage component
CN111597066A (en) SSD (solid State disk) repairing method and device, computer equipment and storage medium
CN110515769A (en) A kind of backup processing method, device and electronic equipment and readable storage medium storing program for executing
CN107257281B (en) Method, apparatus and computer readable storage medium for NOR F L ASH storage key record
JPH11194938A (en) Memory managing method for computer having hard disk drive
JP3082344B2 (en) Disk file control device and update method
US7536507B1 (en) Methods, systems, and computer program products for preserving atomic writes using leaves and bitmaps
CN112463047A (en) Data migration and recovery method and related device
CN107357536B (en) Data modification and writing method and system for distributed storage system
JP2003150441A (en) Data management method, device thereof, data management program, and storage medium storing data management program
CN113742134A (en) Volume curling method and device and related equipment
JP5161600B2 (en) Information processing apparatus and data recovery method
JP2000112836A (en) Information processor, information storing method, 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