A storage volume task processing method, device, equipment and storage medium

By re-issuing the storage volume task to the online node after a node failure is recovered, the problem of the storage volume task being unable to be executed after a node failure is solved, thus improving the performance and availability of the storage system.

CN119960680BActive Publication Date: 2026-04-10INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

After a node recovers from a failure, the storage volume task request will not be reissued, causing the node to be unable to execute the storage volume task request and affecting the performance of the storage system.

Method used

Upon receiving a storage volume request, obtain the node information and status value in the mirror pair where the target storage volume is located, determine the node status, and reissue the storage volume task to the online nodes.

Benefits of technology

This improved the resource utilization of the storage system, ensuring the performance of user front-end services and the availability of the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119960680B_ABST
    Figure CN119960680B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of storage, and discloses a storage volume task processing method, device, equipment and storage medium, the method comprising: after receiving a storage volume request, obtaining first node information of all nodes in a mirror pair where a target storage volume is located at a first time and a state value corresponding to the target storage volume, the state value being used to indicate an execution state of a storage volume task corresponding to the target storage volume; determining whether the first node information includes a first field, the first field being used to indicate that there is at least one online node; if the first node information includes the first field, determining whether the state value at the first time is a first state value, the first state value being used to indicate that the execution state is an interrupted state; if yes, determining that the at least one online node all support the storage volume task, and sending the storage volume task to the at least one online node. The present application can solve the problem that after node failure recovery, the node cannot execute the storage volume task request due to the fact that the storage volume task is not reissued.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of storage, and particularly relates to a storage volume task processing method and device, equipment and a storage medium. BACKGROUND

[0002] In a storage system, in a cache write-back mode, when a host sends an instruction to the storage system to write data to a specific storage volume, the write data is first written into a node cache in the form of dirty data, and then the dirty data (data not flushed to the back-end disk) in the node cache is flushed to the back-end disk through periodic flushing. This cache write-back mode can achieve that after the write data is written into the cache, the storage system will immediately return an acknowledgement to the host, indicating that the write operation has been completed. This way provides higher write performance, because the host does not need to wait for the data to be actually written to the disk before continuing to work. However, in the cache write-back mode, after a node failure and recovery, the dirty data in the node cache needs to be discarded. At this time, the node can issue a delete volume task request to the node in the mirror pair of the target storage volume to delete the data block of the storage dirty data corresponding to the target storage volume in the node cache.

[0003] In related technologies, when the host issues a storage volume task request to the node in the mirror pair of the target storage volume, if the node fails, the storage volume task request will not be issued; and after the node failure is recovered, the storage volume task request will not be reissued, which causes the node to be unable to execute the storage volume task request, affecting the performance of the storage system. For example, when the storage volume task is a delete volume task, the dirty data corresponding to the target storage volume cannot be deleted, i.e., the node cache resource is occupied by invalid data, causing the available cache resource of other storage volumes to become smaller, reducing the resource utilization of the storage system. SUMMARY

[0004] Therefore, the present application provides a storage volume task processing method and device, equipment and a storage medium to solve the problem that after a node failure is recovered, the storage volume task request is not reissued, causing the node to be unable to execute the storage volume task request, affecting the performance of the storage system.

[0005] In a first aspect, the present application provides a processing method for a storage volume task, which comprises: after receiving a storage volume request sent from a client, obtaining first node information of all nodes in a mirror pair in which a target storage volume is located at a first time point, and obtaining a state value corresponding to the target storage volume at the first time point, the state value being used to indicate an execution state of a storage volume task corresponding to the target storage volume, and the storage volume request being used to request all nodes to execute the storage volume task; judging whether the first node information includes a first field after analyzing the first node information, the first field being used to indicate that there is at least one online node in all nodes; if the first node information includes the first field, detecting whether the state value at the first time point is a first state value, the first state value being used to indicate that the execution state is an interrupted state; if yes, determining that all the at least one online node supports the storage volume task, and sending the storage volume task to the at least one online node.

[0006] The method provided in the present aspect can obtain the first node information of all nodes in the mirror pair in which the target storage volume is located and the state value corresponding to the target storage volume after receiving the storage volume request sent from the client, and send the storage volume task to at least one online node in the case that the execution state of the storage volume task corresponding to the target storage volume is determined to be the interrupted state based on the first node information and the state value, and there is at least one online node in all nodes.

[0007] Since the first state value indicates that the execution state of the storage volume task corresponding to the target storage volume is the interrupted state, i.e., the storage volume task of all nodes is not executed at the first time point, and since the first node information is used to record whether all nodes are in an online state, the node state of all nodes can be determined by analyzing the content of the first node information when the storage volume request sent from the client is received; specifically, if the first field is contained in the first node information, it indicates that there is at least one online node in all nodes, and then the storage volume task is sent to the at least one online node, so that each online node executes the storage volume task. If it is not the first field, it indicates that all nodes may be in an offline state, and the delete volume task will not be issued, thereby avoiding the failure of sending the storage volume task. Therefore, the present application embodiment can reissue the storage volume task to the online node after the node failure is recovered, improves the resource utilization rate of the storage system, greatly guarantees the performance of the user front-end business, and improves the availability of the storage system.

[0008] In combination with the first aspect, in an optional implementation, the processing device comprises a volume state machine module and a node monitoring module; after receiving the storage volume request sent from the client, the first node information of all nodes in the mirror pair in which the target storage volume is located at the first time point is obtained, which comprises:

[0009] After receiving the storage volume request sent from the client, a first time point is determined as a time point of receiving the storage volume request; node states of all nodes are monitored at the first time point, and first node information is obtained according to the node states.

[0010] In the embodiment of the application, after receiving the storage volume request sent from the client, the node states of all nodes are monitored at the first time point, that is, the node states are used to indicate whether the nodes are online, and then the first node information can be obtained based on the node states, so that the storage volume task can be sent based on the node states in the first device information in time when the storage volume request is received.

[0011] In combination with the first aspect, in another optional embodiment, the method further includes: when the storage volume request is received, obtaining a state value corresponding to a target storage volume at a second time point; detecting whether the state value at the second time point is a second state value, the second state value indicating that the execution state is an idle state; if yes, updating the second state value corresponding to the target storage volume to a third state value, and sending the storage volume task to all nodes, the third state value indicating that the execution state is an executing task state; in the process of sending the storage volume task to all nodes, if it is detected that all nodes are offline at a third time point, updating the third state value corresponding to the target storage volume to the first state value, the third time point being before the first time point, and the second time point being before the third time point.

[0012] In the embodiment of the application, the state value corresponding to the target storage volume can be updated to the executing task state when the storage volume request is received, and the state value corresponding to the target storage volume can be updated to the interrupt state when it is detected that all nodes are offline, so that whether the storage volume task needs to be sent to the nodes can be determined based on the state value corresponding to the target storage volume subsequently.

[0013] In combination with the first aspect, in yet another optional embodiment, in the process of sending the storage volume task to all nodes, if it is detected that all nodes are offline at a third time point, the third state value corresponding to the target storage volume is updated to the first state value, including: in the process of sending the storage volume task to all nodes, obtaining second node information of all nodes at the third time point and a state value at the third time point; analyzing the second node information to determine whether the second node information includes a second field, the second field being used to indicate that all nodes are offline; if the second node information includes the second field, detecting whether the state value at the third time point is the third state value; if yes, obtaining a bitmap of the target storage volume at the third time point, the bitmap being used to record whether there is at least one target node that has not executed the storage volume task among all nodes at the third time point; and if the bitmap indicates that there is at least one target node that has not executed the storage volume task at the third time point, updating the third state value corresponding to the target storage volume to the first state value.

[0014] In the process of sending the storage volume task to all the nodes, the second field is used to indicate that all the nodes are offline, so that the node offline can be found in time during the execution of the task, and when it is detected at the third time that all the nodes are offline, whether there is at least one target node that has not executed the storage volume task in all the nodes is determined based on the bitmap of the target storage volume, and if there is, it indicates that the storage volume task corresponding to the target storage volume is not executed, that is, the execution state of the target storage volume is the interrupted state, so that it is convenient to determine whether the storage volume task needs to be sent to the node based on the state value of the target storage volume.

[0015] In combination with the first aspect, in yet another optional implementation, after it is determined that the at least one online node supports the storage volume task, the method further includes: determining one or more target online nodes from the at least one online node according to the bitmap, each target online node being any one of the at least one target node; and sending the storage volume task to the one or more target online nodes.

[0016] In the implementation of the present application, the one or more target online nodes can be determined based on the at least one target node that has not executed the storage volume task recorded in the bitmap and the at least one online node in the first device information, that is, each target online node determined is both an online node and a node that has not executed the storage volume task, so that the storage volume task can be accurately sent to the one or more target online nodes.

[0017] In combination with the first aspect, in yet another optional implementation, after the storage volume task is sent to the at least one online node, the method further includes: updating the state value of the target storage volume from the first state value to the third state value.

[0018] In the implementation of the present application, after the storage volume task is sent to the at least one online node, the state value is updated to the third state value, which indicates that the storage volume task is being executed, and this helps to ensure that all related components (such as the volume state machine module and the node monitoring module) have a consistent understanding of the task state. In addition, after the node fails or goes offline, the state value can be further updated to ensure the execution of the storage volume task.

[0019] In combination with the first aspect, in yet another optional implementation, the method further includes: after all the nodes execute the storage volume task, emptying the bitmap and updating the state value of the target storage volume from the third state value to the second state value.

[0020] In the embodiment of the present application, after all the nodes complete the storage volume task, the bitmap is emptied to release resources and prepare for the next task, ensuring that each task has an independent tracking mechanism to avoid confusion, and updating the state value of the target storage volume to an idle state after all the nodes complete the storage volume task, facilitating viewing of the task execution state of the target storage volume when other tasks are performed on the target storage volume.

[0021] In a second aspect, the present application provides a processing device, comprising: a transceiver module, configured to obtain first node information of all nodes in a mirror pair of a target storage volume at a first time and obtain a state value corresponding to the target storage volume at the first time after receiving a storage volume request sent by a client, the storage volume request being used to request all the nodes to perform a storage volume task; and a processing module, configured to determine whether the first node information includes a first field after analyzing the first node information, and if the first node information includes the first field, determine whether the state value at the first time is a first state value, and if yes, determine that at least one online node supports the storage volume task and send the storage volume task to the at least one online node. The first field is used to indicate that there is at least one online node in all the nodes; and the first state value is used to indicate that the execution state is an interrupted state.

[0022] In a third aspect, the present application provides a computer device, comprising: a memory and a processor, which are in communication connection with each other, and the memory stores computer instructions; and the processor executes the computer instructions to perform the processing method of the storage volume task according to the first aspect or any one of the corresponding embodiments thereof.

[0023] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions, and the computer instructions are used to make a computer execute the processing method of the storage volume task according to the first aspect or any one of the corresponding embodiments thereof.

[0024] In addition, the present application provides a computer program product, which comprises computer instructions, and the computer instructions are used to make a computer execute the processing method of the storage volume task according to the first aspect or any one of the corresponding embodiments thereof. BRIEF DESCRIPTION OF DRAWINGS

[0025] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0026] Figure 1 This is a schematic diagram of a volume deletion task processing method according to an embodiment of the present invention;

[0027] Figure 2 This is a topology diagram of a storage volume task processing system according to an embodiment of the present invention;

[0028] Figure 3 This is a flowchart of a method for processing storage volume tasks according to an embodiment of the present invention;

[0029] Figure 4 This is a flowchart of another storage volume task processing method according to an embodiment of the present invention;

[0030] Figure 5 This is a structural block diagram of a processing apparatus according to an embodiment of the present invention;

[0031] Figure 6 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] This invention applies to scenarios where a host sends a storage volume task request to a node in the mirror pair containing the target storage volume, such as a host sending a volume deletion task request to a node in the mirror pair containing the target storage volume.

[0034] Currently, in scenarios where the host issues a volume deletion request to a node in the mirror pair containing the target storage volume, such as... Figure 1 As shown, Figure 1 This is a schematic diagram of a volume deletion task processing method according to an embodiment of the present invention; the processing method specifically includes:

[0035] 1) When the client sends a volume deletion request to the volume state machine module, the nodes in the mirror pair containing the storage volume are stored in the discardBitmap. For example, if the node in the mirror pair is (0, 1), the bitmap is 0011, with one bit representing one node. If the bit corresponding to the node ID is 1, it means that the node exists in the bitmap.

[0036] 2) Send the delete volume request to all nodes in the mirror pair, and initiate the delete volume task to the service end task processing module of each node. However, if the nodes in the mirror pair are all offline at this time, the delete volume task is not initiated.

[0037] 3) If the task is successfully sent to each node, each node initiates a traversal query on its own cache data block hash table. Once a data block belonging to the storage volume is queried, it is discarded. After all data blocks have completed the traversal and discard processing, each node notifies the volume state machine of the task completion.

[0038] 4) The volume state machine clears the node from the bitmap upon receiving a task completion notification from each node. For scenarios where the delete volume task request is not sent to the node due to node offline, the volume state machine will always store the node bitmap of the unexecuted task.

[0039] 5) When the node recovers from failure, the bitmap of the volume state machine is restored, and the dirty data cached on the node is also restored. At this time, the volume state machine is not triggered, so the previously interrupted delete volume task is not reinitiated.

[0040] 6) When the user re-creates a volume and is assigned the same volume ID as the previous storage volume, the volume state machine is triggered. If the unexecuted task node bitmap stored in the state machine is not empty, the delete volume task is initiated to each node in the bitmap, and after the delete volume task of each node is completed, the newly created volume can be normally online.

[0041] The processing method of the delete volume task in the related art does not reissue the storage volume task request to the node after the node recovers from failure, which causes the node to be unable to execute the storage volume task request and affects the performance of the storage system.

[0042] To solve the above technical problems, the embodiment of the present application provides a storage volume task processing method. The method can achieve the effect of reissuing the storage volume task request to the node to execute the storage volume task request even after the node recovers from failure by obtaining the first node information of all nodes in the mirror pair of the target storage volume and the state value corresponding to the target storage volume at the first time after receiving the storage volume request sent from the client, making the execution state of the storage volume task corresponding to the target storage volume be in the interrupted state, and sending the storage volume task to at least one online node.

[0043] The storage volume task processing system 200 shown in Figure 2 will be taken as an example to describe the method provided by the embodiment of the present application. Figure 2 It is only a schematic diagram and does not constitute a limitation on the applicable scenarios of the technical solutions provided by the present application.

[0044] As shown in Figure 2 ,Figure 2 is a topology diagram of a processing system of a storage volume task according to an embodiment of the present application. Figure 2 In the embodiment, the processing system 200 of the storage volume task can include a processing device 201, a client 202, a first node 203 and a second node 204.

[0045] The processing device 201 in the embodiment of the present application can be any device with communication function and computing function. For example, the processing device 201 can be a storage controller. The processing device 201 includes a volume state machine module and a node monitoring module. The volume state machine module is used to maintain a state value and a bitmap corresponding to a target storage volume; the node monitoring module is used to monitor node states of the first node 203 and the second node 204.

[0046] The client 202 in the embodiment of the present application can be any device with communication function and computing function. The device has a display interface, and a user can input a storage volume task request on the display interface.

[0047] The first node 203 or the second node 204 in the embodiment of the present application can be any one of all nodes in a mirror pair in which a target storage volume is located in a storage system.

[0048] Figure 2 The processing system 200 of the storage volume task shown in the figure is only used for example, and is not used to limit the technical solutions of the present application. Those skilled in the art should understand that in the specific implementation process, the processing system 200 of the storage volume task can also include other nodes, which is not limited.

[0049] According to the embodiment of the present application, an embodiment of a processing method of a storage volume task is provided. It should be noted that the steps shown in the flowchart of the figure can be executed in a computer system such as a group of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in different order from here.

[0050] In the embodiment, a processing method of a storage volume task is provided, which can be used for the processing device described above, Figure 3 is a flowchart of a processing method of a storage volume task according to an embodiment of the present application, as shown in the figure, the flow includes the following steps: Figure 3

[0051] S301: after receiving a storage volume request sent from a client, obtaining first node information of all nodes in a mirror pair in which a target storage volume is located at a first time, and obtaining a state value corresponding to the target storage volume at the first time.

[0052] ​The status value indicates the execution status of the storage volume task corresponding to the target storage volume. This status value can be called a volume attribute (discardState).

[0053] The execution state can be idle (IDLE state), running a task (DISCARDING state), or interrupted (DISCARDING_INTERRUPTED state).

[0054] A storage volume request is used to request all nodes to execute a storage volume task. For example, a storage volume task can be a volume deletion task.

[0055] The first node information is used to indicate whether there is at least one online node among all nodes.

[0056] In some optional implementations, after receiving a storage volume request from a client, the processing device determines the moment of receiving the storage volume request as the first moment; at the first moment, it monitors the node status of all nodes and obtains the first node information based on the node status.

[0057] In one example, after the volume state machine module receives a storage volume request from the client, the node monitoring module monitors the node status of all nodes at the first moment and generates and publishes a first node event based on the node status; the volume state machine module detects that the node monitoring module has published the first node event through a subscription function and obtains the first node information from the first node event.

[0058] The first node event includes the first node information.

[0059] Optionally, the node monitoring module can add the allNodeFailed flag to all nodes in the mirror pair where the target storage volume resides, based on the node status.

[0060] For example, after the volume state machine module receives a storage volume request from the client, the node monitoring module monitors the node status of all nodes at the first moment. Upon detecting that at least one node is online, the module clears the `allNodeFailed` flag, sets its value to `false`, and generates and publishes the first node event based on the `false` value of the `allNodeFailed` flag. The first node information is indicated by the `allNodeFailed` flag being set to `false`.

[0061] It can be understood that the node monitoring module monitors the status of all nodes in real time, and updates the allNodeFailed flag according to the node status, so that the subscription function of the volume state machine module can obtain the information of whether each node in all nodes is faulty or offline in time, and then the volume state machine module can timely issue a storage volume task when at least one node in all nodes is online.

[0062] S302: After parsing the first node information, it is judged whether the first node information includes a first field.

[0063] The first field is used to indicate that there is at least one online node in all nodes. For example, the first field is "false".

[0064] S303: If the first node information includes the first field, it is detected whether the state value at the first time is the first state value.

[0065] The first state value is used to indicate that the execution state is the interrupted state.

[0066] It can be understood that the reason why the state value of the target storage volume is the first state value is that there is a faulty node in all nodes, which causes the node to be offline.

[0067] In some optional embodiments, when the volume state machine module receives a storage volume request, the state value corresponding to the target storage volume at the second time is obtained; it is detected whether the state value at the second time is the second state value; if so, the second state value corresponding to the target storage volume is updated to the third state value, and the storage volume task is sent to all nodes; during the process of sending the storage volume task to all nodes, if it is detected that all nodes are in an offline state at the third time, the third state value corresponding to the target storage volume is updated to the first state value.

[0068] The second state value indicates that the execution state is the idle state. The third state value indicates that the execution state is the task execution state. The third time is before the first time, and the second time is before the third time.

[0069] In some optional embodiments, during the process of sending the storage volume task to all nodes by the volume state machine module, the second node information of all nodes at the third time and the state value at the third time are obtained; after parsing the second node information, it is judged whether the second node information includes a second field; if the second node information includes the second field, it is detected whether the state value at the third time is the third state value; if so, the bitmap of the target storage volume at the third time is obtained; if the bitmap indicates that there is at least one target node that has not executed the storage volume task at the third time, the third state value corresponding to the target storage volume is updated to the first state value.

[0070] The bitmap is used to record whether there is at least one target node that has not executed the storage volume task in all nodes at the third time.

[0071] The second field is used to indicate that all nodes are offline. For example, the second field can be "true".

[0072] For example, the node monitoring module monitors the node status of all nodes at the third time, and when it is monitored that all nodes are offline at the first time, the value of the allNodeFailed flag is set to true, and a second node event is generated and published based on the value of the allNodeFailed flag being true. The second node information included in the second node event is that the value of the allNodeFailed flag is true.

[0073] S304: If yes, it is determined that at least one online node supports the storage volume task, and the storage volume task is sent to the at least one online node.

[0074] It can be understood that if the state value of the target storage volume is the first state value, it indicates that the storage volume task corresponding to the target storage volume is in an interrupted state. Therefore, when it is determined that at least one online node supports the storage volume task, the storage volume task can be sent to the at least one online node, so that the at least one online node continues to execute the storage volume task in the interrupted state to completion.

[0075] In some optional embodiments, after the volume state machine module sends the storage volume task to the at least one online node, the state value of the target storage volume is updated from the first state value to the third state value.

[0076] Further, since there can be a node that has executed the storage volume task in the at least one online node, after the volume state machine module determines that the at least one online node supports the storage volume task, one or more target online nodes can also be determined in the at least one online node according to the bitmap; the storage volume task is sent to the one or more target online nodes.

[0077] Each target online node is any one of the at least one target node.

[0078] In an example, after all nodes execute the storage volume task, the volume state machine module can clear the bitmap, and update the state value of the target storage volume from the third state value to the second state value.

[0079] In some optional embodiments, if the first node information comprises the first field, and the volume state machine module detects that the state value at the first time is not the first state value, the volume state machine module determines that at least one online node supports the storage volume task, acquires a first bitmap of the target storage volume at the first time; if the first bitmap indicates that there is a node that has not executed the storage volume task at the first time, the storage volume task is sent to the at least one online node. If the first bitmap indicates that there is no node that has not executed the storage volume task at the first time, it is determined that all node storage volume tasks are executed.

[0080] It can be understood that the first field indicates that there is at least one online node in all nodes, and the node failure recovery can be discovered in time during the task execution process and put online. When it is detected that there is at least one online node in all nodes at the first time, it can be further determined whether there is a node that has not executed the storage volume task in all nodes based on the bitmap of the target storage volume. If there is, it indicates that the storage volume task corresponding to the target storage volume is not executed, i.e., the storage volume task needs to be sent to the node. If there is not, it indicates that the storage volume task corresponding to the target storage volume is executed, i.e., the storage volume task does not need to be sent to the node.

[0081] In some optional embodiments, if the first node information comprises the second field, and the volume state machine module detects that the state value at the first time is the first state value, the volume state machine module determines that all nodes do not support the storage volume task, and stops sending the storage volume task to all nodes.

[0082] It can be understood that the first node information comprises the second field at the first time, i.e., all nodes are offline. Even if the state value of the target storage volume is the interrupt state, the storage volume task cannot be continuously sent to the node.

[0083] Based on the above Figure 3The method provided by the application, since the first state value indicates that the execution state of the storage volume task corresponding to the target storage volume is the interrupt state, that is, the storage volume task of all nodes is not executed at the first time, and since the first node information is used to record whether all nodes are in the online state, when the storage volume request sent by the client is received, the node state of all nodes can be determined by analyzing the content of the first node information. Specifically, if the first field is contained in the first node information, it indicates that there is at least one online node in all nodes, and then the storage volume task is sent to the at least one online node, so that each online node executes the storage volume task. If it is not the first field, it indicates that all nodes may be in the offline state, and the delete volume task will not be issued, thereby avoiding the failure of sending the storage volume task. Therefore, the embodiment of the application can reissue the storage volume task to the online node after the node failure is recovered, improve the resource utilization rate of the storage system, greatly ensure the performance of the user front-end business, and improve the availability of the storage system. For example, when the storage volume task is a delete volume task, the application can delete the dirty data corresponding to the target storage volume after the node failure is recovered, avoid the occupation of the node cache resource by invalid data, increase the available cache resource of other storage volumes, improve the resource utilization rate of the storage system, greatly ensure the performance of the user front-end business, and improve the availability of the storage system.

[0084] In the embodiment, another storage volume task processing method is provided, which can be used for the processing device described above, Figure 4 is a flowchart of another storage volume task processing method according to the embodiment of the application, as Figure 4 shown, the storage volume task is a delete volume task. The delete volume task is used to instruct each node to delete the invalid data block cached on each node in the mirror pair where the target storage volume is located. In Figure 4 , the client sends a delete volume request to the volume state module.

[0085] The volume state machine module receives the delete volume request, updates the discardState to DISCARDING, and sends the delete volume task to each node in the mirror pair where the target storage volume is located.

[0086] Each node receives the delete volume task.

[0087] The node monitoring module monitors the node state of each node.

[0088] Scenario one: the node monitoring module monitors that the node is offline due to failure and all nodes are offline, and sets the allNodeFailed flag.

[0089] If the discardBitmap is not empty, the volume state machine module updates the discardState to DISCARDING_INTERRUPTED.

[0090] Scenario 2: The node monitoring module detects that a node has returned to offline status and all nodes have online nodes, and clears the allNodeFailed flag.

[0091] If discardBitmap is not empty and discardState is DISCARDING_INTERRUPTED, then the volume deletion task is retried, and the volume state machine module resends the volume deletion task to each node.

[0092] After each node completes the volume deletion task, it deletes all invalid data blocks.

[0093] After a node completes a volume deletion task, the volume state machine module removes the node entry from the discardBitmap. The entry is used to record nodes that have not performed a volume deletion task.

[0094] After all nodes have completed the volume deletion task, the volume state machine module clears the discardBitmap and updates the discardState to IDLE.

[0095] This embodiment also provides a processing apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0096] This embodiment provides a processing device, such as Figure 5 As shown, Figure 5 This is a structural block diagram of a processing device according to an embodiment of the present invention; the processing device includes a transceiver module 501 and a processing module 502.

[0097] The transceiver module 501 is used to obtain the first node information of all nodes in the mirror pair where the target storage volume is located at the first moment after receiving the storage volume request sent from the client, and to obtain the status value corresponding to the target storage volume at the first moment. The status value is used to indicate the execution status of the storage volume task corresponding to the target storage volume. The storage volume request is used to request all nodes to execute the storage volume task.

[0098] The processing module 502 is used to parse the first node information and determine whether the first node information includes a first field. If the first node information includes a first field, it checks whether the status value at the first moment is the first status value. If so, it determines that at least one online node supports the storage volume task and sends the storage volume task to at least one online node. The first status value is used to indicate that the execution status is interrupted. The first field is used to indicate that at least one online node exists among all nodes.

[0099] In some optional embodiments, the transceiver 501 is specifically configured to, after receiving the storage volume request sent by the client, determine a time point of receiving the storage volume request as the first time point; monitor the node states of the all nodes at the first time point, and obtain the first node information according to the node states.

[0100] In some optional embodiments, the transceiver 501 is further configured to, when receiving the storage volume request, obtain a state value corresponding to the target storage volume at a second time point; the processing module 502 is further configured to detect whether the state value at the second time point is a second state value, the second state value indicating an execution state as an idle state; if yes, update the second state value corresponding to the target storage volume as a third state value, and send the storage volume task to the all nodes, the third state value indicating the execution state as a task execution state; in the process of sending the storage volume task to the all nodes, if it is detected that all the nodes are in an offline state at a third time point, update the third state value corresponding to the target storage volume as the first state value, the third time point being before the first time point, and the second time point being before the third time point.

[0101] In some optional embodiments, the processing module 502 is further configured to, in the process of sending the storage volume task to the all nodes, obtain the second node information of the all nodes at the third time point and the state value at the third time point; after analyzing the second node information, determine whether the second node information includes a second field, the second field being used to indicate that all the nodes are in the offline state; if the second node information includes the second field, detect whether the state value at the third time point is the third state value; if yes, obtain a bitmap of the target storage volume at the third time point, the bitmap being used to record whether there is at least one target node that has not executed the storage volume task in the all nodes at the third time point; if the bitmap indicates that there is at least one target node that has not executed the storage volume task at the third time point, update the third state value corresponding to the target storage volume as the first state value.

[0102] In some optional embodiments, after determining that the at least one online node supports the storage volume task, the processing module 502 is further configured to determine one or more target online nodes in the at least one online node according to the bitmap, each target online node being any one of the at least one target node; and send the storage volume task to the one or more target online nodes.

[0103] In some optional embodiments, after sending the storage volume task to the at least one online node, the processing module 502 is further configured to update the state value of the target storage volume from the first state value to the third state value.

[0104] In some optional implementations, the processing module 502 is further configured to clear the bitmap and update the status value of the target storage volume from the third status value to the second status value after all nodes have completed the storage volume task.

[0105] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0106] In this embodiment, the processing device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0107] This invention also provides a computer device having the above-described features. Figure 5 The processing device shown.

[0108] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 6 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.

[0109] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0110] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0111] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required by at least one function, etc. The data storage area can store data created by the computer device, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory such as at least one disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some alternative embodiments, the memory 20 can optionally include memory that is remotely located with respect to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0112] The memory 20 can include a volatile memory such as a random access memory, and can also include a non-volatile memory such as a flash memory, a hard disk, or a solid state disk. The memory 20 can also include a combination of the above-mentioned types of memory.

[0113] The computer device also includes a communication interface 30 for communication of the computer device with other devices or communication networks.

[0114] The embodiments of the present application also provide a computer readable storage medium. The above-mentioned method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium through network downloading and stored in a local storage medium, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above-mentioned embodiments is implemented.

[0115] The embodiments of the present application can also provide a computer program product including computer program instructions, which, when executed by a processor, cause the processor to perform the steps of the above-mentioned method.

[0116] A computer program product can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language, or the like. The program code can execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. The embodiments of methods

[0117] While the embodiments of the application have been described in connection with the preferred embodiments thereof, it will occur to those skilled in the art that modifications and variations can be made by them without departing from the spirit and scope of the application, and that other embodiments of the application will be apparent to those skilled in the art from consideration of this disclosure and representative treatment thereof, such embodiments being within the scope of the application as defined by the appended claims.

Claims

1. A processing method of a storage volume task, characterized by, The method comprises: After receiving a storage volume request sent from a client, obtaining first node information of all nodes in a mirror pair in which a target storage volume is located at a first time, and obtaining a state value corresponding to the target storage volume at the first time, the state value being used to indicate an execution state of a storage volume task corresponding to the target storage volume, the storage volume request being used to request the all nodes to execute the storage volume task; After analyzing the first node information, determining whether the first node information comprises a first field, the first field being used to indicate that there is at least one online node in the all nodes; If the first field is included, detecting whether the state value at the first time is a first state value, the first state value being used to indicate that the execution state is an interrupted state; If yes, determining that the at least one online node all supports the storage volume task, and sending the storage volume task to the at least one online node.

2. The method according to claim 1, wherein After receiving the storage volume request sent from the client, obtaining the first node information of the all nodes in the mirror pair in which the target storage volume is located at the first time comprises: After receiving the storage volume request sent from the client, determining that a time at which the storage volume request is received is the first time; Monitoring node states of the all nodes at the first time, and obtaining the first node information according to the node states.

3. The method of claim 2, wherein, The method further comprises: When the storage volume request is received, obtaining a state value corresponding to the target storage volume at a second time; Detecting whether the state value at the second time is a second state value, the second state value indicating that the execution state is an idle state; If yes, updating the second state value corresponding to the target storage volume to a third state value, and sending the storage volume task to the all nodes, the third state value indicating that the execution state is an executing task state; In a process of sending the storage volume task to the all nodes, if it is detected that the all nodes are offline at a third time, updating the third state value corresponding to the target storage volume to the first state value, the third time being before the first time, and the second time being before the third time.

4. The method of claim 3, wherein, In the process of sending the storage volume task to the all nodes, if it is detected that the all nodes are offline at a third time, updating the third state value corresponding to the target storage volume to the first state value comprises: In the process of sending the storage volume task to the all nodes, obtaining second node information of the all nodes at the third time and a state value at the third time; After analyzing the second node information, determining whether the second node information comprises a second field, the second field being used to indicate that the all nodes are in the offline state; If the second node information comprises the second field, detecting whether the state value at the third time is the third state value; If yes, a bitmap of the target storage volume at the third time is acquired, the bitmap being used to record whether at least one target node in the all nodes does not execute the storage volume task at the third time; If the bitmap indicates that the at least one target node does not execute the storage volume task at the third time, the third state value corresponding to the target storage volume is updated to the first state value.

5. The method of claim 4, wherein, After determining that the at least one online node supports the storage volume task, the method further comprises: According to the bitmap, one or more target online nodes are determined from the at least one online node, each of the target online nodes being any one of the at least one target node; The storage volume task is sent to one or more target online nodes.

6. The method of claim 5, wherein, After sending the storage volume task to the at least one online node, the method further comprises: The state value of the target storage volume is updated from the first state value to the third state value.

7. The method of claim 6, wherein, The method further comprises: After the all nodes execute the storage volume task, the bitmap is emptied, and the state value of the target storage volume is updated from the third state value to the second state value.

8. A processing device, characterized by The apparatus comprises: The transceiving module is configured to, after receiving a storage volume request sent from a client, acquire first node information of all nodes in a mirror pair in which a target storage volume is located at a first time, and acquire a state value corresponding to the target storage volume at the first time, the state value being used to indicate an execution state of a storage volume task corresponding to the target storage volume, the storage volume request being used to request the all nodes to execute the storage volume task; The processing module is configured to, after analyzing the first node information, determine whether the first node information includes a first field, and if the first node information includes the first field, determine whether the state value at the first time is a first state value, and if yes, determine that at least one online node supports the storage volume task, and send the storage volume task to the at least one online node; the first field is used to indicate that the at least one online node exists in the all nodes; the first state value is used to indicate that the execution state is an interrupted state.

9. A computer device, comprising: comprise: A memory and a processor, which are in communication connection with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the processing method of the storage volume task according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to make a computer execute the processing method of the storage volume task according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Volume deletion optimization method and device in distributed storage system and storage medium

    CN114153390A

  • Storage volume synchronizations responsive to communication link recoveries

    US20230049823A1