File system deletion method and device, equipment, storage medium and program product
By scanning and deleting data and attribute information concurrently based on the file system's identification information in the distributed storage system, combined with preset concurrency control, the problem of low file system deletion efficiency is solved, achieving efficient storage space release and minimizing business impact.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-03-10
AI Technical Summary
The deletion efficiency of existing file systems is not high, especially in distributed storage systems, where traditional deletion methods cannot efficiently free up storage space.
By scanning the disk of the distributed storage system based on the identification information of the file system to be deleted, the location information of the data to be deleted is determined, and the attribute information and data are deleted concurrently. A preset concurrency level is set to control the deletion task and avoid affecting normal business requests.
It improves the speed and efficiency of file system deletion, enables concurrent scanning on multiple disks, supports concurrent deletion of multiple file systems, and reduces the impact on business operations.
Smart Images

Figure CN121636458A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, and in particular to a method, apparatus, device, storage medium, and program product for deleting a file system. Background Technology
[0002] In distributed storage systems, a file system is a logical device for organizing and allocating data storage. In practical applications, it's often necessary to create numerous file systems to store data separately. For example, in video surveillance scenarios, when storage space utilization is high, file systems need to be deleted to free up storage space. Some applications require the continuous creation and deletion of file systems. For instance, in cloud tenant scenarios, each tenant is bound to a file system; when a tenant terminates their lease, the tenant's bound file system needs to be reclaimed, requiring the file system to be deleted and its storage space released.
[0003] Currently, deleting data in a file system typically involves triggering a delete command, which in turn triggers the deletion of metadata in the background. This process first deletes the data corresponding to the metadata within the file system, then deletes the metadata itself, and finally deletes the file system. However, this traditional deletion method is inefficient. Summary of the Invention
[0004] Therefore, it is necessary to provide a file system deletion method, apparatus, device, storage medium, and program product that can improve the efficiency of file system deletion in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a method for deleting a file system, including:
[0006] Based on the first identifier information of the file system to be deleted, the disks of the distributed storage system are scanned to determine the location information of the data to be deleted corresponding to the file system to be deleted; at least one disk of the distributed storage system stores the data to be deleted corresponding to the file system to be deleted.
[0007] Configuration strategy for deleting attribute information corresponding to the file system to be deleted;
[0008] Delete the data to be deleted corresponding to the file system to be deleted according to the preset concurrency level.
[0009] In the above embodiments, firstly, the disks of the distributed storage system are scanned according to the first identifier information of the file system to be deleted to determine the location information of the data to be deleted corresponding to the file system; wherein, at least one disk of the distributed storage system stores the data to be deleted corresponding to the file system to be deleted. Then, the configuration strategy for deleting the attribute information corresponding to the file system to be deleted is applied. Finally, the data to be deleted corresponding to the file system to be deleted is deleted according to a preset concurrency level. In this way, when deleting a file system, scanning the disk for the data to be deleted based on the first identifier information of the file system to be deleted, and then deleting the data, allows for concurrent scanning on multiple disks of the distributed storage system, improving the file system deletion speed.
[0010] Furthermore, when multiple file systems need to be deleted, the disk can be scanned based on the first identifier information corresponding to each file system to be deleted, so that multiple file systems can be deleted at the same time, and the efficiency of file system deletion is higher.
[0011] In one embodiment, the disk of the distributed storage system is scanned based on the first identification information of the file system to be deleted to determine the location information of the data to be deleted corresponding to the file system to be deleted, including:
[0012] For each disk in a distributed storage system, the disk is divided into multiple logical disks;
[0013] Based on the first identification information, the logical disks corresponding to each disk in the distributed storage system are scanned to determine the location information of the data to be deleted.
[0014] In the above embodiments, each disk in the distributed management system is divided into multiple logical disks, and disk scanning is performed based on each logical disk to determine the data to be deleted. By dividing into smaller logical disks, the flexibility of disk scanning management is improved.
[0015] In one embodiment, based on the first identification information, the logical disks corresponding to each disk in the distributed storage system are scanned to determine the location information of the data to be deleted, including:
[0016] During the scanning of the logical disks corresponding to each disk in the distributed storage system based on the first identification information, if a scan interruption occurs, the target logical disk is determined based on the second identification information; the second identification information is used to indicate that the target logical disk has been scanned.
[0017] After the scan is interrupted and resumed, a scan is performed according to the preset scan strategy. The scan strategy includes scanning other logical drives besides the target logical drive.
[0018] In the above embodiments, when a scan interruption occurs and the disk scan resumes, the scan is performed on a logical disk-by-logical disk basis. The completion of the scan is determined based on whether each logical disk includes the second identification information. Logical disks that have been scanned do not need to be re-scanned, while logical disks that have not been scanned are re-scanned. In this way, it is not necessary to scan the entire disk, and the disk scan speed is faster and more efficient.
[0019] In one embodiment, the method further includes:
[0020] During the process of scanning the logical disks corresponding to each disk in the distributed storage system based on the first identification information, the second identification information is added to the scanned logical disks.
[0021] In the above embodiments, adding a second identifier to the completed logical disk can record the scanning progress of each logical disk.
[0022] In one embodiment, the method further includes:
[0023] Based on the business requests of the distributed storage system, determine the number of disk read / write operations required by the business requests.
[0024] The preset concurrency level is determined based on the number of disk read / write operations and the total number of disk read / write operations in the distributed storage system.
[0025] In the above embodiments, a preset concurrency level is determined based on the business requests of the distributed storage system to avoid deleting tasks from affecting normal business requests.
[0026] In one embodiment, a preset concurrency level is determined based on the number of disk read / write operations and the total number of disk read / write operations in the distributed storage system, including:
[0027] Determine the ratio of disk read / write operations to the total number of disk read / write operations in the distributed storage system;
[0028] The preset concurrency level is determined based on the ratio and the preset correspondence; the preset correspondence includes the correspondence between different ratios and their corresponding concurrency levels.
[0029] In the above embodiments, a preset concurrency level is determined based on the business requests of the distributed storage system to avoid deleting tasks from affecting normal business requests.
[0030] In one embodiment, the method further includes:
[0031] According to a preset cycle, obtain the status information of each file system in the distributed storage system;
[0032] File systems whose status information is "to be deleted" are identified as file systems to be deleted.
[0033] In the above embodiments, the status of each file system in the distributed storage system is scanned periodically to determine the file systems to be deleted. Multiple file systems to be deleted can be deleted concurrently, resulting in higher file system deletion efficiency.
[0034] In one embodiment, the method further includes:
[0035] The first identification information of the file system to be deleted is sent to the client so that the client stops accessing the data in the file system to be deleted.
[0036] In the above embodiments, the first identification information of the file system to be deleted is sent to each client, and the client stops accessing the file system to be deleted, so as to avoid abnormal data access by the client.
[0037] Secondly, this application also provides a file system deletion device, comprising:
[0038] The scanning module is used to scan the disks of the distributed storage system based on the first identification information of the file system to be deleted, and to determine the location information of the data to be deleted corresponding to the file system to be deleted; at least one disk of the distributed storage system stores the data to be deleted corresponding to the file system to be deleted.
[0039] The first deletion module is used to configure strategies for deleting attribute information corresponding to the file system to be deleted.
[0040] The second deletion module is used to delete the data to be deleted corresponding to the file system to be deleted according to a preset concurrency level.
[0041] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the first aspects above.
[0042] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the first aspects above.
[0043] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the first aspects above.
[0044] The aforementioned file system deletion method, apparatus, device, storage medium, and program product first scan the disks of the distributed storage system based on the first identification information of the file system to be deleted, determining the location information of the data to be deleted corresponding to the file system; wherein at least one disk in the distributed storage system stores the data to be deleted corresponding to the file system to be deleted; then, a configuration strategy for deleting the attribute information corresponding to the file system to be deleted is applied; finally, the data to be deleted corresponding to the file system to be deleted is deleted according to a preset concurrency level. In this way, when deleting a file system, scanning the disks for the data to be deleted based on the first identification information of the file system to be deleted, and then deleting the data, allows for concurrent scanning on multiple disks of the distributed storage system, improving the file system deletion speed.
[0045] Furthermore, when multiple file systems need to be deleted, the disk can be scanned based on the first identifier information corresponding to each file system to be deleted, so that multiple file systems can be deleted at the same time, and the efficiency of file system deletion is higher. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a diagram illustrating the application environment of a file system deletion method in one embodiment;
[0048] Figure 2 This is a flowchart illustrating a file system deletion method in one embodiment;
[0049] Figure 3 This is a flowchart illustrating a file system deletion method in another embodiment;
[0050] Figure 4 This is a flowchart illustrating the disk scanning steps in one embodiment;
[0051] Figure 5 This is a flowchart illustrating the steps for determining the preset concurrency level in one embodiment;
[0052] Figure 6 This is a flowchart illustrating the steps for determining the file system to be deleted in one embodiment;
[0053] Figure 7 This is a schematic diagram of the state transition of a file system in one embodiment;
[0054] Figure 8 This is a flowchart illustrating the steps for determining the list of file systems to be deleted in one embodiment;
[0055] Figure 9 This is a flowchart illustrating the steps of creating a scan and delete task in one embodiment;
[0056] Figure 10 This is a flowchart illustrating a file system deletion method in another embodiment;
[0057] Figure 11 This is a structural block diagram of a file system deletion device in one embodiment;
[0058] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0060] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0061] In distributed storage systems, to improve storage space utilization, data from different file systems is stored across various disks within the system. This means each disk may contain data from multiple file systems, and data from the same file system may be distributed across different disks. In existing technologies, deleting data from a file system typically involves triggering a delete command, which in turn triggers the deletion of metadata in the backend. This process first deletes the data corresponding to the metadata within the file system, then deletes the metadata itself, and finally deletes the file system. However, traditional deletion methods are inefficient.
[0062] In view of this, this application proposes a file system deletion method. When deleting a file system, the method scans the disk for data to be deleted based on the first identifier information of the file system to be deleted, and then deletes the data. This allows for concurrent scanning on multiple disks in a distributed storage system, improving the file system deletion speed. Furthermore, when multiple file systems need to be deleted, the method can scan the disk based on the first identifier information corresponding to each file system to be deleted, enabling simultaneous deletion of multiple file systems and further increasing the efficiency of file system deletion.
[0063] The file system deletion method provided in this application embodiment can be applied to, for example, Figure 1 The application environment shown includes a distributed storage system, which can be a distributed cluster system capable of providing block storage services. Optionally, the distributed storage system includes multiple nodes, wherein the nodes are connected via communication methods such as Wi-Fi, mobile network connections, etc. In this embodiment, to improve communication performance and security, the communication method is a 10 Gigabit network or a private network connection, etc. Each node in the distributed storage system can be, but is not limited to, an independent server or a server cluster composed of multiple servers, or a cloud server providing cloud computing services. This embodiment does not limit the specific form of each node. Optionally, the distributed storage system can include one master node and multiple slave nodes, where the master node can be a management node. Figure 1 This example illustrates a distributed storage system with three slave nodes.
[0064] In one exemplary embodiment, such as Figure 2 As shown, a file system deletion method is provided, which can be applied to... Figure 1 Taking the master node of a distributed storage system as an example, the explanation includes the following steps 201 to 203. Wherein:
[0065] Step 201: Based on the first identifier information of the file system to be deleted, scan the disk of the distributed storage system to determine the location information of the data to be deleted corresponding to the file system to be deleted.
[0066] In this distributed storage system, at least one disk stores the data to be deleted corresponding to the file system to be deleted. Optionally, the data to be deleted corresponding to the file system to be deleted may be stored on one disk or multiple disks. The first identification information can be the identification information generated for the file system when it was created. The first identification information is unique. To improve search efficiency, the first identification information can be a numeric identifier or a string identifier. All data in the file system to be deleted carries the first identification information of the file system to be deleted. Based on the first identification information of the file system to be deleted, a concurrent scan is performed on all disks of the distributed storage system to identify all the data to be deleted corresponding to the file system to be deleted, and to determine the location information of the data to be deleted. Thus, the file system to be deleted can be deleted based on the scan results.
[0067] Optionally, when deleting a file system, one file system can be deleted at a time, or multiple file systems can be deleted in parallel. Based on the first identification information corresponding to each file system to be deleted, the data to be deleted corresponding to each file system to be deleted is scanned in all disks, and then the deletion operation is performed. Multiple file systems can be deleted in one scan.
[0068] Step 202: Delete the configuration policy for the attribute information corresponding to the file system to be deleted.
[0069] Optionally, the file system also includes configuration policies for different attribute information, such as snapshots, quotas, and extended attributes. These attribute configuration policies provide fine-grained control over file system data management. When deleting a file system, the configuration policies for the corresponding attribute information of the file system to be deleted must also be deleted. Taking snapshots as an example, only the snapshot can access snapshot data. In existing technologies, when deleting a file system, the snapshot is usually deleted first, and then the snapshot data corresponding to the snapshot is deleted.
[0070] In this embodiment, the file system to be deleted is deleted by scanning the disk, which can delete all data corresponding to the file system to be deleted at the same time. Therefore, when deleting a snapshot, it is only necessary to delete the snapshot configuration policy first, without deleting the snapshot data separately, which further improves the deletion speed of the file system.
[0071] Step 203: Delete the data to be deleted corresponding to the file system to be deleted according to the preset concurrency level.
[0072] In this embodiment, after the disk scan identifies the data to be deleted, a deletion task is created to delete the data. The disk scan and deletion task will occupy the disk's I / O (Input / Output) resources. When there are many deletion tasks, it will put pressure on the disk and may affect the normal read and write operations of the distributed storage system. Therefore, for a single disk, a preset concurrency level is set for the single disk, and the operation of the deletion task is controlled according to the preset concurrency level.
[0073] Optionally, the preset concurrency level can be adjusted according to business conditions. The concurrency of deletion tasks can be adjusted through programmatic voltage regulator settings. For example, the preset concurrency level can range from 1 to 100. When the preset concurrency level is set to 1, the disk resource usage of deletion tasks is controlled to within 5%, resulting in slower data deletion. When the preset concurrency level is set to 100, meaning business needs are not considered and no flow control is applied to deletion tasks, the deletion tasks can occupy all disk resources. In this case, data deletion is faster, but the impact on business operations is greater. Typically, by default, the preset concurrency level is set to a default level such as 30, allowing deletion tasks to occupy 30% of disk resources. It is understood that the above-mentioned preset concurrency level and the adjustment of disk resources occupied by deletion tasks can be adjusted according to the actual business conditions of the distributed storage system, and this application embodiment does not impose any restrictions on this.
[0074] Optionally, the deletion task may include not only the first deletion task that deletes the data to be deleted, but also a second deletion task issued by the business side. After determining the concurrency of the deletion tasks, the disk resources allowed for the first and second deletion tasks are further determined based on the disk resources allowed for each deletion task. For example, if the business occupies 50% of the disk resources, then the disk resources allowed for the deletion task can be 50%. If the second deletion task occupies a maximum of 20% of the disk resources, then the first deletion task occupies a maximum of no more than 30% of the disk resources.
[0075] In the above embodiments, firstly, the disks of the distributed storage system are scanned according to the first identifier information of the file system to be deleted to determine the location information of the data to be deleted corresponding to the file system; wherein, at least one disk of the distributed storage system stores the data to be deleted corresponding to the file system to be deleted. Then, the configuration strategy for deleting the attribute information corresponding to the file system to be deleted is applied. Finally, the data to be deleted corresponding to the file system to be deleted is deleted according to a preset concurrency level. In this way, when deleting a file system, scanning the disk for the data to be deleted based on the first identifier information of the file system to be deleted, and then deleting the data, allows for concurrent scanning on multiple disks of the distributed storage system, improving the file system deletion speed.
[0076] Furthermore, when multiple file systems need to be deleted, the disk can be scanned based on the first identifier information corresponding to each file system to be deleted, so that multiple file systems can be deleted at the same time, and the efficiency of file system deletion is higher.
[0077] In the embodiments of this application, such as Figure 3 As shown, the disk scanning process may include:
[0078] Step 301: For each disk in the distributed storage system, divide the disk into multiple logical disks.
[0079] In a distributed storage system, in order to manage the large amount of data on each physical disk more efficiently and improve the performance and reliability of the distributed storage system, partitioning technology can be used to divide each physical disk into multiple independent logical disks of a fixed size. Each logical disk has its own logical identifier and storage space in the system.
[0080] Step 302: Based on the first identification information, scan the logical disks corresponding to each disk in the distributed storage system to determine the location information of the data to be deleted.
[0081] During the scanning process, each disk in the distributed storage system is scanned concurrently based on the first identification information. For the logical disks on each disk, the scan is performed sequentially. When data carrying the first identification information is scanned, it is determined that the data belongs to the file system to be deleted and is therefore data to be deleted. The location information of the data to be deleted is recorded to provide accurate physical location guidance for subsequent data deletion operations.
[0082] Optionally, during the scanning of logical disks corresponding to each disk in the distributed storage system based on the first identification information, a second identification information is added to the scanned logical disks. That is, during the logical disk scanning process, after a logical disk has been scanned and deleted, the second identification information is added to the deleted logical disk to indicate that the logical disk has been scanned. Simultaneously, the scanning progress of each logical disk on each disk can be reported to the management module.
[0083] In the above embodiments, each disk in the distributed management system is divided into multiple logical disks, and disk scanning is performed based on each logical disk to determine the data to be deleted. By dividing into smaller logical disks, the flexibility of disk scanning management is improved.
[0084] In one embodiment, the disk scanning process in step 302 described above is as follows: Figure 4 As shown, it includes:
[0085] Step 401: During the process of scanning the logical disks corresponding to each disk in the distributed storage system based on the first identification information, if a scan interruption occurs, the target logical disk is determined based on the second identification information.
[0086] The second identification information indicates that the target logical disk has been scanned. During the scanning process for each logical disk, anomalies such as network fluctuations, hard drive failures, or resource usage may cause the scan to be interrupted. After a scan interruption, the target logical disk is determined based on the second identification information recorded for each logical disk during the scan. For example, it is determined whether each logical disk includes the second identification information. If it does, it means that the logical disk has been scanned and deleted, and the logical disk is determined to be the target logical disk. If it does not include the second identification information, it means that the logical disk has not been scanned, and the logical disk does not belong to the target logical disk.
[0087] Step 402: After the scan is resumed from interruption, a scan is performed according to the preset scan strategy.
[0088] The scanning strategy includes scanning all logical drives except the target logical drive. When the exception handling is complete and the disk scan needs to be restarted, to improve the overall scanning efficiency, a preset scanning strategy can be used to rescan all logical drives that were not scanned before the scan was interrupted, excluding the target logical drive. After the scan is complete, the scan progress of each logical drive in the management module is updated.
[0089] In the above embodiments, when a scan interruption occurs and the disk scan resumes, the scan is performed on a logical disk-by-logical disk basis. The completion of the scan is determined based on whether each logical disk includes the second identification information. Logical disks that have been scanned do not need to be re-scanned, while logical disks that have not been scanned are re-scanned. In this way, it is not necessary to scan the entire disk, and the disk scan speed is faster and more efficient.
[0090] In the embodiments of this application, such as Figure 5 As shown, the method also includes:
[0091] Step 501: Determine the number of disk read / write operations required by the business requests in the distributed storage system.
[0092] Get the current number of business requests, and determine the number of disk read / write operations required by each business request based on that number.
[0093] Step 502: Determine the preset concurrency level based on the number of disk read / write operations and the total number of disk read / write operations of the distributed storage system.
[0094] Optionally, determine the ratio of disk read / write operations to the total disk read / write operations of the distributed storage system; and determine the preset concurrency level based on the ratio and a preset correspondence.
[0095] The preset correspondence includes the relationship between different ratios and their corresponding concurrency levels. This preset correspondence can be pre-set according to business needs and stored in the distributed storage system. When determining the disk resources used by the current business based on the ratio of disk read / write counts to total disk read / write counts, the preset correspondence is looked up based on this ratio to determine the preset concurrency level.
[0096] In the above embodiments, a preset concurrency level is determined based on the business requests of the distributed storage system to avoid deleting tasks from affecting normal business requests.
[0097] In an optional embodiment, such as Figure 6 As shown, the method also includes:
[0098] Step 601: Obtain the status information of each file system in the distributed storage system according to a preset period.
[0099] The preset period can be set according to requirements. For example, by setting a scheduled task, when the scheduled task arrives, the status information of each file system in the distributed storage system can be obtained. The status can include not deleting (NO_DELETE), waiting to be deleted (WAIT_DELETE), deletion configuration policy (DELETE_CONF), deleted data (DELETE_DATA), and deleted (DELETED).
[0100] Step 602: The file system whose status information is pending deletion is identified as the file system to be deleted.
[0101] Under normal circumstances, the state of each file system in a distributed storage system is NO_DELETE. When the distributed storage system receives a request from a client to delete a file system, it marks the file system's state as WAIT_DELETE. Then, depending on the different stages of file system deletion, the file system's state is marked as DELETE_CONF during the deletion configuration policy stage, DELETE_DATA during the data deletion stage, and DELETE_DATA after the file system deletion is complete. At this point, the file system deletion is successful. Optionally, the file system state transition process can be as follows: Figure 7 As shown.
[0102] Optionally, the client can submit a request to delete the file system immediately, or after a specified period, such as 0-72 hours. If the deletion is immediate, the file system status is marked as WAIT_DELETE. If the deletion is delayed, a timer is started, and the file system status is marked as WAIT_DELETE after the timer expires. If the file system deletion request is cancelled during the waiting time, the file system status is marked as NO_DELETE.
[0103] After obtaining the current status information of each file system, the file systems with the status "to be deleted" are identified as file systems to be deleted. When multiple file systems are identified as "to be deleted," a list of file systems to be deleted is generated based on these multiple file systems. A file system deletion task is then created to delete each file system in the list. Multiple file systems can be deleted concurrently. The obtained file systems to be deleted or the list of file systems to be deleted is submitted to the file system deletion task to execute the deletion operation. Specifically, this can be done as follows: Figure 8 As shown. The file system deletion task creates a scan and deletion task for each disk, starts scanning and deleting, and after all disks have been scanned and deleted, the file system is considered deleted, the file system status information is set to DELETED, and the file system deletion process ends. For details, see... Figure 9 As shown. After a file system is deleted, the first identifier information of the file system can be reused and allocated to other file systems when they are created, in order to save system resources.
[0104] In the above embodiments, the status of each file system in the distributed storage system is scanned periodically to determine the file systems to be deleted. Multiple file systems to be deleted can be deleted concurrently, resulting in higher file system deletion efficiency.
[0105] In one embodiment, after determining the list of file systems to be deleted, the first identification information of the file systems to be deleted is sent to the client so that the client stops accessing the data in the file systems to be deleted.
[0106] Optionally, the first identification information of each file system to be deleted in the file system list is sent to the client. When there are multiple file systems to be deleted, the first identification information of each file system to be deleted is sent to the client. Since the deletion order of data and metadata is unpredictable during the data deletion process by scanning the disk, the data of the file system being deleted is in an inconsistent state during the scanning process. The client determines the file system to be deleted based on the first identification information and stops accessing the data in the file system to be deleted.
[0107] For a received data access request for the file system to be deleted, determine whether the data access request is a data read request or a data write request. If it is a data read request, allow data reading. If it is a data write request, since even if data is written, it will be deleted by disk scan, so do not allow data writing and return a success message for request execution.
[0108] In the above embodiments, the first identification information of the file system to be deleted is sent to each client, and the client stops accessing the file system to be deleted, so as to avoid abnormal data access by the client.
[0109] In the embodiments of this application, such as Figure 10 As shown, a method for processing cached data is provided, including:
[0110] Step 1001: Obtain the status information of each file system in the distributed storage system according to a preset period.
[0111] Step 1002: Determine the file system whose status information is pending deletion as the file system to be deleted.
[0112] Step 1003: For each disk in the distributed storage system, divide the disk into multiple logical disks.
[0113] Step 1004: Based on the first identification information, scan the logical disks corresponding to each disk in the distributed storage system to determine the location information of the data to be deleted.
[0114] Step 1005: Delete the configuration policy for the attribute information corresponding to the file system to be deleted.
[0115] Step 1006: Determine the number of disk read / write operations required by the business requests in the distributed storage system.
[0116] Step 1007: Determine the preset concurrency level based on the number of disk read / write operations and the total number of disk read / write operations of the distributed storage system.
[0117] Step 1008: Delete the data to be deleted corresponding to the file system to be deleted according to the preset concurrency level.
[0118] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0119] Based on the same inventive concept, this application also provides a file system deletion apparatus for implementing the file system deletion method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more file system deletion apparatus embodiments provided below can be found in the limitations of the file system deletion method described above, and will not be repeated here.
[0120] In one exemplary embodiment, such as Figure 11 As shown, a file system deletion device 1100 is provided, including: a scanning module 1101, a first deletion module 1102, and a second deletion module 1103, wherein:
[0121] The scanning module 1101 is used to scan the disk of the distributed storage system according to the first identification information of the file system to be deleted, and to determine the location information of the data to be deleted corresponding to the file system to be deleted; at least one disk of the distributed storage system stores the data to be deleted corresponding to the file system to be deleted.
[0122] The first deletion module 1102 is used for the configuration strategy of deleting the attribute information corresponding to the file system to be deleted;
[0123] The second deletion module 1103 is used to delete the data to be deleted corresponding to the file system to be deleted according to a preset concurrency level.
[0124] In one embodiment, the scanning module 1101 is specifically used to divide each disk in the distributed storage system into multiple logical disks; and to scan the logical disks corresponding to each disk in the distributed storage system according to the first identification information to determine the location information of the data to be deleted.
[0125] In one embodiment, the scanning module 1101 is specifically used to determine the target logical disk based on the second identification information if a scanning interruption occurs during the scanning process of the logical disk corresponding to each disk in the distributed storage system according to the first identification information; the second identification information is used to indicate that the target logical disk has been scanned; and after the scanning interruption is resumed, scanning is performed according to a preset scanning strategy; the scanning strategy includes scanning other logical disks except the target logical disk.
[0126] In one embodiment, the apparatus further includes an adding module, used to add second identification information to the scanned logical disks during the process of scanning the logical disks corresponding to each disk in the distributed storage system according to the first identification information.
[0127] In one embodiment, the device further includes a determining module, configured to determine the number of disk read / write operations occupied by the service request based on the service request of the distributed storage system; and to determine a preset concurrency level based on the number of disk read / write operations and the total number of disk read / write operations of the distributed storage system.
[0128] In one embodiment, the determining module is specifically used to determine the ratio of disk read / write counts to the total disk read / write counts of the distributed storage system; and to determine a preset concurrency level based on the ratio and a preset correspondence relationship; the preset correspondence relationship includes the correspondence between different ratios and corresponding concurrency levels.
[0129] In one embodiment, the device further includes an acquisition module, configured to acquire the status information of each file system in the distributed storage system according to a preset period; and to determine the file system whose status information is pending deletion as the file system to be deleted.
[0130] In one embodiment, the apparatus further includes a sending module for sending first identification information of the file system to be deleted to the client, so that the client stops accessing data in the file system to be deleted.
[0131] The modules in the aforementioned file system deletion device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0132] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 12As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores file system data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a file system deletion method.
[0133] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0134] In one exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: scanning the disk of a distributed storage system according to the first identification information of the file system to be deleted, and determining the location information of the data to be deleted corresponding to the file system to be deleted; storing the data to be deleted corresponding to the file system to be deleted in at least one disk of the distributed storage system; configuring a strategy for deleting the attribute information corresponding to the file system to be deleted; and deleting the data to be deleted corresponding to the file system to be deleted according to a preset concurrency level.
[0135] In one embodiment, when the processor executes the computer program, it further performs the following steps: for each disk in the distributed storage system, the disk is divided into multiple logical disks; based on the first identification information, the logical disks corresponding to each disk in the distributed storage system are scanned to determine the location information of the data to be deleted.
[0136] In one embodiment, when the processor executes the computer program, it further implements the following steps: during the scanning of the logical disks corresponding to each disk in the distributed storage system according to the first identification information, if a scan interruption occurs, the target logical disk is determined based on the second identification information; the second identification information is used to indicate that the target logical disk has been scanned; after the scan interruption is recovered, a scan is performed according to a preset scan strategy; the scan strategy includes: scanning other logical disks besides the target logical disk.
[0137] In one embodiment, when the processor executes the computer program, it further performs the following steps: during the process of scanning the logical disks corresponding to each disk in the distributed storage system according to the first identification information, adding second identification information to the scanned logical disks.
[0138] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining the number of disk read / write operations required by the business request based on the business request of the distributed storage system; and determining a preset concurrency level based on the number of disk read / write operations and the total number of disk read / write operations of the distributed storage system.
[0139] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining the ratio of disk read / write operations to the total number of disk read / write operations in the distributed storage system; determining a preset concurrency level based on the ratio and a preset correspondence; the preset correspondence includes the correspondence between different ratios and their corresponding concurrency levels.
[0140] In one embodiment, when the processor executes the computer program, it further performs the following steps: according to a preset period, it acquires the status information of each file system in the distributed storage system; and determines the file system whose status information is pending deletion as the file system to be deleted.
[0141] In one embodiment, when the processor executes the computer program, it further performs the following steps: sending first identification information of the file system to be deleted to the client so that the client stops accessing the data in the file system to be deleted.
[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: scanning the disks of a distributed storage system according to the first identification information of the file system to be deleted, and determining the location information of the data to be deleted corresponding to the file system to be deleted; storing the data to be deleted corresponding to the file system to be deleted in at least one disk of the distributed storage system; configuring a strategy for deleting the attribute information corresponding to the file system to be deleted; and deleting the data to be deleted corresponding to the file system to be deleted according to a preset concurrency level.
[0143] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: for each disk in the distributed storage system, the disk is divided into multiple logical disks; based on the first identification information, the logical disks corresponding to each disk in the distributed storage system are scanned to determine the location information of the data to be deleted.
[0144] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: during the scanning of the logical disks corresponding to each disk in the distributed storage system according to the first identification information, if a scan interruption occurs, the target logical disk is determined based on the second identification information; the second identification information is used to indicate that the target logical disk has been scanned; after the scan interruption is recovered, a scan is performed according to a preset scan strategy; the scan strategy includes: scanning other logical disks besides the target logical disk.
[0145] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: during the process of scanning the logical disks corresponding to each disk in the distributed storage system according to the first identification information, adding second identification information to the scanned logical disks.
[0146] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the number of disk read / write operations required by the business request of the distributed storage system based on the business request of the distributed storage system; and determining a preset concurrency level based on the number of disk read / write operations and the total number of disk read / write operations of the distributed storage system.
[0147] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the ratio of disk read / write operations to the total number of disk read / write operations in the distributed storage system; determining a preset concurrency level based on the ratio and a preset correspondence; the preset correspondence includes the correspondence between different ratios and their corresponding concurrency levels.
[0148] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: according to a preset period, it obtains the status information of each file system in the distributed storage system; and determines the file system whose status information is pending deletion as the file system to be deleted.
[0149] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: sending first identification information of the file system to be deleted to the client so that the client stops accessing the data in the file system to be deleted.
[0150] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: scanning the disks of a distributed storage system based on first identification information of the file system to be deleted, to determine the location information of the data to be deleted corresponding to the file system to be deleted; storing the data to be deleted corresponding to the file system to be deleted in at least one disk of the distributed storage system; configuring a strategy for deleting the attribute information corresponding to the file system to be deleted; and deleting the data to be deleted corresponding to the file system to be deleted according to a preset concurrency level.
[0151] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: for each disk in the distributed storage system, the disk is divided into multiple logical disks; based on the first identification information, the logical disks corresponding to each disk in the distributed storage system are scanned to determine the location information of the data to be deleted.
[0152] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: during the scanning of the logical disks corresponding to each disk in the distributed storage system according to the first identification information, if a scan interruption occurs, the target logical disk is determined based on the second identification information; the second identification information is used to indicate that the target logical disk has been scanned; after the scan interruption is recovered, a scan is performed according to a preset scan strategy; the scan strategy includes: scanning other logical disks besides the target logical disk.
[0153] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: during the process of scanning the logical disks corresponding to each disk in the distributed storage system according to the first identification information, adding second identification information to the scanned logical disks.
[0154] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the number of disk read / write operations required by the business request of the distributed storage system based on the business request of the distributed storage system; and determining a preset concurrency level based on the number of disk read / write operations and the total number of disk read / write operations of the distributed storage system.
[0155] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the ratio of disk read / write operations to the total number of disk read / write operations in the distributed storage system; determining a preset concurrency level based on the ratio and a preset correspondence; the preset correspondence includes the correspondence between different ratios and their corresponding concurrency levels.
[0156] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: according to a preset period, it obtains the status information of each file system in the distributed storage system; and determines the file system whose status information is pending deletion as the file system to be deleted.
[0157] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: sending first identification information of the file system to be deleted to the client so that the client stops accessing the data in the file system to be deleted.
[0158] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0159] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0160] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0161] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A file system deletion method characterized by comprising: The method comprises: According to the first identification information of the to-be-deleted file system, scanning the disks of the distributed storage system to determine the location information of the to-be-deleted data corresponding to the to-be-deleted file system; at least one disk of the distributed storage system stores the to-be-deleted data corresponding to the to-be-deleted file system; Deleting the configuration strategy of the attribute information corresponding to the to-be-deleted file system; According to the preset concurrency degree, deleting the to-be-deleted data corresponding to the to-be-deleted file system.
2. The method of claim 1, wherein, According to the first identification information of the to-be-deleted file system, scanning the disks of the distributed storage system to determine the location information of the to-be-deleted data corresponding to the to-be-deleted file system, comprising: For each disk in the distributed storage system, the disk is divided into a plurality of logical disks; According to the first identification information, scanning the logical disk corresponding to each disk in the distributed storage system to determine the location information of the to-be-deleted data.
3. The method of claim 2, wherein, According to the first identification information, scanning the logical disk corresponding to each disk in the distributed storage system to determine the location information of the to-be-deleted data, comprising: In the process of scanning the logical disk corresponding to each disk in the distributed storage system according to the first identification information, if the scanning is interrupted, the target logical disk is determined based on the second identification information; the second identification information is used to represent that the target logical disk has been scanned; After the scanning interruption is restored, scanning is performed according to a preset scanning strategy; the scanning strategy comprises scanning the logical disks other than the target logical disk.
4. The method of claim 3, wherein, The method further comprises: In the process of scanning the logical disk corresponding to each disk in the distributed storage system according to the first identification information, adding the second identification information to the scanned logical disk.
5. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: According to the business request of the distributed storage system, determining the disk read-write times occupied by the business request; According to the disk read-write times and the total disk read-write times of the distributed storage system, determining the preset concurrency degree.
6. The method of claim 5, wherein, According to the disk read-write times and the total disk read-write times of the distributed storage system, determining the preset concurrency degree, comprising: Determining the ratio of the disk read-write times to the total disk read-write times of the distributed storage system; According to the ratio and a preset corresponding relationship, determining the preset concurrency degree; the preset corresponding relationship comprises the corresponding relationship between different ratios and corresponding concurrency degrees.
7. The method of claim 1, wherein, The method further comprises: According to a preset period, acquiring the state information of each file system in the distributed storage system; The file system in the to-be-deleted state is determined as the to-be-deleted file system.
8. The method of claim 1, wherein, The method further comprises: The first identification information of the to-be-deleted file system is sent to the client, so that the client stops accessing the data in the to-be-deleted file system.
9. A file system deletion apparatus characterized by comprising: The device comprises: The scanning module is configured to scan disks of a distributed storage system according to first identification information of a to-be-deleted file system, and determine location information of to-be-deleted data corresponding to the to-be-deleted file system; at least one disk of the distributed storage system stores the to-be-deleted data corresponding to the to-be-deleted file system; The first deleting module is configured to delete a configuration strategy of attribute information corresponding to the to-be-deleted file system. The second deleting module is configured to delete the to-be-deleted data corresponding to the to-be-deleted file system according to a preset concurrency degree. 10.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-9. The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 8.
11. A computer readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 8.
12. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 8.
Citation Information
Patent Citations
Data deletion method and system for distributed storage cluster
CN106227469A
Method and device for erasing information on terminal device
CN106909542A
Disk data processing method and system, storage medium and electronic equipment
CN114415958A
Method for sharing file system by multiple hosts, product, equipment and storage medium
CN120123305A
Deleting a file from a distributed filesystem
US9678968B1