Method, device, apparatus, storage medium and program product for deleting a volume
By sending query requests to the target service node from the management node and selecting a backup node, the problem of smooth execution of volume deletion tasks in fault scenarios is solved, and efficient volume deletion and resource management are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DAWNING INFORMATION IND (BEIJING) CO LTD
- Filing Date
- 2022-10-20
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies cannot guarantee the successful execution of volume deletion tasks in fault scenarios, leading to volume deletion failures or the inability to clean up managed resources.
The management node sends a query request to the target service node to check the progress of the deletion task, and releases management resources after the task is completed. It selects a backup service node or management node to ensure the smooth progress of the task, uses load capacity to select the target service node, and queries periodically to improve the success rate.
It improves the success rate and efficiency of volume deletion tasks, avoids task failures caused by accidental release of management resources and network failures, and ensures the smooth execution of volume deletion tasks under various failure scenarios.
Smart Images

Figure CN116027967B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, storage medium, and program product for deleting volumes. Background Technology
[0002] In distributed block storage systems, deleting a volume is a common volume management operation. A volume, also known as a logical volume, is a certain amount of storage space allocated from a storage pool. These storage spaces logically form a logical volume. Generally, a logical volume provides services on a specific node, and the task of deleting a volume is also performed on that node.
[0003] In existing technologies, when deleting a volume, the management node typically sends a volume deletion command to the service node. The service node then performs the deletion operation on the corresponding volume based on the received volume deletion command and notifies the management node after the deletion is complete.
[0004] However, the above-mentioned technologies cannot guarantee the successful execution of volume deletion tasks in certain failure scenarios. Summary of the Invention
[0005] Therefore, it is necessary to provide a volume deletion method, apparatus, device, storage medium, and program product that can ensure the smooth execution of volume deletion tasks under various fault scenarios, in order to address the above-mentioned technical problems.
[0006] Firstly, this application provides a method for deleting a volume, the method comprising:
[0007] Obtain the deletion command; the deletion command includes the identifier of the volume to be deleted;
[0008] Based on the identifier of the volume to be deleted, the target service node corresponding to the volume to be deleted is determined, and the deletion command is sent to the target service node so that the target service node can perform the deletion task on the volume to be deleted;
[0009] Send a query request to the target service node; the query request is used to check whether the target service node has completed the deletion task.
[0010] After the deletion task is completed on the target service node, the management resources corresponding to the volume to be deleted are released.
[0011] In this embodiment, since the management node can send a query request to the target service node to be deleted to check whether the target service node has completed the deletion task, the management node can accurately know whether the target service node has completed the deletion task and release the management resources corresponding to the volume inside the management node after completion, ensuring the smooth execution of the volume deletion task. At the same time, the management node can accurately and quickly obtain the target service node to perform the deletion task through the identifier of the volume to be deleted, which can also improve the efficiency of deleting the volume.
[0012] In one embodiment, determining the target service node corresponding to the volume to be deleted based on the identifier of the volume to be deleted includes:
[0013] Determine the initial service node corresponding to the volume to be deleted based on the identifier of the volume to be deleted;
[0014] If the initial service node fails, a candidate service node will be selected from at least one preset candidate service node as the target service node.
[0015] Migrate the volume to be deleted to the target service node so that the target service node can perform the deletion task on the volume to be deleted.
[0016] In this embodiment, the initial service node is determined by the identifier of the volume to be deleted. If the initial service node fails, a target service node is selected from the candidate service nodes, and the volume to be deleted is migrated to the target service node so that the target service node can perform the deletion task. This ensures the smooth execution of the volume deletion task and improves its success rate even if the service node performing the volume deletion task fails. By migrating the data of the volume to be deleted to a new service node and interacting with the management node, the deletion can continue.
[0017] In one embodiment, the above-mentioned selection of a candidate service node as the target service node from at least one preset candidate service nodes includes:
[0018] Obtain the load capacity corresponding to each candidate service node;
[0019] The target service node is determined from the candidate service nodes based on the load capacity.
[0020] In this embodiment, a new service node for the volume to be deleted is determined by the load capacity of each service node. This process is simple and accurate, and can further improve the efficiency of volume deletion.
[0021] In one embodiment, sending a query request to the target service node includes:
[0022] Periodically send query requests to the target service node.
[0023] In this embodiment, by periodically sending query requests to the target service node, the problem of not being able to obtain query results in a timely manner due to query request failure can be avoided. At the same time, the problem of the target service node failing to notify the management node due to network failures or other issues can also be avoided, thereby improving the success rate of obtaining query results.
[0024] In one embodiment, releasing the management resources corresponding to the volume to be deleted after the deletion task is completed on the target service node includes:
[0025] Receive a response message sent by the target service node; the response message is used to indicate that the target service node has completed the deletion task.
[0026] After receiving the response message, once it is determined that the target service node has completed the deletion task, the management resources corresponding to the volume to be deleted are released.
[0027] In this embodiment, after receiving a response message from the target service node indicating that the deletion task has been completed, the management node releases the management resources corresponding to the volume to be deleted. This can prevent the management node from accidentally releasing management resources, which could lead to deletion failure. Furthermore, it can ensure the smooth execution of the volume deletion task even if there is a network failure at the target service node or a failure in the interaction between the target service node and the management node, thereby further improving the success rate of the volume deletion task.
[0028] In one embodiment, the method further includes:
[0029] If no response message is received within the preset time period, another candidate service node will be selected from at least one preset candidate service node as the new target service node.
[0030] Migrate the volume to be deleted to the new target service node and send a query request to the new target service node.
[0031] In this embodiment, if the management node does not receive a response message from the target service node within a set time period, it can re-determine a new target service node and migrate the volume to the new target service node to continue service, ensuring the smooth execution of the volume deletion task in this fault scenario.
[0032] In one embodiment, the method further includes:
[0033] If the target management node that communicates with the target service node fails, a candidate management node is selected from at least one preset candidate management node as the new target management node.
[0034] In this embodiment, when the target management node communicating with the target service node fails, a new target management node can be selected, and the deletion task of the volume to be deleted can be queried on the target service node. In this way, even if the management node fails, the volume deletion task can still be executed smoothly, and the volume data deletion and recycling can be completed, thereby further improving the success rate of the volume deletion task.
[0035] Secondly, this application also provides a volume deletion device, the device comprising:
[0036] The acquisition module is used to acquire deletion instructions; the deletion instructions include the identifier of the volume to be deleted.
[0037] The determination module is used to determine the target service node corresponding to the volume to be deleted based on the identifier of the volume to be deleted, and send the deletion command to the target service node so that the target service node can perform the deletion task on the volume to be deleted;
[0038] The query module is used to send query requests to the target service node; the query request is used to check whether the target service node has completed the deletion task.
[0039] The deletion module is used to release the management resources corresponding to the volume to be deleted after the deletion task is completed on the target service node.
[0040] Thirdly, this application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0041] Obtain the deletion command; the deletion command includes the identifier of the volume to be deleted;
[0042] Based on the identifier of the volume to be deleted, determine the target service node corresponding to the volume to be deleted, and send the deletion command to the target service node so that the target service node can perform the deletion task on the volume to be deleted;
[0043] Send a query request to the target service node; the query request is used to check whether the target service node has completed the deletion task.
[0044] After the deletion task is completed on the target service node, the management resources corresponding to the volume to be deleted are released.
[0045] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0046] Obtain the deletion command; the deletion command includes the identifier of the volume to be deleted;
[0047] Based on the identifier of the volume to be deleted, determine the target service node corresponding to the volume to be deleted, and send the deletion command to the target service node so that the target service node can perform the deletion task on the volume to be deleted;
[0048] Send a query request to the target service node; the query request is used to check whether the target service node has completed the deletion task.
[0049] After the deletion task is completed on the target service node, the management resources corresponding to the volume to be deleted are released.
[0050] Fifthly, this application also provides a computer program product, comprising a computer program that, when executed by a processor, performs the following steps:
[0051] Obtain the deletion command; the deletion command includes the identifier of the volume to be deleted;
[0052] Based on the identifier of the volume to be deleted, determine the target service node corresponding to the volume to be deleted, and send the deletion command to the target service node so that the target service node can perform the deletion task on the volume to be deleted;
[0053] Send a query request to the target service node; the query request is used to check whether the target service node has completed the deletion task.
[0054] After the deletion task is completed on the target service node, the management resources corresponding to the volume to be deleted are released.
[0055] The aforementioned method, apparatus, device, storage medium, and program product for deleting volumes determine the target service node for the deletion task by acquiring the identifier of the volume to be deleted, send a deletion command to the target service node to execute the deletion task, then send a query request to the target service node to check whether the target service node has completed the deletion task, and release the management resources corresponding to the volume to be deleted after the target node has completed the deletion task. In this method, since the management node can send a query request to the target service node to delete the volume to check whether the target service node has completed the deletion task, this allows the management node to accurately know whether the target service node has completed the deletion task, and release the management resources corresponding to the volume within the management node after completion, ensuring the smooth execution of the volume deletion task. Simultaneously, the management node can accurately and quickly obtain the target service node for the deletion task through the identifier of the volume to be deleted, which also improves the efficiency of volume deletion. Attached Figure Description
[0056] Figure 1 This is a diagram illustrating the application environment of a volume deletion method in one embodiment.
[0057] Figure 2 This is a flowchart illustrating a volume deletion method in one embodiment;
[0058] Figure 3 This is a flowchart illustrating a volume deletion method in another embodiment;
[0059] Figure 4 This is a flowchart illustrating a volume deletion method in another embodiment;
[0060] Figure 5 This is a structural block diagram of a volume deletion device in one embodiment;
[0061] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0062] 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.
[0063] Currently, when deleting a volume, the management node typically sends a volume deletion command to the service node. The service node then performs the deletion operation on the corresponding volume based on the received command and notifies the management node upon completion. However, if the service node crashes during background volume reclamation, the deletion task is interrupted. When the volume set is migrated to a new service node, the reclamation task cannot be restarted, resulting in the volume's storage space not being reclaimed and the volume deletion and reclamation failing. Furthermore, even if the service node successfully reclaims the volume in the background, network failures causing notification failures to the management node or loss of notification messages can prevent the management information of the corresponding volume on the management node from being cleared, again hindering the complete deletion and reclamation of the volume. Therefore, the above techniques cannot guarantee the successful execution of volume deletion tasks in certain scenarios. Based on this, embodiments of this application provide a volume deletion method, apparatus, device, storage medium, and program product to solve the aforementioned technical problems.
[0064] The volume deletion method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, management node 102 can communicate with service nodes 104, and one management node 102 can communicate with multiple service nodes 104. Management node 102 can send instructions and query messages to service nodes 104, and service nodes 104 can perform corresponding operations based on the instructions or query messages from management node 102, and can also send response or reply messages back to management node 102. Both management node 102 and service node 104 can be computer devices or other devices with computing and communication functions. If management node 102 and service node 104 are computer devices, they can both be terminals, both be servers, or one can be a terminal and the other a server; no specific limitation is made here. The specific form of the terminal and server is also not specifically limited here.
[0065] In one embodiment, such as Figure 2 As shown, a method for deleting a volume is provided, which can be applied to... Figure 1 Taking the management node in the example, this method may include the following steps:
[0066] S202, Obtain deletion command; the deletion command includes the identifier of the volume to be deleted.
[0067] In this step, a user can initiate a deletion task, indicating that a volume needs to be deleted and specifying the identifier of the volume to be deleted. For example, the user can select the volume to be deleted and its identifier on the management node's display interface and click the delete control. The management node will then be aware that the user wants to delete the volume, i.e., receive the deletion instruction, and obtain the identifier of the volume to be deleted, which can be denoted as the "volume to be deleted." The identifier of the volume to be deleted can be one or more combinations of numbers, letters, and words.
[0068] S204. Based on the identifier of the volume to be deleted, determine the target service node corresponding to the volume to be deleted, and send the deletion command to the target service node so that the target service node can perform the deletion task on the volume to be deleted.
[0069] In this step, the management node can pre-push all volumes (LUNs) to the service nodes in a balanced manner. The service nodes then provide services or tasks such as computation, access, and deletion for their respective volumes. The balanced distribution method can be to distribute the volumes evenly among the service nodes. For example, with 10 volumes and 5 service nodes, 2 volumes can be distributed to each service node. The specific volume distribution to each service node is not limited; the goal is to ensure a more even distribution of workload across the service nodes, preventing any single service node from having an excessive workload and resulting in high power consumption.
[0070] The management node can also know the identifiers of each volume and each service node in advance. After evenly distributing the volumes to the service nodes, it can also know the volumes distributed to each service node and their identifiers, and can establish a correspondence between each service node and the volumes it serves (specifically, a correspondence between identifiers). Thus, after the management node obtains the identifier of the volume to be deleted, it can search the correspondence using that identifier to obtain the identifier of the service node corresponding to that volume. Through this obtained service node, the target service node for performing the deletion task on the volume to be deleted can be determined.
[0071] After the management node learns the target service node from which to perform the deletion task on the volume to be deleted, it can send the deletion command to the target service node. Upon receiving the deletion command, the target service node can generate an asynchronous deletion task for the volume to be deleted and submit it to the background to run. It can then send a notification message to the management node, instructing it to periodically check whether the deletion task has been completed. Establishing an asynchronous deletion task here ensures that the target service node's execution of the deletion task on the volume to be deleted does not affect the service operation of other volumes.
[0072] Of course, if a failure occurs during the deletion process on the target service node, the management node can resend the deletion command to the target service node so that it can quickly execute the deletion task and complete the deletion of the volume to be deleted. Situations where the target service node encounters a failure during the deletion process may include: the deletion task failing, the target service node timing out its notification message to the management node, or a network outage at the target service node.
[0073] Additionally, it should be noted that asynchronous deletion tasks on the target service node generally need to support reentrancy. If a previous asynchronous deletion task is in progress but failed to notify the management node, then when the management node resends the deletion command, the target service node needs to identify that it is a duplicate deletion command to avoid data inconsistency caused by the concurrent execution of two identical deletion tasks.
[0074] S206, Send a query request to the target service node; the query request is used to check whether the target service node has completed the deletion task.
[0075] In this step, as mentioned above, a notification message can be sent to the management node to notify it to periodically check whether the deletion task has been completed. After sending the deletion instruction to the target service node, the management node can send a query request to the target service node to check whether the target service node has completed the deletion task of the volume to be deleted. This allows the management node to proactively and promptly know whether the target service node has completed the deletion task of the volume to be deleted.
[0076] Additionally, as an optional implementation, when the management node sends a query request, it can periodically send query requests to the target service node. This period could be, for example, every 10ms, 100ms, 1 second, etc., and the specific interval can be set according to actual needs. By periodically sending query requests to the target service node, the problem of not being able to obtain query results in a timely manner due to query request failures can be avoided. It also avoids the problem of the target service node failing to notify the management node due to network failures or other issues, thus improving the success rate of obtaining query results.
[0077] S208: After the deletion task is completed on the target service node, the management resources corresponding to the volume to be deleted are released.
[0078] In this step, if the management node learns that the target service node has completed the deletion task for the volume, then the management node can delete the management resources previously allocated to the volume to be deleted on the management node, that is, clear all management resources corresponding to the volume to be deleted, thus achieving the complete deletion of the volume. If the management node learns that the target service node has not yet completed the deletion task, it will continue to send query requests periodically to perform queries until the management node learns that the target service node has completed the deletion task.
[0079] In the aforementioned volume deletion method, the target service node for executing the deletion task is determined by obtaining the identifier of the volume to be deleted. A deletion command is then sent to the target service node to execute the deletion task. Subsequently, a query request is sent to the target service node to check whether the deletion task has been completed. After the target node completes the deletion task, the management resources corresponding to the volume to be deleted are released. This method allows the management node to accurately determine whether the target service node has completed the deletion task and release the management resources corresponding to the volume within the management node after completion, ensuring the smooth execution of the volume deletion task. Simultaneously, the management node can accurately and quickly obtain the target service node for executing the deletion task through the identifier of the volume to be deleted, which also improves the efficiency of volume deletion.
[0080] The above embodiments mentioned that the corresponding target service node can be determined by the identifier of the volume to be deleted. The following embodiments will describe in detail the specific process of this determination.
[0081] In another embodiment, a different method for deleting a volume is provided, based on the above embodiments, such as... Figure 3 As shown, the above S204 may include the following steps:
[0082] S302, Based on the identifier of the volume to be deleted, determine the initial service node to perform the deletion task on the volume to be deleted.
[0083] In this step, as mentioned above, the initial service node for the volume to be deleted can be determined from the pre-established correspondence between the management node and the distribution service nodes. This initial service node is denoted as the initial service node.
[0084] After determining the initial service node, it can be checked whether the initial service node has failed (e.g., crashed). In one possible implementation, if the initial service node has not failed, it can be used as the target service node for services such as deleting the volume to be deleted.
[0085] In another possible implementation, if the initial service node fails (e.g., goes down), the following steps can be performed to determine the target service node:
[0086] S304. If the initial service node fails, select a candidate service node from at least one preset candidate service node as the target service node.
[0087] The candidate service node can be any service node other than the initial service node that has not experienced a failure. As an optional implementation, when selecting the target service node from the candidate service nodes, one approach is to obtain the load capacity corresponding to each candidate service node and determine the target service node from among the candidate service nodes based on the load capacity.
[0088] In this step, the management node can determine the load capacity of each candidate service node when pre-distributing service volumes to them. The load capacity can be the number of volumes requiring service on each candidate service node. After obtaining the load capacity of each candidate service node, the management node can select the smallest load capacity and use the candidate service node corresponding to the smallest load capacity as the target service node to execute the deletion task of the volume to be deleted.
[0089] S306, migrate the volume to be deleted to the target service node so that the target service node can perform the deletion task on the volume to be deleted.
[0090] In this step, after identifying the target node, the volume to be deleted can be migrated to the target service node. The management node can then send a query request to the target node to check if the deletion task for the volume has been completed. Additionally, in the event of an initial service node failure, the takeover target service node, while processing the query request sent by the management node, can also check if an asynchronous deletion task has been started in the background. If not, it will start the background asynchronous volume deletion task to complete the deletion of the volume to be deleted.
[0091] Furthermore, after the target service node starts the asynchronous volume deletion task in the background, it can send a notification message to the management node so that the management node can periodically check whether the deletion task of the target service node has been completed. In this way, the management node can periodically send query requests to the target service node to perform queries.
[0092] In this embodiment, the initial service node is determined by the identifier of the volume to be deleted. If the initial service node fails, a target service node is selected from the candidate service nodes, and the volume to be deleted is migrated to the target service node so that the target service node can perform the deletion task. This ensures the smooth execution of the volume deletion task and improves its success rate even if the service node performing the volume deletion task fails. Furthermore, determining a new service node to serve the volume to be deleted based on the load capacity of each service node is simple and accurate, further improving the efficiency of volume deletion.
[0093] The above embodiments mention that the management node can release the corresponding management resources after the target service node completes the volume deletion. The following embodiments describe a possible implementation of this process.
[0094] In another embodiment, a different method for deleting a volume is provided, based on the above embodiments, such as... Figure 4 As shown, the above S208 may include the following steps:
[0095] S402, Receive a response message sent by the target service node; the response message is used to indicate that the target service node has completed the deletion task.
[0096] In this step, after the target service node completes the deletion task of the volume to be deleted, it can send a response message to the management node to inform the management node that the target service node has completed the deletion task of the volume to be deleted, that is, the deletion task of the volume to be deleted was successful.
[0097] The target service node can send response messages to the management node periodically or only once; there is no specific limitation here.
[0098] S404: After receiving the response message, if the target service node has completed the deletion task, the management resources corresponding to the volume to be deleted will be released.
[0099] In this step, in one possible implementation, if the management node receives a response message from the target service node within a preset time period, it can determine that the target service node has completely completed the deletion task of the volume to be deleted. Then, the management node can delete the management resources pre-set for the volume to be deleted on the management node, thus completing the deletion of the volume. The preset time period can be set according to actual conditions, such as 10 seconds, 1 minute, etc.
[0100] In another possible implementation, as an optional embodiment, if no response message is received within a preset time period, another candidate service node is selected from at least one preset candidate service node as the new target service node; the volume to be deleted is migrated to the new target service node, and a query request is sent to the new target service node. That is, if the management node does not receive a response message from the target service node within the preset time period, it may be due to a network failure at the target service node, causing the response message to time out or the network failure to recover. In this case, the management node can remove the target service node from the cluster of the at least one candidate service node, and reselect a service node from the cluster of candidate service nodes as the new target service node. The volume to be deleted and other volumes originally on the target service node are migrated to the new target service node, and the query continues on the new target service node. For volumes whose deletion tasks have been completed in the background, the new service node can directly send a response message to the management node so that the management node can release subsequent management resources.
[0101] In this embodiment, the management node releases the management resources corresponding to the volume to be deleted after receiving a confirmation message from the target service node indicating that the deletion task has been completed. This avoids the management node accidentally releasing management resources, which could lead to deletion failure. Furthermore, it ensures the smooth execution of the volume deletion task even if there is a network failure at the target service node or a failure in the interaction between the target service node and the management node, further improving the success rate of the volume deletion task. Additionally, if the management node does not receive a confirmation message from the target service node within a set time period, it can re-determine a new target service node and migrate the volume to the new target service node to continue service, ensuring the smooth execution of the volume deletion task in this type of failure scenario.
[0102] The above embodiments mentioned how to ensure the smooth execution of the volume deletion task when the service node executing the volume deletion task fails, or when the interaction between the service node and the management node fails, or when the network of the service node fails. However, in actual applications, the management node may also fail. Therefore, the following embodiments will explain how to ensure the smooth execution of the volume deletion task when the management node fails.
[0103] In another embodiment, a different method for deleting a volume is provided. Based on the above embodiments, the method may further include the following steps:
[0104] If the target management node that communicates with the target service node fails, a candidate management node is selected from at least one preset candidate management node as the new target management node.
[0105] In this step, the distributed block storage cluster typically includes multiple candidate management nodes. These candidate management nodes are selected by means of a vote that is more than half of the total number of candidate management nodes. The candidate management node that receives more than half of the votes can be elected as the target management node.
[0106] In this embodiment and the embodiments described above, the management node that interacts with the target service node and other service nodes is the target management node. During the interaction process between the target management node and the target service node, if the target management node fails (e.g., the target management node crashes), a new candidate management node can be selected from multiple candidate management nodes other than the target management node. The selection method can also be based on the number of nodes that receive more than half of the votes.
[0107] After a new target management node is selected, it can continue to interact with the aforementioned target service node and other service nodes. For example, it can continue to query on the target service node whether the deletion task of the volume to be deleted has been completed, ensuring the smooth execution of the volume deletion task.
[0108] In this embodiment, when the target management node communicating with the target service node fails, a new target management node can be selected, and the deletion task of the volume to be deleted can be queried on the target service node. In this way, even if the management node fails, the volume deletion task can still be executed smoothly, and the volume data deletion and recycling can be completed, thereby further improving the success rate of the volume deletion task.
[0109] The following is a detailed embodiment to better illustrate the technical solution of the embodiments of this application. Based on the above embodiment, taking the interaction process between the service node and the management node as an example, the method may include the following steps:
[0110] S1, the management node obtains the deletion command; the deletion command includes the identifier of the volume to be deleted;
[0111] S2, the management node determines the initial service node corresponding to the volume to be deleted based on the identifier of the volume to be deleted;
[0112] S3, If the initial service node fails, the management node selects a candidate service node from at least one preset candidate service node as the target service node.
[0113] S4, the management node migrates the volume to be deleted to the target service node;
[0114] S5, the management node sends the deletion command to the target service node, so that the target service node can perform the deletion task on the volume to be deleted;
[0115] S6, the target service node sends a notification message to the management node to notify the management node to check whether the target service node has completed the deletion task;
[0116] S7, the management node periodically sends query requests to the target service node; the query requests are used to check whether the target service node has completed the deletion task;
[0117] S8. After the target service node completes the deletion task of the volume to be deleted, it sends a response message to the management node, indicating that the target service node has completed the deletion task.
[0118] S9, the management node receives the response message sent by the target service node;
[0119] S10, after receiving the response message, if it is determined that the target service node has completed the deletion task, the management resources corresponding to the volume to be deleted are released;
[0120] S11. If no response message is received within the preset time period, another candidate service node is selected from at least one preset candidate service node as the new target service node.
[0121] S12, migrate the volume to be deleted to the new target service node, and send a query request to the new target service node;
[0122] S13, if the target management node communicating with the target service node fails, select a candidate management node from at least one preset candidate management node as the new target management node.
[0123] 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 of other steps.
[0124] Based on the same inventive concept, this application also provides a volume deletion apparatus for implementing the volume 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 the one or more volume deletion apparatus embodiments provided below can be found in the limitations of the volume deletion method described above, and will not be repeated here.
[0125] In one embodiment, such as Figure 5 As shown, a volume deletion device is provided, comprising: an acquisition module 11, a determination module 12, a query module 13, and a deletion module 14, wherein:
[0126] The acquisition module 11 is used to acquire a deletion instruction; the deletion instruction includes the identifier of the volume to be deleted.
[0127] The determination module 12 is used to determine the target service node corresponding to the volume to be deleted based on the identifier of the volume to be deleted, and send the deletion instruction to the target service node so that the target service node can perform the deletion task on the volume to be deleted;
[0128] Query module 13 is used to send a query request to the target service node; the query request is used to check whether the target service node has completed the deletion task.
[0129] The deletion module 14 is used to release the management resources corresponding to the volume to be deleted after the deletion task is completed on the target service node.
[0130] Optionally, the query module 13 mentioned above is specifically used to periodically send query requests to the target service node.
[0131] In another embodiment, a different volume deletion device is provided. Based on the above embodiments, the determining module 12 may include:
[0132] The node determination unit is used to determine the initial service node corresponding to the volume to be deleted based on the identifier of the volume to be deleted.
[0133] The selection unit is used to select a candidate service node as the target service node from at least one preset candidate service nodes if the initial service node fails.
[0134] The migration unit is used to migrate the volume to be deleted to the target service node, so that the target service node can perform the deletion task on the volume to be deleted.
[0135] Optionally, the selection unit is specifically used to obtain the load capacity corresponding to each candidate service node; and to determine the target service node from each candidate service node based on the load capacity.
[0136] In another embodiment, a different volume deletion device is provided. Based on the above embodiments, the deletion module 14 may include:
[0137] The receiving unit is used to receive the response message sent by the target service node; the response message is used to indicate that the target service node has completed the deletion task.
[0138] The release unit is used to release the management resources corresponding to the volume to be deleted after receiving a response message and determining that the target service node has completed the deletion task.
[0139] Optionally, the above-mentioned device may further include:
[0140] The service node selection module is used to select another candidate service node as the new target service node from at least one preset candidate service node if no response message is received within a preset time period.
[0141] The volume migration module is used to migrate the volume to be deleted to a new target service node and send a query request to the new target service node.
[0142] In another embodiment, a different volume deletion device is provided, which, based on the above embodiments, may further include:
[0143] The management node selection module is used to select a candidate management node as the new target management node from at least one preset candidate management nodes if the target management node that communicates with the target service node fails.
[0144] The modules in the aforementioned volume 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.
[0145] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing 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 an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data involved in the volume deletion process. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a volume deletion method.
[0146] Those skilled in the art will understand that Figure 6 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.
[0147] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0148] Obtain a deletion instruction; the deletion instruction includes the identifier of the volume to be deleted; based on the identifier of the volume to be deleted, determine the target service node corresponding to the volume to be deleted, and send the deletion instruction to the target service node so that the target service node can perform the deletion task on the volume to be deleted; send a query request to the target service node; the query request is used to check whether the target service node has completed the deletion task; after the target service node has completed the deletion task, release the management resources corresponding to the volume to be deleted.
[0149] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0150] Based on the identifier of the volume to be deleted, determine the initial service node corresponding to the volume to be deleted; if the initial service node fails, select a candidate service node from at least one preset candidate service node as the target service node; migrate the volume to be deleted to the target service node so that the target service node can perform the deletion task on the volume to be deleted.
[0151] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0152] Obtain the load capacity corresponding to each candidate service node; determine the target service node from the candidate service nodes based on the load capacity.
[0153] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0154] Periodically send query requests to the target service node.
[0155] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0156] Receive a response message sent by the target service node; the response message is used to indicate that the target service node has completed the deletion task; after receiving the response message, if it is determined that the target service node has completed the deletion task, the management resources corresponding to the volume to be deleted are released.
[0157] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0158] If no response message is received within the preset time period, another candidate service node is selected from at least one preset candidate service node as the new target service node; the volume to be deleted is migrated to the new target service node, and a query request is sent to the new target service node.
[0159] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0160] If the target management node that communicates with the target service node fails, a candidate management node is selected from at least one preset candidate management node as the new target management node.
[0161] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0162] Obtain a deletion instruction; the deletion instruction includes the identifier of the volume to be deleted; based on the identifier of the volume to be deleted, determine the target service node corresponding to the volume to be deleted, and send the deletion instruction to the target service node so that the target service node can perform the deletion task on the volume to be deleted; send a query request to the target service node; the query request is used to check whether the target service node has completed the deletion task; after the target service node has completed the deletion task, release the management resources corresponding to the volume to be deleted.
[0163] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0164] Based on the identifier of the volume to be deleted, determine the initial service node corresponding to the volume to be deleted; if the initial service node fails, select a candidate service node from at least one preset candidate service node as the target service node; migrate the volume to be deleted to the target service node so that the target service node can perform the deletion task on the volume to be deleted.
[0165] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0166] Obtain the load capacity corresponding to each candidate service node; determine the target service node from the candidate service nodes based on the load capacity.
[0167] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0168] Periodically send query requests to the target service node.
[0169] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0170] Receive a response message sent by the target service node; the response message is used to indicate that the target service node has completed the deletion task; after receiving the response message, if it is determined that the target service node has completed the deletion task, the management resources corresponding to the volume to be deleted are released.
[0171] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0172] If no response message is received within the preset time period, another candidate service node is selected from at least one preset candidate service node as the new target service node; the volume to be deleted is migrated to the new target service node, and a query request is sent to the new target service node.
[0173] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0174] If the target management node that communicates with the target service node fails, a candidate management node is selected from at least one preset candidate management node as the new target management node.
[0175] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0176] Obtain a deletion instruction; the deletion instruction includes the identifier of the volume to be deleted; based on the identifier of the volume to be deleted, determine the target service node corresponding to the volume to be deleted, and send the deletion instruction to the target service node so that the target service node can perform the deletion task on the volume to be deleted; send a query request to the target service node; the query request is used to check whether the target service node has completed the deletion task; after the target service node has completed the deletion task, release the management resources corresponding to the volume to be deleted.
[0177] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0178] Based on the identifier of the volume to be deleted, determine the initial service node corresponding to the volume to be deleted; if the initial service node fails, select a candidate service node from at least one preset candidate service node as the target service node; migrate the volume to be deleted to the target service node so that the target service node can perform the deletion task on the volume to be deleted.
[0179] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0180] Obtain the load capacity corresponding to each candidate service node; determine the target service node from the candidate service nodes based on the load capacity.
[0181] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0182] Periodically send query requests to the target service node.
[0183] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0184] Receive a response message sent by the target service node; the response message is used to indicate that the target service node has completed the deletion task; after receiving the response message, if it is determined that the target service node has completed the deletion task, the management resources corresponding to the volume to be deleted are released.
[0185] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0186] If no response message is received within the preset time period, another candidate service node is selected from at least one preset candidate service node as the new target service node; the volume to be deleted is migrated to the new target service node, and a query request is sent to the new target service node.
[0187] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0188] If the target management node that communicates with the target service node fails, a candidate management node is selected from at least one preset candidate management node as the new target management node.
[0189] It should be noted that the data involved in this application (including but not limited to data used for analysis, stored data, and displayed data) are all information and data authorized by the user or fully authorized by all parties.
[0190] Those skilled in the art will understand that all or part of the processes in 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. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile 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, etc., and are not limited to these.
[0191] 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 specification.
[0192] 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 method for deleting a volume, characterized in that, The method includes: Obtain a deletion command; the deletion command includes an identifier of the volume to be deleted; Based on the identifier of the volume to be deleted, the initial service node corresponding to the volume to be deleted is determined; if the initial service node fails, a candidate service node is selected from at least one preset candidate service node as the target service node; the volume to be deleted is migrated to the target service node, and the deletion instruction is sent to the target service node so that the target service node performs the deletion task on the volume to be deleted, and the deletion instruction is used to trigger the target service node to generate an asynchronous deletion task corresponding to the volume to be deleted; the management node knows the identifier of each volume and the identifier of each service node in advance, and establishes a correspondence between the identifiers of each service node and the volume it serves; A query request is sent to the target service node; the query request is used to check whether the target service node has completed the deletion task. After the target service node completes the deletion task, the management resources corresponding to the volume to be deleted are released. If the target management node communicating with the target service node fails, a new target management node is selected from at least one preset candidate management node. The new target management node continues to send the query request to the target service node to check whether the target service node has completed the deletion task.
2. The method according to claim 1, characterized in that, The step of selecting a candidate service node as the target service node from at least one preset candidate service nodes includes: Obtain the load capacity corresponding to each of the candidate service nodes; The target service node is determined from the candidate service nodes based on the load capacity of each node.
3. The method according to claim 1 or 2, characterized in that, Sending a query request to the target service node includes: Periodically send query requests to the target service node.
4. The method according to claim 1 or 2, characterized in that, After the deletion task is completed on the target service node, the management resources corresponding to the volume to be deleted are released, including: Receive a response message sent by the target service node; the response message is used to indicate that the target service node has completed the deletion task; Upon receiving the response message, once it is determined that the target service node has completed the deletion task, the management resources corresponding to the volume to be deleted are released.
5. The method according to claim 4, characterized in that, The method further includes: If the response message is not received within the preset time period, another candidate service node is selected from at least one preset candidate service node as the new target service node. The volume to be deleted is migrated to the new target service node, and the query request is sent to the new target service node.
6. A volume deletion device, characterized in that, The device includes: The acquisition module is used to acquire a deletion instruction; the deletion instruction includes an identifier of the volume to be deleted. The determination module is used to determine the initial service node corresponding to the volume to be deleted based on the identifier of the volume to be deleted; if the initial service node fails, a candidate service node is selected from at least one preset candidate service node as the target service node; the volume to be deleted is migrated to the target service node, and the deletion instruction is sent to the target service node so that the target service node performs the deletion task on the volume to be deleted, and the deletion instruction is used to trigger the target service node to generate an asynchronous deletion task corresponding to the volume to be deleted; the management node knows the identifier of each volume and the identifier of each service node in advance, and establishes a correspondence between the identifiers of each service node and the volume it serves; The query module is used to send a query request to the target service node; the query request is used to query whether the target service node has completed the deletion task. The deletion module is used to release the management resources corresponding to the volume to be deleted after the target service node has completed the deletion task; The management node selection module is used to select a new target management node from at least one preset candidate management node if the target management node communicating with the target service node fails. The new target management node continues to send the query request to the target service node to query whether the target service node has completed the deletion task.
7. The apparatus according to claim 6, characterized in that, The determining module includes a selection unit, which is specifically used to obtain the load capacity corresponding to each candidate service node. The target service node is determined from the candidate service nodes based on the load capacity of each node.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Resource configuration method and system, electronic equipment and storage medium
CN112905538A
Data volume processing method and device, electronic equipment, medium and program product
CN113655964A
Volume deletion optimization method and device in distributed storage system and storage medium
CN114153390A