Slow disk detection method and device, electronic equipment and computer readable storage medium

By detecting the IO queue clearing status and delay information of the hard disk in the storage system, combined with fault detection, the accurate identification and isolation of the slow disk is achieved, solving the problem of low slow disk detection efficiency in the storage system and ensuring system performance.

CN118885346APending Publication Date: 2024-11-01ZHENGZHOU INSPUR DATA TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411095772.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

In a storage system, how to accurately and efficiently identify and process slow hard disks to avoid its negative impact on the performance of the entire storage system.

Method used

By receiving slow disk detection instructions, determine whether the IO queue of the target hard disk is cleared under preset conditions. If it is not cleared, it is determined to be a slow disk; if it is cleared, it is constructed to obtain delay information to confirm whether it is a slow disk, and can Select a fault detection script for hard disk failure detection and isolation processing.

Benefits of technology

It realizes accurate and efficient slow disk detection in the storage system, avoids unnecessary time and resource waste caused by faulty disk detection, and ensures the normal operation of the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885346A_ABST
    Figure CN118885346A_ABST
Patent Text Reader

Abstract

The invention discloses a slow disk detection method and device, electronic equipment and a computer readable storage medium, and the method comprises the steps: determining a target hard disk according to a slow disk detection instruction when the slow disk detection instruction is received; determining an existing IO queue corresponding to the target hard disk, detecting the existing IO queue according to a preset detection condition, and judging whether the existing IO queue is emptied under the preset detection condition or not; if the existing IO queue is not emptied under the preset detection condition, determining that the target hard disk is a slow disk; if the existing IO queue is emptied under the preset detection condition, constructing an IO request for the target hard disk, and obtaining corresponding time delay information by executing the IO request; and determining whether the target hard disk is a slow disk or not according to the time delay information. By applying the technical scheme provided by the invention, accurate and efficient slow disk detection can be realized in the storage system, and normal operation of the storage system is effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a slow disk detection method, and also to a slow disk detection device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] Slow disk detection is an important technology in storage system management, used to identify and handle slow hard disks in storage systems. Slow disks usually refer to hard disks that are slow to read and write data or have long response times, which may have a negative impact on the performance of the entire storage system. With the continuous development of technology, the technical types, disk speeds, and capacities of hard disks have undergone tremendous changes, and the performance of disks with different technical indicators and different manufacturers is also uneven, which poses a challenge to the storage system to quickly and effectively identify slow disks.

[0003] Therefore, how to implement accurate and efficient slow disk detection in a storage system to effectively ensure the normal operation of the storage system is an urgent problem to be solved by those skilled in the art. Summary of the invention

[0004] The purpose of the present application is to provide a slow disk detection method, which can realize accurate and efficient slow disk detection in the storage system, effectively ensuring the normal operation of the storage system; another purpose of the present application is to provide a slow disk detection device, electronic device, computer-readable storage medium and computer program product, all of which have the above-mentioned beneficial effects.

[0005] In a first aspect, the present application provides a slow disk detection method, comprising:

[0006] When a slow disk detection instruction is received, determining a target hard disk according to the slow disk detection instruction;

[0007] Determine an existing IO queue corresponding to the target hard disk, and detect the existing IO queue according to a preset detection condition to determine whether the existing IO queue is cleared under the preset detection condition;

[0008] If the existing IO queue is not cleared under the preset detection condition, determining that the target hard disk is a slow disk;

[0009] If the existing IO queue is cleared under the preset detection condition, constructing an IO request for the target hard disk, and obtaining corresponding latency information by executing the IO request;

[0010] Determine whether the target hard disk is a slow disk according to the delay information.

[0011] Optionally, the determining an existing IO queue corresponding to the target hard disk, and detecting the existing IO queue according to a preset detection condition to determine whether the existing IO queue is cleared under the preset detection condition, further includes:

[0012] Retrieving a fault detection script, and using the fault detection script to perform fault detection on the target hard disk to determine whether the target hard disk is a faulty hard disk;

[0013] When the target hard disk is the faulty hard disk, outputting a hard disk fault prompt;

[0014] When the target hard disk is not the faulty hard disk, the step of determining an existing IO queue corresponding to the target hard disk, detecting the existing IO queue according to a preset detection condition, and judging whether the existing IO queue is cleared under the preset detection condition is executed.

[0015] Optionally, the performing fault detection on the target hard disk by using the fault detection script to determine whether the target hard disk is a faulty hard disk includes:

[0016] Execute the fault detection script to search the hard disk log to determine whether there is IO error information in the hard disk log;

[0017] When the IO error information exists in the hard disk log, determining that the target hard disk is the faulty hard disk;

[0018] When the IO error information does not exist in the hard disk log, it is determined that the target hard disk is not the faulty hard disk.

[0019] Optionally, when a slow disk detection instruction is received, before determining a target hard disk according to the slow disk detection instruction, the method further includes:

[0020] When a slow disk mark notification is received, a slow disk message is sent to the monitoring component according to the slow disk mark notification, so that the monitoring component isolates the target hard disk according to the slow disk message;

[0021] A response message corresponding to the slow disk message fed back by the monitoring component is received, and the slow disk detection instruction is triggered according to the response message.

[0022] Optionally, the slow disk detection method further includes:

[0023] When it is determined that the target hard disk is not a slow disk, a recovery process is performed on the target hard disk to release the isolation of the target hard disk.

[0024] Optionally, if the existing IO queue is cleared under the preset detection condition, constructing an IO request for the target hard disk, and obtaining corresponding latency information by executing the IO request, includes:

[0025] If the existing IO queue is cleared under the preset detection condition, constructing a first preset number of IO requests for a preset storage location of the target hard disk;

[0026] Execute each of the IO requests in sequence to obtain a request processing delay of each of the IO requests;

[0027] An average IO delay is calculated according to the request processing delay of each IO request and the first preset number, and the average IO delay is used as the delay information;

[0028] Determine whether the current delay calculation times reaches the preset times;

[0029] If the current delay calculation times do not reach the preset times, returning to the step of constructing a first preset number of IO requests for the preset storage location of the target hard disk;

[0030] If the current delay calculation times reaches the preset times, obtaining the delay information corresponding to the preset times;

[0031] Correspondingly, determining whether the target hard disk is a slow disk according to the delay information includes:

[0032] When the average IO delays in all the delay information exceed a preset threshold, determining that the target hard disk is a slow disk;

[0033] When the average IO delays in all the delay information do not all exceed the preset threshold, it is determined that the target hard disk is not a slow disk.

[0034] Optionally, the slow disk detection method further includes:

[0035] When it is determined that the target hard disk is a slow disk, the final IO latency of the target hard disk is calculated according to the average IO latency corresponding to the preset number of times;

[0036] Obtain a slow disk level mapping relationship, and use the slow disk level mapping relationship to query the final IO latency to determine the slow disk level of the target hard disk;

[0037] The post-processing operation mapping relationship is obtained, and the preset operation corresponding to the slow disk level is performed on the target hard disk using the post-processing operation mapping relationship.

[0038] Optionally, the detecting the existing IO queue according to a preset detection condition to determine whether the existing IO queue is cleared under the preset detection condition includes:

[0039] The existing IO queue is detected according to a preset detection cycle to determine whether the existing IO queue is cleared within a second preset number of the preset detection cycles.

[0040] In a second aspect, the present application further provides a slow disk detection device, comprising:

[0041] A first determination module, configured to determine a target hard disk according to a slow disk detection instruction when a slow disk detection instruction is received;

[0042] A judgment module, used for determining an existing IO queue corresponding to the target hard disk, and detecting the existing IO queue according to a preset detection condition to determine whether the existing IO queue is cleared under the preset detection condition;

[0043] A second determination module, configured to determine that the target hard disk is a slow disk if the existing IO queue is not cleared under the preset detection condition;

[0044] an execution module, configured to construct an IO request for the target hard disk if the existing IO queue is cleared under the preset detection condition, and obtain corresponding latency information by executing the IO request;

[0045] The third determination module is used to determine whether the target hard disk is a slow disk according to the delay information.

[0046] In a third aspect, the present application further discloses an electronic device, comprising:

[0047] Memory for storing computer programs;

[0048] A processor is used to implement the steps of any one of the above-mentioned slow disk detection methods when executing the computer program.

[0049] In a fourth aspect, the present application further discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the slow disk detection methods described above are implemented.

[0050] In a fifth aspect, the present invention further discloses a computer program product, including a computer program / instruction, which implements the steps of any of the slow disk detection methods described above when executed by a processor.

[0051] The present application provides a slow disk detection method. When a slow disk detection instruction is received, a target hard disk is determined according to the slow disk detection instruction; an existing IO queue corresponding to the target hard disk is determined, and the existing IO queue is detected according to a preset detection condition to determine whether the existing IO queue is cleared under the preset detection condition; if the existing IO queue is not cleared under the preset detection condition, it is determined that the target hard disk is a slow disk; if the existing IO queue is cleared under the preset detection condition, an IO request is constructed for the target hard disk, and corresponding latency information is obtained by executing the IO request; and it is determined whether the target hard disk is a slow disk according to the latency information.

[0052] By applying the technical solution provided by the present application, after determining the target hard disk that needs to be detected by the slow disk according to the slow disk detection instruction, the existing IO request corresponding to the target hard disk (i.e., the IO request in the above-mentioned existing IO queue) can be used to perform slow disk detection on it. In this process, the existing IO queue can be detected according to the preset detection conditions to determine whether it can be emptied under the preset detection conditions. If it cannot be emptied under the preset detection conditions, the target hard disk can be directly determined to be a slow disk without further processing; if the existing IO queue can be emptied under the preset detection conditions, a new IO request can be constructed for the target hard disk, and the slow disk identification of the target hard disk can be realized by counting its delay information. It can be seen that the present technical solution realizes accurate and efficient slow disk detection in the storage system, and effectively ensures the normal operation of the storage system.

[0053] In one embodiment of the present application, after determining the target hard disk that needs to be tested for slow disk, before performing the slow disk test on it, it can be firstly tested for faults, that is, a fault detection script is used to perform a fault detection on the target hard disk to determine whether the target hard disk is a faulty hard disk. If it is a faulty hard disk, a fault prompt is given, otherwise the slow disk detection process is continued. In this way, unnecessary time occupation and waste of resources caused by triggering the slow disk detection of the faulty disk can be effectively avoided, thereby ensuring the efficiency of the slow disk detection and reducing resource occupation.

[0054] The slow disk detection device, electronic device, computer-readable storage medium and computer program product provided in this application also have the above-mentioned technical effects, and this application will not elaborate on them here. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present application, the drawings required for use in the description of the prior art and the embodiments of the present application are briefly introduced below. Of course, the drawings described below in relation to the embodiments of the present application are only part of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work, and the obtained other drawings also belong to the protection scope of the present application.

[0056] Figure 1 A schematic diagram of a slow disk detection method provided in this application;

[0057] Figure 2 A schematic diagram of the structure of a slow disk detection device provided in this application;

[0058] Figure 3 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0059] The core of the present application is to provide a slow disk detection method, which can realize accurate and efficient slow disk detection in the storage system, effectively ensuring the normal operation of the storage system; another core of the present application is to provide a slow disk detection device, electronic device, computer-readable storage medium and computer program product, all of which have the above-mentioned beneficial effects.

[0060] In order to describe the technical solutions in the embodiments of the present application more clearly and completely, the technical solutions in the embodiments of the present application will be introduced below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0061] An embodiment of the present application provides a slow disk detection method.

[0062] Please refer to Figure 1 , Figure 1 This is a schematic flow chart of a slow disk detection method provided by the present application. The slow disk detection method may include the following S101 to S105:

[0063] S101: When a slow disk detection instruction is received, a target hard disk is determined according to the slow disk detection instruction.

[0064] This step is intended to determine the target hard disk. Specifically, when a slow disk detection instruction is received, the target hard disk can be determined according to the slow disk detection instruction. The target hard disk is the hard disk that needs to be slow disk detected, that is, to detect whether the target hard disk is a slow disk. Among them, the slow disk detection instruction carries relevant information of the target hard disk, such as the device number, ID number, etc. The target hard disk can be determined by parsing the slow disk detection instruction. In addition, the method of obtaining the slow disk detection instruction does not affect the implementation of the present technical solution. It can be directly initiated by a technician through a corresponding user terminal, or it can be automatically triggered according to a preset response condition. This application does not limit this.

[0065] S102: Determine an existing IO queue corresponding to the target hard disk, and detect the existing IO queue according to a preset detection condition to determine whether the existing IO queue is cleared under the preset detection condition.

[0066] This step aims to realize slow disk detection based on the existing IO queue. It is understandable that in actual application scenarios, due to business needs, the target hard disk is generally in a read-write state, and the IO requests for the target hard disk are stored in the existing IO queue in the order of receipt, so that each IO request can be executed in sequence in the order of receipt. Based on this, the IO requests in the existing IO queue can be directly used for slow disk detection without constructing new IO requests.

[0067] In the implementation process, after determining the target hard disk that needs to be detected for a slow disk, the corresponding existing IO queue can be determined first. In the storage system, different hard disks generally correspond to different existing IO queues; further, the existing IO queue can be detected according to the preset detection conditions (i.e., the above-mentioned preset detection conditions) to determine whether the existing IO queue can be cleared under the preset detection conditions. It is conceivable that if the existing IO queue cannot be cleared under the preset detection conditions, the target hard disk can be directly determined to be a slow disk (enter S103). Otherwise, a new IO request can be constructed to perform a slow disk detection on it (enter S104). Among them, the specific content of the preset detection conditions does not affect the implementation of the present technical solution. For example, it can be a preset time condition, cycle condition, etc., which can be set by technical personnel according to actual conditions, and this application does not limit this.

[0068] In one embodiment of the present application, the above-mentioned detecting the existing IO queue according to the preset detection conditions to determine whether the existing IO queue is cleared under the preset detection conditions may include: detecting the existing IO queue according to the preset detection cycle to determine whether the existing IO queue is cleared within a second preset number of preset detection cycles.

[0069] The embodiment of the present application provides a specific implementation form of a preset detection condition. Specifically, the existing IO queue can be detected according to a preset detection cycle (i.e., the above-mentioned preset detection cycle), and the detection cycles that have been executed can be counted. When the existing IO queue cannot be emptied within the second preset number of preset detection cycles, it can be determined that the current target hard disk is a slow disk. Otherwise, enter S104 to continue the secondary slow disk detection. It should be noted that the specific values ​​of the above-mentioned preset detection cycle and the second preset number do not affect the implementation of the present technical solution. The technical personnel can customize them according to the actual situation, and the present application does not limit this.

[0070] S103: If the existing IO queue is not cleared under the preset detection condition, it is determined that the target hard disk is a slow disk.

[0071] As described above, if the existing IO queue cannot be cleared under the preset detection conditions, the target hard disk can be directly determined to be a slow disk, and the slow disk detection for the target hard disk is completed. Furthermore, when it is determined that the detected target hard disk is indeed a slow disk, corresponding slow disk prompt information can be output.

[0072] S104: If the existing IO queue is cleared under the preset detection condition, an IO request is constructed for the target hard disk, and corresponding latency information is obtained by executing the IO request.

[0073] As described above, if the existing IO queue can be emptied under the preset detection conditions, a new IO request can be constructed to perform a slow disk detection. It is understandable that in the case where the number of existing IO requests in the existing IO queue is small, the existing IO queue can be easily emptied under the preset detection conditions. At this time, if it is directly determined that the target hard disk is not a slow disk, it may not be accurate. Therefore, a new IO request can be constructed to perform a second slow disk detection to effectively ensure the accuracy of the slow disk detection result. In the implementation process, a new IO request can be constructed for the target hard disk, and the corresponding delay information can be obtained by executing the IO request, so as to determine whether the target hard disk is a slow disk based on the delay information.

[0074] S105: Determine whether the target hard disk is a slow disk according to the delay information.

[0075] This step aims to implement slow disk detection based on latency information, that is, to determine whether the target hard disk is a slow disk according to the latency of the newly constructed IO request. It can be understood that when the latency of the IO request is long, it can be determined that the target hard disk is a slow disk, and when the latency of the IO request is short, it can be determined that the target hard disk is not a slow disk. Similarly, after completing the slow disk detection, the final slow disk detection result can also be output.

[0076] In one embodiment of the present application, if the existing IO queue is cleared under a preset detection condition, constructing an IO request for the target hard disk and obtaining corresponding latency information by executing the IO request may include:

[0077] If the existing IO queue is cleared under the preset detection condition, constructing a first preset number of IO requests for the preset storage location of the target hard disk;

[0078] Execute each IO request in sequence and obtain the request processing delay of each IO request;

[0079] An average IO delay is calculated according to the request processing delay of each IO request and the first preset number, and the average IO delay is used as the delay information;

[0080] Determine whether the current delay calculation times reaches the preset times;

[0081] If the current delay calculation times do not reach the preset times, returning to the step of constructing a first preset number of IO requests for the preset storage location of the target hard disk;

[0082] If the current delay calculation times reaches the preset times, then the delay information corresponding to the preset times is obtained;

[0083] Accordingly, the above-mentioned determining whether the target hard disk is a slow disk according to the delay information may include:

[0084] When the average IO delays in all the delay information exceed the preset threshold, the target hard disk is determined to be a slow disk;

[0085] When the average IO delays in all the delay information do not all exceed the preset threshold, it is determined that the target hard disk is not a slow disk.

[0086] The embodiment of the present application provides a method for determining whether a target hard disk is a slow disk by counting latency information. Specifically, if the existing IO queue can be emptied under preset detection conditions, a first preset number of IO requests can be constructed for the preset storage location of the target hard disk, that is, the first preset number of IO requests are all requests for the same storage location in the target hard disk, so as to ensure the accuracy of the latency information finally obtained, and then ensure the accuracy of the slow disk detection result; further, each IO request is executed in sequence, and the latency information corresponding to each IO request is counted, that is, the request processing delay of each IO request mentioned above, thereby, the average IO latency can be calculated as latency information based on the request processing delay of each IO request and the first preset number, obviously, the average IO latency = the sum of the request processing delays of the first preset number of IO requests / the first preset number, so far, a latency calculation result is obtained; on this basis, the above steps can be executed repeatedly to obtain the latency calculation results corresponding to the preset number of times, and the latency information corresponding to the preset number of times can be obtained. Finally, it is possible to determine whether the target hard disk is a slow disk based on the number of delay information corresponding to the preset number of times, that is: when the average IO delays in all delay information exceed the preset threshold, it can be determined that the target hard disk is a slow disk; when the average IO delays in all delay information do not exceed the preset threshold, it can be determined that the target hard disk is not a slow disk. Similarly, the specific values ​​of the first preset number, preset number of times, and preset threshold do not affect the implementation of this technical solution, and can be customized by technicians according to actual conditions, and this application does not limit this.

[0087] In one embodiment of the present application, the slow disk detection method may further include:

[0088] When it is determined that the target hard disk is a slow disk, the final IO latency of the target hard disk is calculated according to the average IO latency corresponding to the preset number of times;

[0089] Obtain a slow disk level mapping relationship, and use the slow disk level mapping relationship to query the final IO latency to determine the slow disk level of the target hard disk;

[0090] The post-processing operation mapping relationship is obtained, and the preset operation corresponding to the slow disk level is performed on the target hard disk using the post-processing operation mapping relationship.

[0091] The embodiment of the present application provides a method for identifying the level of a slow disk and a post-processing implementation method for a slow disk. Specifically, for the average IO delays corresponding to the preset number of delay calculations obtained by the preset number of times, the final IO delay of the target hard disk can be obtained by calculating its average value, and it is matched with the slow disk level hard disk hard disk relationship. In the slow disk level hard disk relationship, the final IO delays of different value ranges correspond to different slow disk levels. For example, the slow disk level can be divided into a low-level slow disk, a medium-level program slow disk, a high-level slow disk, etc.; on this basis, different slow disk levels correspond to different slow disk post-processing operations, so that the corresponding preset operations can be performed on the target hard disk according to the slow disk level of the target hard disk with reference to the post-processing operation mapping relationship. For example, for a low-level slow disk, it can be restored to the storage system to continue to provide normal business services; for a medium-level slow disk, an operation and maintenance prompt can be output to inform the technician that it can be repaired abnormally and then restored to the storage system to continue to provide normal business services; for a high-level slow disk, a discard prompt or a hard disk replacement prompt can be output, that is, the target hard disk is abandoned and replaced with a new hard disk to continue to provide business services for the storage system.

[0092] It should be noted that the specific implementation forms and specific mapping relationships of the above-mentioned slow disk level mapping relationship and post-processing operation mapping relationship are not unique and can be set by technical personnel according to actual conditions, and this application does not limit this.

[0093] It can be seen that the slow disk detection method provided by the embodiment of the present application can first use the existing IO request corresponding to the target hard disk (i.e., the IO request in the above-mentioned existing IO queue) to perform slow disk detection on it after determining the target hard disk that needs to be detected according to the slow disk detection instruction. In this process, the existing IO queue can be detected according to the preset detection conditions to determine whether it can be emptied under the preset detection conditions. If it cannot be emptied under the preset detection conditions, it can be directly determined that the target hard disk is a slow disk without further processing; if the existing IO queue can be emptied under the preset detection conditions, a new IO request can be constructed for the target hard disk, and the slow disk identification of the target hard disk can be realized by counting its delay information. It can be seen that the technical solution realizes accurate and efficient slow disk detection in the storage system, and effectively guarantees the normal operation of the storage system.

[0094] Based on the above embodiments:

[0095] In one embodiment of the present application, the above-mentioned determining the existing IO queue corresponding to the target hard disk, and detecting the existing IO queue according to the preset detection condition, and judging whether the existing IO queue is cleared under the preset detection condition, may also include:

[0096] Retrieving a fault detection script, and using the fault detection script to perform fault detection on the target hard disk to determine whether the target hard disk is a faulty hard disk;

[0097] When the target hard disk is a faulty hard disk, a hard disk fault prompt is output;

[0098] When the target hard disk is not a faulty hard disk, the step of determining an existing IO queue corresponding to the target hard disk, detecting the existing IO queue according to a preset detection condition, and judging whether the existing IO queue is cleared under the preset detection condition is executed.

[0099] The slow disk detection method provided in the embodiment of the present application can further realize the hard disk fault detection function. Specifically, after determining the target hard disk that needs to be slow disk detected, before performing the slow disk detection on it, it can be firstly fault detected, that is, the target hard disk is fault detected by using a fault detection script to determine whether the target hard disk is a faulty hard disk. If it is a faulty hard disk, a fault prompt is given, otherwise the slow disk detection process continues. Among them, the fault detection script can be pre-stored in the corresponding storage space and can be directly called when used; in addition, the implementation method of the hard disk fault prompt is not unique, for example, it can be an email notification, a sound prompt, etc., and the present application does not limit this.

[0100] It can be seen that in the embodiment of the present application, after determining the target hard disk that needs to be tested for slow disk, before performing the slow disk test on it, it can be firstly tested for faults, that is, the target hard disk is tested for faults using a fault detection script to determine whether the target hard disk is a faulty hard disk. If it is a faulty hard disk, a fault prompt is given, otherwise the slow disk detection process is continued. In this way, unnecessary time occupation and waste of resources caused by triggering the slow disk detection of the faulty disk can be effectively avoided, thereby ensuring the efficiency of the slow disk detection and reducing resource occupation.

[0101] In one embodiment of the present application, the above-mentioned use of the fault detection script to perform fault detection on the target hard disk to determine whether the target hard disk is a faulty hard disk may include:

[0102] Execute the fault detection script and search the hard disk log to determine whether there is IO error information in the hard disk log;

[0103] When there is IO error information in the hard disk log, it is determined that the target hard disk is a faulty hard disk;

[0104] When there is no IO error information in the hard disk log, it is determined that the target hard disk is not a faulty hard disk.

[0105] The embodiment of the present application provides a method for implementing a fault detection on a target hard disk using a fault detection script to determine whether the target hard disk is a faulty hard disk. Specifically, when executing the fault detection script, the hard disk log can be retrieved to determine whether there is IO error information about the target hard disk in the hard disk log, and the hard disk log stores the IO execution logs of each hard disk in the storage system. Obviously, if there is IO error information about the target hard disk in the hard disk log, it can be determined that the target hard disk is a faulty hard disk. Conversely, if there is no IO error information about the target hard disk in the hard disk log, it can be determined that the target hard disk is not a faulty hard disk. In this way, fault detection of the target hard disk is achieved.

[0106] In one embodiment of the present application, when a slow disk detection instruction is received, before determining the target hard disk according to the slow disk detection instruction, the following steps may also be included:

[0107] When a slow disk mark notification is received, a slow disk message is sent to the monitoring component according to the slow disk mark notification, so that the monitoring component isolates the target hard disk according to the slow disk message;

[0108] A response message corresponding to the slow disk message fed back by the monitoring component is received, and a slow disk detection instruction is triggered according to the response message.

[0109] The embodiment of the present application provides a method for obtaining a slow disk detection instruction, that is, automatic triggering based on preset response conditions. Specifically, for the storage system, it will use the monitoring component to monitor each of its own hard disks during the actual operation process. When it detects that a certain hard disk has certain abnormal conditions (such as a hard disk is slow in responding to IO requests), the hard disk will be initially marked as a slow disk, thereby triggering the hard disk to enter the slow disk self-test process. Then, for each hard disk in the storage system, when it receives a slow disk mark notification, it can send a slow disk message to the monitoring component of the storage system according to the slow disk mark notification, so that the monitoring component can isolate the corresponding hard disk (i.e., the target hard disk) according to the slow disk message, and feedback the response message corresponding to the slow disk message to the target hard disk, that is, to inform the target hard disk that the isolation has been completed and the self-test operation can be triggered. As a result, the target hard disk can trigger the slow disk detection instruction according to the received response message and enter the slow disk self-test process.

[0110] Among them, the monitoring component can be specifically a MON component, and the work content of the MON component is to be responsible for monitoring the health information of itself and other components in the cluster. In the embodiment of the present application, it is used to monitor the health information of each hard disk in the storage system.

[0111] It is understandable that triggering the slow disk self-check process after isolating the target hard disk marked as a slow disk can effectively prevent the target hard disk from continuing to undertake actual business processing during the slow disk self-check process, further ensuring the accuracy of the slow disk self-check results.

[0112] In one embodiment of the present application, the slow disk detection method may further include: when it is determined that the target hard disk is not a slow disk, performing recovery processing on the target hard disk to release the isolation of the target hard disk.

[0113] Specifically, since the target hard disk has been isolated before the slow disk detection is triggered and normal business services cannot be continued, after the slow disk detection is completed on the target hard disk and it is determined that the target hard disk is not a slow disk, the target hard disk can be recovered, that is, the isolation of the target hard disk is released so that it can continue to provide normal business services.

[0114] Based on the above embodiments, the present application embodiment provides another slow disk detection method by taking OSD (Object Storage Device) as an example. The implementation process of the slow disk detection method is as follows:

[0115] First, after the OSD is marked as a slow disk by the slow disk detection, it will send a slow disk message to the MON, and the MON will isolate the OSD from the storage cluster. This step can isolate the slow disk as quickly as possible and reduce the performance impact on the cluster. After that, the MON replies to the OSD slow disk reply (response message). After the OSD receives the slow disk reply, it triggers the slow disk self-check. Among them, after the OSD receives the slow disk reply returned by the MON, it can use the periodic detection method to trigger the OSD to enter the slow disk self-check process.

[0116] Secondly, in the OSD startup preparation phase, the self-check timer is initialized; the reserved object is written and the location information of the reserved object is initialized.

[0117] Then, OSD calls the fault detection script to identify whether the hard disk is a faulty disk by searching for disk-related I / O error and other disk error information in the message log. If it is a faulty disk, the process exits directly without the need for slow disk self-check.

[0118] Finally, enter the following two-stage detailed detection process:

[0119] Phase 1: When there are unreturned IOs in OSD, the detection result of this cycle can be set to normal_slow (normal slow), the continuous detection count of phase 1 is increased by one, and the next cycle still enters the detection of phase 1; when the detection count of phase 1 reaches 5 times, if the unreturned IOs are still not cleared, they are directly returned to the slow disk and the OSD process exits. When all IOs have been returned, the detection result of this cycle is directly set to normal_slow (normal slow), and the detection of phase 2 is entered in the next cycle.

[0120] Phase 2: Construct 10 pairs of read and write IO requests for fixed positions and fixed sizes, simulate 10 pairs of IO with a queue depth of 1, send them to the hard disk, and count the average latency of these IO requests to determine whether the hard disk response is really slow. The judgment criteria are as follows: Internal test of the average processing time of IO requests in the last 5-10 minutes. If it exceeds the set value of 900ms, it is judged as extreme_slow (extremely slow); internal test of the average processing time of IO requests in the last 5-10 minutes. If it exceeds the set value of 500ms, it is judged as normal_slow (normally slow).

[0121] The statistical method for the average processing time of IO requests in the last 5-10 minutes is as follows: IO data is obtained every five minutes, then: IO data obtained in this cycle - IO data obtained in the previous cycle = IO data in this 5 minutes. Therefore, by calculating the IO data in these 5 minutes, the average latency of IO in the last 5 minutes can be calculated. If it is obtained in the first cycle, the historical average IO latency can be obtained. The total IO time in the last 5-10 minutes / the total number of IO in the last 5-10 minutes = the average latency in the last 5-10 minutes. If the IO-related data in the last 5-10 minutes cannot be obtained, the average processing latency of the overall IO can be returned as the standard.

[0122] Phase 2 can be executed 20 times in a row. If all 20 detection results are slow (exterme_slow or normal_slow), the slow disk can be returned. If any result in phase 2 is no_slow (not slow), the non-slow disk can be returned and the OSD can be restarted.

[0123] At this point, the slow disk detection for OSD is completed.

[0124] In addition, when it is determined that the OSD is indeed a slow disk, different post-processing operations such as repairing or abandoning the OSD can be performed according to the detection result, such as exterme_slow or normal_slow.

[0125] It can be seen that the slow disk detection method provided by the embodiment of the present application can first use the existing IO request corresponding to the target hard disk (i.e., the IO request in the above-mentioned existing IO queue) to perform slow disk detection on it after determining the target hard disk that needs to be detected according to the slow disk detection instruction. In this process, the existing IO queue can be detected according to the preset detection conditions to determine whether it can be emptied under the preset detection conditions. If it cannot be emptied under the preset detection conditions, it can be directly determined that the target hard disk is a slow disk without further processing; if the existing IO queue can be emptied under the preset detection conditions, a new IO request can be constructed for the target hard disk, and the slow disk identification of the target hard disk can be realized by counting its delay information. It can be seen that the technical solution realizes accurate and efficient slow disk detection in the storage system, and effectively guarantees the normal operation of the storage system.

[0126] An embodiment of the present application provides a slow disk detection device.

[0127] Please refer to Figure 2 , Figure 2 This is a schematic diagram of the structure of a slow disk detection device provided by the present application. The slow disk detection device may include:

[0128] A first determination module 1 is used to determine a target hard disk according to the slow disk detection instruction when a slow disk detection instruction is received;

[0129] The judgment module 2 is used to determine the existing IO queue corresponding to the target hard disk, and detect the existing IO queue according to the preset detection conditions to determine whether the existing IO queue is cleared under the preset detection conditions;

[0130] A second determination module 3 is used to determine that the target hard disk is a slow disk if the existing IO queue is not cleared under a preset detection condition;

[0131] An execution module 4 is used to construct an IO request for a target hard disk if the existing IO queue is cleared under a preset detection condition, and obtain corresponding latency information by executing the IO request;

[0132] The third determination module 5 is used to determine whether the target hard disk is a slow disk according to the delay information.

[0133] It can be seen that the slow disk detection device provided in the embodiment of the present application can first use the existing IO request corresponding to the target hard disk (i.e., the IO request in the above-mentioned existing IO queue) to perform slow disk detection on it after determining the target hard disk that needs to be detected according to the slow disk detection instruction. In this process, the existing IO queue can be detected according to the preset detection conditions to determine whether it can be emptied under the preset detection conditions. If it cannot be emptied under the preset detection conditions, it can be directly determined that the target hard disk is a slow disk without further processing; if the existing IO queue can be emptied under the preset detection conditions, a new IO request can be constructed for the target hard disk, and the slow disk identification of the target hard disk can be realized by counting its delay information. It can be seen that the technical solution realizes accurate and efficient slow disk detection in the storage system, and effectively guarantees the normal operation of the storage system.

[0134] In one embodiment of the present application, the slow disk detection device may further include a fault self-detection module, which is used to call a fault detection script before determining the existing IO queue corresponding to the target hard disk and detecting the existing IO queue according to preset detection conditions to determine whether the existing IO queue is cleared under the preset detection conditions, and use the fault detection script to perform a fault detection on the target hard disk to determine whether the target hard disk is a faulty hard disk; when the target hard disk is a faulty hard disk, output a hard disk fault prompt; when the target hard disk is not a faulty hard disk, execute the steps of determining the existing IO queue corresponding to the target hard disk, detecting the existing IO queue according to preset detection conditions, and determining whether the existing IO queue is cleared under the preset detection conditions.

[0135] In one embodiment of the present application, the above-mentioned fault self-check module can be specifically used to execute a fault detection script, retrieve the hard disk log to determine whether there is IO error information in the hard disk log; when there is IO error information in the hard disk log, it is determined that the target hard disk is a faulty hard disk; when there is no IO error information in the hard disk log, it is determined that the target hard disk is not a faulty hard disk.

[0136] In one embodiment of the present application, the slow disk detection device may further include an isolation module, which is used for sending a slow disk message to the monitoring component according to the slow disk mark notification when a slow disk mark notification is received, before determining the target hard disk according to the slow disk detection instruction when a slow disk detection instruction is received, so that the monitoring component isolates the target hard disk according to the slow disk message; receiving a response message corresponding to the slow disk message fed back by the monitoring component, and triggering the slow disk detection instruction according to the response message.

[0137] In one embodiment of the present application, the slow disk detection device may further include an isolation release module for performing recovery processing on the target hard disk to release the isolation of the target hard disk when it is determined that the target hard disk is not a slow disk.

[0138] In one embodiment of the present application, the execution module 4 can be specifically used to construct a first preset number of IO requests for a preset storage location of a target hard disk if an existing IO queue is cleared under a preset detection condition; execute each IO request in sequence to obtain a request processing delay of each IO request; calculate an average IO delay based on the request processing delay of each IO request and the first preset number, and use the average IO delay as delay information; determine whether the current delay calculation times reaches the preset times; if the current delay calculation times does not reach the preset times, return to the step of constructing a first preset number of IO requests for a preset storage location of the target hard disk; if the current delay calculation times reaches the preset times, obtain delay information corresponding to the preset times;

[0139] Accordingly, the third determination module 5 can be specifically used to determine that the target hard disk is a slow disk when the average IO delays in all delay information exceed the preset threshold; and to determine that the target hard disk is not a slow disk when the average IO delays in all delay information do not exceed the preset threshold.

[0140] In one embodiment of the present application, the above-mentioned determination module 2 can be specifically used to detect the existing IO queue according to a preset detection cycle, and determine whether the existing IO queue is emptied within a second preset number of preset detection cycles.

[0141] In one embodiment of the present application, the slow disk detection device may further include a post-processing module, which is used to, when it is determined that the target hard disk is a slow disk, calculate the final IO delay of the target hard disk according to an average IO delay corresponding to a preset number of times; obtain a slow disk level mapping relationship, and use the slow disk level mapping relationship to query the final IO delay to determine the slow disk level of the target hard disk; obtain a post-processing operation mapping relationship, and use the post-processing operation mapping relationship to perform a preset operation corresponding to the slow disk level on the target hard disk.

[0142] For an introduction to the device provided in the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate on them here.

[0143] An embodiment of the present application provides an electronic device.

[0144] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in this application, and the electronic device may include:

[0145] A memory 11, used for storing computer programs;

[0146] The processor 10 can implement the steps of any of the above-mentioned slow disk detection methods when executing a computer program.

[0147] like Figure 3, which is a schematic diagram of the composition structure of an electronic device, the electronic device may include: a processor 10, a memory 11, a communication interface 12 and a communication bus 13. The processor 10, the memory 11 and the communication interface 12 all communicate with each other through the communication bus 13.

[0148] In the embodiment of the present application, the processor 10 may be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic devices, etc.

[0149] The processor 10 may call a program stored in the memory 11. Specifically, the processor 10 may execute operations in the embodiment of the slow disk detection method.

[0150] The memory 11 is used to store one or more programs, which may include program codes, and the program codes include computer operation instructions. In the embodiment of the present application, the memory 11 at least stores programs for implementing the following functions:

[0151] When a slow disk detection instruction is received, a target hard disk is determined according to the slow disk detection instruction;

[0152] Determine an existing IO queue corresponding to the target hard disk, and detect the existing IO queue according to a preset detection condition to determine whether the existing IO queue is cleared under the preset detection condition;

[0153] If the existing IO queue is not cleared under the preset detection conditions, the target hard disk is determined to be a slow disk;

[0154] If the existing IO queue is cleared under the preset detection condition, an IO request is constructed for the target hard disk, and the corresponding latency information is obtained by executing the IO request;

[0155] Determine whether the target hard disk is a slow disk based on the latency information.

[0156] In a possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function, etc.; the data storage area may store data created during use.

[0157] In addition, the memory 11 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.

[0158] The communication interface 12 may be an interface of a communication module, and is used to connect to other devices or systems.

[0159] Of course, it should be noted that Figure 3The structure shown does not constitute a limitation on the electronic device in the embodiment of the present application. In actual applications, the electronic device may include Figure 3 More or fewer components than shown, or combinations of certain components.

[0160] An embodiment of the present application provides a computer-readable storage medium.

[0161] The computer-readable storage medium provided in the embodiment of the present application stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned slow disk detection methods can be implemented.

[0162] Among them, the computer-readable storage medium can be any available medium that can be stored in a computer or a data storage device such as a server or data center that includes one or more available media integrated. For example, it can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk) and other media that can store computer program codes.

[0163] For an introduction to the computer-readable storage medium provided in the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate on them here.

[0164] An embodiment of the present application provides a computer program product.

[0165] The computer program product provided in the embodiment of the present application includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of any of the above-mentioned slow disk detection methods can be implemented.

[0166] Specifically, in the above embodiments, all or part of them can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of them can be implemented in the form of a computer program product.

[0167] Among them, the computer program product may include one or more computer programs / instructions, and when the computer program / instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application may be generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line, etc.) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0168] For an introduction to the computer program product provided in the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate on them here.

[0169] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred 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.

[0170] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0171] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0172] The technical solution provided by the present application is described in detail above. The principle and implementation method of the present application are described in detail using specific examples herein, and the description of the above embodiments is only used to help understand the method and core idea of ​​the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.

Claims

1. A slow disk detection method, characterized in that: include: When a slow disk detection instruction is received, determining a target hard disk according to the slow disk detection instruction; Determine an existing IO queue corresponding to the target hard disk, and detect the existing IO queue according to a preset detection condition to determine whether the existing IO queue is cleared under the preset detection condition; If the existing IO queue is not cleared under the preset detection condition, determining that the target hard disk is a slow disk; If the existing IO queue is cleared under the preset detection condition, constructing an IO request for the target hard disk, and obtaining corresponding latency information by executing the IO request; Determine whether the target hard disk is a slow disk according to the delay information.

2. The slow disk detection method according to claim 1, characterized in that: The determining of the existing IO queue corresponding to the target hard disk, and detecting the existing IO queue according to a preset detection condition to determine whether the existing IO queue is cleared under the preset detection condition, further includes: Retrieving a fault detection script, and using the fault detection script to perform fault detection on the target hard disk to determine whether the target hard disk is a faulty hard disk; When the target hard disk is the faulty hard disk, outputting a hard disk fault prompt; When the target hard disk is not the faulty hard disk, the step of determining an existing IO queue corresponding to the target hard disk, detecting the existing IO queue according to a preset detection condition, and judging whether the existing IO queue is cleared under the preset detection condition is executed.

3. The slow disk detection method according to claim 2, characterized in that: The using the fault detection script to perform fault detection on the target hard disk to determine whether the target hard disk is a faulty hard disk includes: Execute the fault detection script to search the hard disk log to determine whether there is IO error information in the hard disk log; When the IO error information exists in the hard disk log, determining that the target hard disk is the faulty hard disk; When the IO error information does not exist in the hard disk log, it is determined that the target hard disk is not the faulty hard disk.

4. The slow disk detection method according to any one of claims 1 to 3, characterized in that: When a slow disk detection instruction is received, before determining the target hard disk according to the slow disk detection instruction, the method further includes: When a slow disk mark notification is received, a slow disk message is sent to the monitoring component according to the slow disk mark notification, so that the monitoring component isolates the target hard disk according to the slow disk message; A response message corresponding to the slow disk message fed back by the monitoring component is received, and the slow disk detection instruction is triggered according to the response message.

5. The slow disk detection method according to claim 4, characterized in that: Also includes: When it is determined that the target hard disk is not a slow disk, a recovery process is performed on the target hard disk to release the isolation of the target hard disk.

6. The slow disk detection method according to claim 1, characterized in that: If the existing IO queue is cleared under the preset detection condition, constructing an IO request for the target hard disk, and obtaining corresponding latency information by executing the IO request, including: If the existing IO queue is cleared under the preset detection condition, constructing a first preset number of IO requests for a preset storage location of the target hard disk; Execute each of the IO requests in sequence to obtain a request processing delay of each of the IO requests; An average IO delay is calculated according to the request processing delay of each IO request and the first preset number, and the average IO delay is used as the delay information; Determine whether the current delay calculation times reaches the preset times; If the current delay calculation times do not reach the preset times, returning to the step of constructing a first preset number of IO requests for the preset storage location of the target hard disk; If the current delay calculation times reaches the preset times, obtaining the delay information corresponding to the preset times; Correspondingly, determining whether the target hard disk is a slow disk according to the delay information includes: When the average IO delays in all the delay information exceed a preset threshold, determining that the target hard disk is a slow disk; When the average IO delays in all the delay information do not all exceed the preset threshold, it is determined that the target hard disk is not a slow disk.

7. The slow disk detection method according to claim 1, characterized in that: The detecting the existing IO queue according to the preset detection condition, and determining whether the existing IO queue is cleared under the preset detection condition, comprises: The existing IO queue is detected according to a preset detection cycle to determine whether the existing IO queue is cleared within a second preset number of the preset detection cycles.

8. A slow disk detection device, characterized in that: include: A first determination module, configured to determine a target hard disk according to a slow disk detection instruction when a slow disk detection instruction is received; A judgment module, used for determining an existing IO queue corresponding to the target hard disk, and detecting the existing IO queue according to a preset detection condition to determine whether the existing IO queue is cleared under the preset detection condition; A second determination module, configured to determine that the target hard disk is a slow disk if the existing IO queue is not cleared under the preset detection condition; an execution module, configured to construct an IO request for the target hard disk if the existing IO queue is cleared under the preset detection condition, and obtain corresponding latency information by executing the IO request; The third determination module is used to determine whether the target hard disk is a slow disk according to the delay information.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the slow disk detection method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the slow disk detection method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Data management method, device and system, cluster, product and storage medium

    CN121116173A