WO2020048442A1 - Hard disk fault processing method, array controller and hard disk - Google Patents

Hard disk fault processing method, array controller and hard disk Download PDF

Info

Publication number
WO2020048442A1
WO2020048442A1 PCT/CN2019/104163 CN2019104163W WO2020048442A1 WO 2020048442 A1 WO2020048442 A1 WO 2020048442A1 CN 2019104163 W CN2019104163 W CN 2019104163W WO 2020048442 A1 WO2020048442 A1 WO 2020048442A1
Authority
WO
WIPO (PCT)
Prior art keywords
hard disk
fault
information
storage block
data
Prior art date
Application number
PCT/CN2019/104163
Other languages
French (fr)
Chinese (zh)
Inventor
刘国霞
吴黎明
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN201811451958.7A external-priority patent/CN110879761A/en
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP19856725.7A priority Critical patent/EP3822792A4/en
Priority to MX2021002274A priority patent/MX2021002274A/en
Priority to BR112021002987-7A priority patent/BR112021002987B1/en
Priority to EP21164813.4A priority patent/EP3920031B1/en
Priority to JP2021512508A priority patent/JP7147050B2/en
Priority to KR1020217006066A priority patent/KR102632961B1/en
Publication of WO2020048442A1 publication Critical patent/WO2020048442A1/en
Priority to US17/167,231 priority patent/US11322179B2/en
Priority to US17/226,588 priority patent/US11264055B2/en
Priority to US17/549,094 priority patent/US11501800B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • G06F11/2094Redundant storage or storage space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1076Parity data used in redundant arrays of independent storages, e.g. in RAID systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation

Definitions

  • the present invention relates to the field of storage technology, and in particular, to a processing method after a failure occurs in a storage area in a hard disk, and an array controller and a hard disk that execute the processing method.
  • solid-state hard disks cannot be written in place, they can only be written off-site, so a part of the redundant space must be reserved in the solid-state hard disk as a free space for writing data to the solid-state hard disk to improve the performance of the solid-state hard disk.
  • the nominal capacity provided by the solid state hard disk to the outside does not include the capacity of the redundant space.
  • failure area When a partial area failure (such as a die failure, hereinafter referred to as a failure area) occurs in the solid state hard disk, in order to keep the nominal capacity from being reduced, it is necessary to compensate the failure area through the capacity of a redundant space, which will cause redundancy The capacity of the free space is reduced. The reduction of redundant space will cause the wear and tear of solid state drives to increase, which will affect the performance of solid state drives.
  • An embodiment of the present invention provides a method for processing a fault area that appears in a hard disk. Using the processing method, after a fault area of a hard disk occurs, the redundant space of the hard disk is not reduced, and thus the wear degree of the hard disk is not increased.
  • a first aspect of the embodiments of the present invention provides a hard disk failure processing method, where the method is executed by an array controller of a storage array.
  • the storage array includes a plurality of hard disks, each hard disk is divided into a plurality of storage blocks, and a plurality of storage blocks located on different hard disks form a storage block group through a redundant algorithm.
  • the method includes: obtaining fault information of a fault area where a fault occurs in the first hard disk; when the fault information indicates that data is lost in the fault area, determining a faulty storage block where the missing data is located; and using the faulty storage block
  • the other storage blocks in the belonging storage block group recover the data of the faulty storage block; store the recovered data to the recovery storage block, the recovery storage block is located on 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.
  • two methods are provided for obtaining fault information of a faulted area in the first hard disk, and the first is for the array controller to receive the fault information reported by the first hard disk.
  • the second 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.
  • the fault information includes an identifier indicating whether data is lost, and it is determined that data is lost in the fault area according to the identifier.
  • two methods are provided for determining a failed storage block where the missing data is located.
  • the first is for the array controller to obtain a first storage block in the first hard disk from the first storage block. An address in the hard disk; sending a data loss query command to the first hard disk, the query command carrying the address of the first storage block in the first hard disk; receiving the query on the first hard disk After the instruction, it is determined whether the address carried in the query instruction includes part or all of the address of the fault area. If it is included, the first hard disk carries an indication of the first storage block in the return message of the query instruction. Including the indication information of the missing data; otherwise, the return message of the query instruction carries indication information indicating that the first storage block does not include the missing data.
  • the array controller After receiving the indication information indicating whether the first storage block includes the lost data returned by the first hard disk, if the array controller determines that the indication information indicates that the first storage block includes the lost data, Data, it is determined that the first storage block is the faulty storage block; then a new data loss query command is generated, and the new data loss query command carries the second storage block of the first hard disk in the first An address in a hard disk.
  • the second way to determine the faulty storage block where the missing data is is to send a fault zone query command to the first hard disk; receive information returned by the first hard disk that includes the address of the faulty area; The address determines the faulty memory block.
  • the fault information includes a capacity of the fault area
  • the method further includes: acquiring the capacity of the fault area in the fault information, and accumulating the capacity of the fault area to a fault of the first hard disk.
  • the total capacity when it is determined that the total capacity of the failure is greater than a preset value, the user is prompted to replace the first hard disk.
  • the determination of whether to replace the hard disk based on the total lost capacity of the hard disk is more convenient and accurate than the method for detecting the wear of the hard disk in the prior art.
  • a second aspect of the present invention provides a hard disk failure 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 a 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; recording the migrated The mapping relationship between the address of data in the first hard disk and the address in the second hard disk.
  • the first hard disk and other hard disks in the storage array form a logical disk according to a redundant algorithm.
  • the method further includes judging whether data is lost on the first hard disk according to the failure information; and if data is lost on the first hard disk, recovering data in the first hard disk through the redundancy algorithm.
  • the lost data in the hard disk can be recovered in time.
  • a third aspect of the present invention provides a hard disk failure processing method, which is executed by a hard disk.
  • the method includes detecting a faulty area in the hard disk; determining whether there is data loss in the faulty area; setting a flag for data loss in the faulty area according to the determination result; A flag indicating whether there is data loss in the fault area is reported to the array controller as fault information.
  • the hard disk also records the capacity of the fault area, and reports the capacity of the fault area to the array controller as fault information.
  • the array controller can sense the lost capacity in the faulty area, so that when the array receives a write request, it can allocate the write request to a hard disk with a larger remaining capacity, so as to better control the hard disk. .
  • 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 a preset value, reporting the fault information to the array controller.
  • a manner in which the hard disk records and reports the fault information is also different.
  • the communication protocol between the hard disk and the array controller is a SCSI protocol
  • the failure information is recorded in an information exception log page in the SCSI protocol
  • the fault information is reported to the array controller through the response information; the second is: receiving a fault information query request sent by the array controller; and carrying the information exception log page in the fault information query In the requested response information, the fault information is reported through the response information.
  • the fault information is recorded in the disk information statistics page in the ATA protocol; then the way to report the fault information is to receive the The fault information query request sent by the array controller; carrying the on-disk information statistics page in the response information of the fault information query request, and reporting the fault information through the response information.
  • the fault information is recorded in the health information log in the NVMe protocol; then the way to report the fault information is to:
  • the information statistics page is carried in the response information of the asynchronous event request, and the failure information is reported through the response information.
  • the fourth aspect of the present invention provides a hard disk failure processing method.
  • the difference between the hard disk processing method provided in the fourth aspect and the hard disk failure processing method provided in the first aspect is only that after the recovered data is stored in the recovery storage block, The recovery storage block replaces the faulty storage block in the storage block group without recording the correspondence between the recovery storage block and the faulty storage block.
  • a fifth aspect of the present invention provides an array controller corresponding to the hard disk failure processing method provided in the first aspect, and functions performed by each functional module of the array controller and the hard disk failure processing provided in the first aspect The steps included in the method are the same and will not be repeated here.
  • a sixth aspect of the present invention provides an array controller corresponding to the hard disk failure processing method provided in the second aspect, and functions performed by each functional module of the array controller and the hard disk failure processing provided in the second aspect The steps included in the method are the same and will not be repeated here.
  • a seventh aspect of the present invention provides a hard disk corresponding to the hard disk failure processing method provided in the third aspect, and the functions performed by the functional modules of the hard disk and the hard disk failure processing method provided by the third aspect include The steps are the same and will not be repeated here.
  • An eighth aspect of the present invention provides an array controller corresponding to the hard disk failure processing method provided in the fourth aspect, and the functions performed by each functional module of the array controller and the hard disk failure processing provided in the fourth aspect The steps included in the method are the same and will not be repeated here.
  • a ninth aspect of the present invention provides an array controller.
  • the array controller includes a processor and a computer-readable storage medium.
  • the storage medium stores program instructions, and the processor runs the program instructions to execute a first Aspect, the second aspect or the fourth aspect of the hard disk failure processing method.
  • a tenth aspect of the present invention provides a hard disk.
  • the hard disk includes a processor and a computer-readable storage medium.
  • the storage medium stores program instructions.
  • the processor runs the program instructions to execute the program instructions provided in the third aspect. Hard disk troubleshooting method.
  • a computer-readable storage medium stores instructions that, when run on a computer, cause the computer to execute the first aspect, the second aspect, and the third aspect. Aspect, or the fourth aspect.
  • FIG. 1 is a structural diagram of a storage array.
  • FIG. 2 is a schematic diagram of an array controller generating a logical disk in the first embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a hot spare space and a redundant space provided by a storage array in the first embodiment of the present invention.
  • FIG. 4 is a flowchart of processing a fault area in a hard disk by the storage array in the first embodiment of the present invention.
  • FIG. 5 is an ASC code and an ASCQ code indicating a hard disk failure area defined in the SCSI protocol in the embodiment of the present invention.
  • FIG. 6 is an exemplary diagram of an information exception log page in the SCSI protocol according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of the descriptor format sensing data in the return information of the IO request in the embodiment of the present invention.
  • FIG. 8 is a schematic diagram of an intra-disk information statistics page defined in the ATA protocol in an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a health information log defined in the NVMe protocol according to an embodiment of the present invention.
  • FIG. 10 is a flowchart of a processing method when an array controller receives a rewrite request according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of an array controller forming a logical disk by a RAID algorithm through a plurality of independent hard disks in a second embodiment of the present invention.
  • FIG. 12 is a flowchart of a method for processing a fault area occurring in a hard disk in a second embodiment of the present invention.
  • FIG. 13 is a block diagram of a hard disk in an embodiment of the present invention.
  • FIG. 14 is a block diagram of an array controller in the first embodiment of the present invention.
  • FIG. 15 is a block diagram of an array controller in a second embodiment of the present invention.
  • FIG. 1 it is a structural diagram of a memory array 100.
  • the storage array 100 includes an array controller 101, a plurality of hard disks 105-108, a memory 103, a communication interface 104, and a bus 102.
  • the array controller 101 is configured to run a program (not shown) in the memory 103 to manage the hard disks 105-108 and access data therein.
  • the communication interface 104 is used to connect to a host (not shown), and the host can transmit read-write instructions or management instructions to the storage array 100 through the communication interface 104.
  • the communication interface may 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.
  • NVMe non-Volatile Memory Express
  • SCSI Small Computer System Interface
  • the array controller 101 generates a logical disk for use by a host.
  • 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 disks generated by the storage array 100 can pass a namespace defined in the NVMe protocol.
  • 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 a logical unit number (LUN) defined in the SCSI protocol.
  • LUN logical unit number
  • the process of generating the LUN by the array controller 101 under the SCSI protocol is taken as an example for description.
  • each hard disk 105-108 in the storage array 100 is divided into chunks of the same size, and the chunks belonging to different hard disks utilize redundant arrays of independent hard disks (redundant arrays of independent drives).
  • a RAID) algorithm generates a chunk group.
  • the chunk 201 belonging to the hard disk 102, the chunk 202 belonging to the hard disk 106, and the chunk 203 belonging to the hard disk 107 generate a chunk group 204 by using a RAID 5 algorithm.
  • the chunk 205 belonging to the hard disk 102, the chunk 206 belonging to the hard disk 107, and the chunk 207 belonging to the hard disk 108 generate a chunk group 208 by a RAID 5 algorithm.
  • the storage controller 101 After the chunk group is generated, the storage controller 101 records the hard disk where the chunks constituting each chunk group are located.
  • a storage pool 209 is constructed based on the chunk group, and logical disks such as LUN0, LUN1, and LUN3 are constructed based on the storage pool 209.
  • the storage array 100 in addition to the storage resource pool 209, also provides a hot spare space 210 and a redundant space 211.
  • the hot spare space 210 is used to recover data in the failed chunk and replace the failed chunk after the 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, and the redundant space is used to improve the performance of the storage array 100.
  • the hot spare space 210 and the redundant space 211 may be a single hard disk or a chunk of multiple hard disks to form a pooled space.
  • the hot spare space and the redundant space may be divided into a granularity of the same size as the chunk, which is used to replace a failed chunk in a hard disk. How to replace the failed chunk in the hard disk by using the hot spare space 210 and the redundant space 211 will be described in detail when a method for hard disk failure processing is described below.
  • a fault area that is, a section of storage space where a fault occurs in a hard disk
  • the array controller 100 is not aware, so No failures will be processed, and after the array controller 100 detects that the wear degree of the hard disk reaches a threshold, it directly performs disk replacement processing.
  • the wear degree of the hard disk does not reach the threshold, the fault area will reduce the redundant space of the hard disk, and the reduction of the redundant space will affect the performance of the storage system.
  • the fault processing method provided in the embodiment of the present invention may enable the array controller 100 to determine a faulty storage block in which a faulty area in a hard disk is located, and replace the faulty storage block with a storage block in a redundant space 211 or a hot spare space 210, so Will affect the performance of the entire storage system.
  • FIG. 4 is a flowchart of a method for a storage system to process a failed area in a hard disk under the architecture shown in FIG. 2. In the following description, only the failure of the hard disk 105 in the storage array 100 is described as an example.
  • step S401 the hard disk 105 identifies a fault area in the hard disk 105 and accumulates the capacity of the fault area.
  • the fault area may be a Die particle in a flash of a hard disk, or may be a space on the hard disk.
  • the hard disk counts the number of times an abnormality occurs in the storage area of the hard disk. When the number of times a certain type of abnormality occurs in a storage area exceeds a preset value, the storage area can be identified as a fault area.
  • the abnormality may be error checking and correction (ECC error), uncorrectable error-correcting code error (UNC), slow response to I / O, or I / O response timeout.
  • ECC error error checking and correction
  • UNC uncorrectable error-correcting code error
  • the identification of the fault area may be in any manner in the prior art, and is not limited herein.
  • the function performed by the hard disk is realized by a processor (not shown) in the hard disk executing a piece of program code stored in a memory (not shown) in the hard disk.
  • step S402 the array controller 101 obtains fault information of a fault area in the hard disk 105.
  • the fault information includes an identifier indicating whether there is data loss in the fault area.
  • the fault information further includes a capacity of the fault area.
  • the array controller 101 obtains an identifier indicating whether there is data loss in the fault area, so as to recover the lost data in the fault area subsequently.
  • the methods for acquiring the fault information are different for different communication protocols between the hard disk 105 and the storage array 100.
  • the methods for acquiring the fault information of the fault area under different communication protocols are described below.
  • an additional detection code (ASC) and an attachment detection code qualifier (ASCQ) are defined, and abnormalities generated in a hard disk are identified through different ASC and ASCQ. After the abnormality is detected on the hard disk, the ASC and ASCQ corresponding to the abnormality are recorded in the informational exception log page.
  • the information abnormality log page is a log page defined in the SCSI protocol for recording an abnormality of a hard disk.
  • ASC failure prediction threshold
  • FAILURE PREDICTION THRESHOLD EXCEEDED the failure prediction threshold
  • Each ASCQ corresponding to 5D defines various parameters that need to be detected in the hard disk. Since the existing SCSI protocol does not define ASCQ for reporting a fault area in a hard disk, and the capacity of the fault area cannot be reported, in the embodiment of the present invention, ASCQ codes 6D and 6E indicating the fault conditions of the fault area are defined. As shown in FIG. 5, it is a definition of the newly defined ASCQ codes 6D and 6E in the embodiment of the present invention, where 6D indicates a fault area in the hard disk but no data is lost, and 6E indicates a fault area in the hard disk and there is no data loss. data lost.
  • FIG. 6 it is an example diagram of an information abnormality log page.
  • the information abnormality ASC indicated by the 8th byte of the information abnormality log page (INFORMATION EXCEPTION ADDITIONAL SENSE CODE) is filled in 5D, and the 9th byte information abnormal ASCQ (INFORMATIONAL EXCEPTION ADDITIONAL SENSE CODE QUALIFIER) of the information abnormal log page is filled in.
  • the capacity of the fault area When the capacity of the fault area reaches the preset value and data is lost, the information abnormality ASC indicated by the 8th byte of the information abnormality log page is filled with 5D, and the 9th byte of the information abnormality log page is filled. 6E is entered in the ASCQ.
  • the capacity of the fault area is also recorded in the information byte of the information exception log page, as shown in FIG. 6, which carries "00 00 00 00 00 00 00 00 00 00 00" (Hexadecimal), which is the failure capacity of 8GB.
  • the above-mentioned ASCQ codes 6D and 6E are just examples. In actual use, any ASCQ that is not used by the agreement under ASC 5D can be used.
  • the fault information of the fault area can be obtained in two ways.
  • the first method is that the hard disk 105 actively reports.
  • the descriptor format sensing data includes ASC bytes and ASCQ bytes, the descriptor is filled with the ASC code 5D and ASCQ code 6D / 6E obtained from the information exception log page. ASC and ASCQ in format sensing data.
  • the descriptor format sensing data also includes information bytes, and the capacity of the fault area can be written into the information bytes of the descriptor format sensing data.
  • the array controller 101 After the array controller 101 receives the return information of the IO request, it can obtain the failure information of the fault area in the hard disk from the descriptor format sensing data of the return information.
  • the second way is for the array controller 101 to periodically query the fault information of the fault area in the hard disk 105.
  • the array controller 101 periodically sends a fault query instruction to the hard disk 105, and the fault query instruction carries the identifier of the information abnormal log page.
  • the hard disk 105 After receiving the fault query instruction, the hard disk 105 returns the information abnormal log page to the array controller 101.
  • the array controller 101 obtains the content corresponding to the ASC, ASCQ, and information from the log page. If the ASC and ASCQ are 5D and 6D, respectively, the array controller 101 can obtain that the abnormality in the hard disk 105 is a fault area, and there is no data loss in the fault area.
  • the array controller 101 may obtain that an abnormality in the hard disk is a fault area, and data is lost in the fault area.
  • the capacity of the fault area can also be obtained from the bytes corresponding to the information.
  • an in-disk information statistics page (Solid State State Device Statistics) is defined, and this statistics page is used to record abnormal information of various abnormalities of the hard disk detected by the hard disk.
  • new abnormal information that is, uncorrectable flash unit error information (Uncorrect Flash Unit Error Information) is defined, and is used to record fault information of a fault area in a hard disk.
  • uncorrectable flash unit error information (Uncorrect Flash Unit Error Information) is defined, and is used to record fault information of a fault area in a hard disk.
  • the information is represented by a 64-bit binary number, in which 15: 0 digits are set to 00000010 (hexadecimal representation in the figure: 0002), which is an identifier of the information statistics page in the disc.
  • the 23:16 digit is used to indicate whether there is a fault zone in the hard disk.
  • the hard disk also records the capacity of the faulty area in the information statistics page of the disk. For example, in Figure 8 24-31 bytes define parameters: uncorrectable capacity parameter, which is also 64 bits. The fault capacity of the fault zone is recorded at the position corresponding to the parameter. In the embodiment of the present invention, the reported capacity is: 00 00 00 00 00 01 00 (hexadecimal), that is, 8G.
  • the array controller 101 periodically sends a query command to the hard disk 105, and the query command carries the identifier of the information statistics page in the disk.
  • the hard disk After receiving the fault query instruction, the hard disk returns the statistics page of the information on the disk to the array controller 101.
  • the array controller 101 After the array controller 101 receives the in-disk information statistics page, it obtains the uncorrectable flash unit error information, that is, the 64-bit secondary system number (or 16-bit hexadecimal number). By analyzing the error information of the uncorrectable flash memory unit, the fault area information in the hard disk 105 can be obtained.
  • a health information log (Health Information Log) is defined, and the log is used to record abnormal information about various abnormalities of the hard disk detected by the hard disk.
  • different bits in byte 0 of the health information log define different abnormal information in the hard disk.
  • bits 1, 2, 3, and 4 are abnormal information that has been defined in the existing NVMe protocol. Since it is not related to the present invention, it will not be described here.
  • a fifth bit is newly defined to indicate whether a fault area appears in the hard disk 105. When the value of the fifth bit is 1, it indicates that a fault area exists in the hard disk 105.
  • a 32-bit character string is defined in the 4 bytes of 6-9.
  • 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. 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 failure capacity of the faulty storage block. For example, "00 00 00 00 00 01 00" in hexadecimal indicates that there is no data loss of the faulty storage block, and the faulty storage block has a capacity of 8 GB.
  • the health information log is reported to the array controller 101 through a response of an asynchronous event request (Asynchronous Event Request).
  • the array controller 101 can analyze the health information log to obtain the fault information of the fault area.
  • step S403 the array controller 101 acquires the capacity of the fault area of the hard disk 105 from the fault information, and accumulates the acquired capacity information to the total fault capacity of the hard disk recorded by the array controller 101. in.
  • the total failure capacity of the hard disk 105 reaches a preset value, the user is notified to replace the hard disk 105.
  • step S404 the array controller 101 determines that there is data loss in the fault area according to the fault information, and the array controller 101 determines a chunk where the lost data is located.
  • the first method is that the array controller 101 obtains an address in the hard disk 105 of each chunk belonging to the hard disk.
  • the address in the hard disk 105 refers to A logical address in the hard disk, and then sends a data loss query command to the hard disk 105, where the query command carries the logical address of one of the chunks.
  • the array controller 101 records the chunks belonging to each hard disk. Therefore, when determining the chunk where the lost data is located, the array controller 101 uses the chunk as the granularity. Query the logical address of the lost data in the hard disk.
  • the storage controller 101 When the hard disk receives the lost data query command, it is determined whether the logical address carried by the lost data query command includes part or all of the address of the fault area, and if it contains, the data loss identifier is reported to If not, the storage controller 101 reports an identification that no data is lost to the storage controller 101. After the storage controller 101 receives the report information, if the report information includes a data loss identifier, the storage controller 101 uses the chunk indicated by the logical logical address of the chunk carried in the lost data query command 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 the chunk. In this embodiment, if the reported information includes an identifier without data loss, a new data loss query command is sent to the server.
  • 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 found is found.
  • the array controller sends an address of the chunk to the hard disk to determine the faulty storage block. After receiving the return information of a chunk, , The addresses 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, so as to determine multiple chunks where the lost data is located.
  • the second method is that the array controller 101 sends a fault list query command to the hard disk 105, and the hard disk 105 reports the recorded logical address list of the fault area to the hard disk 105 after receiving the query command.
  • An array controller 101 The array controller 101 can determine the chunk where the lost data is located according to the reported logical address list.
  • step S405 when the array controller 101 determines the chunk where the lost data is located, that is, the failed chunk, it uses other chunks that form a chunk group with the failed chunk to recover the data in the failed chunk by using a RAID algorithm.
  • step S406 the array controller 101 stores the recovered data to an idle chunk in the hot spare space or the OP space, and the idle chunk is a backup chunk.
  • the hard disk where the backup chunk is located is different from the hard disk where other chunks in the chunk group are located.
  • step S407 the array controller 101 records a mapping relationship between an address of the failed chunk in the hard disk and an address of the backup chunk in the backup space or the OP space.
  • the array controller 101 when the array controller 101 subsequently receives a request to update and write data in the faulty chunk, it writes the data to be written in the request into the backup chunk.
  • the data in the faulty chunk is invalidated.
  • the space in the faulty chunk other than the faulty area can be released.
  • the array controller 101 replaces the failed chunk in the chunk group with the restored chunk.
  • the address of the failed chunk recorded in the metadata of the chunk group on the first hard disk may be replaced with the address of the recovery storage block on the hard disk where the recovery storage block is located.
  • FIG. 10 is a flowchart of a processing method when the array controller 101 receives a rewrite request for data in a hard disk.
  • Step S501 Receive a write request, where the write request carries data to be written, a logical address of the data to be written, and a data amount of the data to be written;
  • step S502 it is determined that the target hard disk of the data to be written is the hard disk 105 according to the logical address of the data to be written.
  • Step S503 Query the available capacity of the hard disk 105.
  • step S504 it is determined whether the available capacity of the hard disk is smaller than the data amount of the data to be written.
  • Step S505 If the available capacity of the hard disk is greater than the data amount of the data to be written, write the data to be written to the hard disk.
  • Step S506 if the available capacity of the hard disk is less than or equal to the data amount of the data to be written, write the data to be written into the hot spare space or redundant space, and write the logic in the hard disk 105
  • the data pointed to by the address is marked as garbage data and is waiting for subsequent garbage collection.
  • the available capacity of the hard disk is: the nominal capacity of the hard disk minus the lost capacity, and then minus the used space.
  • a plurality of 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.
  • steps S701 to S703 are the same as steps S401 to S403 in FIG. 4 in the first embodiment, and details are not described herein again.
  • step S704 the array controller 101 obtains an identifier in the fault information indicating whether there is data loss in the fault area.
  • Step S705 if the identification information indicates that no data is lost in the faulty area, the array controller 101 migrates data in the hard disk 105 with the same capacity as the lost capacity to the hot spare space 1102 or redundant space 1103.
  • step S706 if the identification information indicates that data is lost in the faulty area of the hard disk, the data in the hard disk is restored by using a RAID algorithm. After the recovery, step S705 is performed, that is, the data in the hard disk 105 is restored. Data having the same capacity as the lost capacity is migrated to the hot spare space 1102 or the redundant space 1103.
  • Step S707 Record a mapping relationship between an address of the migrated data in the hard disk 105 in the hard disk 105 and an address migrated to the hot spare space or a redundant space.
  • the migrated data When a subsequent access request to the migrated data is received, the migrated data may be accessed in the hot spare space or redundant space according to the mapping relationship.
  • the redundant space or the hot spare space is used to compensate for the space lost in the fault area of the hard disk, so that the redundant space in the hard disk does not need to be used to compensate the fault area in the hard disk.
  • the redundant space in the hard disk will not be reduced, so that the wear of the hard disk will not be increased, and the performance of the storage array is guaranteed.
  • FIG. 13 a block diagram of a hard disk 1200 according to an embodiment of the present invention is shown.
  • the hard disk 1200 includes an identification module 1201, a marking module 1202, and a reporting module 1203.
  • the identification module 1201 is configured to identify a fault area in the hard disk 105 and accumulate the capacity of the fault area.
  • the function performed by the identification module 1201 is the same as step S401 in FIG. 4.
  • the marking module 1202 is used to mark the fault information of the identified fault area.
  • the marking method please refer to step S402 on how to mark the fault area in the hard disk in different protocols, such as the SCSI protocol, the ATA protocol, and the NVMe protocol.
  • the fault information refer to the related descriptions of FIG. 4, FIG. 5, FIG. 8, and FIG. 9.
  • the reporting module 1203 is configured to report the fault information marked by the marking module 1202 to the array controller.
  • the specific way of reporting fault information by the reporting module 1203 please refer to step S402 for descriptions of how the hard disk reports fault information of the fault zone in different protocols, such as SCSI protocol, ATA protocol, and NVMe protocol. More details.
  • the array controller 1300 includes an acquisition module 1301, an accumulation module 1302, a recovery module 1303, and a recording module 1304.
  • the acquiring module 1301 is configured to acquire fault information of a fault area in a hard disk.
  • Different protocols such as the SCSI protocol, the ATA protocol, and the NVMe protocol, obtain the fault information in different ways. For details, refer to step S402. The description is not repeated here.
  • the accumulation module 1302 is configured to obtain the capacity of the hard disk fault area from the fault information, and add the acquired capacity information to the total fault capacity of the hard disk that is recorded. When the total failure capacity of the hard disk reaches a preset value, the user is notified to replace the hard disk. For details, refer to the related description of step S403.
  • the recovery module 1303 is configured to determine, after the acquisition module obtains fault information of a fault area of a hard disk, if the fault information indicates data loss in the fault area, determine a faulty chunk in which the lost data is located. Then use the other chunks that make up the chunk group with the faulty chunk to recover the data in the faulty chunk through the RAID algorithm, and then store the recovered data in the backup chunk, and use the backup chunk and the division in the chunk group to divide. Other chunks other than the failed chunk form a new chunk group. For details, refer to the related description of steps S404-407.
  • the recording module 1304 is configured to record a mapping relationship between an address of the faulty chunk in the hard disk and an address of the backup chunk in the backup space or the OP space. For details, refer to the related description of step S407.
  • 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 of the first embodiment, except that in the second embodiment, the record The module replaces the failed chunk in the chunk group with the restored chunk.
  • the address of the failed chunk recorded in the metadata of the chunk group on the first hard disk may be replaced with the address of the recovery storage block on the hard disk where the recovery storage block is located.
  • FIG. 15 is a block diagram of an array controller 1400 in a 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.
  • the functions of the acquisition module 1401 and the accumulation module 1402 are the same as the functions of the acquisition module 1301 and the accumulation module 1302 in the array controller 1300. For details, refer to the related descriptions of the acquisition module 1301 and the accumulation module 1302, and details are not described herein. .
  • the migration module 1403 is configured to migrate data of the same capacity as the lost capacity in the hard disk to the hot spare space or redundant space in the fault information indicating that there is no data loss in the fault area; if If the fault information indicates that data is lost in the faulty area of the hard disk, the data in the hard disk is recovered by a RAID algorithm, and after the recovery, data of the hard disk having the same capacity as the lost capacity is migrated. To the hot spare space or redundant space. For details, refer to the related description of steps S704 to S706.
  • the recording module 1404 is configured to record a mapping relationship between an address of the migrated data in the hard disk 105 in the hard disk 105 and an address migrated to the hot spare space or a redundant space. For details, refer to the related description of step S707. When a subsequent access request to the migrated data is received, the migrated data may be accessed in the hot spare space or redundant space according to the mapping relationship.
  • One or more of the above modules may be implemented in software, hardware or a combination of both.
  • the software exists in the form of computer program instructions and is stored in a memory, and the processor may 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 (microcontroller), or an artificial intelligence
  • CPU central processing unit
  • DSP digital signal processor
  • microcontroller microcontroller
  • Each computing device may include one or more cores for executing software instructions for operations or processing.
  • the processor can be built into a SoC (System on a Chip) or an application specific integrated circuit (ASIC), or it can be a separate semiconductor chip.
  • SoC System on a Chip
  • ASIC application specific integrated circuit
  • the processor processes cores used to execute software instructions for operations or processing, and may further include necessary hardware accelerators, such as field programmable gate arrays (FPGAs), PLDs (programmable logic devices) Or logic circuits that implement dedicated logic operations.
  • FPGAs field programmable gate arrays
  • PLDs programmable logic devices
  • logic circuits that implement dedicated logic operations.
  • the hardware can be a CPU, microprocessor, DSP, MCU, artificial intelligence processor, ASIC, SoC, FPGA, PLD, dedicated digital circuit, hardware accelerator, or non-integrated discrete device Any one or any combination of them, which can run the necessary software or does not depend on the software to perform the above method flow.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Disclosed is a hard disk fault processing method. The method is executed by an array controller (101) of a storage array (100). The storage array (100) comprises multiple hard disks (105, 106, 107, 108); each of the hard disks (105, 106, 107, 108) is divided into multiple storage blocks; and multiple storage blocks of different hard disks (105, 106, 107, 108) constitute a storage block set by means of a redundancy algorithm. The method comprises: acquiring fault information of a faulty area, where a fault occurs, in a first hard disk; when the fault information indicates that data loss occurs in the faulty area, determining a faulty storage block where the lost data is located; using other storage blocks in a storage block set to which the faulty storage block belongs to restore the data in the faulty storage block; storing the restored data in a restored storage block, wherein the restored storage block is located at a second hard disk and the second hard disk is a hard disk except the hard disk where the storage block set is located; and recording a correlation between the address, in the first hard disk, of the data in the faulty storage block and the address of the restored storage block in the second hard disk.

Description

硬盘故障处理方法、阵列控制器及硬盘Hard disk failure processing method, array controller and hard disk 技术领域Technical field
本发明涉及存储技术领域,特别涉及在硬盘中的存储区发生故障后的处理方法及执行所述处理方法的阵列控制器及硬盘。The present invention relates to the field of storage technology, and in particular, to a processing method after a failure occurs in a storage area in a hard disk, and an array controller and a hard disk that execute the processing method.
背景技术Background technique
由于固态硬盘的不能原地写,只能异地写,所以在固态硬盘中必须留出一部分冗余空间作为固态硬盘的数据写入的腾挪空间以提升固态硬盘的性能。固态硬盘对外提供的标称容量不包括所述冗余空间的容量。Because solid-state hard disks cannot be written in place, they can only be written off-site, so a part of the redundant space must be reserved in the solid-state hard disk as a free space for writing data to the solid-state hard disk to improve the performance of the solid-state hard disk. The nominal capacity provided by the solid state hard disk to the outside does not include the capacity of the redundant space.
当固态硬盘中出现部分区域故障后(例如die故障,以下简称故障区)时,为了使所述标称容量不减少,就需要通过冗余空间的容量进行补偿所述故障区,这样将导致冗余空间的容量减少。冗余空间的减少会导致固态硬盘的磨损度增加,从而影响固态硬盘的性能。When a partial area failure (such as a die failure, hereinafter referred to as a failure area) occurs in the solid state hard disk, in order to keep the nominal capacity from being reduced, it is necessary to compensate the failure area through the capacity of a redundant space, which will cause redundancy The capacity of the free space is reduced. The reduction of redundant space will cause the wear and tear of solid state drives to increase, which will affect the performance of solid state drives.
发明内容Summary of the Invention
本发明实施例提供在硬盘中出现的故障区后的处理方法,使用所述处理方法,在硬盘出现故障区后,不会使硬盘的冗余空间减少,从而不会导致硬盘的磨损度增加。An embodiment of the present invention provides a method for processing a fault area that appears in a hard disk. Using the processing method, after a fault area of a hard disk occurs, the redundant space of the hard disk is not reduced, and thus the wear degree of the hard disk is not increased.
本发明实施例第一方面提供一种硬盘故障处理方法,所述方法由存储阵列的阵列控制器执行。所述存储阵列包括多个硬盘,每个硬盘被划分多个存储块,位于不同硬盘的多个存储块通过冗余算法构成存储块组。所述方法包括:获取第一硬盘中发生故障的故障区的故障信息;当所述故障信息指示所述故障区有数据丢失时,则确定丢失数据所在的故障存储块;利用所述故障存储块所归属的存储块组中的其他存储块恢复所述故障存储块的数据;将所恢复的数据存储至恢复存储块,所述恢复存储块位于第二硬盘,所述第二硬盘为除所述存储块组所在的硬盘以外的硬盘;记录所述故障存储块中的数据在所述第一硬盘中的地址与所述恢复数据块在所述第二硬盘中的地址的对应关系。A first aspect of the embodiments of the present invention provides a hard disk failure processing method, where the method is executed by an array controller of a storage array. The storage array includes a plurality of hard disks, each hard disk is divided into a plurality of storage blocks, and a plurality of storage blocks located on different hard disks form a storage block group through a redundant algorithm. The method includes: obtaining fault information of a fault area where a fault occurs in the first hard disk; when the fault information indicates that data is lost in the fault area, determining a faulty storage block where the missing data is located; and using the faulty storage block The other storage blocks in the belonging storage block group recover the data of the faulty storage block; store the recovered data to the recovery storage block, the recovery storage block is located on 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.
通过将第一硬盘中故障存储块中丢失的数据恢复至第二硬盘的恢复存储块中,并记录故障存储块在第一硬盘中的地址与恢复存储块在第二硬盘中的地址的对应关系,这样,即不会减少第一硬盘中的冗余空间,从而保障了第一硬盘的性能。By recovering the lost data in the failed 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 failed storage block in the first hard disk and the address of the recovery storage block in the second hard disk In this way, the redundant space in the first hard disk is not reduced, thereby ensuring the performance of the first hard disk.
在第一方面的实施例中,提供了两种获取第一硬盘中发生故障的故障区的故障信息的方式,第一种为所述阵列控制器接收所述第一硬盘上报的所述故障信息;第二种为所述阵列控制器发送故障查询命令至所述第一硬盘;然后接收所述第一硬盘根据所述故障查询命令上报的所述故障信息。In the embodiment of the first aspect, two methods are provided for obtaining fault information of a faulted area in the first hard disk, and the first is for the array controller to receive the fault information reported by the first hard disk. The second 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.
可选地,所述故障信息包括指示数据是否丢失的标识,根据所述标识确定所述故障区有数据丢失。Optionally, the fault information includes an identifier indicating whether data is lost, and it is determined that data is lost in the fault area according to the identifier.
在第一方面的实施例中,提供了两种确定丢失数据所在的故障存储块的方式,第一种为所述阵列控制器获取所述第一硬盘中的第一存储块在所述第一硬盘中的地址;发送数据丢失查询命令至所述第一硬盘,所述查询命令中携带所述第一存储块在所述第一硬盘中的地址;在所述第一硬盘接收到所述查询指令后,会确定所述查询指令中携带的地 址是否包括所述故障区的部分或者全部地址,如果包括则所述第一硬盘在所述查询指令的返回消息中携带指示所述第一存储块包括所述丢失数据的指示信息,否则,则在所述查询指令的返回消息中携带指示所述第一存储块不包括所述丢失数据的指示信息。在接收到所述第一硬盘返回的指示所述第一存储块是否包括所述丢失数据的指示信息后,所述阵列控制器若判断所述指示信息指示所述第一存储块包括所述丢失数据,则确定所述第一存储块为所述故障存储块;然后生成新的数据丢失查询命令,所述新的数据丢失查询命令中携带所述第一硬盘的第二存储块在所述第一硬盘中的地址。In an embodiment of the first aspect, two methods are provided for determining a failed storage block where the missing data is located. The first is for the array controller to obtain a first storage block in the first hard disk from the first storage block. An address in the hard disk; sending a data loss query command to the first hard disk, the query command carrying the address of the first storage block in the first hard disk; receiving the query on the first hard disk After the instruction, it is determined whether the address carried in the query instruction includes part or all of the address of the fault area. If it is included, the first hard disk carries an indication of the first storage block in the return message of the query instruction. Including the indication information of the missing data; otherwise, the return message of the query instruction carries indication information indicating that the first storage block does not include the missing data. After receiving the indication information indicating whether the first storage block includes the lost data returned by the first hard disk, if the array controller determines that the indication information indicates that the first storage block includes the lost data, Data, it is determined that the first storage block is the faulty storage block; then a new data loss query command is generated, and the new data loss query command carries the second storage block of the first hard disk in the first An address in a hard disk.
第二种确定丢失数据所在的故障存储块的方式为发送故障区查询命令至所述第一硬盘;接收所述第一硬盘返回的包括所述故障区的地址的信息;根据所述故障区的地址确定所述故障存储块。The second way to determine the faulty storage block where the missing data is is to send a fault zone query command to the first hard disk; receive information returned by the first hard disk that includes the address of the faulty area; The address determines the faulty memory block.
可选地,所述故障信息包括所述故障区的容量,所述方法还包括:获取所述故障信息中的故障区的容量,将所述故障区的容量累加至所述第一硬盘的故障总容量中;当判断所述故障总容量大于预设值,则提示用户替换所述第一硬盘。Optionally, the fault information includes a capacity of the fault area, and the method further includes: acquiring the capacity of the fault area in the fault information, and accumulating the capacity of the fault area to a fault of the first hard disk. Of the total capacity, when it is determined that the total capacity of the failure is greater than a preset value, the user is prompted to replace the first hard disk.
通过硬盘损失的总容量确定是否更换硬盘,跟现有技术中检测硬盘的磨损度相比,检测的方式更方便,且更准确。The determination of whether to replace the hard disk based on the total lost capacity of the hard disk is more convenient and accurate than the method for detecting the wear of the hard disk in the prior art.
本发明第二方面提供一种硬盘故障处理方法,所述方法由存储阵列的阵列控制器执行,所述存储阵列中包括第一硬盘,所述第一硬盘中包括故障区。所述方法包括获取所述故障区的故障信息;根据所述故障信息确定所述故障区的容量;根据所述容量大小将所述第一硬盘中的部分数据迁移至第二硬盘;记录所迁移数据在所述第一硬盘中的地址与在所述第二硬盘中的地址的映射关系。A second aspect of the present invention provides a hard disk failure 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 a 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; recording the migrated The mapping relationship between the address of data in the first hard disk and the address in the second hard disk.
可选地,所述第一硬盘与所述存储阵列中的其他硬盘根据冗余算法构成逻辑磁盘。所述方法还包括根据所述故障信息判断所述第一硬盘是否有数据丢失;若所述第一硬盘有数据丢失,则通过所述冗余算法恢复所述第一硬盘中的数据。Optionally, the first hard disk and other hard disks in the storage array form a logical disk according to a redundant algorithm. The method further includes judging whether data is lost on the first hard disk according to the failure information; and if data is lost on the first hard disk, recovering data in the first hard disk through the redundancy algorithm.
通过获取硬盘中数据丢失的信息及硬盘之间的冗余算法,可以及时恢复硬盘中丢失的数据。By acquiring the information of data loss in the hard disk and the redundant algorithm between the hard disks, the lost data in the hard disk can be recovered in time.
本发明第三方面提供一种硬盘故障处理方法,由硬盘执行。所述方法包括侦测所述硬盘中的故障区;确定所述故障区是否有数据丢失;根据确定结果设置所述故障区是否有数据丢失的标记;将所述硬盘中包括故障区的标记及所述故障区是否有数据丢失的标记作为故障信息上报至阵列控制器。A third aspect of the present invention provides a hard disk failure processing method, which is executed by a hard disk. The method includes detecting a faulty area in the hard disk; determining whether there is data loss in the faulty area; setting a flag for data loss in the faulty area according to the determination result; A flag indicating whether there is data loss in the fault area is reported to the array controller as fault information.
可选地,所述硬盘还会记录所述故障区的容量,并将所述故障区的容量作为故障信息上报至阵列控制器。Optionally, the hard disk also records the capacity of the fault area, and reports the capacity of the fault area to the array controller as fault information.
通过上报硬盘的故障区的容量,可以使阵列控制器感知故障区丢失的容量,从而在阵列接收到写请求时,能将写请求分配到剩余容量比较大的硬盘中,从而更好的控制硬盘。By reporting the capacity of the faulty area of the hard disk, the array controller can sense the lost capacity in the faulty area, so that when the array receives a write request, it can allocate the write request to a hard disk with a larger remaining capacity, so as to better control the hard disk. .
可选地,所述方法还包括判断所述故障区的容量是否大于预设值,当所述故障区的容量大于预设值时,上报所述故障信息至所述阵列控制器。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 a preset value, reporting the fault information to the array controller.
在故障区的容量大于预设值时,再上报故障信息,可以避免频繁的上报故障信息对存储阵列的性能的影响。When the capacity of the fault area is greater than the preset value, the fault information is reported again, which can avoid the frequent impact of the fault information on the performance of the storage array.
在所述第三方面的实现方式中,当硬盘与阵列控制器的通信协议不同时,硬盘记录和上报所述故障信息的方式也有所不同。当所述硬盘与所述阵列控制器之间的通信协议为SCSI协议时,则所述故障信息记录在所述SCSI协议中的信息异常日志页中;In an implementation manner of the third aspect, when a communication protocol between a hard disk and an array controller is different, a manner 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 a SCSI protocol, the failure information is recorded in an information exception log page in the SCSI protocol;
在SCSI协议中,上报所述故障信息的方式又有两种,第一种为:接收所述阵列控制器发送的输入输出IO请求;将所述信息异常日志页携带在所述IO请求的响应信息中,通过所述响应信息上报所述故障信息至所述阵列控制器;第二种为:接收阵列控制器发送的故障信息查询请求;将所述信息异常日志页携带在所述故障信息查询请求的响应信息中,通过所述响应信息上报所述故障信息。In the SCSI protocol, there are two other ways to report the fault information. The first is: receiving input and output IO requests sent by the array controller; and carrying the information exception log page in response to the IO requests. In the information, the fault information is reported to the array controller through the response information; the second is: receiving a fault information query request sent by the array controller; and carrying the information exception log page in the fault information query In the requested response information, the fault information is reported through the response information.
当所述硬盘与所述阵列控制器之间的通信协议为ATA协议时,所述故障信息记录在ATA协议中的盘内信息统计页中;则上报所述故障信息的方式为:接收所述阵列控制器发送的故障信息查询请求;将所述盘内信息统计页携带在所述故障信息查询请求的响应信息中,通过所述响应信息上报所述故障信息。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; then the way to report the fault information is to receive the The fault information query request sent by the array controller; carrying the on-disk information statistics page in the response information of the fault information query request, and reporting the fault information through the response information.
当所述硬盘与所述阵列控制器之间的通信协议为NVMe协议时,所述故障信息记录在NVMe协议中的健康信息日志中;则上报所述故障信息的方式为:将所述盘内信息统计页携带在异步事件请求的响应信息中,通过所述响应信息上报所述故障信息。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; then the way to report the fault information is to: The information statistics page is carried in the response information of the asynchronous event request, and the failure information is reported through the response information.
本发明第四方面提供一种硬盘故障处理方法,第四方面提供的硬盘处理方法与第一方面提供的硬盘故障处理方法的区别仅在于,在将所恢复的数据存储至恢复存储块后,用恢复存储块代替所述存储块组中的故障存储块,而不需要记录恢复存储块和故障存储块之间的对应关系。The fourth aspect of the present invention provides a hard disk failure processing method. The difference between the hard disk processing method provided in the fourth aspect and the hard disk failure processing method provided in the first aspect is only that after the recovered data is stored in the recovery storage block, The recovery storage block replaces the faulty storage block in the storage block group without recording the correspondence between the recovery storage block and the faulty storage block.
本发明第五方面提供一种与所述第一方面提供的硬盘故障处理方法对应的阵列控制器,所述阵列控制器的各功能模块所执行的功能与所述第一方面提供的硬盘故障处理方法包括的各步骤相同,在此不再赘述。A fifth aspect of the present invention provides an array controller corresponding to the hard disk failure processing method provided in the first aspect, and functions performed by each functional module of the array controller and the hard disk failure processing provided in the first aspect The steps included in the method are the same and will not be repeated here.
本发明第六方面提供一种与所述第二方面提供的硬盘故障处理方法对应的阵列控制器,所述阵列控制器的各功能模块所执行的功能与所述第二方面提供的硬盘故障处理方法包括的各步骤相同,在此不再赘述。A sixth aspect of the present invention provides an array controller corresponding to the hard disk failure processing method provided in the second aspect, and functions performed by each functional module of the array controller and the hard disk failure processing provided in the second aspect The steps included in the method are the same and will not be repeated here.
本发明第七方面提供一种与所述第三方面提供的硬盘故障处理方法对应的硬盘,所述硬盘的各功能模块所执行的功能与所述第三方面提供的硬盘故障处理方法包括的各步骤相同,在此不再赘述。A seventh aspect of the present invention provides a hard disk corresponding to the hard disk failure processing method provided in the third aspect, and the functions performed by the functional modules of the hard disk and the hard disk failure processing method provided by the third aspect include The steps are the same and will not be repeated here.
本发明第八方面提供一种与所述第四方面提供的硬盘故障处理方法对应的阵列控制器,所述阵列控制器的各功能模块所执行的功能与所述第四方面提供的硬盘故障处理方法包括的各步骤相同,在此不再赘述。An eighth aspect of the present invention provides an array controller corresponding to the hard disk failure processing method provided in the fourth aspect, and the functions performed by each functional module of the array controller and the hard disk failure processing provided in the fourth aspect The steps included in the method are the same and will not be repeated here.
本发明第九方面提供一种阵列控制器,所述阵列控制器包括处理器及计算机可读存储介质,所述存储介质中存储有程序指令,所述处理器运行所述程序指令以执行第一方面、第二方面或第四方面所提供的硬盘故障处理方法。A ninth aspect of the present invention provides an array controller. The array controller includes a processor and a computer-readable storage medium. The storage medium stores program instructions, and the processor runs the program instructions to execute a first Aspect, the second aspect or the fourth aspect of the hard disk failure processing method.
本发明第十方面提供一种硬盘,所述硬盘包括处理器及计算机可读存储介质,所述存储介质中存储有程序指令,所述处理器运行所述程序指令以执行第三方面所提供的硬盘故障处理方法。A tenth aspect of the present invention provides a hard disk. The hard disk includes a processor and a computer-readable storage medium. The storage medium stores program instructions. The processor runs the program instructions to execute the program instructions provided in the third aspect. Hard disk troubleshooting method.
本发明第十一方面提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面、第二方面、第三方面、或第四方面的方法。According to an eleventh aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions that, when run on a computer, cause the computer to execute the first aspect, the second aspect, and the third aspect. Aspect, or the fourth aspect.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有 技术描述中所需要使用的附图作简单地介绍。In order to explain the technical solutions in the embodiments of the present invention or the prior art more clearly, the drawings used in the embodiments or the description of the prior art will be briefly introduced below.
图1为存储阵列的结构图。FIG. 1 is a structural diagram of a storage array.
图2为本发明第一实施例中,阵列控制器生成逻辑磁盘的示意图。FIG. 2 is a schematic diagram of an array controller generating a logical disk in the first embodiment of the present invention.
图3为本发明第一实施例中存储阵列提供热备空间及冗余空间的示意图。FIG. 3 is a schematic diagram of a hot spare space and a redundant space provided by a storage array in the first embodiment of the present invention.
图4为本发明第一实施例中存储阵列对硬盘中的故障区进行处理的流程图。FIG. 4 is a flowchart of processing a fault area in a hard disk by the storage array in the first embodiment of the present invention.
图5为本发明实施例中SCSI协议中定义的指示硬盘故障区ASC代码及ASCQ代码。FIG. 5 is an ASC code and an ASCQ code indicating a hard disk failure area defined in the SCSI protocol in the embodiment of the present invention.
图6为本发明实施例中SCSI协议中的信息异常日志页的示例图。FIG. 6 is an exemplary diagram of an information exception log page in the SCSI protocol according to an embodiment of the present invention.
图7为本发明实施例中IO请求的返回信息中的描述符格式感应数据的示意图。FIG. 7 is a schematic diagram of the descriptor format sensing data in the return information of the IO request in the embodiment of the present invention.
图8为本发明实施例中ATA协议中定义的盘内信息统计页的示意图。FIG. 8 is a schematic diagram of an intra-disk information statistics page defined in the ATA protocol in an embodiment of the present invention.
图9为本发明实施例中在NVMe协议中定义的健康信息日志的示意图。FIG. 9 is a schematic diagram of a health information log defined in the NVMe protocol according to an embodiment of the present invention.
图10为本发明实施例中阵列控制器接收到改写请求时的处理方法的流程图。FIG. 10 is a flowchart of a processing method when an array controller receives a rewrite request according to an embodiment of the present invention.
图11为本发明第二实施例中,阵列控制器通过多个独立硬盘通过RAID算法形成逻辑磁盘的示意图。11 is a schematic diagram of an array controller forming a logical disk by a RAID algorithm through a plurality of independent hard disks in a second embodiment of the present invention.
图12为本发明第二实施例中对硬盘中出现的故障区进行处理的方法的流程图。FIG. 12 is a flowchart of a method for processing a fault area occurring in a hard disk in a second embodiment of the present invention.
图13为本发明实施例中的硬盘的模块图。FIG. 13 is a block diagram of a hard disk in an embodiment of the present invention.
图14为本发明第一实施例中的阵列控制器的模块图。FIG. 14 is a block diagram of an array controller in the first embodiment of the present invention.
图15为本发明第二实施例中的阵列控制器的模块图。FIG. 15 is a block diagram of an array controller in a second embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。In the following, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments.
如图1所示,为存储阵列100的结构图。所述存储阵列100包括阵列控制器101、多个硬盘105-108、内存103、通讯接口104、及总线102。所述阵列控制器101用于运行内存103中的程序(图未示)以对所述硬盘105-108进行管理并对其中的数据进行访问。所述通讯接口104用于连接至主机(图未示),所述主机可以通过所述通讯接口104传输读写指令或者管理指令至所述存储阵列100。所述通讯接口可以为非易失性存储器标准(Non-Volatile Memory express,NVMe)接口也可以是小型计算机系统接口(Small Computer System Interface,SCSI)SCSI接口。As shown in FIG. 1, it is a structural diagram of a memory array 100. The storage array 100 includes an array controller 101, a plurality of hard disks 105-108, a memory 103, a communication interface 104, and a bus 102. The array controller 101 is configured to run a program (not shown) in the memory 103 to manage the hard disks 105-108 and access data therein. The communication interface 104 is used to connect to a host (not shown), and the host can transmit read-write instructions or management instructions to the storage array 100 through the communication interface 104. The communication interface may 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.
如图2所示,为本发明第一实施例中,阵列控制器101生成提供给主机使用的逻辑磁盘的示意图。在所述存储阵列100是使用NVMe接口的闪存阵列时,则所述主机与所述存储阵列100通过NVMe协议通信,所述存储阵列100生成的逻辑磁盘可通过NVMe协议中定义的命名空间(Namespace)表示。在所述存储阵列100是使用SCSI接口的存储阵列时,则主机与所述存储阵列100通过SCSI协议通信,所述硬盘即可通过SCSI协议中定义的逻辑单元号(Logic Unit Number,LUN)表示。在图2的实施例中,以所述阵列控制器101在SCSI协议下生成LUN的过程为例进行说明。As shown in FIG. 2, in the first embodiment of the present invention, the array controller 101 generates a logical disk for use by a host. 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 disks generated by the storage array 100 can pass a 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 a logical unit number (LUN) defined in the SCSI protocol. . In the embodiment of FIG. 2, the process of generating the LUN by the array controller 101 under the SCSI protocol is taken as an example for description.
如图2所示,所述存储阵列100中的各个硬盘105-108被划分为相同大小的存储块(chunk),将归属于不同硬盘的chunk利用独立硬盘冗余阵列(redundant arrays of independent drives,RAID)算法生成存储块组(chunk group)。如图2中所示,归属于硬盘102的chunk201、归属于硬盘106的chunk202、及归属于硬盘107的chunk203通过RAID5算法生成chunk group 204。归属于硬盘102的chunk205、归属于硬盘107的chunk206、及归 属于硬盘108的chunk207通过RAID5算法生成chunk group 208。在生成chunk group之后,所述存储控制器101记录构成每个chunk group的chunk所在的硬盘。基于所述chunk group构建存储池209,并基于所述存储池209构建逻辑磁盘,例如LUN0、LUN1、及LUN3。As shown in FIG. 2, each hard disk 105-108 in the storage array 100 is divided into chunks of the same size, and the chunks belonging to different hard disks utilize redundant arrays of independent hard disks (redundant arrays of independent drives). A RAID) algorithm generates a chunk group. As shown in FIG. 2, the chunk 201 belonging to the hard disk 102, the chunk 202 belonging to the hard disk 106, and the chunk 203 belonging to the hard disk 107 generate a chunk group 204 by using a RAID 5 algorithm. The chunk 205 belonging to the hard disk 102, the chunk 206 belonging to the hard disk 107, and the chunk 207 belonging to the hard disk 108 generate a chunk group 208 by a RAID 5 algorithm. After the chunk group is generated, the storage controller 101 records the hard disk where the chunks constituting each chunk group are located. A storage pool 209 is constructed based on the chunk group, and logical disks such as LUN0, LUN1, and LUN3 are constructed based on the storage pool 209.
如图3所示,在本发明实施例中,除了所述存储资源池209,所述存储阵列100还提供热备空间210及冗余空间211。所述热备空间210用于在硬盘中的chunk故障后,对故障chunk中的数据进行恢复并替代故障chunk。所述冗余空间是所述存储阵列100预留的空间,所述存储阵列100不对外提供所述冗余空间的大小,所述冗余空间用于提高存储阵列100的性能。所述热备空间210和冗余空间211可以是单个硬盘,也可以是多个硬盘中的chunk构成池化空间。在本发明实施例中,所述热备空间和冗余空间可以被划分为与所述chunk同样大小的粒度,用于替换硬盘中的故障chunk。关于如何利用所述热备空间210和冗余空间211替换硬盘中的故障chunk将在下文描述硬盘故障处理的方法时做详细描述。As shown in FIG. 3, in the 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 data in the failed chunk and replace the failed chunk after the 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, and the redundant space is used to improve the performance of the storage array 100. The hot spare space 210 and the redundant space 211 may be a single hard disk or a chunk of multiple hard disks to form a pooled space. In the embodiment of the present invention, the hot spare space and the redundant space may be divided into a granularity of the same size as the chunk, which is used to replace a failed chunk in a hard disk. How to replace the failed chunk in the hard disk by using the hot spare space 210 and the redundant space 211 will be described in detail when a method for hard disk failure processing is described below.
如背景技术所述,现有技术中在硬盘中产生故障区(即为硬盘中发生故障的一段存储空间)后,例如硬盘中的die故障后,所述阵列控制器100是不感知的,所以也不会对出现的故障进行处理,之后阵列控制器100在检测到所述硬盘的磨损度达到阈值后,直接进行换盘处理。但是在所述硬盘的磨损度没有达到所述阈值时,故障区会导致硬盘的冗余空间减少,冗余空间的减少会影响存储系统的性能。As described in the background art, in the prior art, after a fault area (that is, a section of storage space where a fault occurs in a hard disk) is generated in a hard disk, for example, after a die in the hard disk fails, the array controller 100 is not aware, so No failures will be processed, and after the array controller 100 detects that the wear degree of the hard disk reaches a threshold, it directly performs disk replacement processing. However, when the wear degree of the hard disk does not reach the threshold, the fault area will reduce the redundant space of the hard disk, and the reduction of the redundant space will affect the performance of the storage system.
本发明实施例提供的故障处理方法可以使所述阵列控制器100确定硬盘中的故障区所在的故障存储块,将故障存储块用冗余空间211或者热备空间210的存储块替代,从而不会影响整个存储系统的性能。The fault processing method provided in the embodiment of the present invention may enable the array controller 100 to determine a faulty storage block in which a faulty area in a hard disk is located, and replace the faulty storage block with a storage block in a redundant space 211 or a hot spare space 210, so Will affect the performance of the entire storage system.
下面将通过图4的流程图说明本发明实施例中对硬盘中的故障进行处理的方法。A method for processing a failure in a hard disk in the embodiment of the present invention will be described below through a flowchart of FIG. 4.
图4为在图2所示的架构下,存储系统对硬盘中的故障区进行处理的方法的流程图,在下面的描述中仅以存储阵列100中的硬盘105出现故障为例进行说明。FIG. 4 is a flowchart of a method for a storage system to process a failed area in a hard disk under the architecture shown in FIG. 2. In the following description, only the failure of the hard disk 105 in the storage array 100 is described as an example.
步骤S401,所述硬盘105识别硬盘105中的故障区,并累计故障区的容量。In step S401, the hard disk 105 identifies a fault area in the hard disk 105 and accumulates the capacity of the fault area.
所述故障区可以为硬盘的flash中的Die颗粒,也可以为硬盘上的一段空间。在硬盘运行过程中,硬盘会统计硬盘中的存储区出现异常的次数,当某个存储区的某种类型的异常出现的次数超过预设值时,即可识别该存储区为故障区。所述异常可以为出现错误检查和纠正错误(error checking and correction error,ECC error)、无法纠正的ECC编码错误(uncorrectable error-correcting code error,UNC)、对I/O的响应慢、或者对I/O的响应超时等。对故障区的识别可以是现有技术中任意一种方式,在此不作限制。硬盘所执行的功能由硬盘中的处理器(图未示)执行硬盘中的内存(图未示)中存储的一段程序代码实现。The fault area may be a Die particle in a flash of a hard disk, or may be a space on the hard disk. During the operation of the hard disk, the hard disk counts the number of times an abnormality occurs in the storage area of the hard disk. When the number of times a certain type of abnormality occurs in a storage area exceeds a preset value, the storage area can be identified as a fault area. The abnormality may be error checking and correction (ECC error), uncorrectable error-correcting code error (UNC), slow response to I / O, or I / O response timeout. The identification of the fault area may be in any manner in the prior art, and is not limited herein. The function performed by the hard disk is realized by a processor (not shown) in the hard disk executing a piece of program code stored in a memory (not shown) in the hard disk.
步骤S402,所述阵列控制器101获取硬盘105中的故障区的故障信息。所述故障信息中包括指示所述故障区是否有数据丢失的标识。在一些实施例中,所述故障信息中还包括故障区的容量。In step S402, the array controller 101 obtains fault information of a fault area in the hard disk 105. The fault information includes an identifier indicating whether there is data loss in the fault area. In some embodiments, the fault information further includes a capacity of the fault area.
在实际应用中,有些硬盘为了保证数据的可靠性,会在硬盘内做具有数据恢复能力的RAID,例如RAID1、RAID 5等,这样,即使是硬盘中存在故障区,也可以通过硬盘内的RAID算法恢复故障区的数据,从而不会产生数据丢失。而当硬盘中没有做盘内RAID或者做的是不能恢复数据的RAID,例如RAID0时,则故障区中的数据无法恢复,所以会导致数据丢失。所以在本发明实施例中,所述阵列控制器101会获取指示所述故障区是否有数据丢失的标识,以便后续对所述故障区中丢失的数据进行恢复。In practical applications, in order to ensure the reliability of data, some hard disks will have RAID with data recovery capabilities, such as RAID1, RAID5, etc. In this way, even if there is a fault area in the hard disk, the RAID in the hard disk can also be used. The algorithm recovers the data in the fault area so that no data is lost. However, when the hard disk does not have in-disk RAID or is a RAID that cannot recover data, such as RAID0, the data in the fault area cannot be recovered, so data will be lost. Therefore, in the embodiment of the present invention, the array controller 101 obtains an identifier indicating whether there is data loss in the fault area, so as to recover the lost data in the fault area subsequently.
在本发明实施例中,针对硬盘105与存储阵列100之间的不同通信协议,获取所述故 障信息方式也不同,下面分别介绍在不同通讯协议下获取故障区的故障信息的方式。In the embodiment of the present invention, the methods for acquiring the fault information are different for different communication protocols between the hard disk 105 and the storage array 100. The methods for acquiring the fault information of the fault area under different communication protocols are described below.
SCSI协议SCSI protocol
在现有的SCSI协议中,定义有附加检测代码(ASC)和附件检测代码限定词(ASCQ),通过不同的ASC和ASCQ标识硬盘中产生的异常。在硬盘检测到异常后,即将该异常对应的ASC和ASCQ记录在信息异常日志页(informational exception log page)。所述信息异常日志页为SCSI协议中定义的用于记录硬盘的异常的日志页。在现有的SCSI协议中,ASC为5D时,表示的是超出故障预测阈值(FAILURE PREDICTION THRESHOLD EXCEEDED),即当所监测的硬盘中某个参数超过设定的阈值时,就需要将所述参数上报至阵列控制器。而5D对应的各ASCQ则定义了硬盘中需要检测的各项参数。由于现有的SCSI协议中并未定义上报硬盘中出现故障区的ASCQ,且无法上报故障区的容量,所以在本发明实施例中,定义了表示故障区的故障情况的ASCQ代码6D及6E。如图5所示,为本发明实施例中新定义的ASCQ代码6D及6E的定义,其中,6D表示的是硬盘中的出现故障区但没有数据丢失,而6E表示硬盘中出现故障区且有数据丢失。在硬盘检测到故障区,且总的故障容量达到预设值时,则根据故障区的数据是否丢失将6D或者6E记录在信息异常日志页中。如图6所示,为信息异常日志页的示例图,当故障区的故障容量达到预设值,且没有数据丢失时,则在所述信息异常日志页的第8字节表示的信息异常ASC(INFORMATION EXCEPTION ADDITIONAL SENSE CODE)填入5D,在所述信息异常日志页的第9字节信息异常ASCQ(INFORMATIONAL EXCEPTION ADDITIONAL SENSE CODE QUALIFIER)内填入6D。当故障区的容量达到预设值,且有数据丢失时,则在所述信息异常日志页的第8字节表示的信息异常ASC填入5D,在所述信息异常日志页的第9字节信息异常ASCQ内填入6E。另外,可选地,还会将所述故障区的容量记录在所述信息异常日志页的信息(information)字节中,如图6所示,携带的是“00 00 00 00 00 0100 00”(16进制),即8GB的故障容量。上述ASCQ代码6D及6E只是举例说明,在实际使用中,可以使用ASC 5D下任意未被协议使用的ASCQ。In the existing SCSI protocol, an additional detection code (ASC) and an attachment detection code qualifier (ASCQ) are defined, and abnormalities generated in a hard disk are identified through different ASC and ASCQ. After the abnormality is detected on the hard disk, the ASC and ASCQ corresponding to the abnormality are recorded in the informational exception log page. The information abnormality log page is a log page defined in the SCSI protocol for recording an abnormality of a hard disk. In the existing SCSI protocol, when 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. Each ASCQ corresponding to 5D defines various parameters that need to be detected in the hard disk. Since the existing SCSI protocol does not define ASCQ for reporting a fault area in a hard disk, and the capacity of the fault area cannot be reported, in the embodiment of the present invention, ASCQ codes 6D and 6E indicating the fault conditions of the fault area are defined. As shown in FIG. 5, it is a definition of the newly defined ASCQ codes 6D and 6E in the embodiment of the present invention, where 6D indicates a fault area in the hard disk but no data is lost, and 6E indicates a fault area in the hard disk and there is no data loss. data lost. When the hard disk detects a fault area and the total fault capacity reaches a preset value, 6D or 6E is recorded in the information abnormal log page according to whether the data in the fault area is lost. As shown in FIG. 6, it is an example diagram of an information abnormality log page. When the capacity of the fault area reaches a preset value and no data is lost, the information abnormality ASC indicated by the 8th byte of the information abnormality log page (INFORMATION EXCEPTION ADDITIONAL SENSE CODE) is filled in 5D, and the 9th byte information abnormal ASCQ (INFORMATIONAL EXCEPTION ADDITIONAL SENSE CODE QUALIFIER) of the information abnormal log page is filled in. When the capacity of the fault area reaches the preset value and data is lost, the information abnormality ASC indicated by the 8th byte of the information abnormality log page is filled with 5D, and the 9th byte of the information abnormality log page is filled. 6E is entered in the ASCQ. In addition, optionally, the capacity of the fault area is also recorded in the information byte of the information exception log page, as shown in FIG. 6, which carries "00 00 00 00 00 00 00" (Hexadecimal), which is the failure capacity of 8GB. The above-mentioned ASCQ codes 6D and 6E are just examples. In actual use, any ASCQ that is not used by the agreement under ASC 5D can be used.
在SCSI协议中,可通过两种方式获取所述故障区的故障信息。In the SCSI protocol, the fault information of the fault area can be obtained in two ways.
第一种方式为硬盘105主动上报。The first method is that the hard disk 105 actively reports.
在接收到阵列控制器101发送的IO请求后,在信息异常日志页的所述信息异常ASC字节及信息异常ASCQ字节中记录有异常代码时,例如5D及6E,则将所述5D及6E及信息字节中记录的故障容量8G分别写入所述IO请求的返回信息中的描述符格式感应数据(Descriptor format sense data)中。如图7所示,所述描述符格式感应数据包括ASC字节及ASCQ字节,则将从所述信息异常日志页中获取的ASC代码5D,及ASCQ代码6D/6E填入所述描述符格式感应数据的中的ASC及ASCQ中。另外所述描述符格式感应数据也包括信息字节,则可以将所述故障区容量写入所述描述符格式感应数据的信息字节中。After receiving the IO request sent by the array controller 101, when an abnormal code is recorded in the information abnormal ASC byte and the information abnormal ASCQ byte of the information abnormal log page, for example, 5D and 6E, the 5D and The 6E and the fault capacity 8G recorded in the information byte are respectively written into the descriptor format sensing data in the return information of the IO request. As shown in FIG. 7, if the descriptor format sensing data includes ASC bytes and ASCQ bytes, the descriptor is filled with the ASC code 5D and ASCQ code 6D / 6E obtained from the information exception log page. ASC and ASCQ in format sensing data. In addition, the descriptor format sensing data also includes information bytes, and the capacity of the fault area can be written into the information bytes of the descriptor format sensing data.
如此,在阵列控制器101接收到所述IO请求的返回信息后,即可从所述返回信息的描述符格式感应数据获取所述硬盘中的故障区的故障信息。In this way, after the array controller 101 receives the return information of the IO request, it can obtain the failure information of the fault area in the hard disk from the descriptor format sensing data of the return information.
第二种方式为阵列控制器101定时查询硬盘105中的故障区的故障信息。The second way is for the array controller 101 to periodically query the fault information of the fault area in the hard disk 105.
在这种方式中,阵列控制器101会定时发送故障查询指令至所述硬盘105,该故障查询指令中会携带信息异常日志页的标识。所述硬盘105在接收到所述故障查询指令后,会将所述信息异常日志页返回给所述阵列控制器101。所述阵列控制器101在接收到所述日志页后,从中获取ASC、ASCQ及信息对应的内容。若所述ASC、ASCQ分别为5D及6D,则所述阵列控制器101可获取所述硬盘105中的的异常为出现故障区,故障区没有数据丢 失。若所述ASC、ASCQ分别为5D及6E,则所述阵列控制器101可获取所述硬盘中的异常为出现故障区,故障区有数据丢失。可选地,还可以从信息对应的字节中获取故障区的容量。In this manner, the array controller 101 periodically sends a fault query instruction to the hard disk 105, and the fault query instruction carries the identifier of the information abnormal log page. After receiving the fault query instruction, the hard disk 105 returns the information abnormal log page to the array controller 101. After receiving the log page, the array controller 101 obtains the content corresponding to the ASC, ASCQ, and information from the log page. If the ASC and ASCQ are 5D and 6D, respectively, the array controller 101 can obtain that the abnormality in the hard disk 105 is 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 may obtain that an abnormality in the hard disk is a fault area, and data is lost in the fault area. Optionally, the capacity of the fault area can also be obtained from the bytes corresponding to the information.
第二、高级技术附件(Advanced Technology Attachment,ATA)协议Second, Advanced Technology Attachment (ATA) agreement
在ATA协议中,定义有盘内信息统计页(Solid State Device Statistics),该统计页用于记录硬盘检测到的硬盘的各项异常的异常信息。在本发明实施例中,定义了新的异常信息即不能纠正的闪存单元错误信息(Uncorrect Flash Unit Error Information),用于记录硬盘中出现故障区的故障信息。如图8所示,该信息通过64位的二进制数表示,其中15:0位数被设置为00000010(图中以16进制表示为:0002),为所述盘内信息统计页的标识。23:16位数用于指示硬盘中是否有故障区,如果有故障区,则将23:16位设置为00000001(图中以16进制表示为01),如果没有故障区,则将23:16位设置为00000000(图中以16进制表示为00)。31:24位数用于指示故障区是否有数据丢失,如果有数据丢失,则将31:24设置为00000001(图中以16进制表示为01),如果没有数据丢失,则将31:24设置为00000000(也可以以16进制表示为00)。另外,所述硬盘还会在盘内信息统计页中记录故障区的容量,例如在图8中24至31字节定义了参数:不可纠正的容量参数(uncorrectable capacity parameter),也为64位,将故障区的故障容量记录在该参数对应的位置处,在本发明实施例中,上报的容量为:00 00 00 00 00 01 00 00(16进制),即8G。In the ATA protocol, an in-disk information statistics page (Solid State State Device Statistics) is defined, and this statistics page is used to record abnormal information of various abnormalities of the hard disk detected by the hard disk. In the embodiment of the present invention, new abnormal information, that is, uncorrectable flash unit error information (Uncorrect Flash Unit Error Information) is defined, and is used to record fault information of a fault area in a hard disk. As shown in FIG. 8, the information is represented by a 64-bit binary number, in which 15: 0 digits are set to 00000010 (hexadecimal representation in the figure: 0002), which is an identifier of the information statistics page in the disc. The 23:16 digit is used to indicate whether there is a fault zone in the hard disk. If there is a fault zone, set the 23:16 bit to 00000001 (the hexadecimal representation is 01). If there is no fault zone, set 23: The 16 bits are set to 00000000 (the hexadecimal representation in the figure is 00). The 31:24 digits are used to indicate whether there is data loss in the fault area. If there is data loss, set 31:24 to 00000001 (the hexadecimal representation in the figure is 01). If there is no data loss, set 31:24 Set to 00000000 (or 00 in hexadecimal). In addition, the hard disk also records the capacity of the faulty area in the information statistics page of the disk. For example, in Figure 8 24-31 bytes define parameters: uncorrectable capacity parameter, which is also 64 bits. The fault capacity of the fault zone is recorded at the position corresponding to the parameter. In the embodiment of the present invention, the reported capacity is: 00 00 00 00 00 01 00 (hexadecimal), that is, 8G.
阵列控制器101会定时发送查询命令至所述硬盘105,所述查询命令中携带所述盘内信息统计页的标识。所述硬盘在接收到所述故障查询指令后,会将所述盘内信息统计页返回给所述阵列控制器101。所述阵列控制器101在接收到所述盘内信息统计页后,从中获取不能纠正的闪存单元错误信息,即所述64位的二级制数(或者16位的16进制数)。对所述不能纠正的闪存单元错误信息进行分析,即可得到所述硬盘105中的故障区信息。The array controller 101 periodically sends a query command to the hard disk 105, and the query command carries the identifier of the information statistics page in the disk. After receiving the fault query instruction, the hard disk returns the statistics page of the information on the disk to the array controller 101. After the array controller 101 receives the in-disk information statistics page, it obtains the uncorrectable flash unit error information, that is, the 64-bit secondary system number (or 16-bit hexadecimal number). By analyzing the error information of the uncorrectable flash memory unit, the fault area information in the hard disk 105 can be obtained.
第三、NVMe协议Third, the NVMe protocol
在NVMe协议中,定义有健康信息日志(Health Information Log),该日志用于记录硬盘检测到的硬盘的各项异常的异常信息。如图9所示,在健康信息日志字节0中的不同位定义了硬盘中的不同的异常信息,其中第1、2、3、4位是现有的NVMe协议中已经定义的异常信息,由于跟本发明不相关,在此不做描述。在本发明实施例中,新定义了第5位,用于表示所述硬盘105中是否出现故障区,当所述第5位的值为1时,表示所述硬盘105中有出现故障区。另外在第6-9这4个字节中定义了32位的字符串,其中最高位,也就是第9字节的bit7用于表示故障区是否有数据丢失,例如该位设置为1时,表示所述故障区有数据丢失,设置为0时,表示所述故障区没有数据丢失。最高位之后的位都用来表示故障存储块的故障容量,例如16进制的“00 00 00 00 00 01 00 00”表示故障存储块没有数据丢失,故障存储块的故障容量为8GB。而“80 00 00 00 00 01 00 00”(16进制的最高位为8,相当于2进制的最高位为1),表示故障存储块没有数据丢失,故障存储块的故障容量为8GB。In the NVMe protocol, a health information log (Health Information Log) is defined, and the log is used to record abnormal information about various abnormalities of the hard disk detected by the hard disk. As shown in FIG. 9, different bits in byte 0 of the health information log define different abnormal information in the hard disk. Among them, bits 1, 2, 3, and 4 are abnormal information that has been defined in the existing NVMe protocol. Since it is not related to the present invention, it will not be described here. In the embodiment of the present invention, a fifth bit is newly defined to indicate whether a fault area appears in the hard disk 105. When the value of the fifth bit is 1, it indicates that a fault area exists in the hard disk 105. In addition, a 32-bit character string is defined in the 4 bytes of 6-9. The most significant bit, 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. 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 failure capacity of the faulty storage block. For example, "00 00 00 00 00 01 00" in hexadecimal indicates that there is no data loss of the faulty storage block, and the faulty storage block has a capacity of 8 GB. And "80, 00, 00, 00, 01, 00" (the highest digit in hexadecimal is 8 and the highest digit in binary is 1), which means that there is no data loss in the faulty storage block and the fault capacity of the faulty storage block is 8GB.
当硬盘统计故障存储块的故障容量达到预设值时,则通过异步事件请求(Asynchronous Event Request)的响应将所述健康信息日志上报至阵列控制器101。阵列控制器101对所述健康信息日志进行分析即可获取故障区的故障信息。When the failure capacity of the hard disk statistics failure storage block reaches a preset value, the health information log is reported to the array controller 101 through a response of an asynchronous event request (Asynchronous Event Request). The array controller 101 can analyze the health information log to obtain the fault information of the fault area.
步骤S403,所述阵列控制器101从所述故障信息中获取所述硬盘105故障区的容量,并将所获取的容量信息累加至所述阵列控制器101所记录的所述硬盘的总故障容量中。当所述硬盘105的总故障容量达到预设值时,则通知用户对所述硬盘105进行更换。In step S403, the array controller 101 acquires the capacity of the fault area of the hard disk 105 from the fault information, and accumulates the acquired capacity information to the total fault capacity of the hard disk recorded by the array controller 101. in. When the total failure capacity of the hard disk 105 reaches a preset value, the user is notified to replace the hard disk 105.
步骤S404,所述阵列控制器101根据所述故障信息中指示所述故障区有数据丢失,则所述阵列控制器101确定丢失数据所在的chunk。In step S404, the array controller 101 determines that there is data loss in the fault area according to the fault information, and the array controller 101 determines a chunk where the lost data is located.
在本发明实施例中,提供了两种确定丢失数据的所在的chunk的方法。第一种方法为所述阵列控制器101获取归属于所述硬盘的各chunk的在所述硬盘105中的地址,在所述硬盘为SSD时,在所述硬盘105中的地址指的是在所述硬盘中的逻辑地址,然后发送数据丢失查询命令至所述硬盘105,所述查询命令中携带其中一个chunk的逻辑地址。在图2中描述了在构建所述存储池时,所述阵列控制器101会记录归属于每个硬盘的Chunk,所以所述阵列控制器101在确定丢失数据所在的chunk时,以chunk为粒度查询所述硬盘中的丢失数据的逻辑地址。在所述硬盘收到所述丢失数据查询命令时,判断所述丢失数据查询命令携带的逻辑地址中是否包含所述故障区的部分地址或者全部地址,如果包含,则上报有数据丢失的标识至所述存储控制器101,如果没有,则上报没有数据数据丢失的标识至所述存储控制器101。所述存储控制器101接收到上报信息后,若所述上报信息中包括数据丢失的标识时,将所述丢失数据查询命令中携带的chunk逻辑地址所指示的chunk作为丢失数据所在的chunk。在一种实施方式中,硬盘上报的故障区一般会小于chunk的大小,在这种实施方式中,若所述上报信息中包括没有数据丢失的标识时,则发送新的数据丢失查询命令至所述硬盘,新的数据丢失查询命令中携带的是所述硬盘的其他chunk的逻辑地址,如此,直到找到丢失数据所在的chunk为止。在另外一种实施方式中,若硬盘的上报的故障区大于一个chunk的大小的时候,阵列控制器会每次发送一个chunk的地址至硬盘确定故障存储块,在接收到一个chunk的返回信息后,会发送下一个chunk的地址至所述硬盘,直到所述硬盘的所有chunk的地址发送至硬盘,从而确定丢失数据所在的多个chunk。In the embodiment of the present invention, two methods for determining the chunk where the missing data is located are provided. The first method is that the array controller 101 obtains an address in the hard disk 105 of each chunk belonging to the hard disk. When the hard disk is an SSD, the address in the hard disk 105 refers to A logical address in the hard disk, and then sends a data loss query command to the hard disk 105, where the query command carries the logical address of one of the chunks. It is described in FIG. 2 that when the storage pool is constructed, the array controller 101 records the chunks belonging to each hard disk. Therefore, when determining the chunk where the lost data is located, the array controller 101 uses the chunk as the granularity. Query the logical address of the lost data in the hard disk. When the hard disk receives the lost data query command, it is determined whether the logical address carried by the lost data query command includes part or all of the address of the fault area, and if it contains, the data loss identifier is reported to If not, the storage controller 101 reports an identification that no data is lost to the storage controller 101. After the storage controller 101 receives the report information, if the report information includes a data loss identifier, the storage controller 101 uses the chunk indicated by the logical logical address of the chunk carried in the lost data query command 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 the chunk. In this embodiment, if the reported information includes an identifier without data loss, a new data loss query command is sent to the server. For the hard disk, 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 found 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 sends an address of the chunk to the hard disk to determine the faulty storage block. After receiving the return information of a chunk, , The addresses 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, so as to determine multiple chunks where the lost data is located.
第二种方法为所述阵列控制器101发送故障列表查询命令至所述硬盘105,所述硬盘105会在接收到所述查询命令后,将所记录的故障区的逻辑地址列表上报至所述阵列控制器101,所述阵列控制器101根据上报的逻辑地址列表即可确定丢失数据所在的chunk。The second method is that the array controller 101 sends a fault list query command to the hard disk 105, and the hard disk 105 reports the recorded logical address list of the fault area to the hard disk 105 after receiving the query command. An array controller 101. The array controller 101 can determine the chunk where the lost data is located according to the reported logical address list.
步骤S405,当所述阵列控制器101确定了丢失数据所在的chunk,即故障chunk后,则利用与所述故障chunk组成chunk组的其他chunk通过RAID算法恢复所述故障chunk中的数据。In step S405, when the array controller 101 determines the chunk where the lost data is located, that is, the failed chunk, it uses other chunks that form a chunk group with the failed chunk to recover the data in the failed chunk by using a RAID algorithm.
步骤S406,所述阵列控制器101将所恢复的数据存储至所述热备空间或者所述OP空间中的一个空闲chunk,所述空闲chunk即为备份chunk。所述备份chunk所在的硬盘与所述chunk组中的其他chunk所在的硬盘不同。In step S406, the array controller 101 stores the recovered data to an idle chunk in the hot spare space or the OP space, and the idle chunk is a backup chunk. The hard disk where the backup chunk is located is different from the hard disk where other chunks in the chunk group are located.
步骤S407,所述阵列控制器101记录所述故障chunk在所述硬盘中的地址与所述备份chunk在所述备份空间或者所述OP空间中的地址的映射关系。In step S407, the array controller 101 records a mapping relationship between an address of the failed chunk in the hard disk and an address of the backup chunk in the backup space or the OP space.
如此,在阵列控制器101后续接收到对所述故障chunk中的数据进行更新写的请求时,则将所述请求中的待写数据写入所述备份chunk中。并将故障chunk中的数据置为无效,后续在垃圾回收的过程中,可以释放故障chunk中除所述故障区之外的空间。In this way, when the array controller 101 subsequently receives a request to update and write data in the faulty chunk, it writes the data to be written in the request into the backup chunk. The data in the faulty chunk is invalidated. In the subsequent process of garbage collection, the space in the faulty chunk other than the faulty area can be released.
在本发明第二实施例中,在步骤S406中将所述恢复数据恢复到所述备份chunk之后,所述阵列控制器101会用所述恢复chunk替换所述chunk组中的所述故障chunk。替换时,可以将所述chunk组的元数据中记录的所述故障chunk在所述第一硬盘的地址替换为所述恢复存储块在所述恢复存储块所在硬盘的地址。In the second embodiment of the present invention, after the restored data is restored to the backup chunk in step S406, the array controller 101 replaces the failed chunk in the chunk group with the restored chunk. When replacing, the address of the failed chunk recorded in the metadata of the chunk group on the first hard disk may be replaced with the address of the recovery storage block on the hard disk where the recovery storage block is located.
在硬盘上报了硬盘的损失容量后,阵列控制器101会记录每个硬盘的损失容量,并计算每个硬盘目前的可用容量,并限制写入损失容量比较大的硬盘的数据。如图10所述为 阵列控制器101接收到对硬盘中的数据的改写请求时的处理方法的流程图。After the hard disk has reported the lost capacity of the hard disk, the array controller 101 records the lost capacity of each hard disk, calculates the current available capacity of each hard disk, and limits the data written to the hard disk with a relatively large lost capacity. FIG. 10 is a flowchart of a processing method when the array controller 101 receives a rewrite request for data in a hard disk.
步骤S501,接收写请求,所述写请求中携带待写数据、待写数据的逻辑地址及待写数据的数据量;Step S501: Receive a write request, where the write request carries data to be written, a logical address of the data to be written, and a data amount of the data to be written;
步骤S502,根据所述待写数据的逻辑地址确定所述待写数据的目标硬盘为所述硬盘105。In step S502, it is determined that the target hard disk of the data to be written is the hard disk 105 according to the logical address of the data to be written.
步骤S503,查询该硬盘105的可用容量;Step S503: Query the available capacity of the hard disk 105.
步骤S504,判断所述硬盘的可用容量是否小于所述待写数据的数据量。In step S504, it is determined whether the available capacity of the hard disk is smaller than the data amount of the data to be written.
步骤S505,若所述硬盘的可用容量大于所述待写数据的数据量,则将所述待写数据写入所述硬盘。Step S505: If the available capacity of the hard disk is greater than the data amount of the data to be written, write the data to be written to the hard disk.
步骤S506,若所述硬盘的可用容量小于等于所述待写数据的数据量,则将所述待写数据写入所述热备空间或者冗余空间,并将所述硬盘105中所述逻辑地址指向的数据标记为垃圾数据,等待后续的执行的垃圾回收。Step S506: if the available capacity of the hard disk is less than or equal to the data amount of the data to be written, write the data to be written into the hot spare space or redundant space, and write the logic in the hard disk 105 The data pointed to by the address is marked as garbage data and is waiting for subsequent garbage collection.
在所述阵列控制器101标记了每个硬盘的可用容量后,后续需要创建新的chunk group时,可选择可用容量大的硬盘创建chunk group。其中硬盘的可用容量为:硬盘的标称容量减去损失容量,再减去已用空间。After the array controller 101 marks the available capacity of each hard disk, when a new chunk group needs to be created subsequently, a hard disk with a large available capacity can be selected to create a chunk group. The available capacity of the hard disk is: the nominal capacity of the hard disk minus the lost capacity, and then minus the used space.
如图11所示,为本发明第三实施例中,由多个独立硬盘1104-1106通过RAID算法形成逻辑磁盘LUN1101。热备空间1102和冗余空间1103也是由独立的硬盘1107和1108提供。As shown in FIG. 11, in the third embodiment of the present invention, a plurality of 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.
下面通过图12所示的流程图描述在第三实施例中如何对硬盘中出现的故障区进行处理。The following describes how to deal with a fault area occurring in a hard disk in the third embodiment through a flowchart shown in FIG. 12.
在第三实施例中,步骤S701~S703与第一实施例中图4中的步骤S401~S403相同,在此不再赘述。In the third embodiment, steps S701 to S703 are the same as steps S401 to S403 in FIG. 4 in the first embodiment, and details are not described herein again.
步骤S704,所述阵列控制器101获取所述故障信息中指示所述故障区是否有数据丢失的标识。In step S704, the array controller 101 obtains an identifier in the fault information indicating whether there is data loss in the fault area.
步骤S705,如果所述所述标识信息指示所述故障区中没有数据丢失,则所述阵列控制器101将所述硬盘105中的与所述损失容量同等容量的数据迁移至所述热备空间1102或者冗余空间1103。Step S705, if the identification information indicates that no data is lost in the faulty area, the array controller 101 migrates data in the hard disk 105 with the same capacity as the lost capacity to the hot spare space 1102 or redundant space 1103.
步骤S706,如果所述所述标识信息指示所述硬盘的故障区有数据丢失,则通过RAID算法对所述所述硬盘中的数据进行恢复,恢复后执行步骤S705,即将所述硬盘105中的与所述损失容量同等容量的数据迁移至所述热备空间1102或者冗余空间1103。In step S706, if the identification information indicates that data is lost in the faulty area of the hard disk, the data in the hard disk is restored by using a RAID algorithm. After the recovery, step S705 is performed, that is, the data in the hard disk 105 is restored. Data having the same capacity as the lost capacity is migrated to the hot spare space 1102 or the redundant space 1103.
步骤S707,记录所述硬盘105中的被迁移数据在所述硬盘105中的地址与迁移至所述热备空间或者冗余空间的地址的映射关系。Step S707: Record a mapping relationship between an address of the migrated data in the hard disk 105 in the hard disk 105 and an address migrated to the hot spare space or a redundant space.
在后续接收到对所述被迁移数据访的访问请求时,可根据所述映射关系在所述热备空间或者冗余空间访问所述被迁移数据。When a subsequent access request to the migrated data is received, the migrated data may be accessed in the hot spare space or redundant space according to the mapping relationship.
如此,利用所述冗余空间或者热备空间补偿所述硬盘中故障区所损失的空间,从而无需用所述硬盘中的冗余空间补偿所述硬盘中的故障区,如此,即使所述硬盘出现故障区,也不会减少硬盘中的冗余空间,从而不会增加硬盘的磨损度,保障了存储阵列的性能。In this way, the redundant space or the hot spare space is used to compensate for the space lost in the fault area of the hard disk, so that the redundant space in the hard disk does not need to be used to compensate the fault area in the hard disk. When a fault area occurs, the redundant space in the hard disk will not be reduced, so that the wear of the hard disk will not be increased, and the performance of the storage array is guaranteed.
如图13所示,为本发明实施例中的硬盘1200的模块图。As shown in FIG. 13, a block diagram of a hard disk 1200 according to an embodiment of the present invention is shown.
所述硬盘1200包括识别模块1201、标记模块1202、及上报模块1203。所述识别模块1201用于识别硬盘105中的故障区,并累计故障区的容量。所述识别模块1201所执行的功能与图4的步骤S401相同,关于如何识别故障区及累计故障区的容量的方式可参考步骤 S401的描述。所述标记模块1202用于对识别的故障区的故障信息进行标记,所标记的方法请参考步骤S402中关于在不同的协议中,例如SCSI协议、ATA协议、及NVMe协议中硬盘如何标记故障区的故障信息的相关描述,具体可参考图4、图5、图8、及图9的相关描述。The hard disk 1200 includes an identification module 1201, a marking module 1202, and a reporting module 1203. The identification module 1201 is configured to identify a fault area in the hard disk 105 and accumulate the capacity of the fault area. The function performed by the identification module 1201 is the same as step S401 in FIG. 4. For how to identify the fault area and the capacity of the cumulative fault area, 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 step S402 on how to mark the fault area in the hard disk in different protocols, such as the SCSI protocol, the ATA protocol, and the NVMe protocol. For related descriptions of the fault information, refer to the related descriptions of FIG. 4, FIG. 5, FIG. 8, and FIG. 9.
所述上报模块1203用于将所述标记模块1202标记的故障信息上报至所述阵列控制器。关于所述上报模块1203上报故障信息的具体方式请参考步骤S402中关于在不同的协议中,例如SCSI协议、ATA协议、及NVMe协议中硬盘如何上报故障区的故障信息的相关描述,在此不再赘述。The reporting module 1203 is configured to report the fault information marked by the marking module 1202 to the array controller. For the specific way of reporting fault information by the reporting module 1203, please refer to step S402 for descriptions of how the hard disk reports fault information of the fault zone in different protocols, such as SCSI protocol, ATA protocol, and NVMe protocol. More details.
如图14所示,为本发明第一实施例中的阵列控制器1300的模块图。所述阵列控制器1300包括获取模块1301、累计模块1302、恢复模块1303、及记录模块1304。所述获取模块1301用于获取硬盘中的故障区的故障信息。获取硬盘中的故障区的故障信息的方式可参考步骤S402中的相关描述,不同协议,例如SCSI协议、ATA协议、及NVMe协议获取故障信息的方式会有所不同,具体请参考步骤S402中的描述,在此不再赘述。As shown in FIG. 14, it is a block 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 acquiring module 1301 is configured to acquire fault information of a fault area in a hard disk. For the method of obtaining the fault information of the fault area in the hard disk, refer to the relevant description in step S402. Different protocols, such as the SCSI protocol, the ATA protocol, and the NVMe protocol, obtain the fault information in different ways. For details, refer to step S402. The description is not repeated here.
所述累计模块1302用于从所述故障信息中获取所述硬盘故障区的容量,并将所获取的容量信息累加所记录的所述硬盘的总故障容量中。当所述硬盘的总故障容量达到预设值时,则通知用户对所述硬盘进行更换。具体请参考步骤S403的相关描述。The accumulation module 1302 is configured to obtain the capacity of the hard disk fault area from the fault information, and add the acquired capacity information to the total fault capacity of the hard disk that is recorded. When the total failure capacity of the hard disk reaches a preset value, the user is notified to replace the hard disk. For details, refer to the related description of step S403.
所述恢复模块1303用于在所述获取模块获取硬盘的故障区的故障信息后,如果所述故障信息中指示所述故障区有数据丢失,则确定丢失数据所在的故障chunk。然后利用与所述故障chunk组成chunk组的其他chunk通过RAID算法恢复所述故障chunk中的数据,然后将所恢复的数据存储至备份chunk中,并用所述备份chunk与所述chunk组中的除所述故障chunk之外的其他chunk组成新的chunk组。具体请参考步骤S404-407的相关描述。The recovery module 1303 is configured to determine, after the acquisition module obtains fault information of a fault area of a hard disk, if the fault information indicates data loss in the fault area, determine a faulty chunk in which the lost data is located. Then use the other chunks that make up the chunk group with the faulty chunk to recover the data in the faulty chunk through the RAID algorithm, and then store the recovered data in the backup chunk, and use the backup chunk and the division in the chunk group to divide. Other chunks other than the failed chunk form a new chunk group. For details, refer to the related description of steps S404-407.
所述记录模块1304用于在记录所述故障chunk在所述硬盘中的地址与所述备份chunk在所述备份空间或者所述OP空间中的地址的映射关系。具体请参考步骤S407的相关描述。The recording module 1304 is configured to record a mapping relationship between an address of the faulty chunk in the hard disk and an address of the backup chunk in the backup space or the OP space. For details, refer to the related description of step S407.
本发明第二实施例中的阵列控制器与第一实施例的阵列控制器中的获取模块1301、累计模块1302及恢复模块1303的功能相同,不同之处在于,在第二实施例中,记录模块会用所述恢复chunk替换所述chunk组中的所述故障chunk。替换时,可以将所述chunk组的元数据中记录的所述故障chunk在所述第一硬盘的地址替换为所述恢复存储块在所述恢复存储块所在硬盘的地址。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 of the first embodiment, except that in the second embodiment, the record The module replaces the failed chunk in the chunk group with the restored chunk. When replacing, the address of the failed chunk recorded in the metadata of the chunk group on the first hard disk may be replaced with the address of the recovery storage block on the hard disk where the recovery storage block is located.
图15为为本发明第三实施例中的阵列控制器1400的模块图。所述阵列控制器1400包括包括获取模块1401、累计模块1402、迁移模块1403、及记录模块1404。FIG. 15 is a block diagram of an array controller 1400 in a 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.
所述获取模块1401及累计模块1402的功能与所述阵列控制器1300中的获取模块1301及累计模块1302的功能相同,具体可参考获取模块1301及累计模块1302的相关描述,在此不再赘述。所述迁移模块1403用于在所述故障信息指示所述故障区没有数据丢失,则将所述硬盘中的与所述损失容量同等容量的数据迁移至所述热备空间或者冗余空间;如果所述所述故障信息指示所述硬盘的故障区有数据丢失,则通过RAID算法对所述所述硬盘中的数据进行恢复,恢复后将所述硬盘的与所述损失容量同等容量的数据迁移至所述热备空间或者冗余空间。具体请参考步骤S704至S706的相关描述。The functions of the acquisition module 1401 and the accumulation module 1402 are the same as the functions of the acquisition module 1301 and the accumulation module 1302 in the array controller 1300. For details, refer to the related descriptions of the acquisition module 1301 and the accumulation module 1302, and details are not described herein. . The migration module 1403 is configured to migrate data of the same capacity as the lost capacity in the hard disk to the hot spare space or redundant space in the fault information indicating that there is no data loss in the fault area; if If the fault information indicates that data is lost in the faulty area of the hard disk, the data in the hard disk is recovered by a RAID algorithm, and after the recovery, data of the hard disk having the same capacity as the lost capacity is migrated. To the hot spare space or redundant space. For details, refer to the related description of steps S704 to S706.
所述记录模块1404用于记录所述硬盘105中的被迁移数据在所述硬盘105中的地址与迁移至所述热备空间或者冗余空间的地址的映射关系。具体请参考步骤S707的相关描述。在后续接收到对所述被迁移数据访的访问请求时,可根据所述映射关系在所述热备空间 或者冗余空间访问所述被迁移数据。The recording module 1404 is configured to record a mapping relationship between an address of the migrated data in the hard disk 105 in the hard disk 105 and an address migrated to the hot spare space or a redundant space. For details, refer to the related description of step S707. When a subsequent access request to the migrated data is received, the migrated data may be accessed in the hot spare space or redundant space according to the mapping relationship.
以上模块的一个或多个可以软件、硬件或二者结合来实现。当以上任一模块或单元以软件实现的时候,所述软件以计算机程序指令的方式存在,并被存储在存储器中,处理器可以用于执行所述程序指令并实现以上方法流程。所述处理器可以包括但不限于以下至少一种:中央处理单元(central processing unit,CPU)、微处理器、数字信号处理器(DSP)、微控制器(microcontroller unit,MCU)、或人工智能处理器等各类运行软件的计算设备,每种计算设备可包括一个或多个用于执行软件指令以进行运算或处理的核。该处理器可以内置于SoC(片上系统)或专用集成电路(application specific integrated circuit,ASIC),也可是一个独立的半导体芯片。该处理器内处理用于执行软件指令以进行运算或处理的核外,还可进一步包括必要的硬件加速器,如现场可编程门阵列(field programmable gate array,FPGA)、PLD(可编程逻辑器件)、或者实现专用逻辑运算的逻辑电路。One or more of the above modules may be implemented in software, hardware or a combination of both. When any of the above modules or units is implemented in software, the software exists in the form of computer program instructions and is stored in a memory, and the processor may 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 (microcontroller), or an artificial intelligence Various types of computing devices, such as processors, that run software. Each computing device may include one or more cores for executing software instructions for operations or processing. The processor can be built into a SoC (System on a Chip) or an application specific integrated circuit (ASIC), or it can be a separate semiconductor chip. The processor processes cores used to execute software instructions for operations or processing, and may further include necessary hardware accelerators, such as field programmable gate arrays (FPGAs), PLDs (programmable logic devices) Or logic circuits that implement dedicated logic operations.
当以上模块或单元以硬件实现的时候,该硬件可以是CPU、微处理器、DSP、MCU、人工智能处理器、ASIC、SoC、FPGA、PLD、专用数字电路、硬件加速器或非集成的分立器件中的任一个或任一组合,其可以运行必要的软件或不依赖于软件以执行以上方法流程。When the above modules or units are implemented in hardware, the hardware can be a CPU, microprocessor, DSP, MCU, artificial intelligence processor, ASIC, SoC, FPGA, PLD, dedicated digital circuit, hardware accelerator, or non-integrated discrete device Any one or any combination of them, which can run the necessary software or does not depend on the software to perform the above method flow.
以上对本发明实施例所提供硬盘故障处理方法、阵列控制器及硬盘进行了描述,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The hard disk failure processing method, the array controller, and the hard disk provided in the embodiments of the present invention have been described above. Specific examples are used in this document to explain the principle and implementation of the present invention. The descriptions of the above embodiments are only used to help understand the present invention. The method of the invention and its core ideas; meanwhile, for a person of ordinary skill in the art, according to the ideas of the present invention, there will be changes in the specific implementation and the scope of application. In summary, the content of this specification should not be understood. To limit the present invention.

Claims (46)

  1. 一种硬盘故障处理方法,由存储阵列的阵列控制器执行,所述存储阵列包括多个硬盘,每个硬盘被划分多个存储块,位于不同硬盘的多个存储块通过冗余算法构成存储块组;所述方法包括:A hard disk failure processing method is executed by an array controller of a storage array. The storage array includes multiple hard disks, and each hard disk is divided into multiple storage blocks. Multiple storage blocks located on different hard disks form a storage block through a redundant algorithm. Group; the method includes:
    获取第一硬盘中发生故障的故障区的故障信息;Acquiring fault information of a fault area where a fault occurs in the first hard disk;
    当所述故障信息指示所述故障区有数据丢失时,则确定丢失数据所在的故障存储块;When the fault information indicates data loss in the fault area, determining the faulty storage block where the missing data is located;
    利用所述故障存储块所归属的存储块组中的其他存储块恢复所述故障存储块的数据;Recovering data of the faulty memory block by using other memory blocks in a memory block group to which the faulty memory block belongs;
    将所恢复的数据存储至恢复存储块,所述恢复存储块位于第二硬盘,所述第二硬盘为除所述存储块组所在的硬盘以外的硬盘;Storing the recovered data to a recovery storage block, the recovery storage block being located on a second hard disk, the second hard disk being a hard disk other than the hard disk where the storage block group is located;
    记录所述故障存储块中的数据在所述第一硬盘中的地址与所述恢复数据块在所述第二硬盘中的地址的对应关系。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 is recorded.
  2. 如权利要求1所述的方法,其特征在于,所述获取第一硬盘中发生故障的故障区的故障信息包括:The method according to claim 1, wherein the acquiring the fault information of the fault area where the fault occurs in the first hard disk comprises:
    接收所述第一硬盘上报的所述故障信息。Receiving the failure information reported by the first hard disk.
  3. 如权利要求1所述的方法,其特征在于,所述获取第一硬盘中发生故障的故障区的故障信息包括:The method according to claim 1, wherein the acquiring the fault information of the fault area where the fault occurs in the first hard disk comprises:
    发送故障查询命令至所述第一硬盘;Sending a fault query command to the first hard disk;
    接收所述第一硬盘根据所述故障查询命令上报的所述故障信息。Receiving the fault information reported by the first hard disk according to the fault query command.
  4. 如权利要求2或3所述的方法,其特征在于,所述故障信息包括指示数据是否丢失的标识,根据所述标识确定所述故障区有数据丢失。The method according to claim 2 or 3, wherein the fault information includes an identifier indicating whether data is lost, and it is determined that data is lost in the fault area according to the identifier.
  5. 如权利要求1-4任意一项所述的方法,其特征在于,所述确定丢失数据所在的故障存储块包括:The method according to any one of claims 1-4, wherein the determining the faulty storage block where the missing 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, where 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 missing 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 second storage block of the first hard disk in all locations. Addresses in the first hard disk.
  6. 如权利要求1-4任意一项所述的方法,其特征在于,所述确定丢失数据所在的故障存储块包括:The method according to any one of claims 1-4, wherein the determining the faulty storage block where the missing data is located comprises:
    发送故障区查询命令至所述第一硬盘;Sending a fault zone query command to the first hard disk;
    接收所述第一硬盘返回的包括所述故障区的地址的信息;Receiving information returned by the first hard disk and including an address of the faulty area;
    根据所述故障区的地址确定所述故障存储块。The faulty storage block is determined according to the address of the faulty area.
  7. 如权利要求1-6任意一项所述的方法,其特征在于,所述故障信息包括所述故障 区的容量,所述方法还包括:The method according to any one of claims 1-6, wherein the fault information includes a capacity of the fault area, and the method further comprises:
    获取所述故障信息中的故障区的容量,将所述故障区的容量累加至所述第一硬盘的故障总容量中;Acquiring 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 failure capacity is greater than a preset value, the user is prompted to replace the first hard disk.
  8. 一种硬盘故障处理方法,由存储阵列的阵列控制器执行,所述存储阵列中包括第一硬盘,所述第一硬盘中包括故障区,所述方法包括:A hard disk failure processing 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:
    获取所述故障区的故障信息;Acquiring fault information of the fault area;
    根据所述故障信息确定所述故障区的容量;Determining the capacity of the fault area according to the fault information;
    根据所述容量大小将所述第一硬盘中的部分数据迁移至第二硬盘;Migrate part of the data in the first hard disk to the second hard disk according to the capacity;
    记录所迁移数据在所述第一硬盘中的地址与在所述第二硬盘中的地址的映射关系。The mapping relationship between the address of the migrated data in the first hard disk and the address in the second hard disk is recorded.
  9. 如权利要求8所述的方法,其特征在于,所述第一硬盘与所述存储阵列中的其他硬盘根据冗余算法构成逻辑磁盘,所述方法还包括:The method according to claim 8, wherein the first hard disk and other hard disks in the storage array form a logical disk according to a redundant algorithm, and the method further comprises:
    根据所述故障信息判断所述第一硬盘是否有数据丢失;Determining whether there is data loss on the first hard disk according to the failure information;
    若所述第一硬盘有数据丢失,则通过所述冗余算法恢复所述第一硬盘中的数据。If there is data loss on the first hard disk, the data in the first hard disk is restored through the redundant algorithm.
  10. 一种硬盘故障处理方法,由硬盘执行,所述方法包括:A hard disk failure processing method executed by a hard disk, the method includes:
    侦测所述硬盘中的故障区;Detecting a fault area in the hard disk;
    确定所述故障区是否有数据丢失;Determining whether there is data loss in the fault area;
    根据确定结果设置所述故障区是否有数据丢失的标记;Setting a flag for whether there is data loss in the fault area according to the determination result;
    将所述硬盘中包括故障区的标记及所述故障区是否有数据丢失的标记作为故障信息上报至阵列控制器。And reporting to the array controller as the fault information a flag including a fault area in the hard disk and a flag indicating whether there is data loss in the fault area.
  11. 如权利要求10所述的方法,其特征在于,所述方法还包括:The method of claim 10, further comprising:
    记录所述故障区的容量,所述故障信息还包括所述故障区的容量。The capacity of the fault area is recorded, and the fault information further includes the capacity of the fault area.
  12. 如权利要求11所述的方法,其特征在于,所述方法还包括:The method according to claim 11, further comprising:
    判断所述故障区的容量是否大于预设值;Judging whether the capacity of the fault area is greater than a preset value;
    当所述故障区的容量大于预设值时,上报所述故障信息至所述阵列控制器。When the capacity of the fault area is greater than a preset value, the fault information is reported to the array controller.
  13. 如权利要求10至12任意一项所述的方法,其特征在于,所述故障信息记录在小型计算机系统接口SCSI协议中的信息异常日志页中;The method according to any one of claims 10 to 12, wherein the fault information is recorded in an information exception log page in a small computer system interface SCSI protocol;
    所述方法还包括:The method further includes:
    接收所述阵列控制器发送的输入输出IO请求;Receiving an input-output IO request sent by the array controller;
    将所述信息异常日志页携带在所述IO请求的响应信息中,通过所述响应信息上报所述故障信息至所述阵列控制器。Carrying the information abnormality log page in the response information of the IO request, and reporting the failure information to the array controller through the response information.
  14. 如权利要求10至12任意一项所述的方法,其特征在于,所述故障信息记录在小型计算机系统接口SCSI协议中的信息异常日志页中;The method according to any one of claims 10 to 12, wherein the fault information is recorded in an information exception log page in a small computer system interface SCSI protocol;
    所述方法还包括:The method further includes:
    接收阵列控制器发送的故障信息查询请求;Receiving the fault information query request sent by the array controller;
    将所述信息异常日志页携带在所述故障信息查询请求的响应信息中,通过所述响应信息上报所述故障信息。The information abnormality log page is carried in response information of the failure information query request, and the failure information is reported through the response information.
  15. 如权利要求10至12任意一项所述的方法,其特征在于,所述故障信息记录在高级技术附件ATA协议中的盘内信息统计页中;The method according to any one of claims 10 to 12, wherein the fault information is recorded in an on-disk information statistics page in the Advanced Technology Attachment ATA protocol;
    所述方法还包括:The method further includes:
    接收所述阵列控制器发送的故障信息查询请求;Receiving a fault information query request sent by the array controller;
    将所述盘内信息统计页携带在所述故障信息查询请求的响应信息中,通过所述响应信息上报所述故障信息。Carrying the on-disk information statistics page in response information of the failure information query request, and reporting the failure information through the response information.
  16. 如权利要求10至12任意一项所述的方法,其特征在于,所述故障信息记录在非易失性存储器标准NVMe协议中的健康信息日志中;The method according to any one of claims 10 to 12, wherein the fault information is recorded in a health information log in a non-volatile memory standard NVMe protocol;
    所述方法还包括:The method further includes:
    将所述盘内信息统计页携带在异步事件请求的响应信息中,通过所述响应信息上报所述故障信息。Carrying the on-disk information statistics page in response information of an asynchronous event request, and reporting the failure information through the response information.
  17. 一种存储阵列中的阵列控制器,所述存储阵列包括多个硬盘,每个硬盘被划分多个存储块,位于不同硬盘的多个存储块通过冗余算法构成存储块组;所述阵列控制器包括:An array controller in a storage array. The storage array includes multiple hard disks. Each hard disk is divided into multiple storage blocks. Multiple storage blocks located on different hard disks form a storage block group through a redundant algorithm. The device includes:
    获取模块,用于获取第一硬盘中发生故障的故障区的故障信息;An acquisition module, configured to acquire fault information of a fault area where a fault occurs in the first hard disk;
    恢复模块,用于当所述故障信息指示所述故障区有数据丢失时,则确定丢失数据所在的故障存储块;利用所述故障存储块所归属的存储块组中的其他存储块恢复所述故障存储块的数据;将所恢复的数据存储至恢复存储块,所述恢复存储块位于第二硬盘,所述第二硬盘为除所述存储块组所在的硬盘以外的硬盘;A recovery module, configured to: when the fault information indicates data loss in the fault area, determine a faulty storage block in which the lost data is located; and use the other storage blocks in the storage block group to which the faulty storage block belongs to recover the Data of the faulty storage block; storing the recovered data to a recovery storage block, the recovery storage block being located on a second hard disk, the second hard disk being a hard disk other than the hard disk where the storage block group is located;
    记录模块,用于记录所述故障存储块中的数据在所述第一硬盘中的地址与所述恢复数据块在所述第二硬盘中的地址的对应关系。The recording module is configured to record a correspondence between an address of the data in the faulty storage block in the first hard disk and an address of the recovery data block in the second hard disk.
  18. 如权利要求17所述的阵列控制器,其特征在于,所述获取模块获取第一硬盘中发生故障的故障区的故障信息的方式为接收所述第一硬盘上报的所述故障信息。The array controller according to claim 17, wherein the way for the acquisition module to obtain the fault information of the faulted area in the first hard disk is to receive the fault information reported by the first hard disk.
  19. 如权利要求17所述的阵列控制器,其特征在于,所述获取模块获取第一硬盘中发生故障的故障区的故障信息的方式为发送故障查询命令至所述第一硬盘;接收所述第一硬盘根据所述故障查询命令上报的所述故障信息。The array controller according to claim 17, wherein the way for the acquiring module to obtain the fault information of the faulted area in the first hard disk is to send a fault query command to the first hard disk; receive the first The failure information reported by a hard disk according to the failure query command.
  20. 如权利要求17至19任意一项所述的阵列控制器,其特征在于,所述故障信息包括指示数据是否丢失的标识,根据所述标识确定所述故障区有数据丢失。The array controller according to any one of claims 17 to 19, wherein the fault information includes an identifier indicating whether data is lost, and it is determined that data is lost in the fault area according to the identifier.
  21. 如权利要求17至20任意一项所述的阵列控制器,其特征在于,所述恢复模块在确定丢失数据所在的故障存储块时,具体用于:The array controller according to any one of claims 17 to 20, wherein the recovery module is specifically configured to: when determining the faulty storage block where the lost data is located:
    获取所述第一硬盘中的第一存储块在所述第一硬盘中的地址;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, where 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 missing 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 second storage block of the first hard disk in all locations. Addresses in the first hard disk.
  22. 如权利要求17至20任意一项所述的阵列控制器,其特征在于,所述恢复模块在确定丢失数据所在的故障存储块时,具体用于:The array controller according to any one of claims 17 to 20, wherein the recovery module is specifically configured to: when determining the faulty storage block where the lost data is located:
    发送故障区查询命令至所述第一硬盘;Sending a fault zone query command to the first hard disk;
    接收所述第一硬盘返回的包括所述故障区的地址的信息;Receiving information returned by the first hard disk and including an address of the faulty area;
    根据所述故障区的地址确定所述故障存储块。The faulty storage block is determined according to the address of the faulty area.
  23. 如权利要求17-22任意一项所述的阵列控制器,其特征在于,所述故障信息包括所述故障区的容量,所述阵列控制器还包括:The array controller according to any one of claims 17 to 22, wherein the fault information includes a capacity of the fault area, and the array controller further comprises:
    累计模块,用于获取所述故障信息中的故障区的容量,将所述故障区的容量累加至所述第一硬盘的故障总容量中;当判断所述故障总容量大于预设值,则提示用户替换所述第一硬盘。The accumulation module is configured to obtain the capacity of the fault area in the fault information, and add 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, then The user is prompted to replace the first hard disk.
  24. 一种存储阵列的阵列控制器,所述存储阵列中包括第一硬盘,所述第一硬盘中包括故障区,所述方法包括:An array controller for a storage array. The storage array includes a first hard disk, the first hard disk includes a fault area, and the method includes:
    获取模块,用于获取所述故障区的故障信息;An acquisition module, configured to acquire fault information of the fault area;
    迁移模块,用于根据所述故障信息确定所述故障区的容量,根据所述容量大小将所述第一硬盘中的部分数据迁移至第二硬盘;A migration module, configured to determine the capacity of the fault area according to the fault information, and migrate part of the data in the first hard disk to the second hard disk according to the capacity;
    记录模块,用于记录所迁移数据在所述第一硬盘中的地址与在所述第二硬盘中的地址的映射关系。The recording module is configured to record a mapping relationship between an address of the migrated data in the first hard disk and an address in the second hard disk.
  25. 如权利要求24所述的阵列控制器,其特征在于,所述第一硬盘与所述存储阵列中的其他硬盘根据冗余算法构成逻辑磁盘,所述迁移模块还用于:The array controller according to claim 24, wherein the first hard disk and other hard disks in the storage array form a logical disk according to a redundant algorithm, and the migration module is further configured to:
    根据所述故障信息判断所述第一硬盘是否有数据丢失;Determining whether there is data loss on the first hard disk according to the failure information;
    若所述第一硬盘有数据丢失,则通过所述冗余算法恢复所述第一硬盘中的数据。If there is data loss on the first hard disk, the data in the first hard disk is restored through the redundant algorithm.
  26. 一种硬盘,包括:A hard disk including:
    识别模块,用于侦测所述硬盘中的故障区;An identification module for detecting a fault area in the hard disk;
    标记模块,用于确定所述故障区是否有数据丢失,根据确定结果设置所述故障区是否有数据丢失的标记;A marking module, configured to determine whether there is data loss in the fault area, and set a mark whether there is data loss in the fault area according to the determination result;
    上报模块,用于将所述硬盘中包括故障区的标记及所述故障区是否有数据丢失的标记作为故障信息上报至阵列控制器。The reporting module is configured to report a mark including a fault area in the hard disk and a flag indicating whether there is data loss in the fault area to the array controller as fault information.
  27. 如权利要求26所述的硬盘,其特征在于,所述硬盘还包括:The hard disk according to claim 26, wherein the hard disk further comprises:
    所述标记模块还用于记录所述故障区的容量,所述故障信息还包括所述故障区的容量。The marking module is further configured to record the capacity of the fault area, and the fault information further includes the capacity of the fault area.
  28. 如权利要求26所述的硬盘,其特征在于,所述上报模块还用于:The hard disk according to claim 26, wherein the reporting module is further configured to:
    判断所述故障区的容量是否大于预设值;Judging whether the capacity of the fault area is greater than a preset value;
    当所述故障区的容量大于预设值时,上报所述故障信息至所述阵列控制器。When the capacity of the fault area is greater than a preset value, the fault information is reported to the array controller.
  29. 如权利要求26至28任意一项所述的硬盘,其特征在于,所述记录模块将所述故障信息记录在小型计算机系统接口SCSI协议中的信息异常日志页中;The hard disk according to any one of claims 26 to 28, wherein the recording module records the fault information in an information exception log page in a small computer system interface SCSI protocol;
    所述上报模块具体用于:The reporting module is specifically configured to:
    接收所述阵列控制器发送的输入输出IO请求;Receiving an input-output IO request sent by the array controller;
    将所述信息异常日志页携带在所述IO请求的响应信息中,通过所述响应信息上报所述故障信息至所述阵列控制器。Carrying the information abnormality log page in the response information of the IO request, and reporting the failure information to the array controller through the response information.
  30. 如权利要求26至28任意一项所述的硬盘,其特征在于,所述记录模块将所述故障信息记录在小型计算机系统接口SCSI协议中的信息异常日志页中;The hard disk according to any one of claims 26 to 28, wherein the recording module records the fault information in an information exception log page in a small computer system interface SCSI protocol;
    所述上报模块具体用于:The reporting module is specifically configured to:
    接收阵列控制器发送的故障信息查询请求;Receiving the fault information query request sent by the array controller;
    将所述信息异常日志页携带在所述故障信息查询请求的响应信息中,通过所述响应 信息上报所述故障信息。The information abnormality log page is carried in the response information of the failure information query request, and the failure information is reported through the response information.
  31. 如权利要求26至28任意一项所述的硬盘,其特征在于,所述故障信息记录在高级技术附件ATA协议中的盘内信息统计页中;The hard disk according to any one of claims 26 to 28, wherein the failure information is recorded in a disk information statistics page in the Advanced Technology Attachment ATA protocol;
    所述上报模块具体用于:The reporting module is specifically configured to:
    接收所述阵列控制器发送的故障信息查询请求;Receiving a fault information query request sent by the array controller;
    将所述盘内信息统计页携带在所述故障信息查询请求的响应信息中,通过所述响应信息上报所述故障信息。Carrying the on-disk information statistics page in response information of the failure information query request, and reporting the failure information through the response information.
  32. 如权利要求26至28任意一项所述的硬盘,其特征在于,所述故障信息记录在非易失性存储器标准NVMe协议中的健康信息日志中;The hard disk according to any one of claims 26 to 28, wherein the fault information is recorded in a health information log in a non-volatile memory standard NVMe protocol;
    所述上报模块具体用于:The reporting module is specifically configured to:
    将所述盘内信息统计页携带在异步事件请求的响应信息中,通过所述响应信息上报所述故障信息。Carrying the on-disk information statistics page in response information of an asynchronous event request, and reporting the failure information through the response information.
  33. 一种硬盘故障处理方法,由存储阵列的阵列控制器执行,所述存储阵列包括多个硬盘,每个硬盘被划分多个存储块,位于不同硬盘的多个存储块通过冗余算法构成存储块组;所述方法包括:A hard disk failure processing method is executed by an array controller of a storage array. The storage array includes multiple hard disks, and each hard disk is divided into multiple storage blocks. Multiple storage blocks located on different hard disks form a storage block through a redundant algorithm. Group; the method includes:
    获取第一硬盘中发生故障的故障区的故障信息;Acquiring fault information of a fault area where a fault occurs in the first hard disk;
    当所述故障信息指示所述故障区有数据丢失时,则确定丢失数据所在的故障存储块;When the fault information indicates data loss in the fault area, determining the faulty storage block where the missing data is located;
    利用所述故障存储块所归属的存储块组中的其他存储块恢复所述故障存储块的数据;Recovering data of the faulty memory block by using other memory blocks in a memory block group to which the faulty memory block belongs;
    将所恢复的数据存储至恢复存储块,所述恢复存储块位于第二硬盘,所述第二硬盘为除所述存储块组所在的硬盘以外的硬盘;Storing the recovered data to a recovery storage block, the recovery storage block being located on a second hard disk, the second hard disk being a hard disk other than the hard disk where the storage block group is located;
    将所述存储块组中的所述故障存储块替换为所述恢复存储块。Replacing the failed storage block in the storage block group with the recovery storage block.
  34. 如权利要求33所述的方法,其特征在于,所述将所述存储块组中的所述故障存储块替换为所述恢复存储块包括:The method according to claim 33, wherein the replacing the faulty storage block in the storage block group with the recovery storage block comprises:
    将所述存储块组中的元数据记录的所述故障存储块在所述第一硬盘中的地址替换为所述恢复存储块在所述第二硬盘中的地址。The address of the faulty storage block in the metadata record in the storage block group in the first hard disk is replaced with the address of the recovery storage block in the second hard disk.
  35. 如权利要求33或34所述的方法,其特征在于,所述获取第一硬盘中发生故障的故障区的故障信息包括:The method according to claim 33 or 34, wherein the acquiring fault information of a fault area in which a fault occurs in the first hard disk comprises:
    接收所述第一硬盘上报的所述故障信息。Receiving the failure information reported by the first hard disk.
  36. 如权利要求33或34所述的方法,其特征在于,所述获取第一硬盘中发生故障的故障区的故障信息包括:The method according to claim 33 or 34, wherein the acquiring fault information of a fault area in which a fault occurs in the first hard disk comprises:
    发送故障查询命令至所述第一硬盘;Sending a fault query command to the first hard disk;
    接收所述第一硬盘根据所述故障查询命令上报的所述故障信息。Receiving the fault information reported by the first hard disk according to the fault query command.
  37. 如权利要求34至36任意一项所述的方法,其特征在于,所述故障信息包括指示数据是否丢失的标识,根据所述标识确定所述故障区有数据丢失。The method according to any one of claims 34 to 36, wherein the fault information includes an identifier indicating whether data is lost, and it is determined that data is lost in the fault area according to the identifier.
  38. 如权利要求33至37任意一项所述的方法,其特征在于,所述确定丢失数据所在的故障存储块包括:The method according to any one of claims 33 to 37, wherein the determining the faulty storage block where the missing 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, where 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 missing 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 second storage block of the first hard disk in all locations. Addresses in the first hard disk.
  39. 如权利要求33至37任意一项所述的方法,其特征在于,所述确定丢失数据所在的故障存储块包括:The method according to any one of claims 33 to 37, wherein the determining the faulty storage block where the missing data is located comprises:
    发送故障区查询命令至所述第一硬盘;Sending a fault zone query command to the first hard disk;
    接收所述第一硬盘返回的包括所述故障区的地址的信息;Receiving information returned by the first hard disk and including an address of the faulty area;
    根据所述故障区的地址确定所述故障存储块。The faulty storage block is determined according to the address of the faulty area.
  40. 一种存储阵列中的阵列控制器,所述存储阵列包括多个硬盘,每个硬盘被划分多个存储块,位于不同硬盘的多个存储块通过冗余算法构成存储块组;所述阵列控制器包括:An array controller in a storage array. The storage array includes multiple hard disks. Each hard disk is divided into multiple storage blocks. Multiple storage blocks located on different hard disks form a storage block group through a redundant algorithm. The array controls The device includes:
    获取模块,用于获取第一硬盘中发生故障的故障区的故障信息;An acquisition module, configured to acquire fault information of a fault area where a fault occurs in the first hard disk;
    恢复模块,用于当所述故障信息指示所述故障区有数据丢失时,则确定丢失数据所在的故障存储块;利用所述故障存储块所归属的存储块组中的其他存储块恢复所述故障存储块的数据;将所恢复的数据存储至恢复存储块,所述恢复存储块位于第二硬盘,所述第二硬盘为除所述存储块组所在的硬盘以外的硬盘;A recovery module, configured to: when the fault information indicates data loss in the fault area, determine a faulty storage block in which the lost data is located; and use the other storage blocks in the storage block group to which the faulty storage block belongs to recover the Data of the faulty storage block; storing the recovered data to a recovery storage block, the recovery storage block being located on 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.
  41. 一种存储阵列中的阵列控制器,其特征在于,所述替换模块在将所述存储块组中的所述故障存储块替换为所述恢复存储块时,具体用于将所述存储块组中的元数据记录的所述故障存储块在所述第一硬盘中的地址替换为所述恢复存储块在所述第二硬盘中的地址。An array controller in a storage array, wherein the replacement module is specifically configured to replace the storage block group when the faulty storage block in the storage block group is replaced with the recovery storage block. The address of the faulty storage block in the first hard disk of the metadata record in is replaced with the address of the recovery storage block in the second hard disk.
  42. 如权利要求40或41所述的阵列控制器,其特征在于,所述获取模块获取第一硬盘中发生故障的故障区的故障信息的方式为接收所述第一硬盘上报的所述故障信息。The array controller according to claim 40 or 41, wherein the way for the acquisition module to obtain the fault information of the faulted area in the first hard disk is to receive the fault information reported by the first hard disk.
  43. 如权利要求40或41所述的阵列控制器,其特征在于,所述获取模块获取第一硬盘中发生故障的故障区的故障信息的方式为发送故障查询命令至所述第一硬盘;接收所述第一硬盘根据所述故障查询命令上报的所述故障信息。The array controller according to claim 40 or 41, wherein the way for the acquisition module to obtain the fault information of the fault zone in the first hard disk is to send a fault query command to the first hard disk; The failure information reported by the first hard disk according to the failure query command.
  44. 如权利要求40至43任意一项所述的阵列控制器,其特征在于,所述故障信息包括指示数据是否丢失的标识,根据所述标识确定所述故障区有数据丢失。The array controller according to any one of claims 40 to 43, wherein the fault information includes an identifier indicating whether data is lost, and it is determined that data is lost in the fault area according to the identifier.
  45. 如权利要求40至43任意一项所述的阵列控制器,其特征在于,所述恢复模块在确定丢失数据所在的故障存储块时,具体用于:The array controller according to any one of claims 40 to 43, wherein the recovery module is specifically configured to: when determining the faulty storage block where the lost data is located:
    获取所述第一硬盘中的第一存储块在所述第一硬盘中的地址;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, where 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 missing 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 second storage block of the first hard disk in all locations. Addresses in the first hard disk.
  46. 如权利要求40至43任意一项所述的阵列控制器,其特征在于,所述恢复模块在确定丢失数据所在的故障存储块时,具体用于:The array controller according to any one of claims 40 to 43, wherein the recovery module is specifically configured to: when determining the faulty storage block where the lost data is located:
    发送故障区查询命令至所述第一硬盘;Sending a fault zone query command to the first hard disk;
    接收所述第一硬盘返回的包括所述故障区的地址的信息;Receiving information returned by the first hard disk and including an address of the faulty area;
    根据所述故障区的地址确定所述故障存储块。The faulty storage block is determined according to the address of the faulty area.
PCT/CN2019/104163 2018-09-05 2019-09-03 Hard disk fault processing method, array controller and hard disk WO2020048442A1 (en)

Priority Applications (9)

Application Number Priority Date Filing Date Title
EP19856725.7A EP3822792A4 (en) 2018-09-05 2019-09-03 Hard disk fault processing method, array controller and hard disk
MX2021002274A MX2021002274A (en) 2018-09-05 2019-09-03 Hard disk fault processing method, array controller and hard disk.
BR112021002987-7A BR112021002987B1 (en) 2018-09-05 2019-09-03 HARD DISK FAILURE HANDLING METHOD, ARRAY CONTROLLER, AND HARD DISK
EP21164813.4A EP3920031B1 (en) 2018-09-05 2019-09-03 Hard disk fault handling method, array controller, and hard disk
JP2021512508A JP7147050B2 (en) 2018-09-05 2019-09-03 Hard disk failure countermeasures, array controllers, and hard disks
KR1020217006066A KR102632961B1 (en) 2018-09-05 2019-09-03 Hard disk failure handling methods, array controllers, and hard disks
US17/167,231 US11322179B2 (en) 2018-09-05 2021-02-04 Hard disk fault handling method, array controller, and hard disk
US17/226,588 US11264055B2 (en) 2018-09-05 2021-04-09 Hard disk fault handling method, array controller, and hard disk
US17/549,094 US11501800B2 (en) 2018-09-05 2021-12-13 Hard disk fault handling method, array controller, and hard disk

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201811028931 2018-09-05
CN201811028931.7 2018-09-05
CN201811451958.7 2018-11-30
CN201811451958.7A CN110879761A (en) 2018-09-05 2018-11-30 Hard disk fault processing method, array controller and hard disk

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/167,231 Continuation US11322179B2 (en) 2018-09-05 2021-02-04 Hard disk fault handling method, array controller, and hard disk

Publications (1)

Publication Number Publication Date
WO2020048442A1 true WO2020048442A1 (en) 2020-03-12

Family

ID=69721562

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/104163 WO2020048442A1 (en) 2018-09-05 2019-09-03 Hard disk fault processing method, array controller and hard disk

Country Status (1)

Country Link
WO (1) WO2020048442A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488124A (en) * 2020-04-08 2020-08-04 深信服科技股份有限公司 Data updating method and device, electronic equipment and storage medium
CN111813588A (en) * 2020-06-01 2020-10-23 北京百卓网络技术有限公司 Computer hard disk fault positioning method, device, equipment and storage medium
CN113900594A (en) * 2021-10-12 2022-01-07 天津津航计算技术研究所 RAID control card S.M.A.R.T.information early warning method
CN115080340A (en) * 2022-05-13 2022-09-20 苏州浪潮智能科技有限公司 Method, system, computer device and storage medium for monitoring floppy disk array

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6327671B1 (en) * 1998-11-18 2001-12-04 International Business Machines Corporation Delta compressed asynchronous remote copy
CN101276302A (en) * 2007-03-29 2008-10-01 中国科学院计算技术研究所 Magnetic disc fault processing and data restructuring method in magnetic disc array system
CN106371947A (en) * 2016-09-14 2017-02-01 郑州云海信息技术有限公司 Multi-fault disk data recovery method for RAID (Redundant Arrays of Independent Disks) and system thereof
CN108345519A (en) * 2018-01-31 2018-07-31 河南职业技术学院 The processing method and processing device of hard disc of computer failure

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6327671B1 (en) * 1998-11-18 2001-12-04 International Business Machines Corporation Delta compressed asynchronous remote copy
CN101276302A (en) * 2007-03-29 2008-10-01 中国科学院计算技术研究所 Magnetic disc fault processing and data restructuring method in magnetic disc array system
CN106371947A (en) * 2016-09-14 2017-02-01 郑州云海信息技术有限公司 Multi-fault disk data recovery method for RAID (Redundant Arrays of Independent Disks) and system thereof
CN108345519A (en) * 2018-01-31 2018-07-31 河南职业技术学院 The processing method and processing device of hard disc of computer failure

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3822792A4 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488124A (en) * 2020-04-08 2020-08-04 深信服科技股份有限公司 Data updating method and device, electronic equipment and storage medium
CN111813588A (en) * 2020-06-01 2020-10-23 北京百卓网络技术有限公司 Computer hard disk fault positioning method, device, equipment and storage medium
CN111813588B (en) * 2020-06-01 2024-03-19 北京百卓网络技术有限公司 Computer hard disk fault positioning method, device, equipment and storage medium
CN113900594A (en) * 2021-10-12 2022-01-07 天津津航计算技术研究所 RAID control card S.M.A.R.T.information early warning method
CN115080340A (en) * 2022-05-13 2022-09-20 苏州浪潮智能科技有限公司 Method, system, computer device and storage medium for monitoring floppy disk array

Similar Documents

Publication Publication Date Title
JP7326379B2 (en) Hard disk failure countermeasures, array controllers, and hard disks
JP6294518B2 (en) Synchronous mirroring in non-volatile memory systems
WO2020048442A1 (en) Hard disk fault processing method, array controller and hard disk
CN111177040B (en) Storage device for sharing host memory, operation method thereof and storage system
US10459814B2 (en) Drive extent based end of life detection and proactive copying in a mapped RAID (redundant array of independent disks) data storage system
US9952795B2 (en) Page retirement in a NAND flash memory system
TWI428737B (en) Semiconductor memory device
TWI465904B (en) Semiconductor memory device
US20170308303A1 (en) Systems, Methods, and Computer Readable Media Providing Arbitrary Sizing of Data Extents
US8418029B2 (en) Storage control device and storage control method
US9348704B2 (en) Electronic storage system utilizing a predetermined flag for subsequent processing of each predetermined portion of data requested to be stored in the storage system
CN114600073A (en) Data reconstruction method and device applied to disk array system and computing equipment
BR112021002987B1 (en) HARD DISK FAILURE HANDLING METHOD, ARRAY CONTROLLER, AND HARD DISK
CN110659152B (en) Data processing method and equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19856725

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019856725

Country of ref document: EP

Effective date: 20210215

Ref document number: 20217006066

Country of ref document: KR

Kind code of ref document: A

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112021002987

Country of ref document: BR

ENP Entry into the national phase

Ref document number: 2021512508

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 112021002987

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20210218