CN110515553B - Volume deleting method and device - Google Patents

Volume deleting method and device Download PDF

Info

Publication number
CN110515553B
CN110515553B CN201910780499.5A CN201910780499A CN110515553B CN 110515553 B CN110515553 B CN 110515553B CN 201910780499 A CN201910780499 A CN 201910780499A CN 110515553 B CN110515553 B CN 110515553B
Authority
CN
China
Prior art keywords
volume
deletion
metadata
command
deleting
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
CN201910780499.5A
Other languages
Chinese (zh)
Other versions
CN110515553A (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 CN201910780499.5A priority Critical patent/CN110515553B/en
Publication of CN110515553A publication Critical patent/CN110515553A/en
Application granted granted Critical
Publication of CN110515553B publication Critical patent/CN110515553B/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/0614Improving the reliability of storage systems
    • 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/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • 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
    • G06F3/0676Magnetic disk device

Abstract

The embodiment of the application discloses a volume deleting method and equipment, wherein the method comprises the following steps: receiving a volume deleting command, and determining metadata corresponding to a volume according to the volume corresponding to the volume deleting command; then canceling the execution of the volume deleting command, triggering a metadata interface corresponding to the volume, and deleting the metadata; verifying the deletion state of the volume, calling back a volume deletion command after the metadata is deleted, restarting the volume deletion command, and deleting the volume. After receiving the volume deleting command, the volume deleting command is not immediately executed, but the metadata corresponding to the volume is triggered, after the metadata is successfully deleted, the volume deleting command is called back, then the volume deleting command is restarted, and the volume is deleted, so that the volume is deleted after the metadata is deleted, and the problems that the metadata is not deleted after the volume is deleted, the undeleted metadata occupies the disk space and causes state conflict to the subsequently created volume are avoided.

Description

Volume deleting method and device
Technical Field
The present application relates to the field of storage technologies, and in particular, to a volume deletion method and device.
Background
During data storage, a large amount of metadata, also referred to as data, is generated. The volume refers to a storage area on a hard disk similar to a disk partition, when data is stored in the volume, the data can be directly seen as a document, a picture, a video or the like, the data is data per se, data related to the data, which is generated along with data storage in a file system, cannot be directly seen, such as path information, address information and the like in the file system, and the data is called metadata of the document, the picture, the video and the like in a shared volume.
The metadata occupies the disk space, and the user needs to delete the volume and the corresponding metadata during the use process. However, the metadata data volume is large, the deletion takes a long time, the command behavior is executed sequentially and is provided with a time-out mechanism, and once the time-out causes the deletion to fail, the system crashes.
In the traditional volume deleting method, after the deletion is triggered through a command line, the background deletion of metadata is triggered, and then the volume is directly deleted. When the metadata is not deleted, a state conflict is caused to the subsequent created volume, and in addition, the metadata is not deleted, the disk space is occupied, and it is not known which data is occupied by the undeleted part.
Disclosure of Invention
The application provides a volume deleting method and device, which are used for solving the problem that metadata is not deleted completely after a volume is deleted in the traditional volume deleting method, and avoiding that the undeleted metadata occupies a disk space and causes state conflict to subsequent created volumes.
In order to solve the technical problem, the following technical scheme is adopted in the application:
a first aspect of an embodiment of the present application provides a volume deletion method, including:
receiving a volume deleting command, and determining metadata corresponding to a volume according to the volume corresponding to the volume deleting command; canceling the execution of the volume deleting command, triggering a metadata interface corresponding to the volume, and deleting the metadata; verifying the deletion state of the volume, calling back a volume deletion command after determining that the metadata is deleted, restarting the volume deletion command, and deleting the volume.
Optionally, after the cancel volume deletion command is executed and before triggering deletion of the metadata interface corresponding to the volume, the method includes:
monitoring the cluster state and determining that the cluster is in a stable state.
Optionally, the verifying the deletion status of the volume includes:
verifying that the deletion of the volume is in a deletion preparation state, wherein the deletion preparation state is that the metadata corresponding to the current volume does not start to be deleted;
verifying that the volume deletion is in a deletion state, wherein the deletion state is in the deletion of the metadata corresponding to the current volume;
and verifying that the volume deletion is in a deletion completion state, wherein the deletion completion state is that the metadata corresponding to the current volume is deleted completely.
Optionally, verifying the deletion status of the volume and determining that the metadata deletion is completed includes:
and detecting the address information and the path information of the metadata, and finishing the metadata deletion when the address information and the path information of the metadata cannot be detected.
Optionally, when the volume deletion state is in preparation for deletion and deletion, the method includes:
and restarting the volume deleting command after the volume deleting state is changed to the deleting completion.
Optionally, after the restart volume deletion command, the method includes:
and directly and automatically clearing the volume configuration information and the volume object to finish the deletion of the volume.
A second aspect of the embodiments of the present application provides a volume deletion apparatus, including:
the receiving unit is used for receiving the volume deleting command and determining metadata corresponding to the volume according to the volume corresponding to the volume deleting command;
the control unit cancels the execution of the volume deleting command, triggers a metadata interface corresponding to the volume and deletes the metadata;
and the resetting unit is used for verifying the volume deleting state, calling back the volume deleting command after the metadata is determined to be deleted, restarting the volume deleting command and deleting the volume.
Optionally, the control unit further includes:
and the monitoring module is used for monitoring the cluster state and determining that the cluster is in a stable state.
The reset unit further includes:
and the callback module is used for callback the volume deleting command.
A third aspect of embodiments of the present application provides an electronic device, including: a state machine for performing the steps of the volume deletion method as any one of above in the full flash storage system.
Therefore, the embodiment of the application has the following beneficial effects:
according to the method and the device, after a command for deleting the volume is received, the metadata corresponding to the volume is determined according to the volume corresponding to the command for deleting the volume, then execution of the command for deleting the volume is cancelled, an interface of the metadata corresponding to the volume is triggered to delete the metadata, after the metadata is deleted, a volume deleting command is called back, the command for deleting the volume is restarted, and the configuration information of the volume and deletion of the volume object are automatically completed, so that the volume is deleted after the metadata corresponding to the volume is deleted, and the problems that after the volume is deleted, the metadata is deleted unsuccessfully, the disk space is occupied, and the state conflict is caused to subsequent creation are solved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for a person skilled in the art to obtain other drawings without any inventive exercise.
Fig. 1 is a flowchart of a possible volume deletion method provided in an embodiment of the present application;
FIG. 2 is a flow chart of another possible volume deletion method provided in an embodiment of the present application;
fig. 3 is a schematic diagram of an embodiment of a volume deletion apparatus according to an embodiment of the present application;
fig. 4 is a schematic hardware structure diagram of a volume deletion apparatus according to an embodiment of the present application;
fig. 5 is a schematic view of an embodiment of an electronic device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a volume deleting method and device, which are used for controlling a volume to be deleted after metadata corresponding to the volume is deleted, so as to avoid the problem that the metadata corresponding to the volume is deleted unsuccessfully due to the completion of the volume deletion.
The terms "first," "second," and "third" in the description and claims of this application and the drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprises," "comprising," and variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to those steps or elements expressly listed. The technical solutions in the embodiments of the present application are clearly and completely described below with reference to the drawings of the embodiments of the present application, and the embodiments described are only a part of the embodiments of the present application, but not all of the embodiments.
Referring to fig. 1, a flowchart of an embodiment of a volume deletion method provided in an embodiment of the present application includes the following steps:
101. receiving a volume deleting command, and determining metadata corresponding to a volume according to the volume corresponding to the volume deleting command;
when a certain storage area needs to be deleted similarly to a disk partition, a volume deletion command sent by a user is received, wherein the volume deletion command is used for requesting to delete a volume. After determining metadata corresponding to the volume, which is data related to the data generated with the data storage in the file system, such as path information, address information, etc. in the file system, according to the corresponding volume in the volume deletion command, the next step 102 is performed.
102. Canceling the execution of the volume deleting command, triggering a metadata deleting interface corresponding to the volume, and deleting the metadata;
the metadata data volume is large, the deleting needs longer time, if the deleting of the volume is directly executed, the metadata corresponding to the volume may be failed to delete, therefore, after the metadata corresponding to the volume is determined, the command for executing the volume deleting is cancelled first, the current volume deleting business processing is prevented, the metadata deleting interface is triggered, and the metadata is deleted, namely, the metadata corresponding to the volume is deleted first.
103. Verifying the deletion state of the volume, calling back a volume deletion command after determining that the metadata is deleted, restarting the volume deletion command, and deleting the volume.
And the volume is deleted after the metadata is deleted, so that the condition that the volume is deleted but the metadata is not deleted can be avoided. And verifying the deleting state of the volume so as to continue to execute the next step after the metadata is deleted, calling back a volume deleting command which is cancelled before after the metadata is deleted, restarting the volume deleting command, and deleting the configuration information and the object of the volume so as to complete the deletion of the volume.
According to the embodiment of the application, after the volume deleting command is received, the metadata corresponding to the volume is deleted, then the volume deleting command is called back, the volume deleting command is restarted, and the volume is deleted, so that the conditions that the volume is deleted completely, the volume occupies a disk memory after the metadata deletion fails, and the state conflict is caused to the subsequent volume creation are avoided.
Referring to fig. 2, a flowchart of another embodiment of a volume deletion method provided in an embodiment of the present application includes the following steps:
201. after receiving a volume deleting command, determining metadata corresponding to a volume according to the volume corresponding to the volume deleting command;
the command line inputs a volume deletion command, information such as an ID of an incoming volume, and determines metadata corresponding to the volume based on the volume information.
After the metadata corresponding to the volume is determined, execution continues at step 202.
202. Canceling the execution of the volume deleting command and determining whether the cluster is in a stable state;
canceling the execution of a volume deleting command after determining metadata corresponding to a volume, monitoring whether a cluster is in a stable state, and executing the next step when the cluster is in the stable state to trigger a metadata interface corresponding to the volume and delete the metadata; and if the cluster is not in the stable state, executing other operations, such as triggering the metadata interface and deleting the metadata after waiting for the cluster to be in the stable state, or returning prompt information to the user for indicating that the volume deleting command cannot be executed at present.
203. When the cluster is in a stable state, triggering a metadata interface corresponding to the volume, and deleting the metadata;
when the cluster is in a stable state, triggering a metadata interface corresponding to the volume to complete deletion of the metadata, and specifically deleting the retrieved set of all relevant information corresponding to the volume in batch.
204. Verifying the deletion state of the volume and determining whether the metadata is deleted completely;
the metadata deletion may be completed when the address information, path information, etc. of the metadata are not detected by detecting the address information, path information, etc. of the metadata.
Verifying the deletion state of the volume, namely verifying the metadata corresponding to the volume, and marking the state value to be DELETING _ READY in the preparation stage if the metadata corresponding to the current volume is not deleted; when the metadata corresponding to the current volume is being deleted, marking the state value as DELETING; and marking the state machine as DELETED after the metadata corresponding to the current volume is DELETED. The next step can only be performed if the volume deletion is complete, i.e., the state value is DELETED.
When the flag states of the metadata corresponding to the current volume are DELETING _ READY and DELETING, the volume deletion command cannot be called back, and at this time, the volume deletion state is waited to be changed, and when the state value is changed to DELETED, the metadata deletion is completed, and then the next step is executed.
205. And after the metadata is deleted, calling back a volume deleting command, restarting the volume deleting command and deleting the volume.
And after the metadata is deleted, calling back a volume deleting command which is cancelled previously, restarting the command line deleting command, automatically deleting the configuration information and the volume object of the volume, and completing the volume deletion.
The above describes the volume deletion method in the embodiment of the present application, and the following describes the volume deletion device in the embodiment of the present application, with reference to fig. 3, an embodiment of the volume deletion device in the embodiment of the present application includes:
a receiving unit 301, configured to receive a volume deletion command, and determine, according to a volume corresponding to the volume deletion command, metadata corresponding to the volume;
the control unit 302 cancels the execution of the volume deletion command, triggers a metadata interface corresponding to the volume, and deletes the metadata;
the resetting unit 303 verifies the volume deletion state, and after it is determined that the metadata deletion is completed, recalls the volume deletion command, restarts the volume deletion command, and deletes the volume.
In a possible implementation manner of the present application, the control unit 302 is further configured to monitor a cluster state, and determine that the cluster is in a stable state.
In a possible implementation manner of the present application, the resetting unit 303 further includes a callback module, configured to callback a volume deletion command, restart the volume deletion command, and delete the volume configuration information and the object when detecting that the metadata corresponding to the volume is DELETED, that is, when the volume deletion state value is DELETED.
According to the embodiment of the application, after the volume deleting command is received, the metadata corresponding to the volume is deleted, and then the volume deleting command is executed, so that the situation that the volume is deleted completely, the volume occupies a disk memory after the metadata deletion fails, and the state conflict is caused to the subsequent volume creation is avoided.
Next, a volume deletion apparatus in an embodiment of the present invention is described in detail from the perspective of hardware processing, and referring to fig. 4, an embodiment of a volume deletion apparatus 400 in an embodiment of the present invention includes:
the device comprises an input device 401, an output device 402, a state machine 403 and a callback device 404, wherein the callback device 404 is arranged in the state machine 403. Input device 401, output device 402, state machine 403 in some embodiments of the invention.
A state machine 403 for performing the following steps:
receiving a volume deleting command, and determining metadata corresponding to a volume according to the volume corresponding to the volume deleting command; canceling the execution of the volume deleting command, triggering a metadata interface corresponding to the volume, and deleting the metadata; verifying the deletion state of the volume, calling back a volume deletion command after determining that the metadata is deleted, restarting the volume deletion command, and deleting the volume.
Optionally, the state machine 403 is further configured to perform the following steps:
monitoring the cluster state and determining that the cluster is in a stable state.
Optionally, a callback device 404 in the state machine 403 is used for calling back the volume deletion command.
Referring to fig. 5, fig. 5 is a schematic diagram of an embodiment of an electronic device according to an embodiment of the invention.
As shown in fig. 5, an embodiment of the present invention provides an electronic device 500, which includes a memory 501, a state machine 502, and a computer program 511 stored in the memory 501 and running on the state machine 502, where the state machine implements the following steps when executing the computer program 511:
receiving a volume deleting command, and determining metadata corresponding to a volume according to the volume corresponding to the volume deleting command; canceling the execution of the volume deleting command, triggering a metadata interface corresponding to the volume, and deleting the metadata; verifying the deletion state of the volume, calling back a volume deletion command after the metadata is deleted, restarting the volume deletion command, and deleting the volume.
When the state machine 502 executes the computer program in the embodiment of the present invention, any one of the embodiments corresponding to fig. 1 may be implemented.
Therefore, based on the method described in the embodiment of the present invention, a person skilled in the art can understand the specific implementation manner and various modifications of the electronic device in the embodiment, as long as the person skilled in the art implements the device used in the method in the embodiment of the present invention, which belongs to the intended scope of the present invention.
The above-described embodiments of the apparatus and system are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. One of ordinary skill in the art can understand and implement without inventive effort.

Claims (10)

1. A volume deletion method, comprising:
receiving a volume deleting command, and determining metadata corresponding to a volume according to the volume corresponding to the volume deleting command;
canceling the execution of the volume deleting command, triggering a metadata interface corresponding to the volume, and deleting the metadata;
verifying the deletion state of the volume, calling back a volume deletion command after determining that the metadata is deleted, restarting the volume deletion command, and deleting the volume.
2. The method according to claim 1, wherein after the canceling of the deletion of the volume command is executed and before triggering deletion of a metadata interface corresponding to the volume, the method further comprises:
monitoring the cluster state and determining that the cluster is in a stable state.
3. The method of claim 1, wherein verifying the volume deleted state comprises:
verifying that the deletion of the volume is in a deletion preparation state, wherein the deletion preparation state is that the metadata corresponding to the current volume does not start to be deleted;
verifying that the volume deletion is in a deletion state, wherein the deletion state is in the deletion of the metadata corresponding to the current volume;
and verifying that the deletion of the volume is in a deletion completion state, wherein the deletion completion state is that the deletion of the metadata corresponding to the current volume is completed.
4. The method of claim 1, wherein verifying the volume deletion status and determining that metadata deletion is complete comprises:
and detecting the address information and the path information of the metadata, and finishing the metadata deletion when the address information and the path information of the metadata cannot be detected.
5. The method according to claim 3, wherein when the volume deletion state is in a deletion ready state and a deletion in-progress state, the volume deletion state is waited for changing, and after the volume deletion state is changed to deletion, the volume deletion command is called back, and the volume deletion command is restarted.
6. The method of claim 1, wherein restarting the volume delete command comprises:
and directly and automatically clearing the volume configuration information and the volume object to finish the deletion of the volume.
7. A volume deletion apparatus, characterized by comprising:
the receiving unit is used for receiving the volume deleting command and determining metadata corresponding to the volume according to the volume corresponding to the volume deleting command;
the control unit cancels the execution of the volume deleting command, triggers a metadata interface corresponding to the volume and deletes the metadata;
and the resetting unit is used for verifying the volume deleting state, calling back the volume deleting command after the metadata is determined to be deleted, restarting the volume deleting command and deleting the volume.
8. The apparatus of claim 7, wherein the control unit further comprises:
monitoring the cluster state and determining that the cluster is in a stable state.
9. The apparatus of claim 7, wherein the reset unit further comprises:
and the callback module is used for callback the volume deleting command.
10. An electronic device comprising a state machine, wherein the state machine is configured to perform the steps of the volume deletion method of any one of claims 1-6 in a full flash storage system.
CN201910780499.5A 2019-08-22 2019-08-22 Volume deleting method and device Active CN110515553B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910780499.5A CN110515553B (en) 2019-08-22 2019-08-22 Volume deleting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910780499.5A CN110515553B (en) 2019-08-22 2019-08-22 Volume deleting method and device

Publications (2)

Publication Number Publication Date
CN110515553A CN110515553A (en) 2019-11-29
CN110515553B true CN110515553B (en) 2022-07-22

Family

ID=68627605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910780499.5A Active CN110515553B (en) 2019-08-22 2019-08-22 Volume deleting method and device

Country Status (1)

Country Link
CN (1) CN110515553B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256202B (en) * 2020-10-23 2023-09-26 南京鹏云网络科技有限公司 Distributed storage system and method for deleting volumes in distributed storage system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763517A (en) * 2018-05-30 2018-11-06 郑州云海信息技术有限公司 A kind of method and relevant device for deleting metadata
CN109976668A (en) * 2019-03-14 2019-07-05 北京达佳互联信息技术有限公司 Data-erasure method, data deletion apparatus and computer readable storage medium

Also Published As

Publication number Publication date
CN110515553A (en) 2019-11-29

Similar Documents

Publication Publication Date Title
US11397648B2 (en) Virtual machine recovery method and virtual machine management device
JP6088667B2 (en) MEMORY CLEANING METHOD AND DEVICE, AND TERMINAL DEVICE
CN108572795B (en) Capacity expansion method, device, equipment and storage medium based on built storage virtualization
CN110955598B (en) Breakpoint processing method and device for kernel mode program
WO2019140739A1 (en) Method for determining return visits to client, and electronic apparatus and computer-readable storage medium
CN110138662B (en) Session table item processing method and device in multi-core system and multi-core system
CN111309524A (en) Distributed storage system fault recovery method, device, terminal and storage medium
CN110888704A (en) High-concurrency interface processing method, device, equipment and storage medium
US20190196864A1 (en) Process Processing Method and Apparatus
CN112988185A (en) Cloud application updating method, device and system, electronic equipment and storage medium
CN110515553B (en) Volume deleting method and device
CN107682389B (en) Method, terminal and computer readable storage medium for executing network request
CN110502324B (en) Processing method, system and storage medium for restart data of cloud mobile phone game
CN105242981A (en) Configuration method of Kdump and computer device
CN111045789B (en) Virtual machine starting method and device, electronic equipment and storage medium
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
CN116680055A (en) Asynchronous task processing method and device, computer equipment and storage medium
CN109426563B (en) Process management method and device
CN106598687B (en) Script preheating method and device
JPWO2006001051A1 (en) Multiprocessor device and control method thereof
CN109101253B (en) Management method and device for host in cloud computing system
CN107320119B (en) Image acquisition method and device and medical equipment
CN104837064A (en) Control method for media player of open-type operation system and media player
WO2020063769A1 (en) User request processing method and apparatus and server
WO2018036318A1 (en) Method and device for collecting abnormality information during startup of operating system

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