Distributed storage system space recovery method controlled by central node
Through the distributed storage system space recycling method controlled by the central node, the problem of low chunkgroup space recycling efficiency in the distributed storage system is solved, and all chunk files of the same chunk group are simultaneously recycled, improving the recycling efficiency and effect, and reducing the impact on normal reading and writing.
Patent Information
- Application Number
- CN202411744399.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-30
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-11-30
AI Technical Summary
In distributed storage systems, the existing technology cannot perform space recycling of all chunk files in the same chunk group at the same time, resulting in the write-deletion operation being affected, and the read-write ability of disk nodes is limited, and the space recycling task may affect normal read-write operations.
The distributed storage system space recycling method controlled by the central node is adopted. By setting up the central control node, the disk node reports information, the central node calculates the priority of chunkgroup space recycling and sorts it, and centralized recycle tasks are issued, and the disk node performs the space recycling operation of all chunk files.
All chunk files in the same chunk group are recycled simultaneously, reducing the impact of write and delete operations, improving recycling efficiency and effect, ensuring load balancing of disk nodes, and reducing the impact on normal read and write.
Smart Images

Figure CN119828958A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a space recovery method for a distributed storage system controlled by a central node. Background Art
[0002] In a distributed storage system, data is usually stored in a redundant manner, including multiple copies and erasure codes. A copy of data is stored on multiple different nodes in the distributed system to prevent data loss caused by a single node failure. Data is stored in the form of files, which are composed of multiple pieces of data and stored in a file. These files are called chunk files. Multiple chunk files distributed on different disk nodes are combined to form a redundant failure group (hereinafter referred to as chunkgroup). Chunkgroup is the most basic logical storage unit, just like PG (Placement Group) in a distributed file system (i.e., ceph system). When deleting data stored in this redundant manner, it is necessary to delete the data copies in multiple chunk files at the same time.
[0003] Distributed storage system architecture Figure 1 As shown in the figure, in a distributed storage system, when deleting a piece of data, the data is often marked for deletion, and the data is not directly deleted from the disk. After the deletion operation is performed, the data still occupies the disk space. If the disk space is not reclaimed, the disk space may be exhausted. Therefore, the disk space needs to be reclaimed. The recycling method is usually to read the data that has not been marked for deletion (that is, valid data) in the chunk file and write it to a new chunk file, and then delete the original chunk file to complete the space recycling.
[0004] When performing space reclamation on a chunkgroup, the read operation of the chunkgroup will not be affected, and the business node can directly read the data in the chunkgroup; however, the write and delete operations will be affected. If new data needs to be written, it needs to be written to other chunkgroups; if data in a chunkgroup needs to be deleted, the deletion will fail, and the business layer needs to save the failed request and retry it after the space reclamation is completed. Therefore, the chunk files in the same chunkgroup should be reclaimed at the same time as much as possible.
[0005] The read and write capabilities of disk nodes are limited. When performing space reclamation tasks, disk nodes need to occupy a part of their read and write capabilities, which may affect normal reading and writing. If a cluster has too many disk nodes performing space reclamation at the same time, it may affect the overall reading and writing of the cluster.
[0006] In a distributed storage system, space can be reclaimed directly by each disk node. The disk node regularly checks whether the chunk files on the disk meet the recycling conditions. The recycling condition is mainly that the hole rate of the chunk file (that is, the ratio of the deleted data part of the chunk file to the entire chunk file size) reaches a preset ratio, then space recycling can begin. This method is simple to implement, but the problem is that the chunk files in each chunkgroup are recycled separately, not at the same time. In this case, the entire chunkgroup will be unavailable for a long time. If there are write requests and delete requests for the current chunkgroup, it is very easy to cause write or delete failures. In addition, write requests require the cooperation of multiple disks. If a disk node is overloaded due to space recycling, it will affect the write of the entire cluster. Summary of the invention
[0007] The present application shows a distributed storage system space recovery method controlled by a central node.
[0008] In a first aspect, the present application shows a distributed storage system space recovery method controlled by a central node, the method comprising:
[0009] Set up a central control node;
[0010] The disk node reports the disk information and chunk file information to the central control node;
[0011] The central control node calculates the chunkgroup space recovery priority and sorts them according to the priority;
[0012] The central control node performs a space recovery task on the chunkgroup with a higher priority;
[0013] The central control node sends the space recovery task to the disk node, and the disk node performs the space recovery operation on all chunk files in the chunkgroup.
[0014] According to the method of the first aspect of the present application, the step of the disk node reporting the disk information and the chunk file information to the central control node includes:
[0015] The disk node reports the hole rate and write rate of the chunk file to the central control node. The hole rate is the ratio of the identified deleted data to the file size, and the write rate is the ratio of all written data to the file size.
[0016] The steps for the central control node to calculate the chunkgroup space recovery priority and sort according to the priority include: The central control point calculates the chunkgroup space recovery priority based on the uploaded hole rate and write rate, and performs recovery when the hole rate is greater than 50% and the write rate is greater than 80%.
[0017] According to the method of the first aspect of the present application, the calculation method of the chunkgroup space recovery priority is:
[0018] Let the hole rate be E and the write rate be F. Given that E < F, assuming that recovery is performed only when the hole rate is greater than 50% and the write rate is greater than 80%, then:
[0019] Hole rate: 0.5 < E < 1
[0020] Write rate: 0.8 < F < 1
[0021] Valid data: 0 < F - E < 0.5
[0022] The formula for calculating the priority P of a single chunk file in the chunkgroup is:
[0023] P = ((E - 0.5) + (0.5 - (F - E)))F
[0024] After simplification, it is obtained:
[0025] P = (2E - F)F
[0026] The priority of the entire chunkgroup is the sum of the priorities of all chunk files.
[0027] The formula is as follows:
[0028] Total P = P1 + P2 + P3 +....
[0029] According to the method of the first aspect of the present application, sorting is performed only when the idle time of the chunkgroup entering the priority sorting exceeds 10 minutes. The idle time is the current time - the modification time.
[0030] According to the method of the first aspect of the present application, the steps for the central control node to perform the space recovery task on the chunkgroup include:
[0031] S101, the central control node traverses the chunkgroup queue to be recycled;
[0032] S102, obtaining a chunkgroup from the queue;
[0033] S103, judging whether the hollow rate of the chunkgroup meets the condition, if so, the central control node continues to traverse the chunk file list in the chunkgroup, if not, reselecting a chunkgroup;
[0034] S104, obtaining a chunk file information from the traversed chunk file list, and then obtaining the disk node information corresponding to the chunk file;
[0035] S105, determining whether the load of the disk node meets the condition, if so, continuing to obtain the information of the next chunk file, if not, putting the recycling task back into the queue;
[0036] S106: When the hole rate of the chunkgroup meets the requirement and the disk node loads corresponding to all chunk files in the chunkgroup meet the condition, the traversal ends and the space recovery task is started.
[0037] According to the method of the first aspect of the present application, when executing a space recovery task, the central control point performs a freeze operation on the corresponding chunkgroup, and new write requests will not be written into the chunkgroup.
[0038] According to the method of the first aspect of the present application, the load condition of the disk node is that the same disk node can only execute one task concurrently at the same time.
[0039] According to the method of the first aspect of the present application, when the disk node performs a space recovery operation on a chunk file, the disk node is prohibited from receiving a request to delete data. If there is a new deletion request, the disk node returns a deletion failure signal and notifies the central control node after the recovery task is completed.
[0040] According to the method of the first aspect of the present application, after the central control node receives the notification of completion of the recycling task from the disk node, it thaws the chunkgroup, and the thawed chunkgroup can continue to receive write requests.
[0041] According to the method of the first aspect of the present application, the disk information includes disk read and write load and disk capacity.
[0042] The technical solution provided by this application may have the following beneficial effects:
[0043] This application can recycle all chunk files of the same chunkgroup at the same time, with little impact on write and delete operations. The central control node sorts all the recycling tasks, which has higher recycling efficiency and better recycling effect. The space recycling tasks of the cluster are centrally managed in the central control node to ensure that the space recycling tasks are evenly distributed on each disk node, ensure the load balance of each disk node, and reduce the impact on normal read, write and delete operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a structural diagram of the distributed storage system architecture in the background technology part of this application.
[0045] Figure 2 This is a flow chart of the steps of a distributed storage system space recovery method controlled by a central node in the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 creative work are within the scope of protection of this application.
[0047] Reference Figure 2 , shows a flow chart of the steps of a distributed storage system space recovery method controlled by a central node of the present application, wherein the method may specifically include the following steps:
[0048] In step S101, the central control node receives chunk file information in a chunkgroup reported by a disk node, and the central control node sorts the space recovery tasks, and then traverses the chunkgroup queue with a higher priority;
[0049] In step S102, a chunkgroup is obtained from the queue;
[0050] In step S103, it is determined whether the hollow rate of the chunkgroup meets the condition, that is, the hollow rate of all chunk files is greater than 50%. If so, the central control node continues to traverse the chunk file list in the chunkgroup. If not, a new chunkgroup is selected.
[0051] In step S104, a chunk file information is obtained from the traversed chunk file list, and then the disk node information corresponding to the chunk file is obtained;
[0052] In step S105, it is determined whether the load of the disk node meets the condition. If so, the information of the next chunk file is obtained. If not, the recycling task is put back into the queue and step S102 is repeated.
[0053] In step S106, when the hole rate of the chunkgroup meets the requirement and the disk node load corresponding to all chunk files in the chunkgroup meets the condition, the traversal ends and the space recovery task is started.
[0054] The present application shows a distributed storage system space recovery method controlled by a central node, the method comprising:
[0055] A central control node is set up, which is responsible for managing the space recovery tasks of all disk nodes. According to the situation of each chunkgroup, the recycling priority scoring algorithm is used to sort the chunkgroups according to their scores. Chunks with high scores are recycled first. In addition, the central control node also controls the number of recycling tasks on each disk node according to the read and write load of the disk node, so as to minimize the impact of space recovery tasks on normal reading and writing.
[0056] All disk nodes report corresponding disk information and chunk file information to the central control node;
[0057] The central control node calculates the space recovery priority of each chunkgroup and sorts them according to the priority;
[0058] The central control node performs space recovery tasks on chunkgroups with higher priority, i.e., higher scores;
[0059] The central control node sends the space recovery task to the disk node, and the disk node performs the space recovery operation on all chunk files in the chunkgroup.
[0060] The main purpose of the disk node performing space recovery operations on all chunk files in the chunkgroup is:
[0061] First, it can improve the efficiency of disk space management. Reclaiming the space of all chunk files can ensure the maximum utilization of storage resources. When some chunk files are recycled, many scattered and underutilized space blocks may be left behind. These space blocks may be difficult to effectively use in subsequent file allocations, resulting in space waste. Performing recycling operations on all chunk files can simplify the space management logic of disk nodes. There is no need to track and decide on the usage of each chunk file separately, thereby reducing the complexity and cost of management.
[0062] Second, it can maintain the performance of the storage system. Reclaiming the space of all chunk files helps reduce storage fragmentation. When some chunk files are reclaimed, many small, discontinuous space blocks may be left behind. These space blocks may cause increased storage fragmentation in subsequent file allocations, thereby affecting the read and write performance of the disk. After reclaiming the space of all chunk files, disk nodes can more easily allocate files. In subsequent file allocations, it is easier to find continuous, large blocks of space to meet file storage needs, thereby improving the efficiency and quality of file allocation.
[0063] Third, it can ensure data consistency. Reclaiming the space of all chunk files can ensure the accuracy of metadata. When deleting or modifying chunk files, if the underlying storage system does not update its status in time, it may cause metadata inconsistency. By reclaiming the space of all chunk files, it can ensure that the status of the storage system is consistent with the status of the file system, thereby maintaining data integrity. Regularly performing space reclamation operations on all chunk files in a chunkgroup can prevent potential problems such as data loss or corruption. This helps maintain the stability and reliability of the storage system and ensure the long-term preservation and availability of data.
[0064] Fourth, it can simplify the operation and management process. Recycling all chunk files can reduce the complexity of the operation. There is no need to judge and process the usage of each chunk file separately, which simplifies the operation process and management workload. By recycling the space of all chunk files, the management efficiency of the storage system can be improved. Administrators can more easily monitor and manage the usage of storage resources, and make timely adjustments and optimizations to meet the changes and development of business needs.
[0065] According to the method of the present application, the step of the disk node reporting disk information and chunk file information to the central control node includes:
[0066] The disk node reports the hole rate and write rate of the chunk file to the central control node, wherein the hole rate indicates the ratio of deleted data to the file size, and the write rate indicates the ratio of all written data to the file size;
[0067] The central control node calculates the chunkgroup space recovery priority and sorts according to the priority, including: the central control point calculates the chunkgroup space recovery priority based on the uploaded hole rate and write rate, and recovers when the hole rate is greater than 50% and the write rate is greater than 80%.
[0068] The hole rate refers to the ratio of unused space to total space in a chunk file. When the hole rate is greater than 50%, it means that more than half of the space in the chunk file is not effectively utilized. In this case, recycling can bring the following benefits:
[0069] First, improve space utilization. Through the recycling operation, these unused spaces can be released and reallocated to other chunk files that need to store data, thereby improving the space utilization of the entire storage system.
[0070] Second, reduce storage fragmentation. As data is deleted and modified, many small, discontinuous space blocks (i.e., fragments) may be generated in the chunk file. These fragments may reduce storage efficiency in subsequent file allocation. Through recycling operations, these fragments can be integrated into continuous space blocks, thereby reducing the generation of storage fragmentation.
[0071] The write rate refers to the ratio of the data written to the current chunk file to the file size. When the write rate is greater than 80%, it means that the chunk file is writing a lot of data. In this case, recycling can bring the following benefits:
[0072] First, it can efficiently utilize storage space. When the write rate is high, it means that the chunk file is receiving a large amount of data writes. If there are a large number of holes (i.e., unused space) in the chunk file at this time, then write operations may frequently cross these holes, resulting in a decrease in write performance. Through recycling operations, these empty spaces can be released to make write operations more continuous and efficient, thereby improving the overall performance of the storage system. As data is continuously written, if the hole rate of the chunk file continues to be high and the write rate also remains high, then the storage limit of the chunk file may be reached quickly, resulting in the inability to continue writing data (i.e., data overflow). Through timely recycling operations, this situation can be prevented from happening and the normal storage and writing of data can be ensured.
[0073] Second, it can balance the cost and benefits of recycling. The recycling operation consumes certain system resources, including CPU, memory, and I / O. If you frequently recycle chunk files with low write rates, it may cause unnecessary system overhead and affect the overall performance of the storage system. When the write rate is high, the benefits of recycling operations are more obvious. By releasing empty space, the space utilization and write performance of the storage system can be significantly improved, thus bringing a better user experience.
[0074] Third, ensure data consistency. During the recycling process, it is necessary to ensure that the metadata of the storage system is consistent with the status of the file system. When the write rate is high, it means that the chunk file is frequently writing and modifying data. Performing recycling operations at this time can more easily ensure the accuracy of metadata and avoid data inconsistency issues. Regularly recycling chunk files with high write rates can prevent potential problems such as data loss or corruption. This helps maintain the stability and reliability of the storage system and ensure the long-term preservation and availability of data.
[0075] According to the method of the present application, each disk node regularly reports the disk read and write load and disk capacity to the central control node; regularly checks the hole rate (the ratio of deleted data and file size) and write rate (the ratio of all written data and file size) of each chunk file. If the chunk file is modified and meets the reporting conditions (the hole rate is greater than 50% and the write rate is greater than 80%), the disk node reports the hole rate, write rate and modification time to the central control node.
[0076] The main purpose of each disk node regularly reporting disk read / write load and disk capacity to the central control node is:
[0077] First, the central control node needs to understand the status of each disk node in real time or regularly to ensure the healthy operation of the entire storage system.
[0078] By collecting disk read and write load and capacity information, the control node can monitor the overall performance of the system and promptly identify potential performance bottlenecks or anomalies.
[0079] Second, in a distributed storage system, load balancing is the key to ensuring that all nodes share the load evenly and avoiding single-point overload.
[0080] Through the reported read and write load information, the central control node can dynamically adjust the data distribution and migrate high-load tasks to low-load nodes to achieve load balancing.
[0081] Third, disk capacity is one of the important resources of the storage system. Understanding its usage is crucial for the rational planning and management of storage resources.
[0082] Based on the reported disk capacity information, the central control node can predict future storage requirements and timely add new storage devices or perform capacity expansion operations to avoid service interruptions caused by insufficient storage space.
[0083] Fourth, disk failure is one of the common risks in the storage system. Timely discovery and handling of faulty nodes can minimize the risks of data loss and service interruption.
[0084] Based on the regularly reported disk status information, the central control node can detect abnormal disk nodes (such as decreased read / write speed, abnormal capacity, etc.) and take corresponding preventive measures such as data migration and fault alarm.
[0085] Fifth, the central control node can analyze the usage patterns and trends of the storage system based on the reported load and capacity information, thereby optimizing the storage strategy.
[0086] For example, adjust the data read / write strategy according to the load situation, and optimize the data storage layout according to the capacity usage situation, etc.
[0087] According to the method of the present application, the central control node performs sorting of space reclamation tasks. The central control node counts the hole rate and write rate of all chunk files corresponding to each chunkgroup, calculates the space reclamation priority of the chunkgroup, and sorts according to the priority.
[0088] During the space reclamation process, the higher the hole rate, the more disk space can be reclaimed, and the better the reclamation effect; during the space reclamation process, valid data needs to be written to a new chunk file. The more valid data (write rate - hole rate), the greater the impact on the system performance, and the smaller the valid data, the smaller the impact on the system performance.
[0089] Generally, the writing and deletion of chunkgroup data are continuous. The write control algorithm will try to fill a chunkgroup as much as possible. The higher the write rate, the longer the idle time (current time - modification time), and the less likely it is to modify the chunk file during the reclamation process, and the smaller the impact of the reclamation.
[0090] The calculation method of the space reclamation priority of the chunkgroup is as follows:
[0091] Let the hole rate be E and the write rate be F. Given that E < F, assuming that reclamation is only performed when the hole rate is greater than 50% and the write rate is greater than 80%, then:
[0092] Hole rate: 0.5 < E < 1
[0093] Write rate: 0.8 < F < 1
[0094] Valid data: 0 <F-E<0.5
[0095] The priority of space reclamation is positively correlated with the hole rate and write rate, and negatively correlated with valid data. The formula for calculating the priority P of a single chunk file in a chunkgroup is:
[0096] P=((E-0.5)+(0.5-(FE)))F
[0097] After simplification, we get:
[0098] P=(2E-F)F
[0099] The priority of each chunk file in the chunkgroup is calculated separately, and the priority of the entire chunkgroup is the sum of the priorities of all chunk files.
[0100] The formula is as follows:
[0101] Total P=P1+P2+P3+….
[0102] According to the method of the present application, the chunkgroup that enters the priority sorting is sorted only if its idle time exceeds 10 minutes, and the idle time is the current time minus the modification time.
[0103] For idle time, only chunkgroups whose idle time meets certain conditions (the default setting is 10 minutes) are sorted. The purpose of this is:
[0104] First, if chunkgroups are sorted frequently, a lot of computing resources and time will be consumed, thus affecting the overall performance of the system.
[0105] By setting an idle time threshold (such as 10 minutes), it is possible to reduce unnecessary sorting operations while ensuring data orderliness, thereby improving system operating efficiency.
[0106] Second, system resources (such as CPU, memory, etc.) are limited. Frequent sorting will take up a lot of resources, resulting in other tasks not being processed in a timely manner.
[0107] By setting the idle time threshold, you can make rational use of system resources and ensure that more important tasks are processed first when resources are limited.
[0108] Third, the sorting operation itself consumes certain system resources, including computing resources, memory resources, and I / O resources.
[0109] By limiting the frequency of sorting (i.e. setting an idle time threshold), system overhead can be reduced and the service life of the system can be extended.
[0110] Fourth, frequent sorting of data may undermine the stability of the data, resulting in data inconsistency or loss.
[0111] By setting a reasonable idle time threshold, you can maintain data stability while ensuring data orderliness and reduce data problems caused by sorting operations.
[0112] Fifth, data order is crucial to the performance and stability of the system, but frequent sorting operations will bring large system overhead.
[0113] By setting the idle time threshold, you can balance system overhead while ensuring data orderliness, achieving the best balance between performance and stability.
[0114] According to the method of this application, the central control node performs the space recovery task. Figure 2 As shown, the central control node traverses the space recovery task list, selects a chunkgroup, determines whether the hole rate of the chunkgroup meets the recovery requirements, traverses all the disk nodes corresponding to the chunk files, and determines whether the read and write loads of the disk nodes meet the execution conditions. The space recovery task is started only when all the disk nodes meet the execution conditions.
[0115] When starting a space reclamation task, the central control node freezes the corresponding chunkgroup. New write requests will not get the chunkgroup in the task, and no new data will be written to the chunkgroup in the task. The main purpose is:
[0116] First, when performing space reclamation tasks, if new data is allowed to be written to the reclaimed chunkgroup, data inconsistency may occur.
[0117] The freeze operation ensures that the data in the recycled chunkgroup does not change during the recycling process, thereby maintaining data consistency.
[0118] Second, space recovery tasks may involve operations such as data migration and deletion, and these operations need to be performed in a safe environment.
[0119] The freeze operation can prevent new write requests from interfering with the execution of the recovery task, thereby improving the safety of the task.
[0120] Third, allowing new data to be written to the recycled chunkgroup may increase the complexity and uncertainty of the system, thereby affecting the stability of the system.
[0121] By freezing the operation, the processing logic of the recycling task can be simplified, reducing potential errors and failures, thereby improving the stability of the system.
[0122] Fourth, during the execution of the recycling task, if new data is written to the recycled chunkgroup, it may cause data conflict and overwrite problems.
[0123] The freeze operation ensures that no new data is written to the recycled chunkgroup before the recycling task is completed, thus preventing data conflicts.
[0124] Fifth, the freeze operation can reduce the amount of data processed by the recycling task because no new data will be written to the recycled chunkgroup.
[0125] This helps speed up the execution of recycling tasks and improve recycling efficiency.
[0126] The central control node also needs to control the number of concurrent tasks of the disk node. For the same disk, only one task can be executed concurrently at the same time. If a task is already being executed, it can only execute the next task after the task is finished. The main reasons for this are:
[0127] First, the disk is a shared resource. Multiple tasks accessing the disk at the same time may cause resource competition and conflict, reducing the efficiency of disk access.
[0128] By limiting the number of concurrent tasks, you can avoid multiple tasks competing for disk resources at the same time, reduce conflicts and waiting time, and improve disk access performance.
[0129] Second, multiple tasks writing to disk simultaneously may cause data inconsistency and corruption, especially when disk I / O operations are busy.
[0130] By ensuring that only one task accesses the disk at a time, the risk of data conflicts and corruption can be reduced, and data consistency and integrity can be maintained.
[0131] Third, allowing multiple tasks to execute simultaneously may increase the uncertainty of the system and make the task execution time unpredictable.
[0132] By limiting the number of concurrent tasks, task execution can be made more orderly and predictable, making system management and monitoring easier.
[0133] Fourth, executing multiple tasks simultaneously will consume more system resources, including CPU, memory, and I / O.
[0134] By limiting the number of concurrent tasks, you can reduce the consumption of system resources, reduce system overhead, and improve the overall performance of the system.
[0135] Fifth, the disk has its own processing capacity and limitations. Executing multiple tasks simultaneously may overload the disk, resulting in performance degradation or even crash.
[0136] By limiting the number of concurrent tasks, you can prevent disk overload and protect the healthy operation of the disk.
[0137] According to the method of the present application, the disk node processes the space recovery task. The disk node receives the recovery task sent by the central control node and starts to perform the recovery operation on the chunk file.
[0138] During the recycling process, the disk node is prohibited from receiving requests to delete data. If a deletion request arrives, the deletion failure will be returned.
[0139] The reason why the disk node returns a deletion failure is:
[0140] First, the recycling process may involve operations such as data migration, merging, or deletion, which need to ensure the consistency and integrity of the data.
[0141] If a delete request is allowed during the recycling process, data may be accidentally deleted or overwritten, thus destroying data consistency.
[0142] Therefore, disabling deletion requests ensures that data is not accidentally modified or deleted during the recycling process.
[0143] Second, the recycling task is a complex process, and it is necessary to ensure that it will not be interfered with by other operations during execution.
[0144] Allowing the delete request may interfere with the execution of the reclamation task, causing task failure or data corruption.
[0145] By prohibiting the receipt of deletion requests, it is possible to ensure that the recycling task is performed in a safe and stable environment.
[0146] Third, a deletion request may result in permanent deletion of data, while the recovery process may be attempting to recover or protect that data.
[0147] If a delete request is allowed during the recycling process, the data being recycled may be accidentally deleted, resulting in data loss.
[0148] Therefore, disabling deletion requests can prevent data from being accidentally deleted during the recycling process.
[0149] Fourth, allowing deletion requests may increase the complexity and uncertainty of the system, thereby affecting the stability of the system.
[0150] By prohibiting the receipt of deletion requests, the processing logic of the recycling task can be simplified, reducing potential errors and failures, thereby improving the stability of the system.
[0151] After the recycling task is completed, the central control node is notified. The central task node receives the recycling task completion notification for all chunk files of the chunkgroup. The chunkgroup is thawed, and the chunkgroup that has completed the thaw operation can continue to receive write requests.
[0152] This application has the following advantages:
[0153] 1. Chunk files of the same chunkgroup are recycled at the same time, which has little impact on write and delete operations.
[0154] 2. The central control node sorts all recycling tasks, which increases recycling efficiency and achieves better recycling results.
[0155] 3. The central control node adjusts the execution of space recovery tasks according to the cluster load to avoid affecting normal reading and writing.
[0156] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by the present application.
[0157] Optionally, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0158] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0159] 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.
[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0161] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0162] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0163] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0164] In the embodiments provided in the present application, 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.
[0165] 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.
[0166] In addition, each functional unit in each embodiment of the present application 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.
[0167] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0168] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A distributed storage system space recovery method controlled by a central node, characterized in that: The method includes: Setting up a central control node; The disk nodes report disk information and chunk file information to the central control node; The central control node calculates the space recovery priority of the chunkgroup and sorts them according to the priority; The central control node performs space recovery tasks on the chunkgroups with higher priority; The central control node issues the space recovery tasks to the disk nodes, and the disk nodes perform space recovery operations on all chunk files in the chunkgroup.
2. The distributed storage system space recovery method controlled by a central node according to claim 1, characterized in that: The step where the disk nodes report disk information and chunk file information to the central control node includes: The disk nodes report the hole rate and write rate of the chunk files to the central control node. The hole rate is the ratio of the marked deleted data to the file size, and the write rate is the ratio of all written data to the file size; The step where the central control node calculates the space recovery priority of the chunkgroup and sorts them according to the priority includes: The central control point calculates the space recovery priority of the chunkgroup based on the uploaded hole rate and write rate, and performs recovery when the hole rate is greater than 50% and the write rate is greater than 80%.
3. The distributed storage system space recovery method controlled by a central node according to claim 2, characterized in that: The calculation method of the space recovery priority of the chunkgroup is: Let the hole rate be E and the write rate be F. Given that E < F, assuming that recovery is only performed when the hole rate is greater than 50% and the write rate is greater than 80%, then: Hole rate: 0.5 < E < 1 Write rate: 0.8 < F < 1 Valid data: 0 < F - E < 0.5 The formula for calculating the priority P of a single chunk file in the chunkgroup is: P = ((E - 0.5) + (0.5 - (F - E)))F After simplification, it is obtained: P = (2E - F)F The priority of the entire chunkgroup is the sum of the priorities of all chunk files. The formula is as follows: Total P = P1 + P2 + P3 +...
4. The distributed storage system space recovery method controlled by a central node according to claim 1, characterized in that: Sorting is only performed when the idle time of the chunkgroup entering the priority sorting exceeds 10 minutes. The idle time is the current time - the modification time.
5. The distributed storage system space recovery method controlled by a central node according to claim 1, characterized in that: The step where the central control node performs space recovery tasks on the chunkgroup includes: S101. The central control node traverses the chunkgroup queue to be recovered; S102. Obtain a chunkgroup from the queue; S103. Determine whether the hole rate of the chunkgroup meets the conditions. If it meets, the central control node continues to traverse the chunk file list in the chunkgroup. If it does not meet, select another chunkgroup; S104. Obtain the information of a chunk file from the traversed chunk file list, and then obtain the disk node information corresponding to the chunk file; S105, determining whether the load of the disk node meets the condition, if so, continuing to obtain the information of the next chunk file, if not, putting the recycling task back into the queue; S106: When the hole rate of the chunkgroup meets the requirement and the disk node loads corresponding to all chunk files in the chunkgroup meet the condition, the traversal ends and the space recovery task is started.
6. The distributed storage system space recovery method controlled by a central node according to claim 1, characterized in that: When executing a space recovery task, the central control point performs a freeze operation on the corresponding chunkgroup, and new write requests will not be written into the chunkgroup.
7. The distributed storage system space recovery method controlled by a central node according to claim 5, characterized in that: The load condition of the disk node is that the same disk node can only execute one task concurrently at the same time.
8. The distributed storage system space recovery method controlled by a central node according to claim 1, characterized in that: When the disk node performs a space recovery operation on a chunk file, the disk node is prohibited from receiving a request to delete data. If there is a new deletion request, the disk node returns a deletion failure signal and notifies the central control node after completing the recovery task.
9. The distributed storage system space recovery method controlled by a central node according to claim 8, characterized in that: After receiving the notification of completion of the recycling task from the disk node, the central control node performs an unfreezing operation on the chunkgroup, and the unfrozen chunkgroup can continue to receive write requests.
10. The distributed storage system space recovery method controlled by a central node according to claim 1, characterized in that: The disk information includes disk read / write load and disk capacity.
Citation Information
Patent Citations
Data recovery method and system
CN110716690A
Prioritization and Source-Nonspecific Based Virtual Machine Recovery Apparatuses, Methods and Systems
US20200159625A1
Garbage collection method and apparatus for solid state disk, and electronic device and storage medium
WO2024113746A1
Cited By
Space recovery method and device for file storage system
CN120523780A