Hard disk fault handling method, array controller and hard disk

By using array controllers and redundancy algorithms in solid-state drives to recover data from failed storage blocks between multiple hard disks, the problem of redundant space reduction after SSD failure is solved, and the hard disk performance is maintained.

CN110879761BActive Publication Date: 2024-12-24HUAWEI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN201811451958.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-09-05
Filing Date
2018-11-30
Publication Date
2024-12-24
Estimated Expiration
2038-11-30

AI Technical Summary

Technical Problem

After a solid-state drive fails, in order to maintain the nominal capacity of the solid-state drive, it must be compensated through redundant space, resulting in a reduction in redundant space and affecting the performance of the hard disk.

Method used

The array controller uses a redundant algorithm to form a memory block group between multiple hard disks, obtains the fault information of the failed storage block, restores the lost data and records the address correspondence relationship, avoids reducing redundant space, and thus maintains hard disk performance.

Benefits of technology

It effectively avoids the reduction of redundant space after solid-state drive failure, reduces hard disk wear, and ensures hard disk performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110879761B_ABST
    Figure CN110879761B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method for handling hard disk failure. The method is executed by an array controller of a storage array. The storage array includes multiple hard disks, each of which is divided into multiple storage blocks, and multiple storage blocks located in different hard disks form a storage block group through a redundancy algorithm. The method includes: obtaining fault information of a faulty area in a first hard disk; when the fault information indicates that data is lost in the faulty area, determining the faulty storage block where the lost data is located; using other storage blocks in the storage block group to which the faulty storage block belongs to restore the data of the faulty storage block; storing the restored data in a recovery storage block, the recovery storage block is located in a second hard disk, and the second hard disk is a hard disk other than the hard disk where the storage block group is located; recording the correspondence between the address of the data in the faulty storage block in the first hard disk and the address of the recovery data block in the second hard disk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technology, and in particular to a processing method after a storage area in a hard disk fails, and an array controller and a hard disk for executing the processing method. Background Art

[0002] Since data on a solid-state drive cannot be written locally but can only be written remotely, a portion of redundant space must be reserved in the solid-state drive as a spare space for writing data to the solid-state drive to improve the performance of the solid-state drive. The nominal capacity provided by the solid-state drive does not include the capacity of the redundant space.

[0003] When a partial area failure occurs in the SSD (e.g., die failure, hereinafter referred to as the failure area), in order to prevent the nominal capacity from being reduced, the capacity of the redundant space needs to be used to compensate for the failure area, which will result in a reduction in the capacity of the redundant space. The reduction in redundant space will increase the wear of the SSD, thereby affecting the performance of the SSD. Summary of the invention

[0004] The embodiment of the present invention provides a processing method after a fault area appears in a hard disk. By using the processing method, after a fault area appears in the hard disk, the redundant space of the hard disk will not be reduced, thereby not causing an increase in the wear of the hard disk.

[0005] The first aspect of the embodiment of the present invention provides a hard disk fault processing method, which is executed by an array controller of a storage array. The storage array includes multiple hard disks, each hard disk is divided into multiple storage blocks, and multiple storage blocks located in different hard disks form a storage block group through a redundancy algorithm. The method includes: obtaining fault information of a faulty area in a first hard disk; when the fault information indicates that data is lost in the faulty area, determining the faulty storage block where the lost data is located; using other storage blocks in the storage block group to which the faulty storage block belongs to restore the data of the faulty storage block; storing the restored data in a recovery storage block, the recovery storage block is located in a second hard disk, and the second hard disk is a hard disk other than the hard disk where the storage block group is located; recording the correspondence between the address of the data in the faulty storage block in the first hard disk and the address of the recovery data block in the second hard disk.

[0006] By restoring the lost data in the faulty storage block in the first hard disk to the recovery storage block in the second hard disk, and recording the correspondence between the address of the faulty storage block in the first hard disk and the address of the recovery storage block in the second hard disk, the redundant space in the first hard disk will not be reduced, thereby ensuring the performance of the first hard disk.

[0007] In an embodiment of the first aspect, two methods of obtaining fault information of a faulty area in a first hard disk are provided. The first method is that the array controller receives the fault information reported by the first hard disk; the second method is that the array controller sends a fault query command to the first hard disk; and then receives the fault information reported by the first hard disk according to the fault query command.

[0008] Optionally, the fault information includes an identifier indicating whether data is lost, and data loss is determined in the fault area based on the identifier.

[0009] In an embodiment of the first aspect, two methods for determining a faulty storage block where lost data is located are provided. The first method is that the array controller obtains the address of the first storage block in the first hard disk; sends a data loss query command to the first hard disk, and the query command carries the address of the first storage block in the first hard disk; after the first hard disk receives the query command, it determines whether the address carried in the query command includes part or all of the address of the faulty area. If it does, the first hard disk carries indication information indicating that the first storage block includes the lost data in the return message of the query command; otherwise, the return message of the query command carries indication information indicating that the first storage block does not include the lost data. After receiving the indication information returned by the first hard disk indicating whether the first storage block includes the lost data, if the array controller determines that the indication information indicates that the first storage block includes the lost data, it determines that the first storage block is the faulty storage block; and then generates a new data loss query command, and the new data loss query command carries the address of the second storage block of the first hard disk in the first hard disk.

[0010] The second method for determining the faulty storage block where the lost data is located is to send a fault area query command to the first hard disk; receive information including the address of the faulty area returned by the first hard disk; and determine the faulty storage block according to the address of the faulty area.

[0011] Optionally, the fault information includes the capacity of the fault area, and the method further includes: obtaining the capacity of the fault area in the fault information, and adding the capacity of the fault area to the total fault capacity of the first hard disk; when it is determined that the total fault capacity is greater than a preset value, prompting the user to replace the first hard disk.

[0012] Determining whether to replace the hard disk by the total capacity lost by the hard disk is more convenient and more accurate than detecting the wear degree of the hard disk in the prior art.

[0013] A second aspect of the present invention provides a hard disk fault processing method, the method is executed by an array controller of a storage array, the storage array includes a first hard disk, and the first hard disk includes a fault area. The method includes obtaining fault information of the fault area; determining the capacity of the fault area according to the fault information; migrating part of the data in the first hard disk to a second hard disk according to the capacity; and recording the mapping relationship between the address of the migrated data in the first hard disk and the address in the second hard disk.

[0014] Optionally, the first hard disk and other hard disks in the storage array form a logical disk according to a redundancy algorithm. The method further includes determining whether the first hard disk has data loss according to the fault information; if the first hard disk has data loss, recovering the data in the first hard disk by using the redundancy algorithm.

[0015] By obtaining the information about data loss in the hard disk and the redundancy algorithm between hard disks, the lost data in the hard disk can be restored in time.

[0016] The third aspect of the present invention provides a hard disk fault processing method, which is executed by a hard disk. The method includes detecting a faulty area in the hard disk; determining whether the faulty area has data loss; setting a flag indicating whether the faulty area has data loss according to the determination result; and reporting the flag including the faulty area in the hard disk and the flag indicating whether the faulty area has data loss as fault information to an array controller.

[0017] Optionally, the hard disk further records the capacity of the faulty area, and reports the capacity of the faulty area as fault information to the array controller.

[0018] By reporting the capacity of the hard disk's faulty area, the array controller can sense the lost capacity of the faulty area, so that when the array receives a write request, it can allocate the write request to the hard disk with larger remaining capacity, thereby better controlling the hard disk.

[0019] Optionally, the method further includes determining whether the capacity of the fault area is greater than a preset value, and when the capacity of the fault area is greater than the preset value, reporting the fault information to the array controller.

[0020] When the capacity of the fault area is greater than a preset value, the fault information is reported, thereby avoiding the impact of frequent reporting of fault information on the performance of the storage array.

[0021] In the implementation of the third aspect, when the communication protocol between the hard disk and the array controller is different, the way in which the hard disk records and reports the fault information is also different. When the communication protocol between the hard disk and the array controller is the SCSI protocol, the fault information is recorded in the information exception log page in the SCSI protocol;

[0022] In the SCSI protocol, there are two ways to report the fault information. The first way is: receiving an input / output (IO) request sent by the array controller; carrying the information exception log page in the response information of the IO request, and reporting the fault information to the array controller through the response information; the second way is: receiving a fault information query request sent by the array controller; carrying the information exception log page in the response information of the fault information query request, and reporting the fault information through the response information.

[0023] When the communication protocol between the hard disk and the array controller is the ATA protocol, the fault information is recorded in the disk information statistics page in the ATA protocol; the method of reporting the fault information is: receiving a fault information query request sent by the array controller; carrying the disk information statistics page in the response information of the fault information query request, and reporting the fault information through the response information.

[0024] When the communication protocol between the hard disk and the array controller is the NVMe protocol, the fault information is recorded in the health information log in the NVMe protocol; the method of reporting the fault information is: carrying the in-disk information statistics page in the response information of the asynchronous event request, and reporting the fault information through the response information.

[0025] The fourth aspect of the present invention provides a hard disk fault processing method. The hard disk processing method provided by the fourth aspect differs from the hard disk fault processing method provided by the first aspect only in that, after the recovered data is stored in the recovery storage block, the recovery storage block is used to replace the faulty storage block in the storage block group, and there is no need to record the correspondence between the recovery storage block and the faulty storage block.

[0026] The fifth aspect of the present invention provides an array controller corresponding to the hard disk fault handling method provided in the first aspect. The functions performed by the functional modules of the array controller are the same as the steps included in the hard disk fault handling method provided in the first aspect, and will not be repeated here.

[0027] The sixth aspect of the present invention provides an array controller corresponding to the hard disk fault handling method provided in the second aspect. The functions performed by the functional modules of the array controller are the same as the steps included in the hard disk fault handling method provided in the second aspect, and will not be repeated here.

[0028] The seventh aspect of the present invention provides a hard disk corresponding to the hard disk fault handling method provided in the third aspect. The functions performed by each functional module of the hard disk are the same as the steps included in the hard disk fault handling method provided in the third aspect, and will not be repeated here.

[0029] An eighth aspect of the present invention provides an array controller corresponding to the hard disk fault handling method provided in the fourth aspect. The functions performed by the functional modules of the array controller are the same as the steps included in the hard disk fault handling method provided in the fourth aspect, and will not be repeated here.

[0030] A ninth aspect of the present invention provides an array controller, the array controller comprising a processor and a computer-readable storage medium, the storage medium storing program instructions, the processor running the program instructions to execute the hard disk failure handling method provided in the first aspect, the second aspect or the fourth aspect.

[0031] The tenth aspect of the present invention provides a hard disk, which includes a processor and a computer-readable storage medium, wherein the storage medium stores program instructions, and the processor runs the program instructions to execute the hard disk fault handling method provided in the third aspect.

[0032] The eleventh aspect of the present invention provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the method of the first aspect, the second aspect, the third aspect, or the fourth aspect mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0034] Figure 1 A structural diagram of a storage array.

[0035] Figure 2 This is a schematic diagram of an array controller generating a logical disk in the first embodiment of the present invention.

[0036] Figure 3 A schematic diagram of providing hot spare space and redundant space for a storage array in the first embodiment of the present invention.

[0037] Figure 4 This is a flow chart of processing a faulty area in a hard disk by a storage array in the first embodiment of the present invention.

[0038] Figure 5 It is the ASC code and ASCQ code indicating the hard disk fault area defined in the SCSI protocol in the embodiment of the present invention.

[0039] Figure 6 This is an example diagram of an information exception log page in the SCSI protocol in an embodiment of the present invention.

[0040] Figure 7It is a schematic diagram of sensing data in the descriptor format in the return information of the IO request in an embodiment of the present invention.

[0041] Figure 8 It is a schematic diagram of the disk information statistics page defined in the ATA protocol in an embodiment of the present invention.

[0042] Fig. 9 This is a schematic diagram of a health information log defined in the NVMe protocol in an embodiment of the present invention.

[0043] Fig.10 The flowchart is a processing method when the array controller receives a rewrite request in an embodiment of the present invention.

[0044] Fig.11 This is a schematic diagram of an array controller using a plurality of independent hard disks to form a logical disk using a RAID algorithm in a second embodiment of the present invention.

[0045] Fig.12 This is a flow chart of a method for processing a faulty area in a hard disk in a second embodiment of the present invention.

[0046] Fig.13 It is a module diagram of a hard disk in an embodiment of the present invention.

[0047] Fig.14 FIG. 4 is a block diagram of an array controller in a first embodiment of the present invention.

[0048] Fig.15 FIG. 4 is a block diagram of an array controller in a second embodiment of the present invention. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0050] like Figure 1As shown, it is a structural diagram of the storage array 100. The storage array 100 includes an array controller 101, multiple hard disks 105-108, a memory 103, a communication interface 104, and a bus 102. The array controller 101 is used to run the program in the memory 103 (not shown) to manage the hard disks 105-108 and access the data therein. The communication interface 104 is used to connect to a host (not shown), and the host can transmit read and write instructions or management instructions to the storage array 100 through the communication interface 104. The communication interface can be a non-volatile memory standard (Non-Volatile Memory express, NVMe) interface or a small computer system interface (Small Computer System Interface, SCSI) SCSI interface.

[0051] like Figure 2 As shown, in the first embodiment of the present invention, the array controller 101 generates a schematic diagram of a logical disk provided to the host for use. When the storage array 100 is a flash memory array using an NVMe interface, the host communicates with the storage array 100 through the NVMe protocol, and the logical disk generated by the storage array 100 can be represented by the namespace (Namespace) defined in the NVMe protocol. When the storage array 100 is a storage array using a SCSI interface, the host communicates with the storage array 100 through the SCSI protocol, and the hard disk can be represented by the logical unit number (Logic Unit Number, LUN) defined in the SCSI protocol. Figure 2 In the embodiment of the present invention, the process of the array controller 101 generating a LUN under the SCSI protocol is taken as an example for description.

[0052] like Figure 2 As shown, each hard disk 105-108 in the storage array 100 is divided into storage blocks (chunks) of the same size, and the chunks belonging to different hard disks are used to generate storage block groups (chunk groups) using a redundant arrays of independent drives (RAID) algorithm. Figure 2As shown in, chunk 201 belonging to hard disk 102, chunk 202 belonging to hard disk 106, and chunk 203 belonging to hard disk 107 generate chunk group 204 through RAID5 algorithm. Chunk 205 belonging to hard disk 102, chunk 206 belonging to hard disk 107, and chunk 207 belonging to hard disk 108 generate chunk group 208 through RAID5 algorithm. After generating chunk groups, the storage controller 101 records the hard disks where the chunks constituting each chunk group are located. A storage pool 209 is constructed based on the chunk groups, and a logical disk, such as LUN0, LUN1, and LUN3, is constructed based on the storage pool 209.

[0053] like Figure 3 As shown, in an embodiment of the present invention, in addition to the storage resource pool 209, the storage array 100 also provides a hot spare space 210 and a redundant space 211. The hot spare space 210 is used to recover the data in the failed chunk and replace the failed chunk after a chunk in the hard disk fails. The redundant space is a space reserved by the storage array 100. The storage array 100 does not provide the size of the redundant space to the outside. The redundant space is used to improve the performance of the storage array 100. The hot spare space 210 and the redundant space 211 can be a single hard disk, or a pooled space composed of chunks in multiple hard disks. In an embodiment of the present invention, the hot spare space and the redundant space can be divided into granularities of the same size as the chunk, and are used to replace the failed chunk in the hard disk. How to use the hot spare space 210 and the redundant space 211 to replace the failed chunk in the hard disk will be described in detail below when describing the method for handling hard disk failures.

[0054] As described in the background technology, in the prior art, after a fault area (i.e., a section of storage space in the hard disk where a fault occurs) is generated in the hard disk, such as a die failure in the hard disk, the array controller 100 is not aware of it, and therefore will not process the fault. After that, after the array controller 100 detects that the wear of the hard disk has reached a threshold, it directly performs a disk replacement process. However, when the wear of the hard disk has not reached the threshold, the fault area will cause the redundant space of the hard disk to be reduced, and the reduction of the redundant space will affect the performance of the storage system.

[0055] The fault handling method provided in the embodiment of the present invention can enable the array controller 100 to determine the faulty storage block where the faulty area in the hard disk is located, and replace the faulty storage block with a storage block in the redundant space 211 or the hot spare space 210, thereby not affecting the performance of the entire storage system.

[0056] The following will be Figure 4 The flowchart of the embodiment of the present invention illustrates the method for handling a hard disk failure.

[0057] Figure 4 For Figure 2 The flowchart of the method for the storage system to process the fault area in the hard disk under the shown architecture is described below by taking the hard disk 105 in the storage array 100 having a fault as an example.

[0058] In step S401, the hard disk 105 identifies a faulty area in the hard disk 105 and accumulates the capacity of the faulty area.

[0059] The fault area can be a Die particle in the flash of the hard disk, or a space on the hard disk. During the operation of the hard disk, the hard disk will count the number of abnormalities in the storage area of ​​the hard disk. When the number of abnormalities of a certain type in a storage area exceeds a preset value, the storage area can be identified as a fault area. The abnormality can be an error checking and correction error (ECC error), an uncorrectable ECC encoding error (UNC), a slow response to I / O, or a timeout in the response to I / O. The identification of the fault area can be any method in the prior art, which is not limited here. The function performed by the hard disk is implemented by a processor in the hard disk (not shown) executing a program code stored in the memory (not shown) in the hard disk.

[0060] Step S402: the array controller 101 obtains fault information of the fault area in the hard disk 105. The fault information includes an identifier indicating whether the fault area has data loss. In some embodiments, the fault information also includes the capacity of the fault area.

[0061] In actual applications, in order to ensure data reliability, some hard disks will have RAID with data recovery capabilities inside the hard disk, such as RAID1, RAID 5, etc. In this way, even if there is a fault area in the hard disk, the data in the fault area can be restored by the RAID algorithm in the hard disk, so that data loss will not occur. However, when the hard disk does not have an internal RAID or has a RAID that cannot recover data, such as RAID0, the data in the fault area cannot be recovered, which will cause data loss. Therefore, in the embodiment of the present invention, the array controller 101 will obtain an identifier indicating whether the fault area has data loss, so as to subsequently recover the lost data in the fault area.

[0062] In the embodiment of the present invention, for different communication protocols between the hard disk 105 and the storage array 100, the methods for obtaining the fault information are also different. The following describes the methods for obtaining the fault information of the fault area under different communication protocols.

[0063] SCSI Protocol

[0064] In the existing SCSI protocol, additional detection codes (ASC) and attachment detection code qualifiers (ASCQ) are defined, and different ASCs and ASCQs are used to identify abnormalities generated in the hard disk. After the hard disk detects an abnormality, the ASC and ASCQ corresponding to the abnormality are recorded in the informational exception log page. The informational exception log page is a log page defined in the SCSI protocol for recording hard disk abnormalities. In the existing SCSI protocol, when the ASC is 5D, it means that the failure prediction threshold (FAILURE PREDICTION THRESHOLD EXCEEDED) is exceeded, that is, when a parameter in the monitored hard disk exceeds the set threshold, the parameter needs to be reported to the array controller. The ASCQs corresponding to 5D define the various parameters that need to be detected in the hard disk. Since the existing SCSI protocol does not define an ASCQ for reporting a faulty area in the hard disk, and the capacity of the faulty area cannot be reported, in an embodiment of the present invention, ASCQ codes 6D and 6E that represent the fault condition of the faulty area are defined. Figure 5 As shown in the figure, the newly defined ASCQ codes 6D and 6E in the embodiment of the present invention are defined, where 6D indicates that a faulty area appears in the hard disk but no data is lost, and 6E indicates that a faulty area appears in the hard disk and data is lost. When the hard disk detects a faulty area and the total fault capacity reaches a preset value, 6D or 6E is recorded in the information abnormality log page according to whether the data in the faulty area is lost. Figure 6As shown, this is an example diagram of an information exception log page. When the fault capacity of the fault area reaches a preset value and there is no data loss, 5D is filled in the information exception ASC (INFORMATION EXCEPTION ADDITIONAL SENSE CODE) represented by the 8th byte of the information exception log page, and 6D is filled in the information exception ASCQ (INFORMATIONAL EXCEPTION ADDITIONAL SENSECODE QUALIFIER) at the 9th byte of the information exception log page. When the capacity of the fault area reaches a preset value and there is data loss, 5D is filled in the information exception ASC represented by the 8th byte of the information exception log page, and 6E is filled in the information exception ASCQ at the 9th byte of the information exception log page. In addition, optionally, the capacity of the fault area will also be recorded in the information byte of the information exception log page, as shown in FIG. Figure 6 As shown, it carries "00 00 00 00 00 01 00 00" (hexadecimal), that is, 8GB of fault capacity. The above ASCQ codes 6D and 6E are just examples. In actual use, any ASCQ under ASC 5D that is not used by the protocol can be used.

[0065] In the SCSI protocol, the fault information of the fault area can be obtained in two ways.

[0066] The first method is that the hard disk 105 actively reports.

[0067] After receiving the IO request sent by the array controller 101, when the abnormal code is recorded in the abnormal information ASC byte and abnormal information ASCQ byte of the abnormal information log page, for example, 5D and 6E, the fault capacity 8G recorded in the abnormal information byte and 5D and 6E are written into the descriptor format sense data in the return information of the IO request. Figure 7 As shown, the descriptor format sensing data includes ASC bytes and ASCQ bytes, and the ASC code 5D and ASCQ code 6D / 6E obtained from the information abnormality log page are filled into the ASC and ASCQ in the descriptor format sensing data. In addition, the descriptor format sensing data also includes information bytes, and the fault area capacity can be written into the information bytes of the descriptor format sensing data.

[0068] In this way, after the array controller 101 receives the return information of the IO request, it can obtain the fault information of the fault area in the hard disk by sensing the data in the descriptor format of the return information.

[0069] The second method is that the array controller 101 periodically queries the fault information of the fault area in the hard disk 105 .

[0070] In this way, the array controller 101 will periodically send a fault query instruction to the hard disk 105, and the fault query instruction will carry the identifier of the information abnormality log page. After receiving the fault query instruction, the hard disk 105 will return the information abnormality log page to the array controller 101. After receiving the log page, the array controller 101 obtains the ASC, ASCQ and the corresponding content of the information. If the ASC and ASCQ are 5D and 6D respectively, the array controller 101 can obtain the abnormality in the hard disk 105 as a fault area, and there is no data loss in the fault area. If the ASC and ASCQ are 5D and 6E respectively, the array controller 101 can obtain the abnormality in the hard disk as a fault area, and there is data loss in the fault area. Optionally, the capacity of the fault area can also be obtained from the bytes corresponding to the information.

[0071] Second, Advanced Technology Attachment (ATA) protocol

[0072] In the ATA protocol, a disk information statistics page (Solid State Device Statistics) is defined, which is used to record the abnormal information of various abnormalities of the hard disk detected by the hard disk. In the embodiment of the present invention, a new abnormal information, namely, uncorrectable flash unit error information (Uncorrect Flash Unit Error Information), is defined to record the fault information of the fault area in the hard disk. Figure 8 As shown, the information is represented by a 64-bit binary number, where bit 15:0 is set to 00000010 (represented in hexadecimal as 0002 in the figure), which is the identifier of the disk information statistics page. Bit 23:16 is used to indicate whether there is a faulty area in the hard disk. If there is a faulty area, bit 23:16 is set to 00000001 (represented in hexadecimal as 01 in the figure); if there is no faulty area, bit 23:16 is set to 00000000 (represented in hexadecimal as 00 in the figure). Bit 31:24 is used to indicate whether there is data loss in the faulty area. If there is data loss, bit 31:24 is set to 00000001 (represented in hexadecimal as 01 in the figure); if there is no data loss, bit 31:24 is set to 00000000 (can also be represented in hexadecimal as 00). In addition, the hard disk will also record the capacity of the faulty area in the disk information statistics page, for example, in Figure 8Bytes 24 to 31 define a parameter: an uncorrectable capacity parameter, which is also 64 bits. The fault capacity of the fault area is recorded at the position corresponding to the parameter. In the embodiment of the present invention, the reported capacity is: 0000 00 00 00 01 00 00 (hexadecimal), i.e. 8G.

[0073] The array controller 101 will periodically send a query command to the hard disk 105, and the query command carries the identifier of the disk information statistics page. After receiving the fault query instruction, the hard disk will return the disk information statistics page to the array controller 101. After receiving the disk information statistics page, the array controller 101 obtains the uncorrectable flash memory unit error information, that is, the 64-bit binary number (or 16-bit hexadecimal number). The uncorrectable flash memory unit error information is analyzed to obtain the fault area information in the hard disk 105.

[0074] Third, NVMe protocol

[0075] In the NVMe protocol, a health information log is defined, which is used to record the abnormal information of various abnormalities detected by the hard disk. Fig. 9 As shown, different bits in the health information log byte 0 define different abnormal information in the hard disk, where the 1st, 2nd, 3rd, and 4th bits are abnormal information already defined in the existing NVMe protocol, and are not described here because they are not relevant to the present invention. In an embodiment of the present invention, a new bit 5 is defined to indicate whether a fault area appears in the hard disk 105. When the value of the bit 5 is 1, it indicates that a fault area appears in the hard disk 105. In addition, a 32-bit string is defined in the 4 bytes 6-9, where the highest bit, that is, bit 7 of the 9th byte, is used to indicate whether there is data loss in the fault area. For example, when the bit is set to 1, it indicates that there is data loss in the fault area, and when it is set to 0, it indicates that there is no data loss in the fault area. The bits after the highest bit are used to indicate the fault capacity of the fault storage block. For example, the hexadecimal "00 00 00 00 00 01 00 00" indicates that there is no data loss in the fault storage block, and the fault capacity of the fault storage block is 8GB. And "80 00 00 00 00 01 00 00" (the highest bit in hexadecimal is 8, which is equivalent to the highest bit in binary is 1) indicates that there is no data loss in the faulty storage block, and the faulty capacity of the faulty storage block is 8GB.

[0076] When the fault capacity of the hard disk statistical fault storage block reaches a preset value, the health information log is reported to the array controller 101 through the response of the asynchronous event request. The array controller 101 analyzes the health information log to obtain the fault information of the fault area.

[0077] Step S403, the array controller 101 obtains the capacity of the fault area of ​​the hard disk 105 from the fault information, and adds the obtained capacity information to the total fault capacity of the hard disk recorded by the array controller 101. When the total fault capacity of the hard disk 105 reaches a preset value, the user is notified to replace the hard disk 105.

[0078] Step S404: the array controller 101 determines the chunk where the lost data is located based on the indication in the fault information that the fault area has data lost.

[0079] In the embodiment of the present invention, two methods for determining the chunk where the lost data is located are provided. The first method is that the array controller 101 obtains the address of each chunk belonging to the hard disk in the hard disk 105. When the hard disk is an SSD, the address in the hard disk 105 refers to the logical address in the hard disk, and then sends a data loss query command to the hard disk 105, and the query command carries the logical address of one of the chunks. Figure 2It is described in that when constructing the storage pool, the array controller 101 will record the chunks belonging to each hard disk, so when the array controller 101 determines the chunk where the lost data is located, it queries the logical address of the lost data in the hard disk with chunk as the granularity. When the hard disk receives the lost data query command, it determines whether the logical address carried by the lost data query command contains part or all of the address of the fault area. If it does, it reports an indication of data loss to the storage controller 101. If not, it reports an indication of no data loss to the storage controller 101. After the storage controller 101 receives the report information, if the report information includes an indication of data loss, the chunk indicated by the chunk logical address carried in the lost data query command is used as the chunk where the lost data is located. In one embodiment, the fault area reported by the hard disk is generally smaller than the size of a chunk. In this embodiment, if the reported information includes an indication that there is no data loss, a new data loss query command is sent to the hard disk, and the new data loss query command carries the logical addresses of other chunks of the hard disk, and so on, until the chunk where the lost data is located is found. In another embodiment, if the fault area reported by the hard disk is larger than the size of a chunk, the array controller will send the address of a chunk to the hard disk each time to determine the faulty storage block. After receiving the return information of a chunk, the address of the next chunk will be sent to the hard disk, until the addresses of all chunks of the hard disk are sent to the hard disk, thereby determining the multiple chunks where the lost data is located.

[0080] The second method is that the array controller 101 sends a fault list query command to the hard disk 105. After receiving the query command, the hard disk 105 reports the recorded logical address list of the fault area to the array controller 101. The array controller 101 can determine the chunk where the lost data is located based on the reported logical address list.

[0081] Step S405: After the array controller 101 determines the chunk where the lost data is located, that is, the failed chunk, it uses other chunks forming a chunk group with the failed chunk to recover the data in the failed chunk through a RAID algorithm.

[0082] Step S406: the array controller 101 stores the restored data in a free chunk in the hot spare space or the OP space, where the free chunk is a backup chunk. The backup chunk is located on a different hard disk than other chunks in the chunk group.

[0083] Step S407: the array controller 101 records a mapping relationship between the address of the failed chunk in the hard disk and the address of the backup chunk in the backup space or the OP space.

[0084] In this way, when the array controller 101 subsequently receives a request to update the data in the faulty chunk, the data to be written in the request is written into the backup chunk, and the data in the faulty chunk is set to be invalid. In the subsequent garbage collection process, the space in the faulty chunk except the faulty area can be released.

[0085] In the second embodiment of the present invention, after restoring the recovery data to the backup chunk in step S406, the array controller 101 replaces the faulty chunk in the chunk group with the recovery chunk. During the replacement, the address of the faulty chunk in the first hard disk recorded in the metadata of the chunk group may be replaced with the address of the recovery storage block in the hard disk where the recovery storage block is located.

[0086] After the hard disks report the lost capacity of the hard disks, the array controller 101 will record the lost capacity of each hard disk, calculate the current available capacity of each hard disk, and limit the data written to the hard disks with larger lost capacity. Fig.10 The above is a flowchart of a processing method when the array controller 101 receives a request to rewrite data in a hard disk.

[0087] Step S501, receiving a write request, wherein the write request carries data to be written, a logical address of the data to be written, and a data volume of the data to be written;

[0088] Step S502 : determining, according to the logical address of the data to be written, that the target hard disk of the data to be written is the hard disk 105 .

[0089] Step S503, querying the available capacity of the hard disk 105;

[0090] Step S504, determining whether the available capacity of the hard disk is smaller than the amount of the data to be written.

[0091] Step S505: if the available capacity of the hard disk is greater than the amount of the data to be written, the data to be written is written into the hard disk.

[0092] Step S506, if the available capacity of the hard disk is less than or equal to the amount of the data to be written, the data to be written is written into the hot spare space or redundant space, and the data pointed to by the logical address in the hard disk 105 is marked as garbage data, waiting for subsequent garbage collection.

[0093] After the array controller 101 marks the available capacity of each hard disk, when a new chunkgroup needs to be created later, a hard disk with a large available capacity can be selected to create a chunkgroup. The available capacity of a hard disk is: the nominal capacity of the hard disk minus the lost capacity minus the used space.

[0094] like Fig.11 As shown in the third embodiment of the present invention, multiple independent hard disks 1104-1106 form a logical disk LUN 1101 through a RAID algorithm. The hot spare space 1102 and the redundant space 1103 are also provided by independent hard disks 1107 and 1108.

[0095] Below through Fig.12 The flowchart shown describes how to process a failed area occurring in a hard disk in the third embodiment.

[0096] In the third embodiment, steps S701 to S703 are the same as those in the first embodiment. Figure 4 Steps S401 to S403 are the same as in the above, and will not be repeated here.

[0097] Step S704: the array controller 101 obtains an identifier in the fault information indicating whether there is data loss in the fault area.

[0098] Step S705 , if the identification information indicates that there is no data loss in the fault area, the array controller 101 migrates data of a capacity equal to the lost capacity in the hard disk 105 to the hot spare space 1102 or the redundant space 1103 .

[0099] Step S706, if the identification information indicates that there is data loss in the faulty area of ​​the hard disk, the data in the hard disk is restored by using the RAID algorithm, and after recovery, step S705 is executed, that is, data with the same capacity as the lost capacity in the hard disk 105 is migrated to the hot spare space 1102 or the redundant space 1103.

[0100] Step S707 , recording a mapping relationship between the address of the migrated data in the hard disk 105 and the address of the migrated data to the hot spare space or the redundant space.

[0101] When an access request for the migrated data is subsequently received, the migrated data may be accessed in the hot spare space or the redundant space according to the mapping relationship.

[0102] In this way, the redundant space or hot spare space is used to compensate for the space lost in the faulty area in the hard disk, so there is no need to use the redundant space in the hard disk to compensate for the faulty area in the hard disk. In this way, even if a faulty area appears in the hard disk, the redundant space in the hard disk will not be reduced, thereby not increasing the wear of the hard disk, thereby ensuring the performance of the storage array.

[0103] like Fig.13 , which is a module diagram of the hard disk 1200 in an embodiment of the present invention.

[0104] The hard disk 1200 includes an identification module 1201, a marking module 1202, and a reporting module 1203. The identification module 1201 is used to identify the fault area in the hard disk 105 and accumulate the capacity of the fault area. Figure 4 The method of marking the fault area in step S402 is the same as step S401. For the method of identifying the fault area and accumulating the capacity of the fault area, please refer to the description of step S401. The marking module 1202 is used to mark the fault information of the identified fault area. For the marking method, please refer to the description of how to mark the fault information of the hard disk in the fault area in different protocols, such as SCSI protocol, ATA protocol, and NVMe protocol in step S402. For details, please refer to Figure 4 , Figure 5 , Figure 8 ,and Fig. 9 Related description.

[0105] The reporting module 1203 is used to report the fault information marked by the marking module 1202 to the array controller. For the specific method of reporting the fault information by the reporting module 1203, please refer to the description of how the hard disk reports the fault information of the fault area in different protocols, such as the SCSI protocol, the ATA protocol, and the NVMe protocol in step S402, which will not be repeated here.

[0106] like Fig.14 As shown, it is a module diagram of the array controller 1300 in the first embodiment of the present invention. The array controller 1300 includes an acquisition module 1301, an accumulation module 1302, a recovery module 1303, and a recording module 1304. The acquisition module 1301 is used to obtain the fault information of the fault area in the hard disk. The method of obtaining the fault information of the fault area in the hard disk can refer to the relevant description in step S402. Different protocols, such as the SCSI protocol, the ATA protocol, and the NVMe protocol, have different methods for obtaining fault information. Please refer to the description in step S402 for details, which will not be repeated here.

[0107] The accumulation module 1302 is used to obtain the capacity of the hard disk fault area from the fault information, and add the obtained capacity information to the recorded total fault capacity of the hard disk. When the total fault capacity of the hard disk reaches a preset value, the user is notified to replace the hard disk. Please refer to the relevant description of step S403 for details.

[0108] The recovery module 1303 is used to determine the faulty chunk where the lost data is located after the acquisition module acquires the faulty area of ​​the hard disk, if the faulty information indicates that the faulty chunk has data loss. Then, the data in the faulty chunk is recovered by using the other chunks forming a chunk group with the faulty chunk through the RAID algorithm, and the recovered data is stored in a backup chunk, and a new chunk group is formed by using the backup chunk and other chunks in the chunk group except the faulty chunk. Please refer to the description of steps S404-407 for details.

[0109] The recording module 1304 is used to record the mapping relationship between the address of the failed chunk in the hard disk and the address of the backup chunk in the backup space or the OP space. Please refer to the relevant description of step S407 for details.

[0110] The array controller in the second embodiment of the present invention has the same functions as the acquisition module 1301, the accumulation module 1302 and the recovery module 1303 in the array controller in the first embodiment, except that in the second embodiment, the recording module replaces the faulty chunk in the chunk group with the recovery chunk. During the replacement, the address of the faulty chunk in the first hard disk recorded in the metadata of the chunk group can be replaced with the address of the recovery storage block in the hard disk where the recovery storage block is located.

[0111] Fig.15 14 is a block diagram of an array controller 1400 in the third embodiment of the present invention. The array controller 1400 includes an acquisition module 1401 , an accumulation module 1402 , a migration module 1403 , and a recording module 1404 .

[0112] The functions of the acquisition module 1401 and the accumulation module 1402 are the same as those of the acquisition module 1301 and the accumulation module 1302 in the array controller 1300. For details, please refer to the relevant descriptions of the acquisition module 1301 and the accumulation module 1302, which will not be repeated here. The migration module 1403 is used to migrate the data of the same capacity as the lost capacity in the hard disk to the hot spare space or redundant space when the fault information indicates that there is no data loss in the fault area of ​​the hard disk; if the fault information indicates that there is data loss in the fault area of ​​the hard disk, the data in the hard disk is restored by the RAID algorithm, and after the restoration, the data of the same capacity as the lost capacity in the hard disk is migrated to the hot spare space or redundant space. Please refer to the relevant descriptions of steps S704 to S706 for details.

[0113] The recording module 1404 is used to record the mapping relationship between the address of the migrated data in the hard disk 105 and the address migrated to the hot spare space or redundant space. Please refer to the relevant description of step S707 for details. When an access request for the migrated data is received later, the migrated data can be accessed in the hot spare space or redundant space according to the mapping relationship.

[0114] One or more of the above modules can be implemented by software, hardware or a combination of the two. When any of the above modules or units are implemented in software, the software exists in the form of computer program instructions and is stored in a memory, and the processor can be used to execute the program instructions and implement the above method flow. The processor may include but is not limited to at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor and other types of computing devices that run software, each of which may include one or more cores for executing software instructions to perform operations or processing. The processor may be built into an SoC (system on chip) or an application specific integrated circuit (ASIC), or it may be an independent semiconductor chip. In addition to the core used to execute software instructions for operations or processing in the processor, it may further include necessary hardware accelerators, such as field programmable gate arrays (FPGA), PLDs (programmable logic devices), or logic circuits that implement dedicated logic operations.

[0115] When the above modules or units are implemented in hardware, the hardware can be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator or a non-integrated discrete device, which can run the necessary software or not rely on the software to execute the above method flow.

[0116] The hard disk fault handling method, array controller and hard disk provided in the embodiments of the present invention are described above. Specific examples are used herein to illustrate the principle and implementation of the present invention. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there may be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A hard disk failure processing method, executed by an array controller of a storage array, wherein the storage array includes multiple hard disks, each hard disk is divided into multiple storage blocks, and multiple storage blocks located in different hard disks form a storage block group through a redundancy algorithm; the method comprises: Obtaining fault information of a faulty area in the first hard disk; When the fault information indicates that data is lost in the fault area, determining the faulty storage block where the lost data is located; Restoring data of the faulty storage block by using other storage blocks in the storage block group to which the faulty storage block belongs; The recovered data is stored in a recovery storage block, where the recovery storage block is located in a second hard disk, and the second hard disk is a hard disk other than the hard disk where the storage block group is located; Recording the correspondence between the address of the data in the failed storage block in the first hard disk and the address of the recovery data block in the second hard disk; Wherein, determining the faulty storage block where the lost data is located comprises: Obtaining an address of a first storage block in the first hard disk in the first hard disk; Sending a data loss query command to the first hard disk, wherein the query command carries an address of the first storage block in the first hard disk; receiving indication information returned by the first hard disk indicating whether the first storage block includes the lost data; When the indication information indicates that the first storage block includes the lost data, determining that the first storage block is the faulty storage block; When the indication information indicates that the first storage block does not include the lost data, a new data loss query command is generated, and the new data loss query command carries the address of the second storage block of the first hard disk in the first hard disk.

2. The method according to claim 1, characterized in that The obtaining of the fault information of the faulty area in the first hard disk includes: Receive the fault information reported by the first hard disk.

3. The method according to claim 1, characterized in that The obtaining of the fault information of the faulty area in the first hard disk includes: Sending a fault query command to the first hard disk; Receive the fault information reported by the first hard disk according to the fault query command.

4. The method according to claim 2 or 3, characterized in that The fault information includes an identifier indicating whether data is lost, and data loss is determined in the fault area based on the identifier.

5. An array controller in a storage array, the storage array comprising a plurality of hard disks, each hard disk being divided into a plurality of storage blocks, and a plurality of storage blocks located in different hard disks forming a storage block group through a redundancy algorithm; The array controller comprises: An acquisition module, used for acquiring fault information of a faulty area in the first hard disk; A recovery module, configured to, when the fault information indicates that data is lost in the fault area, determine the faulty storage block where the lost data is located; use other storage blocks in the storage block group to which the faulty storage block belongs to recover the data of the faulty storage block; store the recovered data in a recovery storage block, wherein the recovery storage block is located in a second hard disk, and the second hard disk is a hard disk other than the hard disk where the storage block group is located; A recording module, used for recording the correspondence between the address of the data in the failed storage block in the first hard disk and the address of the recovery data block in the second hard disk; When determining the failed storage block where the lost data is located, the recovery module is specifically used to: Obtaining an address of a first storage block in the first hard disk in the first hard disk; Sending a data loss query command to the first hard disk, wherein the query command carries an address of the first storage block in the first hard disk; receiving indication information returned by the first hard disk indicating whether the first storage block includes the lost data; When the indication information indicates that the first storage block includes the lost data, determining that the first storage block is the faulty storage block; When the indication information indicates that the first storage block does not include the lost data, a new data loss query command is generated, and the new data loss query command carries the address of the second storage block of the first hard disk in the first hard disk.

6. The array controller according to claim 5, characterized in that: The acquisition module acquires the fault information of the faulty area in the first hard disk by receiving the fault information reported by the first hard disk.

7. The array controller according to claim 5, characterized in that: The acquisition module acquires the fault information of the faulty area in the first hard disk by sending a fault query command to the first hard disk; and receives the fault information reported by the first hard disk according to the fault query command.

8. The array controller according to any one of claims 5 to 7, characterized in that: The fault information includes an identifier indicating whether data is lost, and data loss is determined in the fault area based on the identifier.

9. A method for handling hard disk failure, executed by an array controller of a storage array, wherein the storage array includes multiple hard disks, each hard disk is divided into multiple storage blocks, and multiple storage blocks located on different hard disks form a storage block group through a redundancy algorithm; the method comprises: Obtaining fault information of a faulty area in the first hard disk; When the fault information indicates that data is lost in the fault area, determining the faulty storage block where the lost data is located; Restoring data of the faulty storage block by using other storage blocks in the storage block group to which the faulty storage block belongs; The recovered data is stored in a recovery storage block, where the recovery storage block is located in a second hard disk, and the second hard disk is a hard disk other than the hard disk where the storage block group is located; replacing the faulty storage block in the storage block group with the recovery storage block; wherein the fault information includes the capacity of the faulty area; Determining the failed storage block where the lost data is located comprises: Obtaining an address of a first storage block in the first hard disk in the first hard disk; Sending a data loss query command to the first hard disk, wherein the query command carries an address of the first storage block in the first hard disk; receiving indication information returned by the first hard disk indicating whether the first storage block includes the lost data; When the indication information indicates that the first storage block includes the lost data, determining that the first storage block is the faulty storage block; When the indication information indicates that the first storage block does not include the lost data, a new data loss query command is generated, and the new data loss query command carries the address of the second storage block of the first hard disk in the first hard disk.

10. The method according to claim 9, characterized in that The replacing the failed storage block in the storage block group with the recovery storage block comprises: The address of the failed storage block in the first hard disk recorded in the metadata of the storage block group is replaced with the address of the restored storage block in the second hard disk.

11. The method according to claim 9 or 10, characterized in that The obtaining of the fault information of the faulty area in the first hard disk includes: Receive the fault information reported by the first hard disk.

12. The method according to claim 9 or 10, characterized in that The obtaining of the fault information of the faulty area in the first hard disk includes: Sending a fault query command to the first hard disk; Receive the fault information reported by the first hard disk according to the fault query command.

13. The method according to claim 10, characterized in that The fault information includes an identifier indicating whether data is lost, and data loss is determined in the fault area based on the identifier.

14. An array controller in a storage array, the storage array comprising a plurality of hard disks, each hard disk being divided into a plurality of storage blocks, and a plurality of storage blocks located in different hard disks forming a storage block group through a redundancy algorithm; The array controller comprises: An acquisition module, used for acquiring fault information of a faulty area in the first hard disk; A recovery module, configured to, when the fault information indicates that data is lost in the fault area, determine the faulty storage block where the lost data is located; use other storage blocks in the storage block group to which the faulty storage block belongs to recover the data of the faulty storage block; store the recovered data in a recovery storage block, the recovery storage block being located in a second hard disk, the second hard disk being a hard disk other than the hard disk where the storage block group is located; a recording module, configured to replace the faulty storage block in the storage block group with the recovery storage block, wherein the fault information includes the capacity of the faulty area; When determining the failed storage block where the lost data is located, the recovery module is specifically used to: Obtaining an address of a first storage block in the first hard disk in the first hard disk; Sending a data loss query command to the first hard disk, wherein the query command carries an address of the first storage block in the first hard disk; receiving indication information returned by the first hard disk indicating whether the first storage block includes the lost data; When the indication information indicates that the first storage block includes the lost data, determining that the first storage block is the faulty storage block; When the indication information indicates that the first storage block does not include the lost data, a new data loss query command is generated, and the new data loss query command carries the address of the second storage block of the first hard disk in the first hard disk.

15. The array controller according to claim 14, characterized in that: When the recording module replaces the faulty storage block in the storage block group with the recovery storage block, it is specifically used to replace the address of the faulty storage block in the first hard disk recorded in the metadata of the storage block group with the address of the recovery storage block in the second hard disk.

16. The array controller according to claim 14 or 15, characterized in that: The acquisition module acquires the fault information of the faulty area in the first hard disk by receiving the fault information reported by the first hard disk.

17. The array controller according to claim 14 or 15, characterized in that: The acquisition module acquires the fault information of the faulty area in the first hard disk by sending a fault query command to the first hard disk; and receives the fault information reported by the first hard disk according to the fault query command.

18. The array controller according to claim 14 or 15, characterized in that: The fault information includes an identifier indicating whether data is lost, and data loss is determined in the fault area based on the identifier.

Citation Information

Patent Citations

  • Hard disk fault detection method and device

    CN103197995A

  • Data recovery method and device

    CN103530206A

  • Data recovery method, storage equipment and storage system

    CN103534688A

  • Method and device for processing faults of hard disk

    CN104484251A

  • Life expectancy data migration

    US10067840B1