A Fast Reconfiguration System and Method for MD RAID
By designing a striped bitmap and hot spare space manager, the MD RAID system solves the problem of slow MD RAID reconstruction, improves reconstruction efficiency and enhances system reliability, and achieves rapid reconstruction and self-healing capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING INST OF COMP TECH & APPL
- Filing Date
- 2022-11-24
- Publication Date
- 2026-06-05
AI Technical Summary
MD RAID has low data reconstruction efficiency, especially when reconstructing large-capacity hard drives, which takes a long time, affecting business performance and increasing the risk of data loss.
Design a system that includes a striped bitmap, a file system analyzer, and a hot spare space manager. By recording the storage space status and dynamically reorganizing the hot spare space, concurrent reconstruction can be achieved to improve reconstruction efficiency.
It shortens reconstruction time, improves RAID reliability and reconstruction efficiency, reduces invalid reconstructions, and achieves self-healing capability without a hot spare disk.
Smart Images

Figure CN115878032B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data storage technology, specifically relating to an MD RAID fast reconstruction system and method. Background Technology
[0002] RAID (Redundant Array of Independent Disks) is widely used in storage systems and has various implementations. MD RAID, as one of the important open-source RAID implementations, is also a major driver module of the Linux kernel. The biggest problem with MD RAID is that its reconstruction efficiency is limited by the performance of the hot spare disk. Reconstructing large-capacity hard drives takes a long time, increasing the risk of data loss and severely impacting business performance during the reconstruction process. To address the problems of traditional RAID, new-generation RAID architectures have emerged, such as RAID 2.0 and RAIDZ. These architectures divide and reassemble hard drive space, with multiple disks participating in the reconstruction, greatly improving reconstruction speed. Although MD RAID lags significantly behind these new-generation RAID architectures, its compatibility and stability remain excellent. Therefore, designing and developing a new generation of RAID systems based on MD RAID is of great significance for the complex software and hardware environment in China. Summary of the Invention
[0003] (a) Technical problems to be solved
[0004] To address the issue of slow data reconstruction in MD RAID, a novel RAID reconstruction architecture and method are proposed.
[0005] (II) Technical Solution
[0006] To address the aforementioned technical problems, this invention provides a design method for a fast MD RAID reconstruction system, which includes a striped bitmap, a file system analyzer, and a hot spare space manager. The striped bitmap records the storage space used by the RAID system and, in conjunction with the file system analyzer, can locate the effective data storage location, providing a foundation for data reconstruction. The hot spare space manager dynamically reconstructs hot spare space when a hard drive failure occurs in the array, recovers lost data, and redundantly stores it in the hot spare space to achieve concurrent reconstruction.
[0007] Preferably, the stripe bitmap is designed as a set of bitmaps representing the state of all stripes, with each bit of the bitmap corresponding to one stripe, where 0 indicates that the data in the storage space corresponding to the stripe is invalid, and 1 indicates that the stripe has been used.
[0008] Preferably, after the RAID system obtains the address range of each logical volume, the file system analyzer can parse the file system and its valid data distribution on the logical volume. If the file system cannot be parsed, all data is considered valid. If the file system is parsed, the data distribution on the logical volume can be used to obtain the valid data distribution of the RAID storage space through the address converter. In this process, combined with the stripe bitmap, a RAID valid data distribution bitmap with stripes as the smallest unit is obtained.
[0009] Preferably, the specific operation by which the file system analyzer obtains the effective data distribution in the RAID storage space is as follows:
[0010] 1) The bitmap is initially set to all 0s. When a write operation BIO falls on a stripe, the corresponding position in the stripe bitmap is set to 1.
[0011] 2) The superblock monitoring module in the file system analyzer responds to file system deletion operations. If the operation covers the entire stripe, it sets the corresponding position in the stripe bitmap to 0.
[0012] 3) If no valid file system logical volume is identified, the valid data is based on the data distribution of the striped bitmap; if a valid file system logical volume is identified, the valid data distribution is the OR of the file system analysis results and the striped bitmap.
[0013] Preferably, the hot spare space is a space in the free space of the remaining disks in the RAID used to store reconstructed data and newly written data. When a member disk of the RAID fails, the RAID is in a degraded state. The hot spare space manager can reorganize the remaining RAID space, that is, logically reorganize the member disks that have not failed into a hot spare space. The maximum capacity of the hot spare space is S*(N-1) / N, where S is the capacity of the failed disk and N is the number of RAID member disks before the failure. After the hot spare space is prepared, the RAID can reconstruct the lost data into the hot spare space.
[0014] The present invention also provides a system designed using the method described above.
[0015] The present invention also provides a rapid reconfiguration method using the system.
[0016] Preferably, in this method, before submitting data in a write operation, the method first determines whether the stripe has been initialized or reconstructed by checking the stripe bitmap. If the stripe has not been used, the stripe is initialized first.
[0017] During dynamic partial rebuilding, the RAID system selects the rebuilding RAID level based on system resources, prioritizing the following levels:
[0018] 1) Does the hot standby disk exist? If it does, the hot standby disk will participate in the partial restructuring.
[0019] 2) Prioritize rebuilding at the original RAID level.
[0020] Preferably, in this method, if a hot spare disk exists, it is further determined whether the capacity of the hot spare space is greater than 1 / 2 of the size of the lost valid data. If the hot spare space does not meet the requirements, the reconstruction process does not use the hot spare space, and the reconstruction speed is limited by the hot spare disk. If the hot spare space meets the requirements, the hot spare space and the hot spare disk participate in the reconstruction together for hybrid reconstruction. After the reconstruction is completed, the data in the hot spare space is migrated to the hot spare disk when the system is idle. If the hot spare disk does not exist, the size of the hot spare space is first determined in the reconstruction process. If the capacity is greater than the size of the lost valid data, the reorganization and reconstruction are initiated; otherwise, the process enters a degraded state.
[0021] The present invention also provides an application of the system in the field of data storage technology.
[0022] (III) Beneficial Effects
[0023] To reduce RAID reconstruction time and improve RAID reliability, this invention designs a system and method for partial RAID reconfiguration. This scheme uses striped bitmaps and a file system analyzer to detect valid data in the storage space, reducing invalid reconstructions and improving RAID reconstruction efficiency. For sparse storage spaces, it significantly shortens reconstruction time. Simultaneously, it introduces a dynamic partial reconfiguration scheme to reconstruct lost valid data into a new RAID space, leveraging the concurrency advantages of multiple disks in the array and achieving self-healing of the RAID system without a hot spare disk. Attached Figure Description
[0024] Figure 1 This is a diagram of the rapid RAID system architecture of the present invention;
[0025] Figure 2 This is a design diagram of the strip bitmap for the present invention;
[0026] Figure 3 This is a schematic diagram of the effective data sensing design principle of the present invention;
[0027] Figure 4 This is a schematic diagram of the RAID partial reconstruction principle of the present invention;
[0028] Figure 5 This is a flowchart of the dynamic selection process for hot standby space RAID level in this invention;
[0029] Figure 6 This is a flowchart of the RAID fast reconfiguration process of the present invention. Detailed Implementation
[0030] To make the objectives, contents, and advantages of the present invention clearer, the specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples.
[0031] This invention proposes a fast MD RAID reconstruction system and method. The system aims to solve the problem of slow data reconstruction in MD RAID and proposes a new RAID architecture. Figure 1 As shown, this invention adds a middleware layer to the traditional RAID driver: a stripe bitmap, a file system analyzer, and a spare manager. The stripe bitmap records the storage space used by the RAID system, and in conjunction with the file system analyzer, it can accurately locate the effective data storage location, providing a foundation for efficient data reconstruction. The spare manager dynamically reconstructs hot spare space when a hard drive fails, recovering lost data and redundantly storing it in this hot spare space to achieve concurrent reconstruction, reaching the reconstruction effect of RAID 2.0 and improving the reliability of the array. This invention provides a new solution for next-generation RAID systems.
[0032] Striped bitmap design:
[0033] To enable fine-grained management of RAID data space, this invention designs a set of bitmaps representing the states of all stripes. Figure 2 This describes the specific design of the bitmap. Each bit in the bitmap corresponds to a stripe, where 0 indicates that the data in the corresponding storage space is invalid, and 1 indicates that the stripe has been used.
[0034] Effective data-aware design:
[0035] To address the issue of effective data management and improve RAID reconstruction efficiency, this invention designs an effective data awareness mechanism that avoids reconstructing unnecessary data by sensing the location of valid data. For example... Figure 3 As shown, RAID interacts with the logical volume management tool to obtain the address range of each logical volume. The file system analyzer parses the file system and its valid data distribution on the logical volume. If no file system is parsed, all data is considered valid; if a file system is parsed, the data distribution on the logical volume is converted to the valid data distribution of the RAID storage space using an address translator (part of the file system analyzer, used to convert relative addresses on the logical volume to addresses on the RAID). Because the client's file system has a cache, the file system analysis from the storage end cannot reflect the data distribution in real time. It needs to be combined with a stripe bitmap to obtain a RAID valid data distribution bitmap with stripes as the smallest unit. The specific operations for obtaining the valid data distribution in the RAID storage space are as follows:
[0036] 1. The bitmap is initially set to all 0s. When a write operation BIO falls on a stripe, the corresponding position in the stripe bitmap is set to 1.
[0037] 2. The superblock monitor module in the file system analyzer responds to file system deletion operations. If the operation covers the entire stripe, it sets the corresponding position in the stripe bitmap to 0.
[0038] 3. No valid file system logical volume was identified; valid data is based on the data distribution of the striped bitmap.
[0039] 4. Logical volumes of the file system are identified. To ensure no data is missed, the effective data distribution is the OR of the file system analysis results and the stripe bitmap.
[0040] RAID partial rebuild design:
[0041] This invention improves the reconstruction speed of MD RAID through partial RAID reorganization. Partial reorganization does not create a new block device, but rather allocates a space within the remaining free space of the RAID disks to store reconstructed data and newly written data. This space can also be called hot spare space. This space differs from general hot spare space in that it does not reserve storage space; it is a broad definition of hot spare space. The hot spare space in this invention refers to this broad definition. The data organization format of the hot spare space differs from that of the primary space, and it can flexibly create redundancy levels based on remaining resources. Assuming the RAID has 4 member disks and level 5, then a stripe contains 3 data items and 1 parity item. Figure 4 As shown, when the fourth disk fails, the RAID is in a degraded state. The spare manager reassembles the remaining RAID space, logically combining the first three disks into a new RAID (hot spare space). The maximum capacity of the hot spare space is S*(N-1) / N, where S is the capacity of the failed disk and N is the number of RAID member disks before the failure. After the hot spare space is prepared, the RAID can reconstruct the lost data into the hot spare space. Since the reconstruction process involves multiple disks, it can achieve concurrency and fast reconstruction.
[0042] After reconstruction, the redundancy level of the RAID becomes the minimum redundancy level of the original RAID and the hot spare space. If data is lost on another hard drive at this time, the data recovery process is as follows: first, the hot spare space data is reconstructed, and then the original RAID data is recovered using the reconstructed hot spare space data.
[0043] Write request processing:
[0044] In MD RAID, RAID4, RAID5, and RAID6 have two modes: rebuild write and read-modify write. Rebuild write requires all disks to participate, resulting in a large write penalty; read-modify write only requires writing data to the corresponding location and updating the parity data, resulting in a relatively small write penalty. For this non-full-disk rebuild method (valid data rebuild), if the stripe has not been rebuilt before use, read-modify write cannot guarantee the consistency of the stripe data. When a hard drive failure occurs, the recovered data will be inconsistent with the lost data. Therefore, before committing data in a write operation, it is necessary to determine whether the stripe has been initialized / rebuilt by checking the stripe bitmap. If the stripe has not been used, it should be initialized first.
[0045] Dynamic local reorganization:
[0046] The partial reconfiguration function of this invention provides an address space during reconfiguration to store lost and newly written data. This address space (i.e., hot spare space) stores data according to a certain RAID level, ensuring that the RAID still has data redundancy after reconfiguration. In this case, the RAID is a hybrid RAID structure. Partial reconfiguration can select the redundancy level based on system resources, or the user can reserve a specified level of hot spare space. The latter is generally for RAID systems without a hot spare disk.
[0047] RAID reconfigures the RAID level based on system resources, prioritizing the following order:
[0048] 1. Does the hot standby disk exist? If it does, the hot standby disk will participate in the partial restructuring.
[0049] 2. The original RAID level (RAID level is the redundancy level) will be prioritized for reconstruction. The difference between RAID levels lies in whether hot spare space can be allocated. The same space redundancy level (RAID level) will have different available capacity. If hot spare space can be allocated, the original RAID level (user's choice) will be prioritized.
[0050] 3. Required capacity: Different RAID levels have different available capacities.
[0051] Taking RAID 10 as an example, the process of selecting the RAID level for hot spare space is as follows: Figure 5 As shown, after the reconstruction is completed, if there is a hot spare disk in the system, the data in the hot spare space will be migrated to the hot spare disk when the system is idle, and the hot spare space will be dynamically released; if there is no hot spare disk, subsequent IO will store the original RAID data in the hot spare space, the hot spare space will increase dynamically, and gradually replace the original RAID to form a unified RAID level.
[0052] Rapid refactoring process:
[0053] This invention introduces the concept of hot spare space while retaining the MD RAID hot spare disk solution. Figure 6 The main process of rapid reconfiguration is described. When a hard drive in the RAID fails, the RAID enters a degraded state, and the reconfiguration process selects the best reconfiguration scheme based on system resources.
[0054] 1. A hot spare disk exists. The hot spare space capacity must be at least half the size of the lost valid data. When the hot spare space is insufficient, the reconstruction process cannot use the hot spare space and will proceed with normal reconstruction using the traditional MD RAID reconstruction method. The reconstruction speed is limited by the hot spare disk. When the hot spare space meets the requirements, it will participate in the reconstruction along with the hot spare disk, performing a hybrid reconstruction where all disks participate. After the reconstruction is complete, the data in the hot spare space will be migrated to the hot spare disk when the system is idle.
[0055] 2. The hot spare disk does not exist. The reconstruction process first determines the size of the hot spare space. If the capacity is greater than the size of the lost valid data, the reconstruction enters the reorganization phase; otherwise, it enters the degraded state.
[0056] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A fast reconstruction method implemented using an MD RAID fast reconstruction system, characterized in that, The system includes a striped bitmap, a file system analyzer, and a hot spare space manager. The striped bitmap is used to record the storage space used by the RAID system. Together with the file system analyzer, it can locate the effective data storage location and provide a basis for data reconstruction. The hot spare space manager is used to dynamically reconstruct hot spare space when a hard drive fails in the array. Lost data is recovered and redundantly stored in the hot spare space to achieve concurrent reconstruction. In this method, before the write operation submits the data, it first determines whether the stripe has been initialized or reconstructed by checking the stripe bitmap. If the stripe has not been used, it is initialized first. During dynamic partial rebuilding, the RAID system selects the rebuilding RAID level based on system resources, prioritizing the following levels: 1) Does the hot standby disk exist? If it does, the hot standby disk will participate in the partial restructuring. 2) Prioritize rebuilding at the original RAID level; In this method, if a hot spare disk exists, it is also determined whether the capacity of the hot spare space is greater than half the size of the lost valid data. If the hot spare space does not meet the requirements, the reconstruction process does not use the hot spare space, and the reconstruction speed is limited by the hot spare disk. If the hot spare space meets the requirements, the hot spare space and the hot spare disk participate in the reconstruction together for hybrid reconstruction. After the reconstruction is completed, the data in the hot spare space is migrated to the hot spare disk when the system is idle. If the hot spare disk does not exist, the size of the hot spare space is first determined in the reconstruction process. If the capacity is greater than the size of the lost valid data, the reorganization and reconstruction are initiated; otherwise, the process is degraded.
2. The method as described in claim 1, characterized in that, The stripe bitmap is designed as a set of bitmaps representing the state of all stripes. Each bit in the bitmap corresponds to one stripe, where 0 indicates that the data in the memory space corresponding to the stripe is invalid, and 1 indicates that the stripe has been used.
3. The method as described in claim 2, characterized in that, After the RAID system obtains the address range of each logical volume, the file system analyzer can parse the file system and its valid data distribution on the logical volume. If the file system cannot be parsed, all data is considered valid. If the file system is parsed, the data distribution on the logical volume can be used to obtain the valid data distribution of the RAID storage space through the address converter. In this process, combined with the stripe bitmap, a RAID valid data distribution bitmap with stripes as the smallest unit is obtained.
4. The method as described in claim 3, characterized in that, The specific steps by which the file system analyzer obtains the effective data distribution in the RAID storage space are as follows: 1) The bitmap is initially set to all 0s. When a write operation BIO falls on a stripe, the corresponding position in the stripe bitmap is set to 1. 2) The superblock monitoring module in the file system analyzer responds to file system deletion operations. If the operation covers the entire stripe, it sets the corresponding position in the stripe bitmap to 0. 3) If no valid file system logical volume is identified, the valid data is based on the data distribution of the striped bitmap; if a valid file system logical volume is identified, the valid data distribution is the OR of the file system analysis results and the striped bitmap.
5. The method as described in claim 4, characterized in that, Hot spare space is a portion of the remaining free space on the RAID disks used to store reconstructed data and newly written data. When a member disk of the RAID fails, the RAID is in a degraded state. The hot spare space manager can reconstruct the remaining RAID space, that is, logically reassemble the undisturbed member disks into a hot spare space. The maximum capacity of the hot spare space is S. (N-1) / N, where S is the capacity of the failed disk and N is the number of RAID member disks before the failure; after the hot spare space is prepared, the RAID can reconstruct the lost data into the hot spare space.