Input and output timeout processing method and device and medium

By monitoring the offline and fully locked conditions of the storage pool volume and setting the resource exception status bits, the IO timeout problem caused by insufficient resources is solved, and the effect of avoiding IO timeout and system hot restart is achieved.

CN119248599APending Publication Date: 2025-01-03INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410958303.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The prior art cannot effectively deal with the input and output (IO) timeout problem caused by insufficient resources, resulting in an abnormal state of hot restart of the system.

Method used

By monitoring whether there are volumes in the storage pool offline, determine whether the full locking condition is met, and set the resource exception status bit to upload to the storage pool. If it is met, set the upper path output of the volume to offline state, trigger the offline process within the volume to end IO and return an error message to avoid IO timeout.

Benefits of technology

It effectively avoids the IO timeout problem caused by insufficient resources, reduces the possibility of system hot restart, and improves the efficiency and accuracy of insufficient resource detection of storage pool.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248599A_ABST
    Figure CN119248599A_ABST
Patent Text Reader

Abstract

The invention discloses an input and output timeout processing method and device and a medium, relates to the technical field of computers, is used for processing the IO timeout problem, and provides the input and output timeout processing method aiming at the problem that a traditional scheme cannot achieve special IO timeout caused by insufficient resources. According to the method and the device, a state machine in a data end of each volume in a storage pool is indicated to set upper-layer path outputs of all the volumes in the storage pool to be in an offline state, so that the volumes are offline outwards, the volumes do not receive IO any more, and IO timeout caused by no resource processing IO is avoided. Therefore, according to the method, whether the problem of insufficient resources occurs in the storage pool or not is detected, all the volumes in the current storage pool are offline when the resources are insufficient, and subsequent IO is prevented from being processed on the volumes with the insufficient resources, so that overtime IO is avoided, and the IO overtime problem caused by the insufficient resources can be effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an input / output timeout processing method, device and medium. Background Art

[0002] During the operation of the server, there may be some input / output (IO) processing timeouts due to many factors. If IO processing timeouts occur, it will be reflected on the server side, that is, abnormal alarms may occur, causing abnormal problems such as system restarts.

[0003] At present, the solution for handling timed IO is mainly to send special IO instructions to the lower layer when identifying the timed IO; in response to the Redundant Array of Independent Disks (RAID) module detecting the special IO, trigger the RAID module to go offline; and process the IO of each module to be processed by the RAID module in an offline manner, and return the offline processing result to the host; thereby avoiding the situation where the user host waits for a very long time for the return result after sending the IO.

[0004] However, this solution can only be used for scenarios where the IO sent by the host is fully responded to the lower-layer RAID, and there is no way to handle abnormal IO in special scenarios such as IO timeouts caused by insufficient resources. In scenarios where IO timeouts are caused by insufficient resources, page resources (pages) will be occupied by dirty data that cannot be flushed to the lower layer. Therefore, after the host IO runs to a certain scale, the lower layer will be "full", some volumes will be offline, and data cannot be flushed. As a result, the offline response technology for the lower-layer RAID in the above solution is no longer used, and the above-mentioned special IO timeout situation cannot be effectively solved, which will still cause the abnormal state of the system hot restart after the IO waits too long to return the result.

[0005] Therefore, technicians in this field are in urgent need of an input and output timeout processing method to solve the special IO timeout problem caused by insufficient resources that traditional solutions cannot solve. Summary of the invention

[0006] The purpose of the present invention is to provide an input / output timeout processing method, device and medium to solve the special IO timeout problem caused by insufficient resources that cannot be solved by traditional solutions.

[0007] In order to solve the above technical problems, the present invention provides an input and output timeout processing method, comprising:

[0008] Monitor whether any volumes in the storage pool are offline;

[0009] If so, determine whether the storage pool meets the full lock condition through a full lock check function;

[0010] If satisfied, the resource abnormality status bit is set to a valid state; wherein the resource abnormality status bit is a pre-set status flag bit corresponding to the storage pool;

[0011] Uploading the value of the resource abnormal status bit to the corresponding storage pool;

[0012] When the resource abnormality status bit is in a valid state, the upper path output of each volume is set to an offline state through the state machine in the data end of each volume in the storage pool, so that the volume is offline.

[0013] In a possible embodiment, when the resource abnormal status bit is in a valid state, the method further includes:

[0014] Sending an input / output cleanup instruction to a service end of the volume through a control end of each volume in the storage pool to trigger an offline process in the volume pre-set in the service end;

[0015] The offline process within the volume includes:

[0016] Performing end process processing on the input / output on each input / output queue in the volume to end the input / output and make the input / output return offline error information to the host end;

[0017] The input / output queues include: an active input / output queue, an inactive input / output queue and a waiting queue.

[0018] In a possible embodiment, it further includes:

[0019] The sum of the input / output scales of the first N flow control inputs / outputs in the volume is counted sequentially to obtain the total flow; wherein the value of N is a positive integer, and the value of N increases by 1 as the number of statistics increases;

[0020] Determining whether the value of the total flow exceeds a preset flow threshold;

[0021] If not, a flow control flag is set for each flow control input / output counted this time; wherein the flow control flag is a special symbol value, which is used to indicate that the current flow control input / output is a normal input / output;

[0022] If so, the flow control input / output newly included in the statistical scope in this statistics is determined to be the first abnormal input / output; and the flow control input / output after the first abnormal input / output is determined to be the abnormal input / output;

[0023] Add each of the abnormal input / output to the flow control input / output linked list pre-created by the corresponding thread;

[0024] The in-volume offline process also includes:

[0025] Traversing the flow control input / output linked list corresponding to each of the threads;

[0026] When the traversed abnormal input / output belongs to an offline volume, the end process is performed on the abnormal input / output to end the abnormal input / output and make the abnormal input / output return offline error information to the host end.

[0027] In a possible embodiment, after traversing the flow control input / output linked list corresponding to each thread, the method further includes:

[0028] When the traversed abnormal input / output does not belong to the offline volume, the currently traversed abnormal input / output is removed from the head of the flow control input / output linked list and placed at the tail of the flow control input / output linked list.

[0029] In a possible embodiment, it further includes:

[0030] After the storage pool in which the resource abnormality status bit is in a valid state is added with a disk to complete the pool expansion, determining whether there is an offline volume that is back online;

[0031] If so, returning to the step of determining whether the storage pool meets the full lock condition through the full lock check function;

[0032] After judging whether the storage pool meets the full lock condition through the full lock check function, the method further includes:

[0033] When the storage pool does not satisfy the full-lock condition, the upper-layer path output of other offline volumes in the storage pool is set to an online state.

[0034] In a possible embodiment, judging whether the storage pool meets the full lock condition by using the full lock check function includes:

[0035] Calling the full-lock check function by running the path switching function to determine whether each of the storage pools meets the full-lock condition;

[0036] The path switching function is triggered to run when a path of a volume in the storage pool changes.

[0037] In a possible embodiment, determining whether the storage pool meets the full lock condition includes:

[0038] Obtaining a maximum number of page resources allocated in the storage pool and a target number of page resources that should be reached and maintained in the storage pool;

[0039] Comparing the maximum number of page resources with the target number of page resources, and determining the smaller value as the representative number of page resources of the current storage pool;

[0040] Determining a resource threshold according to the number of page resource representatives;

[0041] Determine whether the number of page resources currently occupied by the storage pool is greater than the resource threshold;

[0042] If yes, then judging that the storage pool satisfies the full-lock condition;

[0043] If not, it is determined that the storage pool does not meet the full locking condition.

[0044] In order to solve the above technical problems, the present invention further provides an input / output timeout processing device, comprising:

[0045] The volume offline monitoring module is used to monitor whether there are volumes offline in the storage pool. If so, the resource detection module is triggered;

[0046] The resource detection module is used to determine whether the storage pool meets the full lock condition through a full lock check function, and if so, trigger the status setting module;

[0047] The state setting module is used to set the resource abnormal state bit to a valid state; wherein the resource abnormal state bit is a pre-set state flag bit corresponding to the storage pool;

[0048] A status uploading module, used for uploading the value of the resource abnormal status bit to the corresponding storage pool;

[0049] The volume offline module is used to set the upper path output of each volume to an offline state through the state machine in each volume data end in the storage pool when the resource abnormality status bit is in a valid state, so as to make the volume offline.

[0050] In order to solve the above technical problems, the present invention further provides an input / output timeout processing device, comprising:

[0051] Memory for storing computer programs;

[0052] A processor is used to implement the steps of the input and output timeout processing method as described above when executing the computer program.

[0053] In order to solve the above technical problem, the present invention also provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the input and output timeout processing method as described above are implemented.

[0054] The present invention provides an input / output timeout processing method, which detects whether the resources in the storage pool are sufficient to control the path status of the volume in the pool to avoid IO timeout. Specifically, in the scenario where IO timeout is caused by insufficient resources, it is because the thin (SE) pool in the current storage pool is full; the cached dirty data can no longer be sent to the lower layer, so that the resource usage in the current storage pool reaches the upper limit; which leads to the timeout of waiting for resources due to insufficient resources when processing IO; and when the SE pool is full, some volumes will be offline. Therefore, based on the above principle, this method implements the first step of judging whether the storage pool resources are sufficient by monitoring whether there are volumes offline in the storage pool, so as to improve the efficiency and accuracy of detecting insufficient pool resources; if there are volumes offline, the Is All Pinned function is used to judge whether the current storage pool meets the full pinning condition; the full pinning check function is originally used to judge whether the free list and replacer are both empty. If the free list and replacer are both empty, it means that there are no free page resources in the current storage pool, that is, the full pinning condition is met; when the full pinning condition is met, it can be determined that the IO timeout will be caused by insufficient resources in the current storage pool.

[0055] Therefore, this method sets the resource abnormal status bit of the storage pool and uploads it to instruct the state machine in the data end of each volume in the storage pool to set the upper path output of all volumes in the storage pool to an offline state, so that these volumes are offline to the outside, so that these volumes no longer receive IO, and there will be no IO timeout due to lack of resources to process IO. It can be seen that this method can effectively avoid IO timeout problems caused by insufficient resources by detecting whether there is a problem of insufficient resources in the storage pool, and taking all volumes in the current storage pool offline during the time of insufficient resources, preventing subsequent IO from being processed on these volumes with insufficient resources, thereby avoiding the generation of timed IO.

[0056] The input / output timeout processing device and non-volatile storage medium provided by the present invention correspond to the above method and have the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0058] Figure 1 A flowchart of an input / output timeout processing method provided by an embodiment of the present invention;

[0059] Figure 2 A flowchart of a special IO pruning method provided by an embodiment of the present invention;

[0060] Figure 3 A flowchart of an offline IO recovery method provided by an embodiment of the present invention;

[0061] Figure 4 A structural diagram of an input / output timeout processing device provided by an embodiment of the present invention;

[0062] Figure 5 A structural diagram of another input / output timeout processing device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0064] The core of the present invention is to provide an input and output timeout processing method, device and medium.

[0065] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0066] During the deployment of the server, after a storage pool with a certain storage capacity is created, the system will allocate relevant page resources to different storage pools according to the capacity size, resource balancing strategy, etc. When the host runs input / output (IO) later, it will obtain the required page resources (pages) according to certain technical strategies and send them to the lower-level modules for processing. However, since the page resources will be occupied by dirty data that cannot be flushed to the lower layer, the lower-level thin (SE) pool will be "full" after the host IO runs to a certain scale. At this time, some volumes will be offline, unable to flush data, and all the page resources allocated in the pool will be occupied. As a result, the IO being processed or subsequently sent will not get enough resources for normal processing, causing the IO processing to time out due to waiting for resources. If a large number of IOs time out due to waiting for resources, the timeout status will be returned to the upper layer. Reflected on the server, an abnormal alarm will appear, which will eventually lead to a hot restart of the system, causing certain damage to the system data and configuration.

[0067] In the related art, there is a solution for timeout detection of IO sent by the host through all modules on the IO stack in the storage system: in response to a module detecting that the IO sent by the host has timed out, the module sends a special IO; in response to the Redundant Array of Independent Disks (RAID, referred to as disk array) module detecting a special IO, the RAID module is triggered to go offline, and a RAID offline message is sent to all modules respectively; in response to all modules receiving the RAID offline message respectively, the IO to be processed by the RAID module is returned to the host as an offline processing result. This avoids the situation where the user host has to wait for a very long time for the return result after sending the IO.

[0068] However, it is not difficult to see that the above IO timeout processing solution is only applicable to the scenario where the IO sent by the host is fully responded to the lower-layer RAID. In the scenario where IO timeout is caused by insufficient resources, because the page resources are occupied by dirty data, the IO cannot be normally flushed to the lower layer, and the RAID module cannot achieve offline response. It can be seen that the above IO timeout processing solution is still insufficient and is not applicable to the special scenario of IO timeout caused by insufficient resources. It will still cause the abnormal state of system hot restart after the IO waits too long to return the result.

[0069] Based on the above, in order to solve the problem that IO times out due to waiting for resources due to insufficient storage pool resources, the present invention provides an input and output timeout processing method, such as Figure 1 As shown, including:

[0070] S101: Monitor whether there is any volume offline in the storage pool, if so, go to step S102.

[0071] S102: Determine whether the storage pool meets the full lock condition through the full lock check function. If yes, go to step S103.

[0072] S103: Setting the resource abnormality status bit to a valid state.

[0073] The resource abnormal status bit (Partition Reason) is a pre-set status flag bit corresponding to the storage pool.

[0074] S104: Upload the value of the resource abnormal status bit to the corresponding storage pool.

[0075] S105: When the resource abnormality status bit is in a valid state, the upper path output of each volume is set to an offline state through the state machine in the data end of each volume in the storage pool, so that the volume is offline.

[0076] First, from the above-disclosed explanation of the principle of insufficient page resources in the storage pool causing IO processing timeout, it can be known that insufficient resources in the storage pool are usually accompanied by the phenomenon that some volumes in the pool are offline. Therefore, before the subsequent formal judgment of whether the pool resources are sufficient is made in step S102, step S101 first makes a preliminary judgment in the first step. Because in the current server system, there are many mature technical solutions for monitoring the online status of volumes in the storage pool, and it is a common deployment for server storage resource management. Therefore, the preliminary judgment made in step S101 on whether the storage pool resources are sufficient will not have a significant impact on the system function, and no special deployment is required, and it can be achieved by using the original monitoring and management function of the storage pool. However, the preliminary screening made in step S101 is conducive to the initial screening of problem scenarios, avoiding the need to use the method in step S102 to make specific judgments on whether the storage resources are sufficient for all storage pools, thereby improving the efficiency of the entire method, and is also conducive to improving the accuracy of the judgment on whether the storage pool resources are sufficient.

[0077] Then, step S102 is a specific step of determining whether the storage pool has sufficient resources. In this method, the Is All Pinned function, an existing function tool in the server, can be used to implement this determination.

[0078] The full lock check function is a function tool used to determine whether the free list and replacer are both empty. When the free list is empty, it means that there are no free page resources at present; and when the replacer is empty, it means that there are no occupied page resources that can be released; therefore, when the free list and replacer are both empty, the full lock condition is met, and it can be determined that the page resources in the partition corresponding to the current storage pool are insufficient.

[0079] It is not difficult to understand that the storage pool resource sufficiency detection implemented by the full lock check function in step S102 is only one possible detection method provided by the present invention, which is applicable to most server systems and can be implemented using existing function tools without additional settings. However, it does not mean that the detection of whether the storage pool resources are sufficient can only be implemented in this way. Under the requirements of other different scenarios, it can also be implemented by any method that can detect whether the storage pool page resources are sufficient.

[0080] For steps S103 and S104, it is the process of transmitting the detection result of insufficient storage pool page resources detected in step S102 to the upper layer. Since the judgment of whether the storage pool page resources are sufficient is a necessary judgment made by this method for subsequent IO timeout processing, it may not be required in the original server system. Therefore, this method pre-creates a status bit or status item called a resource abnormal status bit (Partition Reason) to indicate whether the storage pool page resources are sufficient. Or in other words, the resource abnormal status bit can also be used to indicate whether the current storage pool needs to perform a subsequent IO timeout processing process. That is, whether the IO timeout processing is valid. If valid, the storage pool is subjected to a subsequent IO timeout processing process. Based on this, in this embodiment, the status of the resource abnormal status bit may include: a valid state and an invalid state. Among them, the valid state indicates that the current storage pool page resources are insufficient and a subsequent IO timeout processing process is required. The invalid state indicates that the current storage pool page resources are sufficient and no subsequent IO timeout processing process is required.

[0081] It should be noted that, since a server does not necessarily include only one storage pool, the judgment of the above steps S101 and S102 is not only for a specific storage pool, but for all storage pools in the server. Therefore, the above preset resource abnormal status bits correspond one-to-one to the storage pools, which are used to indicate whether the page resources of the corresponding storage pool are sufficient or not.

[0082] As for steps S104 and S105, it is the process of uploading the resource abnormality status bit determined in the above steps. It is not difficult to see from the above description that when the resource abnormality status bit of the storage pool is in a valid state, this method needs to take certain measures to avoid the occurrence of timed IO, corresponding to step S105. In step S105 of this method, the offline processing of the volume is realized through the state machine in the data end of the volume, which is the original structure in the current server storage pool structure, so as to prevent the volume with insufficient page resources from processing subsequent IO, thereby avoiding IO processing timeout due to waiting for resources.

[0083] It is easy to understand that the state machine itself is a common management component in the current server storage system deployment, which can be used to manage various states of the volume, including the online state of the volume. Therefore, this method uses the state machine in the volume data end to achieve volume offline management, which can be applied to most server storage architectures without too much additional deployment. In addition, since the state machine is located in the upper layer of the storage structure, it is necessary to report after determining the abnormal resource status bit of the storage pool so that the state machine can know whether the page resources of the current storage pool are sufficient.

[0084] As can be seen from the above, the input and output timeout processing method provided by the present invention realizes accurate and efficient detection of whether the storage pool resources are sufficient through two-step judgment; and when the storage pool resources are insufficient, all volumes in the storage pool are set to an external offline state through the state machine in the data end of each volume in the storage pool, preventing these volumes from receiving IO again, thus avoiding the problem of IO timeout due to waiting for resources, and reducing the possibility of abnormal hot restart of the system.

[0085] On the other hand, it can be seen from the above embodiments that the present application can prevent subsequent IO from being assigned to these volumes for processing by taking volumes with insufficient page resources offline, thereby avoiding the possibility of subsequent IO processing timeouts due to insufficient resources.

[0086] However, this embodiment further provides another solution for avoiding IO timeout. When it is determined that the resource abnormality status bit is in a valid state, the method further includes:

[0087] S106: Sending an input / output cleanup instruction to the business end of the volume through the control end of each volume in the storage pool to trigger the volume offline process preset in the business end.

[0088] The offline process within the volume includes:

[0089] S201: End the input / output process on each input / output queue in the volume to end the input / output and return an offline error message to the host.

[0090] The input / output queues include, but are not limited to, active input / output (active IO) queues, inactive input / output (inactive IO) queues, and waiting queues.

[0091] If the volume is the main body, the above step S105 implements the offline processing of the volume to the outside, while this embodiment controls the offline IO inside the volume, with the purpose of terminating and returning the unfinished IO inside the volume to avoid this part of the IO running for a long time inside the volume and causing timeout.

[0092] Similar to the above-mentioned volume being offline to the outside, the IO termination processing of the volume being offline to the inside can also be implemented using the existing volume management structure. Specifically, in this embodiment, after the resource exception status bit of the storage pool is uploaded to the upper layer, in addition to the data end of the volume, the control end of the volume can also recognize the value of the resource exception status bit. Then, when it is determined that the resource exception status bit is in a valid state, the business end of the volume is notified to implement the IO cleanup process that it originally supports, that is, the process of cleaning up the running IO in all IO queues in the volume. In this embodiment, in addition to ending all running IO in the volume, the ended IO also returns the offline error (FAILED_OFFLINE) status value to the host end to inform the host end that the IO has ended.

[0093] In this embodiment, a solution for processing offline IO within a volume is proposed. The above embodiment is to avoid subsequent IO being allocated to a volume with insufficient resources for processing, which may lead to IO processing timeouts, while this embodiment clears the IO that has been running in the volume with insufficient resources to avoid these IOs from timing out due to waiting for resources. That is, this embodiment and the above embodiment implement the processing of timed IO from two different aspects to avoid IO processing timeouts due to insufficient resources, thereby triggering a system restart. Furthermore, the offline processing of IO within a volume performed in this embodiment can be implemented by using the volume control end and volume business end for volume management in the existing storage architecture, without the need for additional deployment and control, and is simple to implement.

[0094] Furthermore, the IO offline (clearing) processing implemented by the original control end and business end in the volume is limited in the IO that can be cleared. The types of IO that can be cleared are generally the active IO, inactive IO, etc. shown in the above embodiments. However, there are still some special types of IO that cannot be cleared through the original volume business end. For example, special types of IO such as flow control input / output (throttle IO) generated by flow control, and sub-IO (p IO) moved from the active list (that is, the IO list being processed) to other lists.

[0095] For this type of special IO, this embodiment also provides a corresponding clearing (or pruning) solution, and the method further includes:

[0096] S107: The sum of the input / output scales of the first N flow control inputs / outputs in the volume is counted in sequence to obtain the total flow.

[0097] Wherein, the value of N is a positive integer, and the value of N increases by 1 as the number of statistics increases. It should be noted that this embodiment does not limit the initial value of the value of N, which can be 1 or other values. The initial value of N is related to the IO size and the traffic threshold. For example, if it is determined at the beginning of the design that the IO size of the first throttle IO cannot exceed the set traffic threshold, the initial value of N can be set to 2 (i.e., skip the separate statistics of the first throttle IO).

[0098] S108: Determine whether the total flow rate exceeds a preset flow rate threshold.

[0099] S109: If not, a flow control flag is set for each flow control input / output counted this time.

[0100] The flow control identifier is a special symbol value, which is used to indicate that the current flow control input / output is a normal input / output.

[0101] S110: If yes, determine the flow control input / output newly included in the statistical range in this statistics as the first abnormal input / output; and determine the flow control input / output after the first abnormal input / output as the abnormal input / output.

[0102] S111: adding each abnormal input / output to the flow control input / output linked list pre-created by the corresponding thread.

[0103] The offline process within the volume also includes:

[0104] S202: Traverse the flow control input / output linked list corresponding to each thread.

[0105] S203: When the traversed abnormal input / output belongs to an offline volume, the abnormal input / output is terminated to terminate the abnormal input / output and return an offline error message to the host end.

[0106] First, S107 to S111 in this embodiment, that is, the throttle IO in the volume is abnormally identified and processed, and is placed in the corresponding linked list of the corresponding thread so that it can be cut off when the offline process in the volume of S202 and S203 is executed.

[0107] Specifically, steps S107 and S108 are to determine whether the throttle IO is abnormal. Since throttle IO is a special type of IO generated based on IO concurrent size monitoring, in this embodiment, it is controlled by calculating the flow threshold (throttle Limit) and IO scale (IO size). Step S107 counts the sum of the IO sizes of the first N throttle IOs in sequence, that is, the total flow throttle Count, and determines whether the total flow exceeds the flow threshold when there is currently the kth throttle IO (N=k at this time).

[0108] Afterwards, for step S109, if the total traffic does not exceed the traffic threshold, the first N throttleIOs currently counted are all normal IOs and can be processed normally (i.e., there is no need to perform the subsequent special IO pruning process); and to distinguish, a traffic control flag (contribute To Throttle) is set for this part of normal throttle IO; the traffic control flag is a special symbol value, indicating that the throttle IO is a normal IO within the traffic control range.

[0109] As for step S110, when the total traffic of the first N throttle IOs counted for the first time exceeds the traffic threshold, starting from the i-th throttle IO (N=i at this time) newly added in the current statistics, all throttle IOs (if any) from the i-th IO onwards in the volume are determined as abnormal IOs, that is, special IOs that need to be pruned in the subsequent offline process in the volume.

[0110] For example, assuming that there are throttle IOs 1 to 8 in the volume, and the initial value of N is 2, then the total traffic of IO1 and IO2 is counted for the first time in step S107; if the total traffic does not exceed the traffic threshold at this time, IO1 and IO2 are determined to be normal IOs, and a traffic control flag is set for them. Afterwards, because all throttle IOs have not been completely counted, a second count is performed to count the total traffic of IO1 to IO3 (i.e., N=2+1); if the total traffic still does not exceed the traffic threshold at this time, IO1 to IO3 are determined to be normal IOs; since the traffic control flags have been set for IO1 and IO2 in the previous count, the traffic control flag can be set only for IO3 this time. Again, assuming that when the fifth count is performed, i.e., the total traffic of IO1 to IO6 is counted, it is found that the total traffic exceeds the traffic threshold, then IO6 is determined to be the first abnormal IO; accordingly, IO7 and IO8 after IO6 are also abnormal IOs. Since all abnormal IOs are determined at this time, there is no need to repeat the subsequent counts.

[0111] For the abnormal IO determined in steps S107 to S110, step S111 places the abnormal IO in the throttle IO linked list corresponding to the thread, so that the subsequent offline process in the volume can specifically prune it.

[0112] The offline process in the volume corresponding to steps S202 and S203 is the process of pruning the abnormal IO added to the thread throttleIO list. The specific pruning process is similar to step S201, the main difference is that the pruning object is different, so this embodiment will not be repeated here.

[0113] However, based on the above embodiment, this embodiment further provides a possible implementation scheme. After step S203, the above volume offline process further includes:

[0114] S204: When the traversed abnormal input / output does not belong to the offline volume, the currently traversed abnormal input / output is removed from the head of the flow control input / output linked list and placed at the tail of the flow control input / output linked list.

[0115] That is, Figure 2 As shown, when traversing to the IO of a non-offline volume in the throttle IO linked list, since this volume is not offline, its IO is not pruned. In order not to affect the normal operation of the IO, the order between IOs, and the subsequent IO pruning, this IO is removed from the head of the linked list and placed at the end of the linked list to achieve the above purpose.

[0116] Furthermore, for another special IO illustrated in the above embodiment, this embodiment also provides a corresponding pruning solution, and the in-volume offline process also includes:

[0117] Traverse all linked lists corresponding to each thread;

[0118] When the traversed IO belongs to an offline volume, the IO is terminated to terminate the IO and return an offline error message to the host.

[0119] When the traversed IO does not belong to the offline volume, the currently traversed IO is removed from the head of the linked list and placed at the tail of the linked list.

[0120] That is, special IOs such as throttle IO and p IO stored in the linked list corresponding to the thread can be pruned by traversing, and the IOs corresponding to all offline volumes in each thread are pruned to avoid timeout of these IOs.

[0121] On the other hand, it can be seen from the above embodiments that the input / output timeout processing method provided by the present invention avoids IO timeout due to waiting for resources through the offline processing method outside the volume and inside the volume. Then correspondingly, when the resources in the storage pool are restored, this embodiment also provides a corresponding implementation scheme to restore the previously offline volume. Based on this, this embodiment provides a possible implementation scheme, and the above method also includes:

[0122] S112: After a disk is added to the storage pool whose resource abnormality status bit is in the valid state to complete the pool expansion, it is determined whether there is an offline volume that is back online; if so, the process returns to step S102;

[0123] Correspondingly, after step S102, the method further includes:

[0124] S113: When the storage pool does not meet the full lock condition, the upper path output of other offline volumes in the storage pool is set to an online state.

[0125] That is, this embodiment is a recovery method after performing the IO timeout avoidance processing method provided in the above embodiment, restoring the IO and volume to a normal operating state, thereby completely avoiding IO timeout. Figure 3 As shown:

[0126] Assume that there are volumes A and B in storage pool Q; volume A is reported offline by the lower-level SE after the pool is full, and then occupies dirty page resources, resulting in the triggering of a full lock condition; then based on steps S101 to S105 of the above embodiment, volume B is offline; then when a disk is added to volume A due to storage pool Q to achieve capacity expansion, SE can run volume repair to bring volume A back online; then the dirty data corresponding to volume A can be flushed, and after the flush is completed, the originally occupied page resources are released, the full lock condition is no longer met, and volume B will end its original offline state, and all volumes in the pool will also return to the normal IO processing state.

[0127] On the other hand, with respect to the above step S102 to implement a triggering method for determining whether the storage pool meets the full lock condition, this embodiment provides a possible implementation scheme:

[0128] The full lock check function is called by running the path switching function to determine whether each storage pool meets the full lock condition;

[0129] The Run Path Trans function is an existing function tool in the server system, which is triggered when the path of a volume in the storage pool changes.

[0130] As can be seen from the above, steps S101 and S102 require that when a volume in the storage pool is offline (such as volume A in the above example), the full lock check function is triggered to check whether the page resources of the storage pool are sufficient. Steps S112 and S113 require that when a volume that is offline in the storage pool (also such as volume A in the above example) is back online, the full lock check function is also triggered to check whether the page resources of the storage pool are sufficient. This embodiment utilizes the existing Run Path Trans function to meet the above two triggering requirements at the same time. The Run Path Trans function is automatically triggered when it detects that the path of a volume has changed. When a volume is offline or a volume is back online, it is accompanied by a change in the volume path, that is, the Run Path Trans function is automatically triggered. Therefore, by calling the full lock check function through the Run Path Trans function, the automatic triggering of step S102 can be achieved.

[0131] On the other hand, with respect to the specific determination scheme of whether the storage pool meets the full locking condition implemented in the above step S102, this embodiment also provides a possible implementation scheme, and step S102 specifically includes:

[0132] Get the maximum number of page resources allocated in the storage pool and the target number of page resources that should be reached and maintained in the storage pool;

[0133] Compare the maximum number of page resources and the target number of page resources, and determine the smaller value as the representative number of page resources of the current storage pool;

[0134] Determine the resource threshold value according to the number of page resource representatives;

[0135] Determine whether the number of page resources occupied by the current storage pool is greater than the resource threshold;

[0136] If so, it is determined that the storage pool meets the full lock condition;

[0137] If not, it is determined that the storage pool does not meet the full lock condition.

[0138] Specifically, the solution for determining whether resources are sufficient or not provided in this embodiment can be expressed as follows:

[0139] M-Pages >= N-Pages?

[0140] Among them, M-Pages represents the number of page resources currently occupied by the storage pool; N-Pages is the above-mentioned resource threshold, N-Pages = min (max_Pages, target_Pages) – credit_Pages – n; max_Pages represents the maximum number of page resources allocated in the pool; target_Pages is the target number of page resources that should be reached and maintained in the pool; min (max_Pages, target_Pages) represents the representative number of page resources; credit_Pages is other occupied pages; n is a constant.

[0141] That is, this embodiment provides a specific solution for determining whether the storage pool page resources are sufficient, wherein a smaller value between the maximum number of page resources allocated in the pool and the target number of page resources that should be reached and maintained in the pool is selected as a representative of the pool resource number, thereby avoiding fluctuations in the max_Pages resource number when building the pool and bringing higher determination accuracy.

[0142] In the above embodiment, a method for processing an input / output timeout is described in detail, and the present invention also provides an embodiment corresponding to an input / output timeout processing device. It should be noted that the present invention describes the embodiment of the device part from two perspectives, one is based on the perspective of the functional module, and the other is based on the perspective of the hardware.

[0143] Based on the perspective of functional modules, this embodiment provides an input and output timeout processing device, such as Figure 4 As shown, including:

[0144] The volume offline monitoring module 11 is used to monitor whether there is a volume offline in the storage pool, and if so, trigger the resource detection module;

[0145] The resource detection module 12 is used to determine whether the storage pool meets the full lock condition through the full lock check function, and if so, trigger the status setting module;

[0146] A status setting module 13, used to set the resource abnormality status bit to a valid state; wherein the resource abnormality status bit is a pre-set status flag bit corresponding to the storage pool;

[0147] The status upload module 14 is used to upload the value of the resource abnormal status bit to the corresponding storage pool;

[0148] The volume offline module 15 is used to set the upper path output of each volume to an offline state through the state machine in each volume data end in the storage pool when the resource abnormality status bit is in a valid state, so as to make the volume offline.

[0149] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0150] Figure 5 A structural diagram of an input / output timeout processing device provided by another embodiment of the present invention, such as Figure 5 As shown, an input and output timeout processing device includes: a memory 20, for storing a computer program;

[0151] The processor 21 is used to implement the steps of an input and output timeout processing method in the above embodiment when executing a computer program.

[0152] The input / output timeout processing device provided in this embodiment may include but is not limited to a mobile terminal, a personal computer, a workstation, etc.

[0153] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0154] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of an input and output timeout processing method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include but is not limited to an input and output timeout processing method, etc.

[0155] In some embodiments, an input / output timeout processing device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .

[0156] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on an input and output timeout processing device, and may include more or less components than those shown in the figure.

[0157] An input / output timeout processing device provided by an embodiment of the present invention includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: an input / output timeout processing method.

[0158] In addition to the embodiments of the input / output timeout processing method and device provided in the above embodiments, the present invention also provides an embodiment corresponding to a computer program product. A computer program product includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the input / output timeout processing method described in any of the above embodiments can be implemented.

[0159] Since the embodiments of the computer program product part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the computer program product part, which will not be repeated here.

[0160] Finally, the present invention also provides an embodiment corresponding to a non-volatile storage medium. The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.

[0161] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.

[0162] The above is a detailed introduction to an input and output timeout processing method, device and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.

[0163] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A method for processing input and output timeout, characterized in that: include: Monitor whether any volumes in the storage pool are offline; If so, determine whether the storage pool meets the full lock condition through a full lock check function; If satisfied, the resource abnormality status bit is set to a valid state; wherein the resource abnormality status bit is a pre-set status flag bit corresponding to the storage pool; Uploading the value of the resource abnormal status bit to the corresponding storage pool; When the resource abnormality status bit is in a valid state, the upper path output of each volume is set to an offline state through the state machine in the data end of each volume in the storage pool, so that the volume is offline.

2. The input / output timeout processing method according to claim 1, characterized in that: When the resource abnormal status bit is in a valid state, the method further includes: Sending an input / output cleanup instruction to a service end of the volume through a control end of each volume in the storage pool to trigger an offline process in the volume pre-set in the service end; The offline process within the volume includes: Performing end process processing on the input / output on each input / output queue in the volume to end the input / output and make the input / output return offline error information to the host end; The input / output queues include: an active input / output queue, an inactive input / output queue and a waiting queue.

3. The input / output timeout processing method according to claim 2, characterized in that: Also includes: The sum of the input / output scales of the first N flow control inputs / outputs in the volume is counted sequentially to obtain the total flow; wherein the value of N is a positive integer, and the value of N increases by 1 as the number of statistics increases; Determining whether the value of the total flow exceeds a preset flow threshold; If not, a flow control flag is set for each flow control input / output counted this time; wherein the flow control flag is a special symbol value, which is used to indicate that the current flow control input / output is a normal input / output; If so, the flow control input / output newly included in the statistical scope in this statistics is determined to be the first abnormal input / output; and the flow control input / output after the first abnormal input / output is determined to be the abnormal input / output; Add each of the abnormal input / output to the flow control input / output linked list pre-created by the corresponding thread; The in-volume offline process also includes: Traversing the flow control input / output linked list corresponding to each of the threads; When the traversed abnormal input / output belongs to an offline volume, the end process is performed on the abnormal input / output to end the abnormal input / output and make the abnormal input / output return offline error information to the host end.

4. The input / output timeout processing method according to claim 3, characterized in that: After traversing the flow control input / output linked list corresponding to each of the threads, the method further includes: When the traversed abnormal input / output does not belong to the offline volume, the currently traversed abnormal input / output is removed from the head of the flow control input / output linked list and placed at the tail of the flow control input / output linked list.

5. The input / output timeout processing method according to any one of claims 1 to 4, characterized in that: Also includes: After the storage pool in which the resource abnormality status bit is in a valid state is added with a disk to complete the pool expansion, determining whether there is an offline volume that is back online; If so, returning to the step of determining whether the storage pool meets the full lock condition through the full lock check function; After judging whether the storage pool meets the full lock condition through the full lock check function, the method further includes: When the storage pool does not satisfy the full-lock condition, the upper-layer path output of other offline volumes in the storage pool is set to an online state.

6. The method for processing input and output timeout according to claim 5, characterized in that: The determining whether the storage pool meets the full lock condition by the full lock check function includes: Calling the full-lock check function by running the path switching function to determine whether each of the storage pools meets the full-lock condition; The path switching function is triggered to run when a path of a volume in the storage pool changes.

7. The method for processing input and output timeout according to claim 6, characterized in that: Determining whether the storage pool meets the full lock condition includes: Obtaining a maximum number of page resources allocated in the storage pool and a target number of page resources that should be reached and maintained in the storage pool; Comparing the maximum number of page resources with the target number of page resources, and determining the smaller value as the representative number of page resources of the current storage pool; Determining a resource threshold according to the number of page resource representatives; Determine whether the number of page resources currently occupied by the storage pool is greater than the resource threshold; If yes, then judging that the storage pool satisfies the full-lock condition; If not, it is determined that the storage pool does not meet the full locking condition.

8. An input / output timeout processing device, characterized in that: include: The volume offline monitoring module is used to monitor whether there are volumes offline in the storage pool. If so, the resource detection module is triggered; The resource detection module is used to determine whether the storage pool meets the full lock condition through a full lock check function, and if so, trigger the status setting module; The state setting module is used to set the resource abnormal state bit to a valid state; wherein the resource abnormal state bit is a pre-set state flag bit corresponding to the storage pool; A status uploading module, used for uploading the value of the resource abnormal status bit to the corresponding storage pool; The volume offline module is used to set the upper path output of each volume to an offline state through the state machine in each volume data end in the storage pool when the resource abnormality status bit is in a valid state, so as to make the volume offline.

9. An input / output timeout processing device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the input / output timeout processing method as claimed in any one of claims 1 to 7 when executing the computer program.

10. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the input / output timeout processing method according to any one of claims 1 to 7 are implemented.