A directory deletion method, device and storage medium

By creating the first directory in the distributed file system and moving the metadata, combined with the client cache index deletion data, the performance problems caused by recursive directory deletion are solved, efficient directory deletion is achieved, and the resource consumption of the metadata server is reduced. Improved system performance.

CN113590546BActive Publication Date: 2024-10-18JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110742686.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2024-10-18
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

In a distributed file system, recursive directory deletion will cause a large amount of disk IO, affecting read and write performance. Existing methods may cause excessive consumption of metadata server resources during the directory movement process, reducing overall performance.

Method used

Create the first directory on the metadata server of the directory to be deleted, move the metadata of the directory to be deleted to this directory, cache it on the client, and delete the data in the second directory through the index to avoid migration between metadata servers. , optimize the deletion process.

Benefits of technology

It reduces resource consumption between metadata servers, improves the overall performance of the distributed file system, reduces the time-consuming deletion process, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113590546B_ABST
    Figure CN113590546B_ABST
Patent Text Reader

Abstract

The present application involves a directory deletion method, device, and storage medium. The method includes: creating a second directory under the system file directory, and moving the data of the directory to be deleted to the second directory; creating a first directory in the metadata server where the metadata of the directory to be deleted is located, and moving the metadata of the directory to be deleted to the first directory; the client caches the first directories of all metadata servers in a local specified location, and indexes the data of the directory to be deleted under the second directory according to the metadata content of the directory to be deleted at the specified location, and performs a deletion operation to delete the data of the directory to be deleted; after the data of the directory to be deleted is deleted, the client deletes the metadata of the corresponding directory to be deleted in the local specified location and the first directory of the metadata server. When the present application is applied, metadata migration will not occur between metadata servers due to directory deletion, thereby ensuring the overall performance of the distributed file system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of distributed file system directory deletion, and in particular to a directory deletion method, device and storage medium. Background Art

[0002] A distributed file system generally includes a client, a metadata server, and a data server. The client is responsible for establishing the access interface for file data, the metadata server processes the layout and attributes of the file, and the data server stores the data content of the file.

[0003] For distributed file systems, the ability to store massive amounts of data is their most important feature. The file directory of a distributed file system may contain a large number of subdirectories and files of large capacity. When recursively deleting directories, if they are deleted directly, a large amount of disk IO will often be generated, which directly affects the normal data reading and writing of the distributed file system, reduces the reading and writing performance of the entire distributed file system, and the deletion process is time-consuming and the user experience is poor. Existing deletion methods include: moving the directory to be deleted to a hidden folder of the system to achieve the purpose of quick deletion. However, during the directory movement process, the metadata server to which the directory to be deleted belongs may not be consistent with the metadata server to which the moved directory to be deleted belongs, resulting in a large amount of metadata migration required during the movement process, resulting in resource consumption of the metadata server and affecting the overall performance of the distributed file system. Summary of the invention

[0004] In order to solve the above technical problem or at least partially solve the above technical problem, the present application provides a directory deletion method, device and storage medium.

[0005] In a first aspect, the present application provides a directory deletion method, which is applied to a distributed file system, comprising:

[0006] Create a second directory under the system file directory, and move the data of the directory to be deleted to the second directory;

[0007] Creating a first directory in the metadata server where the metadata of the directory to be deleted is located, and moving the metadata of the directory to be deleted to the first directory;

[0008] The client caches the first directory of all metadata servers in a local specified location.

[0009] According to the metadata content of the directory to be deleted at the specified location, index the data of the directory to be deleted under the second directory, and perform a deletion operation to delete the data of the directory to be deleted;

[0010] After deleting the data in the directory to be deleted, the client deletes the metadata of the directory to be deleted in the local designated location and the first directory of the metadata server.

[0011] Furthermore, the client of the distributed file system creates a second directory under the system file directory for centrally storing the directories to be deleted:

[0012] The client first detects whether the second directory already exists in the system file directory of the distributed file system.

[0013] If the second directory does not exist, create it in the system file directory.

[0014] Furthermore, moving the data of the to-be-deleted directory to the second directory includes:

[0015] The client receives a deletion request for a directory to be deleted,

[0016] The client determines whether the directory to be deleted is an empty directory according to the metadata of the directory to be deleted. If yes, the client sends a deletion instruction to the metadata server cluster to directly delete the metadata of the directory to be deleted;

[0017] Otherwise, the client moves the data of the corresponding directory to be deleted to the second directory.

[0018] Furthermore, the client renames the data of the directory to be deleted that is moved to the second directory, and the renamed name includes: a current name and a timestamp.

[0019] Furthermore, creating a first directory in the metadata server where the metadata of the directory to be deleted is located, and moving the metadata of the directory to be deleted to the first directory includes:

[0020] When the client determines that the directory to be deleted is a non-empty directory according to the metadata of the directory to be deleted, the client requests the metadata server number of the directory to be deleted from the metadata server cluster;

[0021] The metadata server cluster feeds back the metadata server number to the client;

[0022] The client creates the first directory in the corresponding metadata server according to the obtained metadata server number;

[0023] The metadata of the directory to be deleted is moved to the first directory.

[0024] Furthermore, a priority attribute is set for the directory to be deleted, and the execution order of deleting the directory to be deleted is controlled according to the priority attribute of the directory to be deleted.

[0025] Furthermore, the method further includes a process of restoring the unprocessed to-be-deleted directory in the first directory:

[0026] Displaying all remaining unprocessed directories to be deleted on the client according to the content of the cached first directory;

[0027] Select the specified directory to be deleted from the unprocessed directories to be deleted;

[0028] Move the specified restored directory to be deleted from the second directory back to the original location of the specified restored directory to be deleted;

[0029] Remove the timestamp to rename the specified restored to-be-deleted directory that is moved back to its original location;

[0030] The client controls the metadata server cluster to move the metadata of the non-to-be-deleted directory that is designated for restoration from the corresponding first directory back to the original location of the metadata.

[0031] In a second aspect, the present application provides a device for implementing a directory deletion method, including:

[0032] A first directory creation module, the first directory creation module is used to create a corresponding first directory on a corresponding metadata server according to the metadata server number;

[0033] A second directory creation module, wherein the second directory creation module is used to create a second directory under the system file directory of the distributed file system;

[0034] A deletion request receiving module, the deletion request receiving module is used to receive a deletion request for a directory to be deleted;

[0035] A judging module, wherein the judging module judges whether the directory to be deleted determined by the deletion request receiving module is an empty directory;

[0036] A first deleting module, wherein the first deleting module directly deletes the metadata of the empty directory according to the judgment result of the judgment module;

[0037] A metadata server number acquisition module, which acquires the metadata server number of the non-empty directory according to the judgment result of the judgment module and provides the metadata server number to the first directory creation module;

[0038] a data moving module, wherein the data moving module moves the data of the directory to be deleted to the second directory according to the judgment result of the judgment module;

[0039] A metadata moving module, the metadata moving module is used to move the metadata of the directory to be deleted to the corresponding first directory;

[0040] The second deleting module is used to index the to-be-deleted directories under the second directory according to all the first directory metadata, and gradually delete the to-be-deleted directories under the second directory.

[0041] Furthermore, it also includes: a recovery module, which provides an unprocessed directory to be deleted in the second directory, and the user selects a specified directory to be deleted to be restored, restores the data of the directory to be deleted in the second directory to the original location, and restores the corresponding metadata in the first directory to the original location.

[0042] In a third aspect, the present application provides a storage medium for implementing a directory deletion method, wherein the storage medium for implementing a directory deletion method stores at least one instruction, and executing the instruction implements the directory deletion method.

[0043] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:

[0044] The present application creates a corresponding first directory on the metadata server where the metadata of the directory to be deleted is located. When deleting the directory to be deleted, the metadata of the directory to be deleted is moved to the corresponding first directory, so that the metadata of the directory to be deleted must be moved locally on the metadata server. There is no need to generate metadata migration between metadata servers in the metadata server cluster of the distributed file system due to directory deletion, thereby reducing internal friction between metadata servers and ensuring the overall performance of the distributed file system. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0047] Figure 1 A flowchart of a directory deletion method provided in an embodiment of the present application;

[0048] Figure 2 A flowchart of creating and deleting a second directory provided in an embodiment of the present application;

[0049] Figure 3 A flowchart of moving data of a directory to be deleted to a second directory and renaming it provided in an embodiment of the present application;

[0050] Figure 4A flowchart of creating a first directory and moving metadata of a directory to be deleted to the first directory provided in this embodiment;

[0051] Figure 5 A flowchart of restoring unprocessed directories to be deleted provided in an embodiment of the present application;

[0052] Figure 6 A flowchart of an embodiment of the present application providing a method for preferentially processing small-capacity directories to be deleted by taking the capacity of the directories to be deleted as a priority attribute;

[0053] Figure 7 A schematic diagram of the architecture of an apparatus for implementing a directory deletion method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0055] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0056] As a commonly used storage system, the file system provides users with file storage and management functions, thereby facilitating file operations. However, with the expansion of data scale, single-machine resources are difficult to meet the storage needs of multiple users. Multiple machines are needed to provide concurrent access to meet the storage needs of users. Distributed file systems came into being.

[0057] Distributed file systems are used in many fields because they do not restrict the location of physical hardware, provide massive storage space, good data access performance, reliability, stability, and good scalability. The system architecture of a distributed file system includes a client cluster, a metadata server cluster, and a data server cluster. The metadata server cluster is responsible for managing the metadata of the distributed file system, such as the directory structure of the file system, the basic attributes of files, the operation permissions of files, the index of file data, and the layout information of file data. The metadata server cluster performs corresponding metadata management according to the metadata operation request initiated by the client cluster; the server cluster is responsible for storing the data content of files in the file system, and the server cluster performs corresponding data management according to the data operation request initiated by the client cluster; the client cluster is responsible for initiating metadata operation requests and data operation requests.

[0058] In a distributed file system, deleting a specified file generally involves moving the metadata of the specified file to a hidden file, making the metadata of the specified file invisible to the user, and then gradually deleting the data of the deleted file using the background deletion process index. During the metadata movement process, in existing distributed file systems, metadata will be migrated from one metadata server to another, causing the deletion process to consume the IO resources of the metadata server cluster and affect the communication between the metadata server cluster and the client cluster.

[0059] Example 1

[0060] See also Figure 1 As shown, an embodiment of the present application provides a directory deletion method, which is applied to a distributed file system, including:

[0061] S100, the client receives a deletion request for a directory to be deleted, and the client determines the directory to be deleted according to the deletion request for the directory to be deleted;

[0062] S200, the client determines whether the directory to be deleted is an empty directory based on the basic attributes of the file in the metadata of the directory to be deleted. When the client determines that the directory to be deleted is an empty directory, step S300 is executed. When the client determines that the directory to be deleted is a non-empty directory, step S400 is executed.

[0063] S300, the client sends an instruction to delete metadata of a directory to be deleted to the metadata server cluster, and the metadata server cluster directly deletes the metadata of the directory to be deleted.

[0064] In a specific implementation process, the client sends an operation instruction to delete the metadata of the directory to be deleted to the metadata server cluster. After receiving the operation instruction to delete the metadata of the directory to be deleted sent by the client, the metadata server cluster directly deletes the metadata of the directory to be deleted. After deleting the metadata of the directory to be deleted, the metadata server cluster feeds back a message to the client that the metadata of the empty directory to be deleted has been successfully deleted. After receiving the message that the metadata of the empty directory to be deleted has been successfully deleted, the client feeds back a message to the user that the deletion is successful.

[0065] S400: The client moves the data of the directory to be deleted to the second directory.

[0066] During the specific implementation process, see Figure 2 and Figure 3 As shown, the client moves the data of the corresponding directory to be deleted to the second directory, including:

[0067] The deletion program implementing the directory deletion method of the present application first detects whether the second directory already exists in the system file directory of the distributed file system during the initialization startup phase.

[0068] If the second directory does not exist, create it in the system file directory.

[0069] When it is detected that the directory to be deleted is a non-empty directory, the data of the directory to be deleted is moved to the second directory.

[0070] The client renames the data of the directory to be deleted moved to the second directory, and the renamed name includes: a current name and a timestamp. The timestamp records the time when the data of the directory to be deleted is moved to the second directory.

[0071] S500: Create a first directory in the metadata server where the metadata of the directory to be deleted is located, and move the metadata of the directory to be deleted to the first directory.

[0072] During the specific implementation process, see Figure 4 As shown, when the client determines that the directory to be deleted is a non-empty directory according to the metadata of the directory to be deleted, step S500 executed includes:

[0073] The client requests the metadata server cluster for the metadata server number of the directory to be deleted;

[0074] Specifically, the metadata server number of the directory to be deleted is stored in the metadata as a type of metadata of the directory to be deleted. The metadata server number is a unique identification number of the metadata server in the metadata server cluster. The metadata server number can be used to determine in which specific metadata server the metadata of the directory to be deleted is stored.

[0075] The client creates the first directory in the corresponding metadata server according to the obtained metadata server number;

[0076] Specifically, during the execution of the deletion program that implements the directory deletion method of the present application, after receiving the metadata server number of step S501, it is detected whether the corresponding first directory exists in the corresponding metadata server. If not, the first directory is created in the corresponding metadata server.

[0077] Furthermore, a learning table is maintained on the client side to record the metadata server number that has created the corresponding first directory, and the learning table is used to assist in the process of detecting whether the corresponding first directory exists in the corresponding data server. After the client creates the first directory on a metadata server, the client records the metadata server number corresponding to the metadata server in the learning table. After the client receives the metadata server number in step S501, it matches the received metadata server number with the content in the learning table. If it matches, it means that the corresponding first directory exists in the corresponding metadata server. If it does not match, it means that the first directory does not exist in the corresponding metadata server, and the first directory is created and the learning table is updated.

[0078] The metadata of the directory to be deleted is moved to the first directory.

[0079] In a specific implementation process, the client sends a metadata moving instruction to the metadata server cluster. The metadata moving instruction acts on the metadata of the directory to be deleted, and the target address of the metadata moving instruction is the first directory of the corresponding metadata server.

[0080] S600, the client caches the first directories of all metadata servers in a local designated location, indexes the data of the directory to be deleted under the second directory according to the metadata content of the directory to be deleted in the designated location, and performs a deletion operation to delete the data of the directory to be deleted;

[0081] During the specific implementation process, the client caches the first directories of all metadata servers in a local designated location by polling. The deletion program configures a scanning deletion process, and the scanning deletion process is executed by configuring limited resources. The scanning deletion process scans the content of the locally cached first directory to index the data of the directory to be deleted under the second directory. The scanning deletion process gradually deletes the directory to be deleted in the second directory according to the allocated limited resources, so as to avoid the scanning deletion process occupying too many resources and affecting the read and write performance of the distributed file system. After the scanning deletion process completes the deletion of the data of the directory to be deleted, it notifies the client, and the client deletes the metadata of the corresponding directory to be deleted in the local designated location and the first directory of the metadata server.

[0082] Example 2

[0083] See also Figure 5 As shown, the difference between Example 2 and Example 1 is that Example 2 provides a process for recovering unprocessed directories to be deleted:

[0084] All remaining unprocessed directories to be deleted and directories to be deleted being processed are displayed on the client according to the contents of the cached first directory. Unprocessed directories to be deleted refer to directories to be deleted that have not been processed by the scanning and deletion process, and the data of unprocessed directories to be deleted is complete in the second directory; directories to be deleted being processed refer to directories to be deleted that are being processed by the scanning and deletion process, and the data of directories to be deleted being processed cannot be guaranteed to be complete in the second directory.

[0085] The user selects the directory to be deleted from the unprocessed directory to be deleted according to the requirements;

[0086] Move the specified restored directory to be deleted from the second directory back to the original location of the specified restored directory to be deleted;

[0087] Remove the timestamp to rename the specified restored to-be-deleted directory that is moved back to its original location;

[0088] The client controls the metadata server cluster to move the metadata of the non-to-be-deleted directory to be restored from the corresponding first directory back to the original location of the metadata, so that the metadata of the directory to be deleted to be restored can be visible to the user.

[0089] Example 3

[0090] The difference between Example 3 and Example 1 is that a priority attribute is set for the directory to be deleted, and the execution order of deleting the directory to be deleted is controlled according to the priority attribute of the directory to be deleted. Figure 6 As shown, in this embodiment, the priority attribute is determined by the capacity of the directory to be deleted. If the capacity of the directory to be deleted is less than the set capacity threshold, the priority attribute is considered to have a high priority level. If the capacity of the directory to be deleted is greater than the set capacity threshold, the priority attribute is considered to have a low priority level. The specific method is as follows: create two first directories on each metadata server: a first directory A and a first directory B.

[0091] Set a capacity threshold in advance;

[0092] The client obtains the capacity of the directory to be deleted according to the metadata of the directory to be deleted;

[0093] The client determines whether the capacity of the directory to be deleted is less than the capacity threshold;

[0094] If yes, move the metadata of the directory to be deleted to the first directory A;

[0095] Otherwise, the metadata data of the directory to be deleted is moved to the first directory B;

[0096] The scanning and deleting process first scans the cache content of the first directory A, and then scans the cache content of the first directory B.

[0097] This embodiment can give priority to quickly deleting small-capacity directories to be deleted.

[0098] Example 4

[0099] This embodiment provides a device for implementing a directory deletion method. Figure 7 As shown, the device for implementing the directory deletion method includes:

[0100] The first directory creation module is used to create a corresponding first directory in the corresponding metadata server according to the metadata server number; in the specific implementation process, the first directory creation module maintains a learning table, which records the metadata server number of the corresponding first directory created by the first directory creation module; after the first directory creation module receives the metadata server number collected by the metadata server number collection module, it matches the metadata server number with the learning table. If it cannot be matched, it creates the first directory in the corresponding metadata server according to the metadata server number, and adds the corresponding metadata server number in the learning table. If it can be matched, it means that the first directory exists in the corresponding metadata server.

[0101] The second directory creation module is used to create a second directory under the system file directory of the distributed file system; the second directory creation module detects whether the second directory exists under the system file directory during initialization, and creates the second directory if it does not exist.

[0102] A deletion request receiving module, the deletion request receiving module is used to receive a deletion request for a directory to be deleted;

[0103] A judging module, wherein the judging module judges whether the directory to be deleted determined by the deletion request receiving module is an empty directory;

[0104] The first deletion module directly deletes the metadata of the empty directory according to the judgment result of the judgment module; when the judgment module determines that the directory to be deleted is an empty directory, the first deletion module directly sends a deletion instruction of the metadata of the directory to be deleted to the metadata server cluster.

[0105] a data moving module, wherein the data moving module moves the data of the directory to be deleted to the second directory according to the judgment result of the judgment module; when the judgment module judges that the directory to be deleted is a non-empty directory, the data moving module moves the data of the directory to be deleted to the second directory,

[0106] A metadata server number acquisition module, which acquires the metadata server number of a non-empty directory and provides the metadata server number to the first directory creation module according to the judgment result of the judgment module; when the judgment module determines that the directory to be deleted is a non-empty directory, the metadata server number acquisition module sends a metadata server number request to the metadata server cluster, acquires the metadata server number of the directory to be deleted, and sends it to the first directory creation module.

[0107] A metadata moving module, wherein the metadata moving module is used to move the metadata of the directory to be deleted to the corresponding first directory when the corresponding first directory exists; after determining that the corresponding first directory exists, the first directory creation module notifies the metadata moving module, and the metadata moving module sends an instruction to the metadata server cluster to move the metadata of the directory to be deleted to the corresponding first directory.

[0108] The second deleting module is used to index the to-be-deleted directories under the second directory according to all the first directory metadata, and gradually delete the to-be-deleted directories under the second directory.

[0109] During the specific implementation process, the device for implementing the directory deletion method also includes: a recovery module, which provides an unprocessed directory to be deleted in the second directory, and the user selects a specified directory to be deleted to be restored, restores the data of the directory to be deleted in the second directory to the original location, and restores the corresponding metadata in the first directory to the original location.

[0110] Example 5

[0111] This embodiment provides a storage medium for implementing a directory deletion method. The storage medium for implementing a directory deletion method stores at least one instruction, and executing the instruction implements the directory deletion method as claimed in claim 1.

[0112] The present application creates a corresponding first directory on the metadata server where the metadata of the directory to be deleted is located. When deleting the directory to be deleted, the metadata of the directory to be deleted is moved to the corresponding first directory, so that the metadata of the directory to be deleted must be moved locally on the metadata server. There is no need to generate metadata migration between metadata servers in the metadata server cluster of the distributed file system due to directory deletion, thereby reducing internal friction between metadata servers and ensuring the overall performance of the distributed file system.

[0113] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0114] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple 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.

[0115] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0116] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A directory deletion method, applied to a distributed file system, characterized in that: include: Create a second directory under the system file directory, and move the data of the directory to be deleted to the second directory; Creating a first directory in the metadata server where the metadata of the directory to be deleted is located, and moving the metadata of the directory to be deleted to the first directory; The client caches the first directory of all metadata servers in a local specified location. According to the metadata content of the directory to be deleted at the specified location, index the data of the directory to be deleted under the second directory, and perform a deletion operation to delete the data of the directory to be deleted; After deleting the data in the directory to be deleted, the client deletes the metadata of the directory to be deleted in the local designated location and the first directory of the metadata server.

2. The directory deletion method according to claim 1, characterized in that: The client of the distributed file system creates a second directory under the system file directory for centrally storing directories to be deleted: The client first detects whether the second directory already exists in the system file directory of the distributed file system. If the second directory does not exist, create it in the system file directory.

3. The directory deletion method according to claim 1, characterized in that: Moving the data of the to-be-deleted directory to the second directory comprises: The client receives a deletion request for a directory to be deleted, The client determines whether the directory to be deleted is an empty directory according to the metadata of the directory to be deleted. If yes, the client sends a deletion instruction to the metadata server cluster to directly delete the metadata of the directory to be deleted; Otherwise, the client moves the data of the corresponding directory to be deleted to the second directory.

4. The directory deletion method according to claim 3, characterized in that: The client renames the data of the to-be-deleted directory moved to the second directory, where the renamed name includes: a current name and a timestamp.

5. The directory deletion method according to claim 1, characterized in that: Creating a first directory in a metadata server where metadata of the directory to be deleted is located, and moving the metadata of the directory to be deleted to the first directory comprises: When the client determines that the directory to be deleted is a non-empty directory according to the metadata of the directory to be deleted, the client requests the metadata server number of the directory to be deleted from the metadata server cluster; The metadata server cluster feeds back the metadata server number to the client; The client creates the first directory in the corresponding metadata server according to the obtained metadata server number; The metadata of the directory to be deleted is moved to the first directory.

6. The directory deletion method according to claim 1, characterized in that: A priority attribute is set for the directory to be deleted, and the execution order of deleting the directory to be deleted is controlled according to the priority attribute of the directory to be deleted.

7. The directory deletion method according to claim 1, characterized in that: It also includes the process of restoring the unprocessed directories to be deleted in the first directory: Displaying all remaining unprocessed directories to be deleted on the client according to the content of the cached first directory; Select the specified directory to be deleted from the unprocessed directories to be deleted; Move the specified restored directory to be deleted from the second directory back to the original location of the specified restored directory to be deleted; Remove the timestamp to rename the specified restored to-be-deleted directory that is moved back to its original location; The client controls the metadata server cluster to move the metadata of the non-to-be-deleted directory that is designated for restoration from the corresponding first directory back to the original location of the metadata.

8. A device for implementing a directory deletion method, characterized in that: include: A first directory creation module, the first directory creation module is used to create a corresponding first directory on a corresponding metadata server according to the metadata server number; A second directory creation module, wherein the second directory creation module is used to create a second directory under the system file directory of the distributed file system; A deletion request receiving module, the deletion request receiving module is used to receive a deletion request for a directory to be deleted; A judging module, wherein the judging module judges whether the directory to be deleted determined by the deletion request receiving module is an empty directory; A first deleting module, wherein the first deleting module directly deletes the metadata of the empty directory according to the judgment result of the judgment module; A metadata server number acquisition module, which acquires the metadata server number of the non-empty directory according to the judgment result of the judgment module and provides the metadata server number to the first directory creation module; a data moving module, wherein the data moving module moves the data of the directory to be deleted to the second directory according to the judgment result of the judgment module; A metadata moving module, the metadata moving module is used to move the metadata of the directory to be deleted to the corresponding first directory; The second deleting module is used to index the to-be-deleted directories under the second directory according to all the first directory metadata, and gradually delete the to-be-deleted directories under the second directory.

9. The device for implementing the directory deletion method according to claim 8, characterized in that: Also includes: The recovery module provides an unprocessed directory to be deleted in the second directory, and the user selects a specified directory to be deleted to be restored, restores the data of the directory to be deleted in the second directory to the original location, and restores the corresponding metadata in the first directory to the original location.

10. A storage medium for implementing a directory deletion method, characterized in that: The storage medium for implementing the directory deletion method stores at least one instruction, and executing the instruction implements the directory deletion method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Massive catalogs and files oriented processing method in distributed type storage system

    CN103473337A

  • Load transfer method and system in metadata cluster

    CN103916467A