A method, apparatus and system for RAID reconstruction
Patent Information
- Application Number
- CN202610757973.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-28
- Publication Date
- 2026-08-21
AI Technical Summary
然而,在RAID重建完成前,常规RAID中数据存在风险,且随着技术发展需要重建和迁移的容量需求越来越大,但是由于单一专用热备盘重建速度较慢,重建之后的数据迁移需要全盘迁移,因此随着重建和迁移容量需求的增大,重建和重建后的数据迁移所需时间也越来越长,从而带来的常规RAID中数据可靠性风险也越来越大
[0009]This application first creates a hot spare RAID and initializes its write bitmap when a faulty disk is detected in a regular RAID. Since the hot spare RAID is created based on multiple global hot spare disks, it offers significantly improved write performance compared to a single dedicated hot spare disk, greatly improving reconstruction efficiency. The write bitmap is used to characterize the physical location of the data stored in the hot spare RAID. Then, the dedicated hot spare disk for the regular RAID is determined from the hot spare RAID. A logical disk is created based on the hot spare RAID. If the proportion of faulty data does not exceed a threshold, the faulty data from the faulty disk is reconstructed to the logical disk of the hot spare RAID, and the write bitmap is updated. Since there is a mapping relationship between the logical space of the logical disk and the physical space of the hot spare RAID, and the logical space of the logical disk matches the physical space of the dedicated hot spare disk, the reconstructed faulty data in the logical disk is migrated to the dedicated hot spare disk according to the write bitmap of the hot spare RAID. This allows for data migration without needing to migrate all the data, greatly improving data migration efficiency, reducing data migration time, and further reducing the risk of data migration. On the other hand, since hot spare RAID is created based on multiple global hot spare disks, it can be used by multiple regular RAIDs. It supports some regular RAIDs to migrate the entire disk and some regular RAIDs to rebuild the partial disk. It can cope with a variety of scenarios and maximize the efficiency of rebuilding and migration.
Smart Images

Figure CN122614636A_ABST
Abstract
Description
Technical Field
[0001] This application relates to RAID technology, and more particularly to a RAID reconstruction method, apparatus and system. Background Technology
[0002] Redundant Array of Independent Disks (RAID) refers to a disk group formed by combining multiple independent physical disks in different ways. For example, a disk group that already stores data and is in use can be called a regular RAID, while a disk group that is spare and has not yet been written to can be called a hot spare RAID. When a disk in a regular RAID fails, a hot spare disk in a hot spare RAID is used to replace the failed disk in the regular RAID to restore the data redundancy of the regular RAID; that is, a failed disk is rebuilt onto a hot spare disk. Hot spare disks can be divided into dedicated hot spare disks and global hot spare disks. A dedicated hot spare disk is a hot spare disk dedicated to a specific RAID, while a global hot spare disk is a hot spare disk that can be used by all RAIDs.
[0003] In a conventional RAID array, if any disk containing data fails, RAID reconstruction is initiated by first selecting a dedicated hot spare disk. If no dedicated hot spare disk is available, a global hot spare disk is designated as the dedicated hot spare disk for this conventional RAID array, and RAID reconstruction is performed using this dedicated hot spare disk. After reconstruction, the reconstructed data must be migrated to the corresponding dedicated hot spare disk to replace the failed disk. However, before RAID reconstruction is complete, data in a conventional RAID array is at risk, and with technological advancements, the capacity requirements for reconstruction and migration are increasing. Since reconstruction using a single dedicated hot spare disk is slow, and data migration after reconstruction requires a full disk migration, the time required for reconstruction and subsequent data migration is also increasing, leading to greater data reliability risks in conventional RAID arrays. Summary of the Invention
[0004] In view of this, this application provides a RAID reconstruction method, apparatus and system to solve the above-mentioned defects in the related art.
[0005] The first aspect of this application provides a RAID reconstruction method, which, when a faulty disk is detected in a regular RAID, creates a hot spare RAID and initializes the write bitmap of the hot spare RAID; wherein, the hot spare RAID is created based on at least two global hot spare disks, and the write bitmap of the hot spare RAID represents the physical location of the data already stored in the hot spare RAID. Select the dedicated hot spare disk corresponding to the failed disk from the hot spare RAID. The dedicated hot spare disk is the mapping disk of the failed disk. Logical disks are created based on hot spare RAID. The logical space of the logical disk is mapped to the physical space of the hot spare RAID, and the logical space of the logical disk matches the physical space of the dedicated hot spare disk. Determine the percentage of faulty data in the total capacity of the logical drive; If the proportion of faulty data does not exceed the threshold, rebuild the faulty data of the faulty disk to the logical disk of the hot spare RAID and update the bitmap. The faulty data rebuilt in the logical disk is migrated to the dedicated hot spare disk based on the write bitmap of the hot spare RAID.
[0006] A second aspect of this application provides a RAID reconstruction apparatus, comprising: A creation unit is used to create a hot spare RAID based on at least two global hot spare disks and initialize the write bitmap of the hot spare RAID when a faulty disk is detected in the regular RAID; wherein, the write bitmap of the hot spare RAID represents the physical location of the data stored in the hot spare RAID. Select the dedicated hot spare disk corresponding to the failed disk from the hot spare RAID. The dedicated hot spare disk is the mapping disk of the failed disk. Logical disks are created based on hot spare RAID. The logical space of the logical disk is mapped to the physical space of the hot spare RAID, and the logical space of the logical disk matches the physical space of the dedicated hot spare disk. The rebuild unit is used to determine the proportion of faulty data in the total capacity of the logical disk; if the proportion does not exceed the threshold, the faulty data of the faulty disk is rebuilt to the logical disk of the hot spare RAID and the bitmap is updated. The migration unit is used to migrate reconstructed faulty data from the logical disk to a dedicated hot spare disk based on the write bitmap of the hot spare RAID.
[0007] A third aspect of this application provides a storage system, comprising: A computing device configured to implement the method of the first aspect of this application; At least one conventional RAID, which includes at least one physical disk used to store computer data; At least two global hot spares are required, which are used for failover of regular RAID.
[0008] The fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method in the first aspect of this application.
[0009] This application first creates a hot spare RAID and initializes its write bitmap when a faulty disk is detected in a regular RAID. Since the hot spare RAID is created based on multiple global hot spare disks, it offers significantly improved write performance compared to a single dedicated hot spare disk, greatly improving reconstruction efficiency. The write bitmap is used to characterize the physical location of the data stored in the hot spare RAID. Then, the dedicated hot spare disk for the regular RAID is determined from the hot spare RAID. A logical disk is created based on the hot spare RAID. If the proportion of faulty data does not exceed a threshold, the faulty data from the faulty disk is reconstructed to the logical disk of the hot spare RAID, and the write bitmap is updated. Since there is a mapping relationship between the logical space of the logical disk and the physical space of the hot spare RAID, and the logical space of the logical disk matches the physical space of the dedicated hot spare disk, the reconstructed faulty data in the logical disk is migrated to the dedicated hot spare disk according to the write bitmap of the hot spare RAID. This allows for data migration without needing to migrate all the data, greatly improving data migration efficiency, reducing data migration time, and further reducing the risk of data migration. On the other hand, since hot spare RAID is created based on multiple global hot spare disks, it can be used by multiple regular RAIDs. It supports some regular RAIDs to migrate the entire disk and some regular RAIDs to rebuild the partial disk. It can cope with a variety of scenarios and maximize the efficiency of rebuilding and migration.
[0010] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0011] Figure 1 This is a flowchart illustrating a RAID reconstruction method according to an exemplary embodiment of this application; Figure 2 This application illustrates a flowchart of a method for migrating reconstructed fault data from a logical disk to a dedicated hot spare disk according to an exemplary embodiment. Figure 3 This is a flowchart illustrating a RAID reconstruction method according to an exemplary embodiment of this application; Figure 4 This is a flowchart illustrating a RAID reconstruction method according to an exemplary embodiment of this application; Figure 5 This is a block diagram of a RAID reconstruction apparatus according to an exemplary embodiment of this application; Figure 6 This is a block diagram of a RAID reconstruction apparatus according to an exemplary embodiment of this application; Figure 7 This is a block diagram of a storage system according to an exemplary embodiment of this application. Detailed Implementation
[0012] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0013] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0014] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0015] To facilitate understanding, some of the concepts involved in this application are explained: RAID (Redundant Array of Independent Disks) is a method of combining multiple independent physical disks into a disk group in different ways. By saving multiple copies of data and adding parity, it can provide higher storage performance than a single disk and provide a certain degree of data redundancy protection and data security.
[0016] Depending on the data organization method, common RAID configurations include RAID 0, RAID 1, RAID 5, RAID 6, and RAID 10. RAID 0 lacks data redundancy and is typically not used in production systems. RAID 1 and RAID 10 are based on mirrored pairs, where data is stored in two copies, with two mirrored disks forming a mirrored pair. This allows for the tolerance of any disk failure or offline status in any mirrored pair. RAID 5 and RAID 6 are based on parity. RAID 5 stores one copy of parity data, tolerating the failure or offline status of any one disk, while RAID 6 stores two copies of parity data, tolerating the failure or offline status of any two disks.
[0017] A stripe is the smallest unit of data computation in a RAID algorithm. Data in a stripe is located across multiple blocks on the RAID member disks; that is, a stripe spans the entire RAID. Each disk in the RAID stores a portion of the stripe, also known as the stripe depth or stripe size, which refers to the size of the stripe data block written on each disk of the RAID (the stripe data block size is the same on each disk). The number of sectors or blocks contained in a stripe is called the stripe length.
[0018] A hot spare disk is a separate disk in a disk system. Allocating a hot spare disk provides additional protection against data loss. Normally, a hot spare disk is not used and no data is stored on it. When a disk in the RAID array fails, the hot spare disk automatically takes over the RAID, replacing the failed disk and providing fault tolerance for the system.
[0019] RAID supports the following two types of hot spare drives: A global hot spare is shared by all configured RAID groups, and one or more global hot spares can be configured. When any member disk in any RAID group fails, the global hot spare can automatically take over. The member disks are each disk that makes up the RAID, and the global hot spare can automatically replace the failed member disk.
[0020] A dedicated hot spare disk is exclusive to a specific RAID group within all RAID configurations. Each RAID group can be configured with one or more dedicated hot spare disks. When a member disk within the specified RAID fails, the dedicated hot spare disk can automatically replace it.
[0021] Hot spare disks are only used for RAID with redundancy features, including RAID 1, 5, 6, 10, etc.
[0022] RAID rebuilding is the process of restoring RAID data redundancy when a member disk in a RAID array fails, such as when the disk goes offline, by rebuilding the data on the failed member disk to the replaced hot spare disk, based on the premise that a hot spare disk has been used to replace the failed member disk.
[0023] The current RAID reconstruction method is as follows: When a member disk in a RAID array fails, the RAID array removes the failed disk from the RAID array and selects a dedicated hot spare disk to rebuild the failed disk. During the rebuilding process, the RAID stripes are rebuilt in sequence, meaning that no matter how large the area of data written to the failed disk is, it must be completely rebuilt until all stripe data has been rebuilt. Then, the hot spare disk is added back to the RAID array to restore RAID data redundancy.
[0024] Before RAID reconstruction is complete, data in conventional RAID is at risk, and with the development of technology, the capacity required for reconstruction is increasing. However, due to the slow reconstruction speed of a single dedicated hot spare disk, the reconstruction time is also increasing as the reconstruction capacity requirement increases, which in turn leads to greater risks to data reliability in conventional RAID.
[0025] Based on this, another RAID reconstruction method exists. This method supports rebuilding data from a failed disk to a hot spare RAID array composed of multiple disks. The key to this approach is using a hot spare RAID array created from multiple disks for data reconstruction. During the actual data writing process, data is simultaneously written to all the disks, thus increasing reconstruction efficiency by a factor of N based on the number of disks in the hot spare RAID array. Therefore, it can improve data reconstruction efficiency to some extent. However, while this method solves the efficiency problem of single-disk reconstruction, it requires migrating the reconstructed data to a dedicated hot spare disk corresponding to the failed disk after reconstruction. This migration requires migrating all data, making it slow and posing data security risks.
[0026] The inventors discovered through research that improving migration efficiency is key to enhancing data security. While the current second RAID reconstruction scheme, using a hot-spare RAID array created from multiple disks, can improve reconstruction efficiency to some extent, it suffers from slow data migration. This is because the reconstructed and migrated data is the complete set of data, while the faulty data that truly needs reconstruction and migration is often only a portion of the data on the faulty disk, or data that wasn't fully written to the faulty disk. Therefore, building upon the above scheme, the inventors conceived of using the hot-spare RAID array to reconstruct and migrate only the partially written data. This would improve data security during reconstruction and migration while simultaneously increasing migration efficiency. Specifically, this is achieved by writing bitmaps to reconstruct and migrate the partially written data.
[0027] The technical solutions described in this specification will now be introduced in conjunction with specific embodiments.
[0028] Figure 1 This is a flowchart illustrating a RAID reconstruction method according to an exemplary embodiment of this application. The method includes the following steps: Step 102: If a faulty disk is detected in the regular RAID, create a hot spare RAID and initialize the write bitmap of the hot spare RAID; Step 104: Select a dedicated hot spare disk from the hot spare RAID and designate the dedicated hot spare disk as the mapping disk of the failed disk; Step 106: Create a logical disk based on the hot-standby RAID; Step 108: Determine the percentage of faulty data in the total capacity of the logical disk; Step 110: If the proportion of faulty data does not exceed the threshold, rebuild the faulty data of the faulty disk to the logical disk of the hot spare RAID and update the write bitmap. Step 112: Migrate the reconstructed fault data from the logical disk to the dedicated hot spare disk according to the write bitmap of the hot spare RAID.
[0029] Among them, hot spare RAID is created based on at least two global hot spare disks. The write bitmap of hot spare RAID represents the physical space location of the data stored in hot spare RAID. There is a mapping relationship between the logical space of the logical disk and the physical space of the dedicated hot spare disk, and the logical space of the logical disk matches the physical space of the dedicated hot spare disk.
[0030] In one embodiment, regarding step 102, it should be noted that the reason for creating a hot spare RAID based on at least two global hot spare disks is that the global hot spare disks can be used by multiple regular RAIDs. In other words, data reconstruction in multiple regular RAIDs can be performed simultaneously. Furthermore, using more than one global hot spare disk can also achieve parallel data writing. Both aspects can greatly improve operational efficiency, minimize the time consumed in the data writing process, and thus improve data security during the data writing process.
[0031] Furthermore, a write bitmap is created corresponding to each RAID configuration. This write bitmap is typically used for data updates or synchronization, i.e., data reconstruction. In RAID structures with data redundancy, such as RAID 1 and RAID 5, data integrity requires that the redundant data and the original data be consistent. Because a RAID write operation is a process, exceptions during this process can lead to inconsistencies between the redundant and original data, such as disk replacement, write failure, or system power loss. The system needs to restore data consistency as quickly as possible so that the RAID can function normally subsequently. The process of recovering from an inconsistent data state is the data reconstruction process.
[0032] Based on the function of the bitmap mentioned above, the inventors realized that the bitmap could be combined with the hot standby RAID to complete the RAID reconstruction process.
[0033] Taking a disk offline scenario in a RAID array as an example, if a disk in a RAID array temporarily disconnects and then reconnects, the RAID must synchronize all data, a process that is time-consuming. Using a RAID bitmap, only the changes made after the disk disconnection need to be synchronized, significantly speeding up the process. Each bit in the bitmap corresponds to whether a data block in the RAID has been written during the synchronization process, i.e., whether the data block has been synchronized. If the writing is complete, the corresponding bit in the bitmap can be cleared to ensure the bitmap space can be reused for other RAID arrays or subsequent use. Alternatively, the bit can be cleared after all operations are complete, aiming to maximize the bitmap's functionality; this embodiment does not impose such limitations. When a disk fails due to power loss or other faults, the bits recorded in the bitmap represent the data that needs to be written at the corresponding position at that moment. Therefore, the bitmap can be used to find the data that truly needs to be rebuilt or synchronized, and then hot-standby RAID can be used to rebuild and migrate the corresponding data, thus completing the reconstruction of the faulty disk's data.
[0034] In one embodiment, regarding step 104, it should be noted that, based on the use of hot-spare RAID, there is a mapping relationship between the logical disk created based on the hot-spare RAID and the dedicated hot-spare disk. The aforementioned fault data will be written to the corresponding logical disk first based on the mapping relationship. This is because the logical disk is created based on a hot-spare RAID using at least two global hot-spare disks. Due to the function of the global hot-spare disks, the writing process to the logical disk is a parallel writing process, which can effectively improve writing efficiency. Moreover, the written data is not all the data, but the data that we actually need to rebuild and migrate, which will further improve RAID rebuild efficiency. The aforementioned mapping relationship, in addition to instructing the writing of data from the failed disk to the logical disk, also instructs the writing of user data from the conventional RAID to the dedicated hot spare disk and the logical disk. User data refers to data that does not need to be rebuilt, in other words, data that has not failed. It can be written to the logical disk based on the mapping relationship and pre-written to the dedicated hot spare disk. This allows for the early updating of user data that does not need to be rebuilt to the dedicated hot spare disk. After updating the user data, the corresponding bits in the bitmap can be cleared, leaving only the bits corresponding to the written failed data. This operation can identify the data to be written as the data that has actually failed, thus avoiding the need for full disk data migration, effectively improving migration efficiency, and reducing data risks during data migration.
[0035] In one embodiment, regarding step 106, it should be noted that the logical disk is an intermediate disk created for data reconstruction using the parallel writing function of hot spare RAID. It is also a virtual disk. In other words, there is no dedicated physical disk corresponding to it, but the space size of the logical disk is consistent with that of the dedicated hot spare disk, and it matches it. At the same time, there is a mapping relationship between the logical space of the logical disk and the physical space of the hot spare RAID. That is, the logical disk is created based on the hot spare RAID created by at least two global hot spare disks. Therefore, writing is equivalent to parallel writing, which can speed up the reconstruction efficiency.
[0036] In one embodiment, regarding step 108, it should be noted that there are cases where a full migration is not required, i.e., when the proportion of faulty data does not exceed a threshold, a full migration is not necessary, and only in this case is it necessary to use the bitmap write function to rebuild the data. The scenario of a full migration is not specifically described in this embodiment. This threshold type is generally set as a percentage value; the specific setting can be determined by the user or by the developers. The threshold type and specific value only need to meet the corresponding requirements, and this embodiment does not impose any restrictions on this. The specific determination of the threshold can be a percentage of the total data capacity to which the written data has been stored; this embodiment also does not impose any restrictions on this.
[0037] In one embodiment, regarding step 110, it should be noted that each conventional RAID creates one or more dedicated hot spare disks during its creation to ensure timely replacement in case of disk failure. When a disk fails, a dedicated hot spare disk created within the conventional RAID is selected to replace it. A mapping relationship is established between the dedicated hot spare disk and the failed disk, and data reconstruction is performed based on this mapping relationship. It should be noted that the dedicated hot spare disk corresponding to the failed disk can be arbitrarily selected, but it must meet the following condition: the data space capacity of the selected dedicated hot spare disk should be the same as or larger than that of the failed disk to ensure successful replacement of the failed disk. A corresponding mapping relationship is then created.
[0038] In one embodiment, for step 112, the reconstructed fault data in the corresponding logical disk is migrated to the dedicated hot spare disk according to the updated bitmap.
[0039] Figure 2 This application illustrates a method for migrating reconstructed fault data from a logical disk to a dedicated hot spare disk according to an exemplary embodiment. The method includes the following steps: Step 202: Generate a write bitmap for a dedicated hot spare disk based on the write bitmap of the hot spare RAID. Step 204: Migrate the reconstructed fault data from the logical disk to the dedicated hot spare disk based on the write bitmap of the dedicated hot spare disk.
[0040] The write bitmap of the dedicated hot spare disk represents the location of the reconstructed fault data in the physical space of the dedicated hot spare disk in the hot spare RAID.
[0041] In one embodiment, the mapping relationship described in the above embodiments, combined with the corresponding write bitmap of the hot spare RAID, can be used to find the write bitmap portion corresponding to the dedicated hot spare disk and perform subsequent operations. Alternatively, the write bitmap of the hot spare RAID can be operated on first, such as writing user data that does not require reconstruction and migration as described in the above embodiments in advance. After the corresponding write bitmap is updated and the user data is written, the corresponding bit of the user data in the write bitmap of the hot spare RAID is cleared, and then the fault data is written. In the end, only the bit of the write bitmap updated for the corresponding fault data in the logical disk will be retained, and the corresponding reconstructed data can be directly migrated from the logical disk to the dedicated hot spare disk. It is worth noting that, in addition to the optional cases listed above, other optional cases are not excluded in determining the write bitmap of the dedicated hot spare disk, and are not limited here.
[0042] In one embodiment, the write bitmap is first updated when a write operation is performed on the RAID. The write record identifier is an identifier added to the RAID write command to indicate whether the write command needs to update the RAID write bitmap. It should be noted that when rebuilding faulty data to the logical disk, the faulty data is written with a write record identifier. This write record identifier is usually set to an initial preset value, which can be any value, such as 0, 1, 2, etc. The preset value indicates that the write bitmap needs to be updated. This identifier is an optional parameter and can be left unspecified. If not specified, it can be set to a default value, such as 1, indicating that the write bitmap needs to be updated. Of course, there are also cases where the write bitmap does not need to be updated. Specifically, whether the proportion of faulty data exceeds a threshold determines whether the write bitmap needs to be updated. If the proportion of faulty data does not exceed the threshold, the write bitmap needs to be updated; if the proportion exceeds the threshold, the write bitmap does not need to be updated. Whether the write bitmap needs to be updated is reflected by the write record identifier. By default, the write bitmap needs to be updated, and the corresponding write record identifier is the initial preset value. If the write record identifier value changes, it indicates that the write bitmap no longer needs to be updated.
[0043] It should be noted that the correspondence between whether the bitmap needs to be updated, the write record identifier value, and whether the proportion of fault data exceeds the threshold as described in this embodiment is only one of them. It is also possible that updating the write record identifier value when the proportion exceeds the threshold indicates that the bitmap does not need to be written, and the write record identifier value can also indicate that the bitmap does not need to be written by default, etc. Those skilled in the art can make any transformations to the above correspondence based on this embodiment, as long as the condition of not updating the bitmap when the threshold is exceeded and updating the bitmap when the threshold is not exceeded is met. This embodiment does not limit this.
[0044] Figure 3 This is a flowchart illustrating a RAID reconstruction method according to an exemplary embodiment of this application. The method further includes the following steps: Step 302: If the proportion of faulty data exceeds the threshold, rebuild the faulty data of the faulty disk to the logical disk of the hot spare RAID. Step 304: Migrate all the reconstructed fault data from the logical disk to the dedicated hot spare disk.
[0045] In one embodiment, there is a situation where the faulty data requiring reconstruction and migration as described in the above embodiments needs to be migrated across the entire disk. It should be noted that disk failures in RAID can take many forms, ultimately manifesting in the following ways: a faulty disk exists, and only some data on the faulty disk has experienced failures such as loss or corruption, while the other data on the faulty disk remains intact; or there is a situation where all data on the faulty disk is faulty. This embodiment illustrates how to handle the situation where all data is faulty.
[0046] Step 302 can be analyzed in conjunction with the above embodiments. When the proportion of faulty data exceeds a threshold—that is, when faulty data almost completely fills or has completely filled the entire disk—the migration time consumed by partial migration and full migration is not significantly different. However, partial migration requires updating the write bitmap during the migration process, which consumes resources and increases the write command and processing time of the RAID, thus impacting performance. Although the impact of migrating and writing a single data block to the bitmap is small, the more data is migrated, the longer the cumulative time. For RAIDs that have been determined to require full migration, updating the write bitmap corresponding to this space (i.e., the write bitmap of the dedicated hot spare disk) is not very meaningful. By determining whether the proportion of faulty data exceeds a threshold, it can be determined whether the dedicated hot spare disk needs a full migration. Therefore, when a conventional RAID writes user data or rebuild data to the logical disk corresponding to the dedicated hot spare disk (i.e., the hot spare RAID), if the write record identifier of the dedicated hot spare disk is 1, the write command can include an update to the write record identifier. The value of the update identifier can be any value other than the preset value. For example, if the preset value is 1, the write record identifier value can be updated to 0; if the preset value is 0, the write record identifier value can be updated to 1, and so on. This embodiment does not impose any restrictions on this. After updating the write record identifier, when the hot spare RAID processes write commands for rebuilding and migrating faulty data, if the write record identifier carried by the write command is any value other than the preset value, then the write command does not need to update the write bitmap; otherwise, the write bitmap is updated according to the conventional process.
[0047] Full disk migration involves rebuilding all data on the entire failed disk and then migrating all the data from the logical disk to a dedicated hot spare disk.
[0048] Figure 4 This application illustrates a flowchart of a RAID reconstruction method according to an exemplary embodiment, the method comprising the following steps: Step 402: Release the physical space occupied by the logical disk in the hot spare RAID according to the mapping relationship between the logical space of the logical disk and the physical space of the hot spare RAID. Step 404: Convert the dedicated hot spare disk in the hot spare RAID that is not used by the regular RAID into a global hot spare disk; Step 406: Initialize the write record identifier and clear the threshold; Step 408: Notify the hot standby RAID to release the occupied space.
[0049] In one embodiment, for step 402, in order to ensure that the hot standby RAID has enough space for multiple regular RAIDs to perform data operations, after the data of the current regular RAID is rebuilt and migrated, it is necessary to release the space occupied by the logical disk created by the hot standby RAID used by the regular RAID in a timely manner. This space is the physical space created in the hot standby RAID based on the mapping relationship.
[0050] In one embodiment, for step 404, in order to make good use of the system storage space, after the data of the current conventional RAID has been rebuilt and migrated, the dedicated hot spare disk in the hot spare RAID that is not used by the conventional RAID needs to be converted into a global hot spare disk for use by other conventional hot spare RAID, thereby improving resource utilization.
[0051] In one embodiment, for steps 406 and 408, the regular RAID currently performing data reconstruction and migration operations must initialize the identifiers used after the final data migration is completed. These identifiers include the aforementioned thresholds and write record identifiers. It should be noted that the aforementioned thresholds exist in each created hot spare RAID. The hot spare RAID will not release space until all regular RAIDs have finished using it. However, after the current regular RAID has finished using it, the hot spare RAID will release the physical space used by that regular RAID and initialize the thresholds used by that regular RAID. The physical space used by other regular RAIDs will not be released, and their respective thresholds will not be initialized. It should be noted that the created hot spare RAID allows multiple regular RAIDs to be used simultaneously, supporting some regular RAIDs to perform a full-disk migration scheme and some regular RAIDs to perform a partial reconstruction scheme, which can handle various scenarios and maximize reconstruction and migration efficiency. The initialization of the corresponding threshold involves clearing the corresponding threshold.
[0052] Figure 5 This application illustrates a block diagram of a RAID reconstruction apparatus according to an exemplary embodiment. The apparatus includes: Creation unit 501 is used to create a hot spare RAID based on at least two global hot spare disks and initialize the write bitmap of the hot spare RAID when a faulty disk is detected in the regular RAID; wherein, the write bitmap of the hot spare RAID represents the physical space location of the data already stored in the hot spare RAID; Select the dedicated hot spare disk corresponding to the failed disk from the hot spare RAID. The dedicated hot spare disk is the mapping disk of the failed disk. Logical disks are created based on hot spare RAID. The logical space of the logical disk is mapped to the physical space of the hot spare RAID, and the logical space of the logical disk matches the physical space of the dedicated hot spare disk. Reconstruction unit 502 is used to determine the proportion of faulty data in the total capacity of the logical disk; if the proportion does not exceed the threshold, the faulty data of the faulty disk is reconstructed to the logical disk of the hot spare RAID and the bitmap is updated. Migration unit 503 is used to migrate reconstructed fault data from the logical disk to a dedicated hot spare disk according to the write bitmap of the hot spare RAID.
[0053] In an exemplary embodiment, the reconstruction unit 501 further has the following function: if it is determined that the proportion of faulty data exceeds a threshold, the faulty data of the faulty disk is reconstructed to the logical disk of the hot standby RAID. Migration unit 503 also has the following function: when the proportion of fault data exceeds the threshold, it migrates all the reconstructed fault data in the logical disk to the dedicated hot spare disk.
[0054] Figure 6 This application illustrates a block diagram of a RAID reconstruction apparatus according to an exemplary embodiment, the apparatus further comprising: Release unit 601 is used to release the physical space occupied by the logical disk in the hot spare RAID according to the mapping relationship between the logical space of the logical disk and the physical space of the hot spare RAID. Convert a dedicated hot spare disk in a hot spare RAID that is not used by the regular RAID into a global hot spare disk; Initialize the write record flag and clear the threshold; Notify the hot standby RAID to release occupied space.
[0055] Figure 7 This application illustrates a storage system block diagram according to an exemplary embodiment. The system includes: Computing device 701 is configured to implement the method of any one of claims 1 to 5; At least one standard RAID 702, a standard RAID includes at least one physical disk used to store computer data; At least two global hot spare disks 703 are used for failover of regular RAID.
[0056] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the RAID reconstruction method described in any of the embodiments above.
Claims
1. A RAID reconstruction method, characterized in that, The method includes: If a faulty disk is detected in a regular RAID, a hot spare RAID is created and the write bitmap of the hot spare RAID is initialized; wherein, the hot spare RAID is created based on at least two global hot spare disks, and the write bitmap of the hot spare RAID represents the physical location of the data stored in the hot spare RAID. Select a dedicated hot spare disk corresponding to the failed disk from the hot spare RAID, wherein the dedicated hot spare disk is a mapping disk of the failed disk; A logical disk is created based on the hot spare RAID, and the logical space of the logical disk is mapped to the physical space of the hot spare RAID, and the logical space of the logical disk matches the physical space of the dedicated hot spare disk. Determine the percentage of fault data in the total capacity of the logical disk; If the proportion of the faulty data does not exceed the threshold, the faulty data of the faulty disk is reconstructed to the logical disk of the hot standby RAID, and the write bitmap is updated. The reconstructed fault data in the logical disk is migrated to the dedicated hot spare disk according to the write bitmap of the hot spare RAID.
2. The method as described in claim 1, characterized in that, The process of migrating the reconstructed fault data from the logical disk to the dedicated hot spare disk according to the write bitmap of the hot spare RAID includes: The write bitmap of the dedicated hot spare disk is generated based on the write bitmap of the hot spare RAID, wherein the write bitmap of the dedicated hot spare disk represents the location of the reconstructed fault data in the hot spare RAID in the physical space of the dedicated hot spare disk. Based on the write bitmap of the dedicated hot spare disk, the reconstructed fault data is migrated from the logical disk to the dedicated hot spare disk.
3. The method as described in claim 2, characterized in that, The fault data reconstructed to the logical disk carries a write record identifier. If the proportion of the fault data does not exceed a threshold, the value of the write record identifier indicates that the write bitmap is updated. If the proportion of faulty data exceeds a threshold, the value of the write record identifier indicates that the write bitmap does not need to be updated.
4. The method as described in claim 1, characterized in that, The method further includes: If the proportion of the faulty data exceeds a threshold, the faulty data of the faulty disk will be reconstructed to the logical disk of the hot standby RAID. The reconstructed fault data in the logical disk is migrated to the dedicated hot spare disk.
5. The method as described in claim 4, characterized in that, After migrating the faulty data from the failed disk using the hot-standby RAID, the process includes: Release the physical space occupied by the logical disk in the hot standby RAID according to the mapping relationship between the logical space of the logical disk and the physical space of the hot standby RAID; Convert the dedicated hot spare disk in the hot spare RAID that is not used by the regular RAID into the global hot spare disk; Initialize the write record identifier and clear the threshold; The notification indicates that the hot standby RAID is releasing the occupied space.
6. A RAID reconstruction device, characterized in that, The device includes: A creation unit is used to create a hot spare RAID based on at least two global hot spare disks and initialize the write bitmap of the hot spare RAID when a faulty disk is detected in a regular RAID; wherein, the write bitmap of the hot spare RAID represents the physical location of the data already stored in the hot spare RAID; Select a dedicated hot spare disk corresponding to the failed disk from the hot spare RAID, wherein the dedicated hot spare disk is a mapping disk of the failed disk; A logical disk is created based on the hot spare RAID, and the logical space of the logical disk is mapped to the physical space of the hot spare RAID, and the logical space of the logical disk matches the physical space of the dedicated hot spare disk. A reconstruction unit is used to determine the proportion of faulty data in the total capacity of the logical disk; if the proportion does not exceed a threshold, the faulty data of the faulty disk is reconstructed to the logical disk of the hot standby RAID, and the write bitmap is updated. The migration unit is used to migrate the reconstructed fault data in the logical disk to the dedicated hot spare disk according to the write bitmap of the hot spare RAID.
7. The apparatus as claimed in claim 6, characterized in that, If the reconstruction unit determines that the proportion of the faulty data exceeds a threshold, it will rebuild the faulty data of the faulty disk to the logical disk of the hot standby RAID. If the migration unit determines that the proportion of the fault data exceeds a threshold, it will migrate all the reconstructed fault data in the logical disk to the dedicated hot spare disk.
8. The apparatus as claimed in claim 7, characterized in that, The device further includes a release unit for: Release the physical space occupied by the logical disk in the hot standby RAID according to the mapping relationship between the logical space of the logical disk and the physical space of the hot standby RAID; Convert the dedicated hot spare disk in the hot spare RAID that is not used by the regular RAID into the global hot spare disk; Initialize the write record identifier and clear the threshold; The notification indicates that the hot standby RAID is releasing the occupied space.
9. A storage system, characterized in that, include: A computing device configured to implement the method of any one of claims 1 to 5; At least one conventional RAID, the conventional RAID including at least one physical disk for storing computer data; At least two global hot spare disks are used for fault reconstruction of the conventional RAID.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.