Method and apparatus for managing a redundant array of independent disks
By detecting and resetting RAID storage device anomalies and storing write operation addresses during temporary errors, the problem of RAID performance degradation and downtime was resolved, achieving more efficient error handling and faster recovery.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-12
- Publication Date
- 2026-03-31
AI Technical Summary
Temporary errors during RAID I/O operations can lead to performance degradation and potential downtime. Existing technologies struggle to efficiently handle these temporary errors, resulting in wasted computing resources and time.
Detect storage device anomalies in the RAID, reset the anomaly device, and store the write operation address within a preset time period so that the RAID can be rebuilt when the device recovers, avoiding global scanning of degraded addresses.
It improves the efficiency of RAID in handling temporary errors, reducing the number of downtimes and the computing resources and time required for rebuilding.
Smart Images

Figure CN115206406B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of this disclosure relate to the field of computers, and more specifically, to methods, apparatus, electronic devices, computer-readable storage media, and computer program products for managing redundant arrays of independent disks (RAID). Background Technology
[0002] Redundant Array of Independent Disks (RAID) is a data storage virtualization technology that combines multiple physical storage devices (e.g., hard disk drives or solid-state drives) into a single logical unit for purposes of data redundancy, performance improvement, or both. Depending on the required level of redundancy and performance, data is distributed across physical storage devices in one of several ways known as RAID levels (e.g., RAID 0, RAID 1, RAID 5, etc.). In RAID I / O read / write operations, data is divided into blocks according to the corresponding RAID level and stored separately on the appropriate storage devices.
[0003] In some situations, the backend of a RAID array (such as a storage device) may enter a temporary error state during I / O operations (e.g., a glitch caused by power loss, firmware upgrade, hiccup, etc.), which may result in a retry error. However, the RAID array may continue to handle this error by retrying until the I / O operation times out, ultimately leading to system degradation, crashes, or data unavailability. Therefore, improved solutions are needed to enhance or optimize RAID performance in such cases. Summary of the Invention
[0004] According to a first aspect of this disclosure, a method for managing a Redundant Array of Independent Disks (RAID) is provided, comprising: detecting an anomaly in a storage device within the RAID; resetting the storage device in response to detecting the anomaly; and storing addresses of write operations to the RAID within a preset time period for rebuilding the RAID if the storage device recovers within the preset time period.
[0005] According to a second aspect of this disclosure, an apparatus for managing RAID is provided, comprising: an anomaly detection unit configured to detect an anomaly in a storage device within the RAID; and an anomaly handling unit configured to reset the storage device in response to detecting the anomaly; wherein the anomaly handling unit is further configured to store addresses of write operations to the RAID within a preset time period for rebuilding the RAID if the storage device recovers within the preset time period.
[0006] According to a third aspect of this disclosure, an electronic device is provided, comprising: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the device to perform the method according to a first aspect of this disclosure.
[0007] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided, including machine-executable instructions that, when executed by a device, cause the device to perform the method according to a first aspect of this disclosure.
[0008] According to a fifth aspect of this disclosure, a computer program product is provided, including machine-executable instructions that, when executed by a device, cause the device to perform the method according to a first aspect of this disclosure.
[0009] The summary section is provided to present the chosen concepts in a simplified form, which will be further described in the detailed description below. The summary section is not intended to identify key or essential features of this disclosure, nor is it intended to limit the scope of this disclosure. Attached Figure Description
[0010] The above and other objects, features and advantages of this disclosure will become more apparent from the accompanying drawings, in which like reference numerals generally denote like parts.
[0011] Figure 1 A schematic architecture diagram of a storage system according to an embodiment of the present disclosure is shown;
[0012] Figure 2 A schematic diagram of an exemplary layout of RAID according to an embodiment of the present disclosure is shown;
[0013] Figure 3 A schematic flowchart of a method for managing RAID according to an embodiment of the present disclosure is shown;
[0014] Figure 4 A state diagram of RAID according to an embodiment of the present disclosure is shown;
[0015] Figure 5 A schematic flowchart of a method for handling RAID anomalies according to an embodiment of the present disclosure is shown;
[0016] Figure 6 A schematic flowchart of a method for processing write operations for RAID according to embodiments of the present disclosure is shown;
[0017] Figure 7 A schematic flowchart of a method for rebuilding RAID according to an embodiment of the present disclosure is shown;
[0018] Figure 8 A schematic block diagram of an apparatus for managing RAID according to embodiments of the present disclosure is shown; and
[0019] Figure 9 A schematic block diagram of an example device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0020] Preferred embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.
[0021] The term "comprising" and its variations as used herein signify open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "at least partially based on". The terms "one example embodiment" and "one embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0022] Traditionally, temporary errors in storage systems can cause RAID to degrade or even crash, and rebuilding the RAID after the error is cleared requires significant computing resources and time. These factors contribute to a decrease in RAID performance.
[0023] The inventors noted that such temporary errors are likely to last only a short time (a few seconds to tens of seconds), and that storage devices can recover from temporary errors and return to online with a simple reset. Based on this understanding, this disclosure provides an improved storage management scheme for RAID-based storage systems. According to this scheme, when an I / O error or anomaly occurs in a storage device, the RAID can enter a temporary degraded state and reset the storage device. In the temporary degraded state, the addresses of write operations to the RAID can be stored so that when the storage device recovers, the stored addresses of the write operations can be used to rebuild the RAID, without having to scan the entire RAID to determine the degraded addresses. This allows for more efficient handling of RAID I / O errors and anomalies, reduces the number of RAID downtimes caused by device failures or backend issues, and significantly reduces the computational resources and time required to rebuild the RAID.
[0024] The following is for reference Figures 1 to 9 The implementation details of this disclosure are described in detail. First, an example basic architecture and data layout of a RAID-based storage system are introduced.
[0025] Figure 1 A schematic architecture diagram of a storage system 100 according to an embodiment of the present disclosure is shown. Figure 1 As shown, storage system 100 includes a hardware storage pool 140, which includes a plurality of storage devices 142-1, 142-2, 142-3, ..., 142-N (N is an integer greater than 1), etc., to provide physical storage space for storage system 100. For ease of discussion, these storage devices are sometimes collectively referred to or separately as storage device 142 or storage disk 142 (these terms are used interchangeably in this disclosure). Storage device 142 may include various types of devices with storage capabilities, including but not limited to, hard disks (HDDs), solid-state drives (SSDs), removable disks, compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, Blu-ray discs, Serial Attached Small Computer System Interface (SCSI) storage disks (SAS), Serial Advanced Technology Attached (SATA) storage disks, any other magnetic storage devices, and any other optical storage devices, or any combination thereof.
[0026] The RAID controller 130 in storage system 100 is built on top of multiple storage devices 142 to organize the physical storage space of the storage disks 142 using RAID algorithms. The RAID controller 130 may have a mapping function to manage the mapping between physical addresses and logical addresses in storage system 100. The RAID controller 130 provides a flat linear logical address space to the upper-level processing unit 110.
[0027] The processing unit 110 uses the logical address space provided by the RAID controller 130 to perform I / O operations on the storage system 100. Specifically, the processing unit 110 can send an I / O request including a logical address to the RAID controller 130. The RAID controller 130 uses a mapping function to find the physical address of the data targeted by the I / O request (the address where the data is written or read) and performs the actual I / O operation on the back-end storage disk 142.
[0028] Storage system 100 also includes memory 120 (also referred to as RAM or main memory). Memory 120 is used to store data that is accessed by processing unit 110 with minimal latency. Data in memory 120 is typically non-persistent and is deleted when storage system 100 loses power.
[0029] It should be understood that Figure 1The units, modules, or components in the storage system 100 that are relevant to embodiments of this disclosure are shown only schematically. Figure 1 The components shown are merely an example storage system management architecture. In other RAID-based storage systems, there may be other architectural partitioning methods, other units, modules, or components used for other functions, and so on. Therefore, the embodiments disclosed herein are not limited to... Figure 1 The description does not refer to any specific device, unit, module, or component, but is generally applicable to any RAID-based storage system. Figure 1 The various components shown (except for hardware storage disk 142) can be implemented in one or more computing devices.
[0030] The following is for reference Figure 2 Describe how data is stored in RAID. Figure 2 In the following discussion, for illustrative purposes, exemplary embodiments of this disclosure are described using the RAID 5 type. However, it should be understood that exemplary embodiments of this disclosure can be similarly applied to any other type of RAID.
[0031] Figure 2 A schematic diagram of an exemplary layout 200 of RAID according to an embodiment of the present disclosure is shown. Figure 2 In this RAID configuration, each storage disk 142 is divided into several storage blocks 202 according to a preset size, and multiple data blocks across multiple storage disks form several stripes 242-0, 242-1, 242-2, 242-3, 242-3, 242-4, 242-5, 242-6...242-M (collectively referred to as stripes 242). Therefore, the RAID physical storage space is divided into multiple stripes. Stripes are sometimes also referred to as physical large blocks (PLBs). Each stripe can have the same size, for example, 2MB.
[0032] Each stripe 242 has multiple storage blocks 202, each allocated for storing data and checksum information calculated using a certain encoding algorithm. Data in one or more storage blocks within a stripe 242 can be calculated from data in other storage blocks within the same stripe. Figure 2 In each stripe 242, the storage blocks allocated for storing data are marked with "D" (the storage blocks storing data in the stripe are also numbered accordingly), while the storage blocks allocated for storing parity information are marked with "P". The number of storage blocks storing data and storage blocks storing parity information in each stripe 242 depends on the RAID type. Figure 2In the RAID 5-based stripe 242 shown, four storage blocks 202 are used to store data, while another storage block 202 is used to store parity information. In this case, for a RAID with a stripe size of 2MB, each storage block is 512KB in size.
[0033] By using parity information, RAID-based storage systems allow the recovery of contents from failed storage disks using blocks from other disks in the event of a disk failure. For example, if disk 0 fails, rendering its blocks inaccessible, the contents of those blocks can be recovered using disks 1 through 4. Specifically, for stripe 242-0, P can be calculated using blocks D3, D2, D1, and D0; for stripe 242-1, D4 can be calculated using blocks P, D7, D6, and D5, and so on.
[0034] In some embodiments, the positions of the storage blocks 202 used for storing verification information in different stripes 242 can be rotated cyclically between different storage disks 142. For example, in Figure 2 In stripe 242-0, the storage block 202 used to store verification information is located on storage disk 0; in stripe 242-1, the storage block 202 used to store verification information is located on another storage disk 1; in stripe 242-2, the storage block 202 used to store verification information is located on a different storage disk 2, and so on. As data is written, the storage blocks in stripe 242 are used to store data and corresponding verification information in a similar layout.
[0035] It should be understood that Figure 2 This is only a layout based on the RAID 5 type striping. Other RAID types may have different striping layouts. In some embodiments, in RAID based on other RAID types, each stripe may also have two or more storage blocks for storing parity information. For example, in a RAID 6 type RAID, each stripe includes six storage blocks, of which four are used to store data and two are used to store parity information.
[0036] During the operation of storage system 100, if a storage disk 142 becomes offline due to factors such as a brief interruption, failure, or removal, all storage blocks 202 of that disk 142 are marked as faulty, and storage system 100 enters a degraded state. In this state, I / O access (read and write) to each stripe 242 is affected due to the presence of the faulty storage disk. While storage system 100 is in a degraded state, I / O read and write operations can still be performed, but access to the faulty storage disk must be avoided. For read operations, if the storage block of the faulty disk is a data block (D), the data to be read must be recovered using storage blocks from other good storage disks; for write operations, the write operation will be marked as a degraded write operation, and the corresponding address will also be marked as degraded. After the fault in storage system 100 is resolved, the RAID will be rebuilt for the addresses of the degraded write operations.
[0037] Therefore, such as Figure 2 As shown, each storage disk 142 also includes storage blocks for storing metadata, which form stripes 242-M across multiple storage disks. The storage blocks storing metadata can be located in designated areas of each storage disk 142 and are protected from being used to store user data (e.g., as shown in stripes 0 to 6). The metadata can record status information about the storage devices in the RAID and information about the stripe status, such as identifiers of faulty or abnormal storage devices, the stripe status (normal or degraded), and the identifier of the storage device where the stripe's parity data is located.
[0038] Figure 3 A schematic flowchart of a method 300 for managing RAID according to an embodiment of the present disclosure is shown. In some embodiments, method 300 may be implemented at storage system 100, particularly at RAID controller 130. Thus, method 300 may be implemented, for example, by a computing device that implements storage system 100 or RAID controller 130.
[0039] In box 310, anomalies in the storage devices within the RAID are detected. Typically, a RAID can enter a degraded state in response to an anomaly detection. Traditional storage systems degrade the RAID upon receiving a failure event (e.g., a timeout) from a storage device. However, the storage system may have been experiencing performance degradation for an extended period without being addressed. In some embodiments, an anomaly is considered to exist when a back-end storage device (a storage disk) continuously returns retryable errors. For example, an anomaly is determined when an I / O operation (read or write operation) on a storage device produces more than a threshold number of retryable errors—for instance, three, five, or more retryable errors. To this end, a counter can be set for the I / O operations in the RAID to record retryable errors; when the counter reaches the set threshold, an anomaly is reported. This allows for earlier anomaly handling without waiting for a timeout error to occur.
[0040] In some embodiments, a malfunction in the storage device is determined in response to receiving a timeout error for an I / O operation from the backend storage device. It should be understood that the timeout error explicitly indicates a malfunction in the storage device.
[0041] In some embodiments, when RAID detects a slowdown in I / O operations on a storage device, it determines that the storage device is malfunctioning. The completion times of I / O operations on backend storage devices over a recent period (e.g., 1 minute, 5 minutes, 10 minutes, half an hour, etc.) can be collected, and the average completion time can be calculated. For example, if the average completion time of a read operation is greater than a preset threshold time, an anomaly is determined; similarly, if the average completion time of a write operation is greater than another preset threshold time, an anomaly is determined. As another example, the average completion time of read or write operations on all storage devices over a recent period can be calculated and compared; if the average completion time of I / O operations on a storage device is significantly slower than that of other storage devices, the storage device is determined to be malfunctioning. As yet another example, the average completion time of read or write operations on a single storage device over a recent period can be calculated and compared to the storage device's historical average completion time; if it is significantly slower than the historical average time, the storage device is determined to be malfunctioning.
[0042] like Figure 3 As shown in box 320, in response to detecting an anomaly, the storage device is reset. According to embodiments of this disclosure, the storage device may recover from the error or anomaly after being reset, thereby returning to online. Therefore, RAID can recover from temporary errors more quickly, without having to wait for a timeout error to occur. The following will refer to... Figures 4 to 8 The exception handling process according to embodiments of this disclosure will be described in detail below. First, the state transition of RAID due to an exception will be described.
[0043] Figure 4 A state diagram 400 of a RAID according to an embodiment of the present disclosure is shown. It is assumed that the RAID is initially in a normal state 410, for example, as... Figures 1 to 2 The exemplary RAID 5 type described performs I / O operations. In response to detecting an anomaly in the storage device in the RAID, the RAID will mark the storage device in its metadata and transition from a normal state 410 to a degraded state, initially entering a temporary degraded state 420.
[0044] After entering temporary degradation state 420 and passing through a preset time period T1 (e.g., 30 to 60 seconds, but not limited to this), the RAID can enter formal degradation state 430. If the faulty storage device comes back online within the preset time period T1 of temporary degradation state 420, or within the standby time T2 of formal degradation state 430 (e.g., 5 to 10 minutes, but not limited to this), the RAID enters rebuild state 440. Alternatively, if the RAID still fails to come back online after the standby time period T2, the RAID can switch to using a standby storage device or standby disk to replace the faulty storage device, also entering rebuild state 440.
[0045] In addition, such as Figure 4 As shown, in the temporary degraded state 420, the addresses of write operations to the RAID in the degraded state can be stored, for example, in a storage area 450 of the memory 120. After describing the various states of RAID and their transitions according to embodiments of the present disclosure, refer to... Figures 5 to 8 Further describe the actions related to the RAID status.
[0046] Figure 5 A schematic flowchart of a method 500 for handling RAID anomalies according to an embodiment of the present disclosure is shown. In block 510, it is determined whether an anomaly of the storage device has been detected. As described above, the anomaly is determined to have been detected based on one or more of the following: the number of retryable errors generated by I / O operations on the storage device, timeout errors generated by the storage device, and the completion time of I / O operations on the storage device.
[0047] In block 520, RAID is degraded to prevent I / O operations to the storage device. In some embodiments, RAID first marks the faulty storage device and transitions from normal state 410 to temporary degraded state 420. In temporary degraded state 420, all I / O operations to the RAID are marked as degraded I / O operations, preventing access to the faulty or erroneous storage device; for example, no I / O operations are generated for that storage device. However, I / O operations to the RAID can still continue in temporary degraded state 420.
[0048] To implement the temporary degraded state 420, an indicator (e.g., a bit) can be set in memory (e.g., memory 120) to indicate whether the RAID is in the temporary degraded state 420. During the temporary degraded state 420, the indicator is set (e.g., set to a value of 1), and in the case of distributed RAID, the indicator can be synchronized among multiple nodes within the RAID. As described above, the temporary degraded state 420 can last for a period of time T1 (e.g., 30 seconds to 1 minute), and after T1, the indicator can be cleared (e.g., set to a value of 0), indicating that the RAID is no longer in the temporary degraded state 420.
[0049] In box 530, once the temporary degraded state 420 is entered, the storage device is reset. For example, control codes can be sent from the RAID controller 130 to the storage device's control platform to reset the storage device. Resetting the storage device can be, for example, restarting it, which typically takes several seconds. After the reset, the storage device may recover from the anomaly and come back online, thus the RAID can enter the rebuild state 440, as... Figure 4 As shown.
[0050] During this period, although the RAID is in a temporary degraded state 420, it can still receive I / O operations. For I / O read operations, the RAID can read data from other storage devices without generating I / O for the marked faulty storage device. When the marked storage device is storing verification data, it can directly obtain the complete data from other devices; otherwise, it can use data from other storage devices to calculate the data on the marked storage device using an encoding algorithm, thereby obtaining the complete data.
[0051] Traditionally, to maintain data consistency, stripes of write operations during a degradation period are marked as "degraded," for example, by setting corresponding degradation information in the metadata. Then, when the storage device or a replacement storage device comes back online and the RAID is rebuilt, the degraded stripes are determined by scanning all the RAID metadata, thereby recovering the corresponding data blocks and achieving stripe data consistency. The problem with this approach is that, in cases where the degradation time is very short (e.g., a hiccup occurs), although there are fewer write operations in the degraded state, all stripes must be scanned every time the RAID is rebuilt, requiring significant computational resources and time, thus impacting RAID performance. To address this, according to embodiments of this disclosure, the addresses of write operations during temporary degradation are stored for direct use in subsequent rebuild phases.
[0052] like Figure 3 In box 330, the addresses of write operations to the RAID within a preset time period are stored for rebuilding the RAID should the storage device recover within the preset time period. See below for reference. Figure 6 Describe in detail the handling of write operations.
[0053] Figure 6 A schematic flowchart of a method 600 for processing a write operation for RAID according to an embodiment of the present disclosure is shown. At block 610, a write operation is received. In some embodiments, the RAID controller may receive a write operation for RAID from the processing unit 110. The write operation may include the physical address of the RAID, such as the physical address of a stripe. As described above, the RAID physical storage space is divided into multiple stripes (also referred to as physical large blocks, PLBs). Alternatively, the address in the write operation may also be a logical address, which may be mapped by the RAID controller to the physical address of the RAID.
[0054] In box 620, it is determined whether the RAID is in a temporary degraded state. In some embodiments, it can be determined whether the RAID is in a temporary degraded state 420 by querying a set indicator. This indicator is set when the RAID transitions from a normal state to a temporary degraded state 420. As described above, the temporary degraded state 420 can last for a period of time T1 (e.g., 30 seconds to 1 minute).
[0055] If it is determined that the RAID is in a temporary degraded state 420, then in box 630, the address of the write operation is stored. In some embodiments, the address of the write operation can be stored in a storage area of the memory, for example, the address of the stripe or PLB to which the write operation is targeted. The size of the storage area can depend on a preset time period T1 of the configured temporary degraded state. For example, for a T1 of about 30 seconds to 1 minute, a storage area of about 2 to 4 MB can be set to store the address of the write operation. According to embodiments of this disclosure, when the storage device recovers within the preset time period, the stored address of the write operation will be used to rebuild the RAID.
[0056] If it is determined that the RAID is not in a temporary degraded state 420, then in box 640, a degraded write operation is performed. At this time, no write operations are performed on storage devices that are malfunctioning or faulty; for example, no I / O operations are generated for that storage device.
[0057] After time period T1, the temporary degradation 420 ends, and the formal degradation 430 begins. At this point, the indicator in memory indicating the temporary degradation state can be cleared, for example, set to a value of 0. In some embodiments, the stored address can be cleared. That is, when transitioning from the temporary degradation state 420 to the rebuild state, the stored write operation address is used to rebuild the RAID, but when transitioning from the formal degradation state 430 to the rebuild state 440, the stripes to be rebuilt are determined by scanning the RAID.
[0058] It should be noted that because it is unknown whether a faulty storage device can quickly come back online after a reset, when the RAID is in a degraded state (whether it is a temporary or formal degrade), stripes related to write operations are marked as degraded. For example, the metadata of the stripe indicates that the stripe is degraded.
[0059] According to embodiments of this disclosure, a RAID can be restored from a degraded state 420, 430 to a normal state 410 by performing a RAID reconstruction process. Specifically, for RAID consistency, reconstruction is performed for write operations in the degraded state, and the addresses of the stored write operations can be used to perform the reconstruction. The following refers to... Figure 7 Describe the reconstruction process.
[0060] Figure 7 A schematic flowchart of a method 700 for rebuilding RAID according to an embodiment of the present disclosure is shown.
[0061] In box 710, a rebuild command is obtained. In some embodiments, the storage device can recover during the temporary degradation period by resetting and signaling readiness to the RAID controller. Alternatively, the storage device may recover during the formal degradation period after the temporary degradation period T1, in which case it may also signal readiness to the RAID controller. Furthermore, if the storage device still fails to recover after entering the formal degradation state and after the formal degradation period T2 has elapsed, and a standby storage device is used, it may also signal standby device readiness to the RAID controller. In either of these cases, the RAID controller obtains a rebuild command to begin the rebuild process.
[0062] In box 720, it is determined whether the RAID is in a temporary degraded state. Specifically, this can be determined by querying an indicator in memory. As described above, during the temporary degrade time T1, the indicator is set (e.g., set to a value of 1); after time T1 has elapsed, the indicator is reset (e.g., set to a value of 0), indicating that the RAID has left the temporary degraded state.
[0063] If the RAID is in a temporary degraded state, then in box 730, the stored addresses are used to rebuild the RAID. In some embodiments, the addresses of write operations during the temporary degrade can be obtained iteratively. For example, first, the smallest stripe address is obtained, and the corresponding stripe is rebuilt based on that stripe address; then, the next stripe address is obtained, and so on, until all addresses have been rebuilt.
[0064] If the RAID is not in a temporary degraded state, then in box 740, the RAID is scanned to determine the degraded addresses. In some embodiments, the degraded stripes within the RAID can be determined by querying the RAID's metadata. This would take more time than simply using the addresses of stored write operations.
[0065] In box 750, reconstruction is performed using the determined degraded addresses. According to embodiments of this disclosure, the process of rebuilding using addresses in memory and using addresses determined by scanning the RAID is similar. Specifically, an encoding algorithm is used to recover the storage blocks of the re-enabled storage devices from the storage blocks of other storage devices on the stripe.
[0066] As can be seen, if the storage device recovers from a temporary degraded state, the reconstruction only needs to process the stripes that have been degraded by write operations, and does not have to access all stripes, thus enabling faster RAID reconstruction.
[0067] Reference above Figures 3 to 7A method for managing RAID according to embodiments of the present disclosure is described. Compared to existing solutions, it can efficiently handle such temporary RAID errors, reduce the number of RAID outages caused by storage devices or the backend, and significantly reduce the computing resources and time required to rebuild the RAID.
[0068] Figure 8 A schematic block diagram of an apparatus 800 for managing RAID according to an embodiment of the present disclosure is shown. The apparatus 800 can be arranged in a storage system 100, and particularly implemented in a RAID controller 130. Therefore, the apparatus 800 can be implemented, for example, by a computing device that implements the storage system 100 or the RAID controller 130.
[0069] As shown in the figure, the device 800 includes an anomaly detection unit 810, an anomaly handling unit 820, and a reconstruction unit 830. The anomaly detection unit 810 is configured to detect anomalies in storage devices within a RAID array. In some embodiments, the anomaly detection unit 810 may detect anomalies based on the number of retryable errors generated by I / O operations on the storage device. For example, the number of retryable errors generated by I / O operations reaches a threshold, such as 3, 5, or more times. In some embodiments, the anomaly detection unit 810 may detect anomalies based on timeout errors generated by the storage device. It should be understood that timeout errors explicitly indicate an anomaly in the storage device. Furthermore, the anomaly detection unit 810 may also detect anomalies based on the completion time of I / O operations for the RAID array. The completion time of I / O operations can be the average completion time of I / O operations over a recent period. For example, when the completion time of a storage device exceeds a certain threshold, or is significantly slower than other storage devices or compared to historical completion times, it is determined that the storage device is anomaly.
[0070] An exception handling unit 820 is configured to store the address of a write operation to the RAID in response to the detection of an exception. In some embodiments, the exception handling unit 820 may be configured to reset the storage device in response to the detection of the exception. For example, the exception handling unit 820 may send a control code to a control platform to restart the storage device.
[0071] The exception handling unit 820 is also configured to store the addresses of write operations to the RAID within a preset time period for rebuilding the RAID if the storage device recovers within the preset time period. In some embodiments, the preset time period is the duration of the aforementioned temporary degraded state. When the storage device recovers from the temporary degraded state by resetting, the stored addresses of the write operations can be used to rebuild the RAID. The addresses of the write operations can be, for example, physical addresses of RAID stripes or PLBs, or logical addresses that can be mapped to physical addresses.
[0072] Furthermore, the exception handling unit 820 can also be configured to cause the RAID to enter a degraded state to prevent I / O operations on the storage device. According to embodiments of this disclosure, the RAID first transitions to a temporary degraded state. Specifically, for example, the exception handling unit 820 can set an indicator to a value of 1 when the RAID enters the temporary degraded state, and to a value of 0 when the RAID leaves the temporary degraded state and enters the formal degraded state.
[0073] In some embodiments, the exception handling unit 820 may also be configured to mark the address of a write operation to a degraded RAID (whether temporary or permanent). For example, the metadata of that address may be updated to indicate that the address is degraded.
[0074] The reconstruction unit 830 can be configured to rebuild the RAID based on stored addresses when the storage device recovers from an anomaly. In some embodiments, the reconstruction unit 830 rebuilds the RAID based on stored addresses when the storage device recovers within a preset time period T1 (e.g., approximately 30 seconds to 1 minute), for example, when the RAID is still in a temporary degraded state. Alternatively, if the storage device does not recover after the preset time T1, for example, during a formal degrade period after the temporary degrade has ended, or even after a period T2 (e.g., approximately 5 to 10 minutes) following the formal degrade, the reconstruction unit 830 rebuilds the RAID based on the degraded addresses of the RAID.
[0075] Similarly, compared to existing solutions, the device 800 disclosed herein can efficiently handle such temporary errors in RAID, reduce the number of RAID outages caused by storage devices or back-end systems, and significantly reduce the computational resources and time required to rebuild the RAID.
[0076] Figure 9 A schematic block diagram of an example device 900 that can be used to implement embodiments of the present disclosure is shown. For example, a backup system and / or recovery system according to embodiments of the present disclosure can be implemented by device 900. As shown, device 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 902 or loaded from storage unit 908 into random access memory (RAM) 903. Various programs and data required for the operation of device 900 may also be stored in RAM 903. CPU 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.
[0077] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0078] The various processes and handling described above, such as method 200 and / or method 700, can be executed by processing unit 901. For example, in some embodiments, method 200 and / or method 700 can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by CPU 901, one or more actions of method 200 and / or method 700 described above can be performed.
[0079] This disclosure can be a method, apparatus, system, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure.
[0080] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0081] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0082] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0083] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0084] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0085] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0086] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0087] Various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method of managing a redundant array of independent disks (RAID), comprising: detecting an anomaly of a storage device in the RAID; in response to detecting the anomaly, setting a RAID stripe in the RAID to a degraded state, the RAID stripe comprising a storage location of the storage device; in response to detecting the anomaly, resetting the storage device; and in response to setting the RAID stripe to the degraded state, storing addresses of write operations to the RAID for a preset time period for rebuilding the RAID in case the storage device recovers within the preset time period. 2.The method of claim 1, wherein detecting the anomaly of the storage device in the RAID comprises detecting at least one of: a number of retryable errors generated for input / output (I / O) operations to the storage device, a timeout error generated by the storage device, and a completion time of I / O operations to the storage device. 3.The method of claim 1, further comprising: after the preset time period elapses, clearing the stored addresses. 4.The method of claim 1, further comprising: in response to detecting the anomaly, degrading the RAID to block I / O operations to the storage device. 5.The method of claim 4, further comprising: flagging addresses of write operations to the degraded RAID as degraded for rebuilding the RAID in case the storage device does not recover within the preset time. 6.An apparatus of managing a redundant array of independent disks (RAID), comprising: an anomaly detecting unit configured to detect an anomaly of a storage device in the RAID; and an anomaly handling unit configured to, in response to detecting the anomaly, set a RAID stripe in the RAID to a degraded state, the RAID stripe comprising a storage location of the storage device; wherein the anomaly handling unit is further configured to, in response to detecting the anomaly, reset the storage device; wherein the anomaly handling unit is further configured to, in response to setting the RAID stripe to the degraded state, store addresses of write operations to the RAID for a preset time period for rebuilding the RAID in case the storage device recovers within the preset time period. 7.The apparatus of claim 6, wherein the anomaly detecting unit is further configured to detect at least one of: a number of retryable errors generated for I / O operations to the storage device, a timeout error generated by the storage device, and a completion time of I / O operations to the storage device. 8.The apparatus of claim 6, wherein the anomaly handling unit is further configured to, after the preset time period elapses, clear the stored addresses. 9.The apparatus of claim 6, wherein the anomaly handling unit is further configured to: in response to detecting the anomaly, degrade the RAID to block I / O operations to the storage device. 10. The apparatus of claim 9, wherein the exception handling unit is further configured to: flag addresses of write operations to the degraded RAID as degraded for rebuilding the RAID in case the storage device does not recover within the preset time.
11. An electronic device, comprising: at least one processing unit; at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions which, when executed by the at least one processing unit, cause the device to carry out the method according to any one of claims 1 to 5.
12. A computer-readable storage medium comprising machine executable instructions that, when executed by a device, cause the device to carry out the method according to any one of claims 1 to 5.
13. A computer program product comprising machine executable instructions that, when executed by a device, cause the device to carry out the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Storage system
CN109313593A
Data writing apparatus, data writing / reading apparatus, data writing method and data writing / reading method
US20040062093A1
Clustered disk error recovery
US20190146890A1