Disk array reconstruction method, device, computer equipment and storage medium
By dividing the disk array into valid and invalid regions, prioritizing the reconstruction of valid data regions and then reconstructing invalid regions in the background, the problem of excessively long disk array reconstruction time was solved, enabling rapid deployment of storage systems and ensuring user data consistency, thus improving the user experience.
Patent Information
- Application Number
- CN202210951616.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-09
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-08-09
AI Technical Summary
In existing technologies, disk array rebuilding takes too long, causing storage systems to be unable to go online in a timely manner, affecting data access and user experience.
The disk array is divided into valid data areas and invalid areas. The valid data areas are reconstructed first, and the invalid areas are reconstructed in the background. By constructing a dot matrix to determine the integrity of data packets and setting reconstruction tags, the valid data areas are reconstructed before the invalid areas, ensuring that the storage system can be brought online quickly.
Without affecting user data consistency, it shortens the repair time when the disk fails, improves the storage system's rapid rebuild capability and user experience.
Smart Images

Figure CN115291803B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of disk array reconstruction technology, and in particular to a disk array reconstruction method, apparatus, computer equipment, and storage medium. Background Technology
[0002] In storage system products, RAID is crucial to the performance of the storage system. Whether the reconstruction efficiency of the RAID on the storage side can be maximized often determines the quality of the entire storage product.
[0003] Currently in the industry, as disk capacity increases, the rebuild time when a disk fails becomes longer. Although rebuild speed is related to the number of disks, it is also affected by disk capacity. Increased disk capacity leads to longer rebuild times, and when a disk fails, the impact on the performance of the disk array is even greater.
[0004] Currently, the long rebuild time for disk arrays prevents storage systems from going online in a timely manner, affecting data access and storage, leading to customer complaints and a poor service experience. Therefore, how to reduce the repair time when disks fail and achieve rapid rebuilding of failed disks is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] Therefore, it is necessary to provide a disk array reconstruction method, apparatus, computer equipment, and storage medium that can reduce the time required for rapid reconstruction of faulty disks, in order to solve the current technical problem of excessively long repair times when disks fail.
[0006] On the one hand, a disk array reconstruction method is provided, the method comprising:
[0007] Read the disk array in the storage system and divide the disk array into valid data areas and invalid areas according to whether user data is stored;
[0008] The stripe information of the data packets is read one by one in the valid data area and the invalid area to construct a dot matrix diagram. Within the dot matrix diagram, a reconstruction label or a valid label is set for each stripe by judging whether the data packet is complete.
[0009] The order of reconstructing valid data is ordered, ensuring that the step of reconstructing valid data in the region containing the stripe with the reconstruction label within the valid data region occurs before the step of reconstructing valid data in the invalid region; and
[0010] Disk array reconstruction is performed on the area where the stripe with reconstruction tag is located within the effective data area. After the effective data is reconstructed within the effective data area, the storage system is brought online for use. Then, the effective data is reconstructed in the background for the invalid area.
[0011] In one embodiment, the method for reconstructing valid data in the invalid region in the background includes:
[0012] Initialize the invalid region; or
[0013] Perform disk array reconstruction on the regions containing stripes with reconstruction tags within the invalid regions; or
[0014] The disk array is reconstructed in the region where the stripe with the reconstruction tag is located in the invalid region, and the data in the invalid region is verified and updated.
[0015] In one embodiment, prior to performing disk array reconstruction on the area containing the stripe with the reconstruction label within the effective data area, the method further includes:
[0016] Real-time monitoring of cluster changes, and comparison of the cluster changes with a first threshold.
[0017] When the change value of the cluster is greater than or equal to the first threshold, a disk array reconstruction task is initiated, and the disk array reconstruction is performed on the area where the stripe with reconstruction label is located in the effective data area.
[0018] In one embodiment, after the valid data in both the valid data region and the invalid data region has been reconstructed, the method further includes:
[0019] Returning to the step of reading the disk array in the storage system, the changes in the cluster are monitored in real time again. The changes in the cluster are compared with the first threshold to determine whether to initiate the disk array reconstruction task again.
[0020] In one embodiment, the disk array reconstruction of the area containing the stripe with the reconstruction label within the effective data area includes:
[0021] The current data of the region where the strip with the reconstruction label is located within the effective data region is processed by input and output to obtain the historical data and time nodes stored in the region where the strip is located.
[0022] Read the historical data;
[0023] Calculate the difference between the historical data and the current data to obtain the time point corresponding to the lost data; and
[0024] The lost data is reconstructed based on the historical data corresponding to that time point.
[0025] In one embodiment, when reconstructing the disk array in the region where the stripe with the reconstruction label is located within the effective data region, the process also includes:
[0026] The dot matrix pattern is adjusted in real time;
[0027] The content of the dot matrix is displayed to show the status and reconstruction progress of the disk array.
[0028] In one embodiment, after the valid data in both the valid data area and the invalid data area has been reconstructed, the method further includes: clearing the dot matrix.
[0029] In one embodiment, when constructing the bitmap, the bitmap is constructed at the granularity of stripes or at the granularity of extents.
[0030] The construction of the dot matrix image specifically includes the following steps:
[0031] This forms a raster interface, which is converted from a memory interface to a raster interface within the stripe of the disks inside the disk array; and
[0032] A reconstruction bitmap and a data bitmap are formed. The reconstruction bitmap is used to record the position information of the stripes for which reconstruction tags are set, and the data bitmap is used to record the position information of the stripes for which valid tags are set.
[0033] On the other hand, a disk array reconstruction apparatus is provided, the apparatus comprising:
[0034] The task management module is reconstructed to read the disk array in the storage system and divide the disk array into valid data areas and invalid areas according to whether user data is stored.
[0035] The dot matrix interface is connected to the reconstruction task management module and is used to read the strip information of the data packets one by one in the valid data area and the invalid area to construct the dot matrix. In the dot matrix, the reconstruction label or valid label is set for each strip by judging whether the data packet is complete.
[0036] The task scheduling module, connected to the dot matrix interface, is used to sort the order of reconstructing valid data, controlling that the step of reconstructing valid data in the region containing the stripe with reconstruction label within the valid data area is performed earlier than the step of reconstructing valid data in the invalid region; and
[0037] The stripe data processing module is connected to the task scheduling module and is used to reconstruct the disk array in the area where the stripe with the reconstruction tag is located in the effective data area. When the effective data is reconstructed in the effective data area, the storage system is brought online for use, and then the effective data in the invalid area is reconstructed in the background.
[0038] In one embodiment, the device further includes: a control state machine for real-time monitoring of changes in cluster values, comparing the changes in cluster values with a first threshold; and initiating a disk array reconstruction task to the stripe data processing module when the changes in cluster values are greater than or equal to the first threshold.
[0039] In one embodiment, the apparatus further includes: a reconstruction metadata module connected to the control state machine, the stripe data processing module, and the dot matrix interface, configured to, upon receiving a disk array reconstruction task initiated by the control state machine, receive the progress of disk array reconstruction performed by the stripe data processing module on the area where the stripe with reconstruction tags is located within the valid data area, and adjust the dot matrix in the dot matrix interface in real time; after the valid data in both the valid data area and the invalid area has been reconstructed, the reconstruction metadata module is further configured to clear the dot matrix.
[0040] In one embodiment, the device further includes a display screen having a graphical interface; the graphical interface is used to invoke a command line for reconstructing the disk array and display the contents of the dot matrix to show the status and reconstruction progress of the disk array.
[0041] In another aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0042] Read the disk array in the storage system and divide the disk array into valid data areas and invalid areas according to whether user data is stored;
[0043] The stripe information of the data packets is read one by one in the valid data area and the invalid area to construct a dot matrix diagram. Within the dot matrix diagram, a reconstruction label or a valid label is set for each stripe by judging whether the data packet is complete.
[0044] The order of reconstructing valid data is ordered, ensuring that the step of reconstructing valid data in the region containing the stripe with the reconstruction label within the valid data region occurs before the step of reconstructing valid data in the invalid region; and
[0045] Disk array reconstruction is performed on the area where the stripe with reconstruction tag is located within the effective data area. After the effective data is reconstructed within the effective data area, the storage system is brought online for use. Then, the effective data is reconstructed in the background for the invalid area.
[0046] In another aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0047] Read the disk array in the storage system and divide the disk array into valid data areas and invalid areas according to whether user data is stored;
[0048] The stripe information of the data packets is read one by one in the valid data area and the invalid area to construct a dot matrix diagram. Within the dot matrix diagram, a reconstruction label or a valid label is set for each stripe by judging whether the data packet is complete.
[0049] The order of reconstructing valid data is ordered, ensuring that the step of reconstructing valid data in the region containing the stripe with the reconstruction label within the valid data region occurs before the step of reconstructing valid data in the invalid region; and
[0050] Disk array reconstruction is performed on the area where the stripe with reconstruction tag is located within the effective data area. After the effective data is reconstructed within the effective data area, the storage system is brought online for use. Then, the effective data is reconstructed in the background for the invalid area.
[0051] The aforementioned disk array reconstruction method, apparatus, computer equipment, and storage media, without affecting the original disk array (RAID) functionality or user data consistency, divide the disk array into valid data areas and invalid areas based on whether user data is stored. Prioritize reconstructing valid data in the areas containing stripes with reconstruction tags within the valid data areas. Once the valid data within the valid data areas is reconstructed, the storage system can be put online and used immediately, reducing repair time in case of disk failure. Furthermore, the remaining invalid areas are reconstructed in the background, further shortening the disk array (RAID) reconstruction time and enabling rapid deployment, thus improving the user experience. Attached Figure Description
[0052] Figure 1 This is a diagram illustrating the application environment of a disk array reconstruction method in one embodiment;
[0053] Figure 2 This is a flowchart illustrating a disk array reconstruction method in one embodiment;
[0054] Figure 3 This is a flowchart illustrating the disk array reconstruction steps for the area containing the stripe with reconstruction tags within the effective data area, as shown in one embodiment.
[0055] Figure 4 This is a flowchart illustrating a disk array reconstruction method in another embodiment;
[0056] Figure 5 This is a flowchart illustrating the steps for constructing the dot matrix diagram in one embodiment;
[0057] Figure 6 This is a structural block diagram of a disk array reconstruction device in one embodiment;
[0058] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0060] The disk array reconstruction method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. Server 104 has a storage system for receiving and storing data from terminal 102. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Server 104 includes a hard disk or a device with a hard disk. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0061] Example 1
[0062] In Example 1, as Figure 2 As shown, a disk array reconstruction method is provided, which is applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0063] Step S1: Read the disk array in the storage system and divide the disk array into valid data area and invalid area according to whether user data is stored.
[0064] Step S2: Read the stripe information of the data packets one by one in the valid data area and the invalid area to construct a bitmap. In the bitmap, set a reconstruction label or a valid label for each stripe by judging whether the data packet is complete.
[0065] Step S3: Sort the order of reconstructing valid data, and control the step of reconstructing valid data in the area where the strip with reconstruction label is located in the valid data area to be earlier than the step of reconstructing valid data in the invalid area;
[0066] Step S4: Perform disk array reconstruction on the area where the stripe with reconstruction label is located within the effective data area;
[0067] Step S5: After reconstructing the valid data within the valid data area, control the storage system to go online and use it, and then reconstruct the valid data in the invalid area in the background.
[0068] BitMap can be understood as a data structure that stores specific data through a bit array; since a bit is the smallest unit of data, this data structure is often very space-efficient.
[0069] The effective area refers to the portion of the RAID array that is actually used by the user; it is the data area used for rapid reconstruction. The definition of the effective area also determines the granularity of the reconstruction.
[0070] There are two schemes for the effective region:
[0071] Option 1: The area actually written by the user is taken as the valid area.
[0072] advantage:
[0073] 1. Rapid reconstruction of small areas and short reconstruction completion time.
[0074] 2. Bitmap's get / set operations are all in the RAID module; you only need to modify the RAID module.
[0075] shortcoming:
[0076] 1. User data boundaries are difficult to define. It is also difficult to distinguish between real user data, formatted data, and internal data. Furthermore, it is difficult to determine the areas where user data has been deleted.
[0077] 2. Each time data is written, it needs to be marked, which affects IO performance and requires modification of the IO process.
[0078] Option 2: Use the allocated Vdisk as the valid region.
[0079] advantage:
[0080] 1. The boundaries of the area are easy to determine.
[0081] 2. Marking it once when creating the Vdisk is sufficient; it does not affect IO performance and does not require modification of the IO process.
[0082] shortcoming:
[0083] 1. The marked valid region is much larger than the user data. Reconstruction takes a long time.
[0084] 2. You need to set the bitmap when creating the vdisk in the vg module and get the bitmap in the RAID module.
[0085] In this embodiment, the preferred option is one, for the following reasons:
[0086] 1. User data area marking can mark all write operations in the RAID. Even if formatted data is formatted across all VDISKs, the worst-case scenario is the same as in Scheme 2. Therefore, the reconstruction time is short.
[0087] 2. Since the bitmap is only stored in memory and is not read or written to disk, the performance impact is not significant.
[0088] 3. Only the RAID module needs to be modified.
[0089] In one embodiment, the method of reconstructing valid data in the invalid region in the background includes: initializing the invalid region; or reconstructing the disk array in the region where the stripe with reconstruction label is located in the invalid region; or reconstructing the disk array in the region where the stripe with reconstruction label is located in the invalid region and verifying and updating the data in the invalid region.
[0090] More specifically, the following solutions exist for handling the remaining invalid region reconstruction portion after the disk array reconstruction of the stripe containing the reconstruction label within the effective data region is completed.
[0091] Option 1: After refactoring, continue refactoring.
[0092] Advantages: Simple process control, minimal modifications required.
[0093] Disadvantages: After reconstructing the valid data portion, continuing to reconstruct the entire RAID is a degraded state; for RAID 5, it cannot afford to lose another disk. However, the user perceives it as an online state, allowing for the loss of another disk.
[0094] Option 2: Refactor and initialize (write all zeros)
[0095] Advantages: After reconstructing the valid data portion, the process is changed from reconstruction to initialization, which allows for the loss of another disk for RAID5.
[0096] Disadvantages: Reinitialization increases I / O load. All unused areas are essentially initialized twice. It increases wear on full flash drives. Also, you can't just initialize the last disk, because invalid areas on the disk may not have been unused before going offline.
[0097] Option 3: Resync after refactoring
[0098] Advantages: After reconstructing the valid data, only the verification data is updated for invalid data. Write I / O load is relatively low. And it's possible to lose another disk.
[0099] Disadvantages: MCS lacks a resync mechanism, only a rebuild parity mechanism. However, this still indicates a rebuilding state, and disk offlineing is not allowed. Therefore, the resync mechanism needs to be reimplemented, which involves a significant amount of work.
[0100] In this embodiment of the application, it is preferred to initialize the invalid region and then reconstruct valid data in the background, i.e., choose scheme two, for the following reasons:
[0101] 1. Continuing to refactor after refactoring the user data is in a degraded state, while initialization is in an online state. This refactoring approach carries a higher risk.
[0102] 2. Initialization is faster than reconstruction.
[0103] 3. The development of the Resync feature cannot be completed in a short period of time.
[0104] like Figure 2 As shown, before performing disk array reconstruction on the area where the stripe with reconstruction label is located within the effective data area, the method further includes:
[0105] Step S11: Monitor the change value of the cluster in real time and compare the change value of the cluster with the first threshold. When the change value of the cluster is greater than or equal to the first threshold, initiate a disk array reconstruction task, and then execute step S4 to reconstruct the disk array in the area where the stripe with reconstruction label is located in the effective data area.
[0106] like Figure 2 As shown, after the valid data in both the valid data region and the invalid data region has been reconstructed, the process further includes:
[0107] Returning to the step of reading the disk array in the storage system, the changes in the cluster are monitored in real time again. The changes in the cluster are compared with the first threshold to determine whether to initiate the disk array reconstruction task again.
[0108] like Figure 3 As shown, the disk array reconstruction of the area containing the stripe with reconstruction tags within the effective data area includes:
[0109] Step S41: Perform input / output processing on the current data of the area where the strip with the reconstruction label is located within the effective data area to obtain the historical data and time nodes stored in the area where the strip is located.
[0110] Step S42: Read the historical data;
[0111] Step S43: Calculate the difference between the historical data and the current data to obtain the time node corresponding to the lost data; and
[0112] Step S44: Reconstruct the lost data based on the historical data corresponding to the time node.
[0113] Example 2
[0114] Example 2 includes all the technical features of Example 1, such as Figure 4 As shown, in Embodiment 2, when reconstructing the disk array in the area where the stripe with the reconstruction tag is located within the effective data area, the following is also included simultaneously:
[0115] Step S6: Adjust the dot matrix pattern in real time;
[0116] Step S7: Display the contents of the dot matrix diagram to show the status and reconstruction progress of the disk array.
[0117] like Figure 4 As shown, after the valid data in both the valid data area and the invalid data area has been reconstructed, the method further includes: step S8, clearing the dot matrix.
[0118] In this embodiment, when constructing the bitmap, the bitmap is constructed at the granularity of stripes or at the granularity of extents.
[0119] The design scheme for the bitmap granularity is as follows.
[0120] Option 1: Use extent as the granularity.
[0121] advantage:
[0122] 1. Saves memory.
[0123] shortcoming:
[0124] 1. The reconstruction area is too large, and the reconstruction may be invalid.
[0125] 2. Settings need to be configured in the VG module.
[0126] Option 2: Use stripe as the granularity.
[0127] advantage:
[0128] 1. The reconstruction area is relatively small.
[0129] 2. No need to modify the VG module or add support for extent interfaces.
[0130] shortcoming:
[0131] 1. Bitmaps consume a lot of memory.
[0132] The preferred option in this application is Option 2, for the following reasons:
[0133] 1. Using extents as the granularity will reconstruct redundant regions.
[0134] 2. No new code using the extent interface is needed. Functions using the stripe interface are already implemented.
[0135] 3. The extent bitmap requires modification by the VG module. RAID does not have the concept of extent internally. The VG module refers to: Virtualization Management – Volume Management.
[0136] like Figure 5 As shown, constructing the dot matrix image specifically includes the following steps:
[0137] Step S21, forming a bitmap interface, which is a bitmap interface converted from a memory interface to the disk within the disk array within the stripe; and
[0138] Step S22: A reconstruction bitmap and a data bitmap are formed. The reconstruction bitmap is used to record the position information of the stripes for which reconstruction tags are set, and the data bitmap is used to record the position information of the stripes for which valid tags are set.
[0139] In the aforementioned disk array reconstruction method, without affecting the original disk array (RAID) functionality or user data consistency, the disk array is divided into valid data areas and invalid areas based on whether user data is stored. Priority is given to reconstructing valid data in the areas containing stripes with reconstruction tags within the valid data areas. Once the valid data within the valid data areas is reconstructed, the storage system can be put online and used immediately, reducing repair time in case of disk failure. Furthermore, the remaining invalid areas are reconstructed in the background, further shortening the disk array (RAID) reconstruction time and enabling rapid deployment, thus improving the user experience.
[0140] It should be understood that, although Figure 2-5 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2-5 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0141] In one embodiment, such as Figure 6 As shown, a disk array reconstruction device is provided, including: a reconstruction task management module 1, a dot matrix interface 2, a task scheduling module 3, and a stripe data processing module 4.
[0142] The reconstruction task management module 1 (schWork) is used to read the disk array in the storage system and divide the disk array into valid data areas and invalid areas according to whether user data is stored.
[0143] The main task of the schWork module is to submit the first stripe of a pack, which is used to reconstruct the entire pack. When submitting the first stripe of a pack, it reads the reconstruction bitmap and calculates which stripes need to be reconstructed.
[0144] Fast reconstruction requires reading the reconstructed bitmap and then the valid data bitmap. Only when a stripe is both the stripe to be reconstructed and within the valid region is it submitted to the reconstruction task for preparation. If the data is not within the valid region, the reconstructed bitmap is not cleared; reconstruction or initialization continues only after the valid region has been reconstructed.
[0145] The dot matrix interface 2 is connected to the reconstruction task management module and is used to read the strip information of the data packets one by one in the valid data area and the invalid area to construct the dot matrix. In the dot matrix, the reconstruction label or valid label is set for each strip by judging whether the data packet is complete.
[0146] The task scheduling module 3 (Tcb_batch) is connected to the dot matrix interface and is used to sort the order of reconstructing valid data, and control the step of reconstructing valid data in the area where the strip with reconstruction label is located in the valid data area to be earlier than the step of reconstructing valid data in the invalid area.
[0147] Task scheduling module 3 is mainly responsible for the coordinated scheduling between various tasks.
[0148] The stripe data processing module 4 (SIO) is connected to the task scheduling module and is used to reconstruct the disk array in the area where the stripe with the reconstruction tag is located in the effective data area. When the effective data is reconstructed in the effective data area, the storage system is brought online for use, and then the effective data in the invalid area is reconstructed in the background.
[0149] Striped Data Processing Module 4 (SIO) is used for data reading, writing, and computation. For reconstruction, it reads normal disk data, performs computation, and recovers lost data. The stripes for reconstruction are obtained from tasks submitted by the schWork module. Reconstruction is performed pack by pack. The bitmap is cleared after reconstruction. For fast reconstruction, if user data is used as valid data, the stripe is simultaneously recorded in the valid data bitmap when writing data, instead of being set in the CSM agent. The valid data bitmap is not cleared after reconstruction. The valid data bitmap is cleared when the vdisk is deleted. Because the deletion of user data is imperceptible, real-time clearing of invalid bitmaps is not possible.
[0150] like Figure 6 As shown, the device further includes: a control state machine 5 (CSM) for real-time monitoring of cluster changes and comparing the cluster changes with a first threshold; when the cluster changes are greater than or equal to the first threshold, a disk array reconstruction task is initiated to the stripe data processing module.
[0151] like Figure 6 As shown, the device further includes: a reconstruction metadata module 6 (Agent), connected to the control state machine, the stripe data processing module, and the dot matrix interface, used to receive the progress of disk array reconstruction in the area where the stripe with reconstruction tags is located within the valid data area from the stripe data processing module after receiving a disk array reconstruction task initiated by the control state machine, and to adjust the dot matrix in the dot matrix interface in real time; after the valid data in both the valid data area and the invalid area has been reconstructed, the reconstruction metadata module is also used to clear the dot matrix.
[0152] The RAID Controller Management System (CSM) is primarily used to initiate reconstruction suggestion tasks. When a disk goes offline, the RAID CSM executes the suggestion logic, recommending RAID reconstruction. The CSM instructs the agent to set the reconstruction metadata, mainly the bitmap data. For fast reconstruction, if a vdisk is used as the valid data area, the vg module needs to set the RAID extent in the RAID module's valid data bitmap when creating the vdisk. If user data is used as the valid data area, no modification is needed in the CSM.
[0153] The primary function of the Agent is to set up reconstruction metadata. For reconstruction, this means performing a `setall` operation on the bitmap of the disk to be reconstructed. During fast reconstruction, if the vdisk is used as the valid user region, the agent also needs to mark the extents used by the vdisk to set the user bitmap. If user data is used as the valid data region, no modification is needed in the Agent.
[0154] like Figure 6 As shown, the device also includes a display screen 7, which has a graphical user interface (GUI); the graphical user interface is used to call the command line for reconstructing the disk array and display the content of the dot matrix to show the status and reconstruction progress of the disk array.
[0155] Specific limitations regarding the disk array reconstruction device can be found in the limitations of the disk array reconstruction method described above, and will not be repeated here. Each module in the aforementioned disk array reconstruction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0156] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores disk array reconstruction data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a disk array reconstruction method.
[0157] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0158] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0159] Read the disk array in the storage system and divide the disk array into valid data areas and invalid areas according to whether user data is stored;
[0160] The stripe information of the data packets is read one by one in the valid data area and the invalid area to construct a dot matrix diagram. Within the dot matrix diagram, a reconstruction label or a valid label is set for each stripe by judging whether the data packet is complete.
[0161] The order of reconstructing valid data is ordered, ensuring that the step of reconstructing valid data in the region containing the stripe with the reconstruction label within the valid data region occurs before the step of reconstructing valid data in the invalid region; and
[0162] Disk array reconstruction is performed on the area where the stripe with reconstruction tag is located within the effective data area. After the effective data is reconstructed within the effective data area, the storage system is brought online for use. Then, the effective data is reconstructed in the background for the invalid area.
[0163] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0164] Read the disk array in the storage system and divide the disk array into valid data areas and invalid areas according to whether user data is stored;
[0165] The stripe information of the data packets is read one by one in the valid data area and the invalid area to construct a dot matrix diagram. Within the dot matrix diagram, a reconstruction label or a valid label is set for each stripe by judging whether the data packet is complete.
[0166] The order of reconstructing valid data is ordered, ensuring that the step of reconstructing valid data in the region containing the stripe with the reconstruction label within the valid data region occurs before the step of reconstructing valid data in the invalid region; and
[0167] Disk array reconstruction is performed on the area where the stripe with reconstruction tag is located within the effective data area. After the effective data is reconstructed within the effective data area, the storage system is brought online for use. Then, the effective data is reconstructed in the background for the invalid area.
[0168] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0169] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0170] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A disk array reconstruction method, characterized in that, Including the following steps: Read the disk array in the storage system and divide the disk array into valid data areas and invalid areas according to whether user data is stored; The stripe information of the data packets is read one by one in the valid data area and the invalid area to construct a dot matrix diagram. Within the dot matrix diagram, a reconstruction label or a valid label is set for each stripe by judging whether the data packet is complete. The order of reconstructing valid data is sorted, and the step of reconstructing valid data in the region where the strip with reconstruction label is located within the valid data region is earlier than the step of reconstructing valid data in the invalid region. as well as Disk array reconstruction is performed on the area where the stripe with reconstruction tag is located within the effective data area. After the effective data is reconstructed within the effective data area, the storage system is brought online for use. Then, the effective data is reconstructed in the background for the invalid area.
2. The disk array reconstruction method according to claim 1, characterized in that, The methods for reconstructing valid data in the invalid region in the background include: Initialize the invalid region; or Perform disk array reconstruction on the regions containing stripes with reconstruction tags within the invalid regions; or The disk array is reconstructed in the region where the stripe with the reconstruction tag is located in the invalid region, and the data in the invalid region is verified and updated.
3. The disk array reconstruction method according to claim 2, characterized in that, Before performing disk array reconstruction on the area containing the stripe with reconstruction tags within the effective data area, the method further includes: Real-time monitoring of cluster changes, and comparison of the cluster changes with a first threshold. When the change value of the cluster is greater than or equal to the first threshold, a disk array reconstruction task is initiated, and the disk array reconstruction is performed on the area where the stripe with reconstruction label is located in the effective data area.
4. The disk array reconstruction method according to claim 3, characterized in that, After the valid data in both the valid data region and the invalid data region has been reconstructed, the method further includes: Returning to the step of reading the disk array in the storage system, the changes in the cluster are monitored in real time again. The changes in the cluster are compared with the first threshold to determine whether to initiate the disk array reconstruction task again.
5. The disk array reconstruction method according to claim 1, characterized in that, When reconstructing the disk array in the area where the stripe with the reconstruction label is located within the effective data area, the process also includes: The dot matrix pattern is adjusted in real time; The content of the dot matrix is displayed to show the status and reconstruction progress of the disk array.
6. The disk array reconstruction method according to claim 5, characterized in that, After the valid data in both the valid data region and the invalid data region has been reconstructed, the method further includes: Clear the bitmap.
7. The disk array reconstruction method according to claim 1, characterized in that, When constructing the dot matrix, the dot matrix is constructed with stripes as the granularity, or the dot matrix is constructed with length as the granularity. The construction of the dot matrix image specifically includes the following steps: This forms a raster interface, which is converted from a memory interface to a raster interface within the stripe of the disks inside the disk array; and A reconstruction label area and a valid label area are formed. The reconstruction label area is used to record the position information of the strips for which reconstruction labels are set, and the valid label area is used to record the position information of the strips for which valid labels are set.
8. A disk array reconstruction device, characterized in that, The device includes: The task management module is reconstructed to read the disk array in the storage system and divide the disk array into valid data areas and invalid areas according to whether user data is stored. The dot matrix interface is connected to the reconstruction task management module and is used to read the strip information of the data packets one by one in the valid data area and the invalid area to construct the dot matrix. In the dot matrix, the reconstruction label or valid label is set for each strip by judging whether the data packet is complete. The order of reconstructing valid data is sorted, and the step of reconstructing valid data in the region where the strip with reconstruction label is located within the valid data region is earlier than the step of reconstructing valid data in the invalid region. The task scheduling module, connected to the dot matrix interface, is used to sort the order of reconstructing valid data, controlling that the step of reconstructing valid data in the region containing the stripe with reconstruction label within the valid data area is performed earlier than the step of reconstructing valid data in the invalid region; and The stripe data processing module is connected to the task scheduling module and is used to reconstruct the disk array in the area where the stripe with the reconstruction tag is located in the effective data area. When the effective data is reconstructed in the effective data area, the storage system is brought online for use, and then the effective data in the invalid area is reconstructed in the background.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
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 7.
Citation Information
Patent Citations
Method and equipment for rebuilding redundant disk array
CN101770413A
Method for restoring redundancy for RAID (Redundant Array of Independent Disks) disk array
CN105549908A