A disk reconstruction method, device, apparatus and storage medium
Patent Information
- Application Number
- CN202411375320.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2044-09-29
AI Technical Summary
[0004]本发明实施例的目的是提供一种磁盘重构方法、装置、设备及存储介质,可以解决磁盘重构中条带初始化的效率低下的问题
[0038]由此可见,本申请应用于控制器,当控制器中的磁盘阵列的目标成员盘出现故障时,基于重构位图对所述目标成员盘中的各条带进行分类,得到包含数据的第一条带和不包含数据的第二条带;然后基于所述重构位图和所述第一条带对新磁盘中相关条带的数据进行重构操作;在所述重构操作完成后,将所述第二条带在所述重构位图中对应的元数据拷贝至所述新磁盘对应的初始化位图中,并在拷贝的过程中,通过检查所述重构位图和所述初始化位图以确定所述新磁盘中的待初始化条带,然后对所述待初始化条带进行初始化,以得到所述目标成员盘对应的重构后磁盘。
Smart Images

Figure CN119292838B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of disk management technology, and in particular to a disk reconstruction method, apparatus, device, and storage medium. Background Technology
[0002] When a disk failure occurs in a Redundant Array of Independent Disks (RAID), the common approach is for the SCH (Scheduler) in the controller to identify the stripes that need reconstruction. This stripe is then packaged into tasks and submitted to the IOmgr (task processing) module for processing. The IOmgr module checks if the stripe to be reconstructed has data. For stripes with data, reconstruction is performed, and the reconstruction metadata is updated (at least two controllers must update synchronously). For stripes without data, both the reconstruction metadata and the initialization metadata are updated (at least two controllers must update synchronously) to mark the stripe as needing initialization. This process involves handling stripes without data and communication between multiple controllers, impacting reconstruction efficiency.
[0003] It is evident that improving the disk reconstruction efficiency in a disk array is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of this invention is to provide a disk reconstruction method, apparatus, device, and storage medium that can solve the problem of low efficiency in stripe initialization during disk reconstruction.
[0005] To address the aforementioned technical problems, in a first aspect, embodiments of the present invention provide a disk reconstruction method applied to a controller, comprising:
[0006] When a target member disk in the disk array fails, the stripes in the target member disk are classified based on the reconstructed bitmap to obtain a first stripe containing data and a second stripe not containing data.
[0007] Based on the reconstructed bitmap and the first stripe, the data of the relevant stripes in the new disk are reconstructed;
[0008] After the reconstruction operation is completed, the metadata corresponding to the second stripe in the reconstruction bitmap is copied to the initialization bitmap corresponding to the new disk. During the copying process, the stripe to be initialized in the new disk is determined by checking the reconstruction bitmap and the initialization bitmap. Then, the stripe to be initialized is initialized to obtain the reconstructed disk corresponding to the target member disk.
[0009] Optionally, when a target member disk in the disk array fails, classifying the stripes in the target member disk based on the reconstructed bitmap to obtain a first stripe containing data and a second stripe not containing data includes:
[0010] When a target member disk in the disk array fails, the index corresponding to each stripe in the target member disk is determined based on the reconstructed bitmap, and each stripe is classified according to whether the index indicates that it contains data, so as to obtain the first stripe containing data and the second stripe not containing data.
[0011] Optionally, the step of reconstructing the data of relevant stripes in the new disk based on the reconstructed bitmap and the first stripe includes:
[0012] Based on the first stripe, the data to be reconstructed contained in the target member disk is determined, and the space of the new disk is divided based on the reconstruction bitmap to obtain a number of corresponding stripes;
[0013] Based on the reconstructed bitmap, the data to be reconstructed is reconstructed on the new disk to reconstruct the data to the relevant stripes on the new disk.
[0014] Optionally, the step of reconstructing the data to be reconstructed on the new disk based on the reconstructed bitmap, so as to reconstruct the data to be reconstructed into the relevant stripes of the new disk, includes:
[0015] The scheduler determines the reconstruction task to be executed at the current moment; the reconstruction task is a task targeting any one of the first stripes in the reconstruction bitmap;
[0016] The reconstruction task is executed to reconstruct the data to be reconstructed in the corresponding first stripe to the corresponding stripe of the new disk, and after the reconstruction task is completed, the metadata corresponding to the first stripe is synchronized between the primary and backup controllers; the primary and backup controllers include the current controller and another controller that is processing the reconstruction operation of the target member disk.
[0017] Optionally, copying the metadata corresponding to the second stripe in the reconstructed bitmap to the initialization bitmap corresponding to the new disk includes:
[0018] The execution time period of the copy operation corresponding to the metadata of the second strip in the reconstructed bitmap is determined by a pre-set timer, and the copy progress position of the metadata of the next second strip corresponding to the last second strip copied in the previous execution time period is determined at the beginning of the execution time period; each of the second strips carries a first initialization flag indicating that it is to be initialized.
[0019] Starting from the second stripe corresponding to the metadata at the copy progress position of the reconstructed bitmap, search for the second stripe carrying the first initialization flag to obtain the target stripe of the metadata to be copied;
[0020] A second initialization flag is added to the stripe in the new disk that corresponds to the target stripe, and the metadata of the target stripe is copied from the reconstructed bitmap to the initialization bitmap, while the first initialization flag of the target stripe is deleted from the reconstructed bitmap.
[0021] Optionally, during the copying process, the uninitialized stripes in the new disk are determined by checking the reconstructed bitmap and the initialization bitmap, and then the uninitialized stripes are initialized to obtain the reconstructed disk corresponding to the target member disk, including:
[0022] During the copying process, it is determined whether there is a second strip carrying the first initialization marker in the strip corresponding to the reconstructed bitmap at the current moment, and the corresponding determination result is obtained;
[0023] If the judgment result indicates that there is a second stripe carrying the first initialization flag, then the scheduler determines a second stripe carrying the first initialization flag from the stripes corresponding to the reconstructed bitmap as the current stripe to be initialized at the current time.
[0024] Based on the metadata corresponding to the current stripe in the reconstructed bitmap, the corresponding stripe in the new disk is initialized, and the first initialization flag corresponding to the current stripe is deleted. Then, the process jumps to the step of determining whether there is a second stripe carrying the first initialization flag in the stripe corresponding to the reconstructed bitmap at the current moment.
[0025] If the judgment result indicates that there is no second strip carrying the first initialization flag in the strip corresponding to the reconstructed bitmap at the current time, and there is a strip carrying the second initialization flag in the strip corresponding to the initialization bitmap, then the scheduler determines a strip carrying the second initialization flag from the strip corresponding to the initialization bitmap as the current strip to be initialized at the current time.
[0026] Based on the metadata corresponding to the current stripe in the initialization bitmap, the corresponding stripe in the new disk is initialized, and the second initialization flag corresponding to the current stripe is deleted. Then, the process jumps to the step of determining a stripe carrying the second initialization flag from the stripes corresponding to the initialization bitmap through the scheduler as the current stripe to be initialized at the current moment.
[0027] If the determination result indicates that there is no second stripe carrying the first initialization mark in the stripe corresponding to the reconstructed bitmap, and there is no stripe carrying the second initialization mark in the stripe corresponding to the initialization bitmap, then it is determined that each second stripe corresponding to the reconstructed bitmap has completed the corresponding initialization process, and the final new disk is determined as the reconstructed disk corresponding to the target member disk.
[0028] Optionally, the method further includes:
[0029] During the copying process, if a new member disk in the disk array fails, the timer is stopped, and the maximum copying performance of the controller at the current moment is used to perform a copying operation on the metadata corresponding to several second stripes in the reconstructed bitmap, so as to copy the relevant metadata to the initialization bitmap corresponding to the new disk.
[0030] Secondly, this application provides a disk reconstruction apparatus applied to a controller, comprising:
[0031] The stripe classification module is used to classify the stripes in the target member disk based on the reconstructed bitmap when the target member disk in the disk array fails, so as to obtain a first stripe containing data and a second stripe not containing data.
[0032] The data reconstruction module is used to reconstruct the data of relevant stripes in the new disk based on the reconstruction bitmap and the first stripe;
[0033] The stripe initialization module is used to copy the metadata corresponding to the second stripe in the reconstruction bitmap to the initialization bitmap corresponding to the new disk after the reconstruction operation is completed. During the copying process, the module checks the reconstruction bitmap and the initialization bitmap to determine the stripe to be initialized in the new disk, and then initializes the stripe to be initialized to obtain the reconstructed disk corresponding to the target member disk.
[0034] Thirdly, this application provides an electronic device, comprising:
[0035] Memory, used to store computer programs;
[0036] A processor for executing the computer program to implement the steps of the disk reconstruction method described above.
[0037] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the disk reconstruction method described above.
[0038] Therefore, this application is applied to a controller. When a target member disk of a disk array in the controller fails, the stripes in the target member disk are classified based on a reconstruction bitmap to obtain a first stripe containing data and a second stripe not containing data. Then, based on the reconstruction bitmap and the first stripe, the data of the relevant stripes in the new disk is reconstructed. After the reconstruction operation is completed, the metadata corresponding to the second stripe in the reconstruction bitmap is copied to the initialization bitmap corresponding to the new disk. During the copying process, the stripes to be initialized in the new disk are determined by checking the reconstruction bitmap and the initialization bitmap. Then, the stripes to be initialized are initialized to obtain the reconstructed disk corresponding to the target member disk.
[0039] As can be seen from the above technical solution, this application ignores the second stripe that does not contain data during the disk data reconstruction process, and only reconstructs the data of the first stripe containing data to the new disk. After reconstructing the data of the first stripe to the new disk, a metadata copy operation is performed to copy the metadata corresponding to the second stripe in the reconstruction bitmap to a pre-built initialization bitmap. Subsequently, the stripe corresponding to the new disk can be initialized through the initialization bitmap, which can minimize the occupation of the reconstruction bitmap during the disk reconstruction process. Furthermore, during the metadata copy process, this application can perform initialization operations on the relevant stripes of the new disk based on the metadata corresponding to the stripe to be initialized in the reconstruction bitmap or the initialization bitmap, which can further speed up the stripe initialization speed, reduce the occupation of the reconstruction bitmap, and improve the disk reconstruction efficiency. Attached Figure Description
[0040] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a flowchart of a disk reconstruction method disclosed in this application;
[0042] Figure 2 This is a schematic diagram illustrating the relationship between specific disk reconstruction modules disclosed in this application;
[0043] Figure 3 This is a schematic diagram of the structure of a disk reconstruction device disclosed in this application;
[0044] Figure 4 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0046] The terms "comprising" and "having," and any variations thereof, in the specification and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.
[0047] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] like Figure 1 As shown in the figure, this application discloses a disk reconstruction method applied to a controller, including:
[0049] Step S11: When a target member disk in the disk array fails, the stripes in the target member disk are classified based on the reconstructed bitmap to obtain a first stripe containing data and a second stripe not containing data.
[0050] When a member disk of a disk array fails, the stripes in the target member disk that failed need to be reconstructed. In this application, during the data reconstruction process, a first stripe containing data and a second stripe not containing data are first distinguished. Specifically, the stripes in the target member disk can be classified using a reconstruction bitmap to reconstruct the first stripe containing data while ignoring the second stripe not containing data. In a specific embodiment, the step of classifying the stripes in the target member disk based on the reconstruction bitmap to obtain the first stripe containing data and the second stripe not containing data when the target member disk in the disk array fails can include: determining the index corresponding to each stripe in the target member disk based on the reconstruction bitmap, and classifying the stripes according to whether the index indicates the presence of data, to obtain the first stripe containing data and the second stripe not containing data. Specifically, when data is written to each member disk in a disk array, the data writing status can be recorded using indexes. For example, when writing data, LP and PL indexes are built. L is the LBA (Logical Block Address) seen by the user, and P is the RAID LBA. This PL is written to the disk along with the user data. When data reconstruction is needed later, the LBA(P) of the disk array is calculated based on the specific stripe x. By querying whether there is a corresponding L for this P, it can be determined whether there is data in this stripe x. Through such indexing, the stripes in the target member disk that has failed can be classified, resulting in the first stripe containing data and the second stripe not containing data.
[0051] Step S12: Reconstruct the data of the relevant stripes in the new disk based on the reconstructed bitmap and the first stripe.
[0052] In this embodiment, for the first stripe containing data, a data reconstruction operation can be performed directly on the new disk using a reconstruction bitmap to reconstruct the data of the first stripe in the faulty target member disk to the relevant stripe in the new disk. Furthermore, the reconstruction bitmap can clear the relevant information of the already reconstructed stripe in the target member disk, leaving only the relevant information of the second stripe in the target member disk that does not contain data and needs to be initialized.
[0053] In one specific embodiment, the reconstruction operation of the data in the relevant stripes of the new disk based on the reconstruction bitmap and the first stripe may include: determining the data to be reconstructed contained in the target member disk based on the first stripe, and dividing the space of the new disk according to the reconstruction bitmap to obtain a number of corresponding stripes; and performing a reconstruction operation on the data to be reconstructed in the new disk based on the reconstruction bitmap to reconstruct the data to be reconstructed into the relevant stripes of the new disk. Specifically, the first stripe is a stripe containing data obtained through classification, which can determine the data that needs to be reconstructed contained in the corresponding target member disk, i.e., the data to be reconstructed. It can be understood that for a new disk, an initialization bitmap needs to be constructed first, and the space of the new disk needs to be divided to obtain a number of stripes; then, a reconstruction operation is performed on the data to be reconstructed based on the reconstruction bitmap to reconstruct the data to be reconstructed into the stripes of the new disk.
[0054] In another specific embodiment, the reconstruction operation of the data to be reconstructed on the new disk based on the reconstruction bitmap, to reconstruct the data to be reconstructed into the relevant stripe of the new disk, may include: determining the reconstruction task to be executed at the current moment through a scheduler; the reconstruction task is a task for any first stripe in the reconstruction bitmap; executing the reconstruction task to reconstruct the data to be reconstructed in the corresponding first stripe into the corresponding stripe of the new disk, and synchronizing the metadata corresponding to the first stripe between the primary and backup controllers after the reconstruction task is completed; the primary and backup controllers include the current controller and another controller that is processing the reconstruction operation of the target member disk. Specifically, the scheduler can organize several data reconstruction tasks of the first stripe corresponding to the reconstruction bitmap and allocate the reconstruction tasks to be executed at the current moment; then the controller can execute the reconstruction task to reconstruct the data to be reconstructed in the corresponding first stripe of the target member disk into the corresponding stripe of the new disk; and, through the cooperation of the primary and backup controllers, data can be backed up, and the current controller and the other controller can work together to process the reconstruction process of the target member disk, and data synchronization is performed between the two controllers to avoid progress loss due to the failure of one controller.
[0055] In one specific embodiment, when distinguishing whether a stripe contains data, the stripes are classified into a first stripe containing data and a second stripe not containing data. Here, the stripes are categorized and marked as first stripe and second stripe. Then, the second stripe carrying the categorization mark can be directly considered as a stripe to be initialized. After data reconstruction of the first stripe, the categorization mark is deleted. The metadata copying process then involves copying the metadata corresponding to the second stripe carrying the categorization mark from the reconstruction bitmap to the initialization bitmap, and marking the stripe on the new disk corresponding to the metadata copied to the initialization bitmap as a stripe to be initialized. This process avoids the need to initialize and mark the stripes that do not contain data on the target member disk corresponding to the reconstruction bitmap after data reconstruction; the remaining categorization marks can be used directly for the metadata copying process.
[0056] Step S13: After the reconstruction operation is completed, the metadata corresponding to the second stripe in the reconstruction bitmap is copied to the initialization bitmap corresponding to the new disk. During the copying process, the stripe to be initialized in the new disk is determined by checking the reconstruction bitmap and the initialization bitmap. Then, the stripe to be initialized is initialized to obtain the reconstructed disk corresponding to the target member disk.
[0057] In this embodiment, the data carried by the first stripe in the target member disk can be reconstructed to the relevant stripe in the new disk through the above steps, thus achieving data reconstruction. Further, after the reconstruction operation is completed, the metadata of the second stripe in the target member disk that does not contain data can be updated; specifically, the metadata corresponding to the second stripe in the reconstruction bitmap is copied to the initialization bitmap corresponding to the new disk, so that the metadata copied to the initialization bitmap can be used to initialize the relevant stripe in the new disk. Correspondingly, during the metadata copying process, the controller can use the metadata copied to the initialization bitmap or the metadata in the reconstruction bitmap to initialize the stripe in the new disk. By checking the initialization bitmap and the reconstruction bitmap, the controller can filter out the stripes in the new disk that need to be initialized corresponding to the metadata copied to the initialization bitmap, as well as the stripes in the new disk that need to be initialized corresponding to the metadata in the uncopied reconstruction bitmap, ensuring that the second stripe in the target member disk that does not contain data is initialized to the new disk, ultimately resulting in the reconstructed disk corresponding to the target member disk.
[0058] In one specific embodiment, copying the metadata corresponding to the second stripe in the reconstructed bitmap to the initialization bitmap corresponding to the new disk may include: determining the execution time period of the copy operation corresponding to the metadata of the second stripe in the reconstructed bitmap by using a pre-set timer, and determining the copy progress position of the metadata of the next second stripe corresponding to the last second stripe copied in the previous execution time period at the beginning of the execution time period; each of the second stripes carries a first initialization flag indicating that it is to be initialized; starting from the second stripe corresponding to the metadata at the copy progress position in the reconstructed bitmap, searching for the second stripe carrying the first initialization flag to obtain the target stripe of the metadata to be copied; adding a second initialization flag to the stripe corresponding to the target stripe in the new disk, copying the metadata of the target stripe from the reconstructed bitmap to the initialization bitmap, and deleting the first initialization flag of the target stripe in the reconstructed bitmap. Specifically, during the metadata copying process, copy tasks are managed periodically using a timer. The reconstructed bitmap can add a first initialization marker to the second stripe that does not contain data, indicating that it needs initialization. After the corresponding metadata copy is completed, this first initialization marker is deleted, thus distinguishing the stage of the stripe. First, the execution time period of the copy operation that matches the metadata of the second stripe of the target member disk in the reconstructed bitmap is determined. It is understandable that the reconstruction time requirements are different for frequently used member disks and infrequently used member disks. Here, the frequency level of the disk can be preset, and the corresponding execution time period can be set. Further, after obtaining the execution time period corresponding to the failed target member disk, the metadata existing in the reconstructed bitmap needs to continue copying from the progress of the copy in the previous execution time period. Specifically, the copy progress position of the metadata of the next second stripe corresponding to the last second stripe copied in the previous execution time period is determined. Then, starting from this copy progress position, the first stripe carrying the first initialization marker is determined as the target stripe to be copied. Then, the metadata in the reconstructed bitmap corresponding to the target stripe is copied to the corresponding stripe carrying the second initialization marker in the initialization bitmap, which indicates that initialization is required. In a specific embodiment, for a new disk, the space of the new disk can be divided into several stripes according to a fixed length c; for each stripe, 1 bit space is used to store information, 1 indicates that initialization is required, and 0 indicates that initialization is complete; these bits are stored in the power-loss protected memory in the order of the stripe numbers; therefore, the corresponding bit can be found according to the stripe number x, or the position of the bit can be used to know which stripe information this bit represents; here 1 is the second initialization flag.
[0059] In another specific embodiment, the step of determining the uninitialized stripe in the new disk by checking the reconstructed bitmap and the initialization bitmap during the copying process, and then initializing the uninitialized stripe to obtain the reconstructed disk corresponding to the target member disk, may include: during the copying process, determining whether there is a second stripe carrying a first initialization mark in the stripe corresponding to the reconstructed bitmap at the current moment, and obtaining a corresponding determination result; if the determination result indicates that there is a second stripe carrying a first initialization mark, then the scheduler determines a second stripe carrying a first initialization mark from the stripe corresponding to the reconstructed bitmap as the current stripe to be initialized at the current moment; initializing the corresponding stripe in the new disk based on the metadata corresponding to the current stripe in the reconstructed bitmap, deleting the first initialization mark corresponding to the current stripe, and then jumping to the step of determining whether there is a second stripe carrying a first initialization mark in the stripe corresponding to the reconstructed bitmap at the current moment; if the determination result indicates that there is a second stripe carrying a first initialization mark in the stripe corresponding to the reconstructed bitmap at the current moment, then the copying process continues; if the determination result indicates that there is a second stripe carrying a first initialization mark in the stripe corresponding to the reconstructed bitmap at the current moment, then the copying process continues; if the copying process ... If there is no second stripe carrying the first initialization flag in the corresponding stripe, and there is a stripe carrying the second initialization flag in the stripe corresponding to the initialization bitmap, then the scheduler determines a stripe carrying the second initialization flag from the stripe corresponding to the initialization bitmap as the current stripe to be initialized at the current moment; the corresponding stripe in the new disk is initialized based on the metadata corresponding to the current stripe in the initialization bitmap, and the second initialization flag corresponding to the current stripe is deleted, and then the process jumps to the step of determining a stripe carrying the second initialization flag from the stripe corresponding to the initialization bitmap as the current stripe to be initialized at the current moment; if the judgment result indicates that there is no second stripe carrying the first initialization flag in the stripe corresponding to the reconstruction bitmap, and there is no stripe carrying the second initialization flag in the stripe corresponding to the initialization bitmap, then it is determined that each of the second stripes corresponding to the reconstruction bitmap has completed the corresponding initialization process, and the final new disk is determined as the reconstructed disk corresponding to the target member disk. Specifically, the initialization of stripes in the new disk during the metadata copying process involves two scenarios: First, the metadata corresponding to the stripe that needs to be initialized is the metadata carrying the first initialization flag in the reconstruction bitmap, which has not yet been copied to the initialization bitmap; Second, the metadata corresponding to the stripe that needs to be initialized is the metadata carrying the second initialization flag in the initialization bitmap, which has already been copied from the reconstruction bitmap to the initialization bitmap.Furthermore, to reduce the time spent reconstructing the bitmap, the process first checks if a second stripe carrying a first initialization flag exists in the reconstructed bitmap. It then determines if a second stripe of this type exists at the current moment, obtaining the corresponding result. If the result indicates that a second stripe carrying a first initialization flag exists in the reconstructed bitmap, this second stripe is identified as the current stripe to be initialized at the current moment. Then, based on the metadata corresponding to this current stripe in the reconstructed bitmap, the relevant stripes in the new disk need to be initialized, and the first initialization flag corresponding to the current stripe needs to be deleted, indicating that initialization is complete. Afterward, the process checks again to see if a second stripe carrying a first initialization flag exists in the corresponding stripes of the reconstructed bitmap, and then proceeds to the initialization process of the next stripe. Correspondingly, if the judgment result indicates that there is no second stripe carrying the first initialization flag in the stripe corresponding to the reconstructed bitmap at the current moment, it means that the corresponding stripes in the reconstructed bitmap that need to be initialized have all completed metadata copying or initialization. At this time, it is necessary to further determine whether there is a stripe carrying the second initialization flag in the stripe corresponding to the initialization bitmap. If so, the scheduler needs to determine a current stripe to be initialized at the current moment from the stripes corresponding to the initialization bitmap, and then use the metadata corresponding to the current stripe in the initialization bitmap to initialize the relevant stripes in the new disk, and delete the second initialization flag corresponding to the current stripe, indicating that the initialization has been completed. Afterwards, the scheduler determines a stripe carrying the second initialization flag from the stripes corresponding to the initialization bitmap as the current stripe to be initialized at the current moment, and enters the initialization process of the next stripe.
[0060] Furthermore, if there is no second stripe carrying the first initialization flag in the stripe corresponding to the reconstructed bitmap, and there is no stripe carrying the second initialization flag in the stripe corresponding to the initialization bitmap, it means that the stripes in the target member disk that do not contain data have also been initialized to the new disk, thus resulting in the reconstructed disk.
[0061] In one specific embodiment, the process may further include: during the copying process, if a new member disk in the disk array fails, the timer is stopped, and the maximum copying performance of the controller at the current moment is used to perform a copy operation on the metadata corresponding to several second stripes in the reconstruction bitmap, so as to copy the relevant metadata to the initialization bitmap corresponding to the new disk. Specifically, during the metadata copying process, if another member disk in the disk array also fails, and the reconstruction of the current target member disk is not yet complete, the timer needs to be stopped, and the maximum copying performance of the controller at the current moment needs to be used to copy the relevant metadata in the reconstruction bitmap to the initialization bitmap corresponding to the new disk. After the copying is completed, the reconstruction bitmap can be released so that the other failed member disk can use the reconstruction bitmap to perform disk reconstruction.
[0062] Therefore, this application ignores the second stripe that does not contain data during the disk data reconstruction process, and only reconstructs the data of the first stripe containing data to the new disk. After reconstructing the data of the first stripe to the new disk, a metadata copy operation is performed to copy the metadata corresponding to the second stripe in the reconstruction bitmap to a pre-built initialization bitmap. Subsequently, the stripe corresponding to the new disk can be initialized through the initialization bitmap, which can minimize the occupation of the reconstruction bitmap during the disk reconstruction process. Furthermore, during the metadata copy process, this application can initialize the relevant stripes of the new disk based on the metadata corresponding to the stripe to be initialized in the reconstruction bitmap or the initialization bitmap, which can further speed up the stripe initialization speed, reduce the occupation of the reconstruction bitmap, and improve the disk reconstruction efficiency.
[0063] like Figure 2 As shown in the embodiments of this application, the relationships between the modules in the disk reconstruction method will be described in detail, specifically including:
[0064] As can be seen, in this embodiment, disk reconstruction is performed collaboratively by two controllers. The SCH (scheduling) module is responsible for scheduling background task execution, obtaining the stripes that need to be reconstructed / initialized from the mm (memory management) module, and encapsulating them into individual tasks according to a predetermined rate and delivering them to the IOmgr (task management) module. The IOreceive (read / write request receiving) module is responsible for receiving IO (Input / Output, read / write) requests from the outside, encapsulating them into individual tasks according to the stripes and delivering them to the IOmgr module. The IOREGrequest (read / write request delivery) module is responsible for delivering the IO requests of this module to the disk. The mm module stores the metadata required for the disk array to operate and provides controller power-loss protection for the data. The mmgr (data backup) module is responsible for performing data backup between controllers.
[0065] Specifically, when a member disk of the disk array fails, all online controllers simultaneously go silent. The IOReeceive module places all new I / Os into the waiting queue instead of delivering them to the IOmgr module, which waits for all I / Os to be processed. Then, the mm module reads whether the reconstruction bitmap is valid (marking the reconstruction bitmap as invalid after the metadata copy is complete). If the reconstruction bitmap is valid, after all the data in the reconstruction bitmap is copied to the initialization bitmap, the position of the current copy is set to 0; otherwise, the reconstruction bitmap is filled with all 1s and used for the reconstruction of the failed member disk. Furthermore, the SCH module prepares the configuration data required for reconstruction (building a scheduler to find the stripes that need reconstruction and delivering the stripes to the IO process for reconstruction at the appropriate time). The SCH module reads the relevant data of the reconstruction bitmap from the mm module. After that, the controller exits silence, and the IOReecive and SCH modules begin to deliver the task to the IOMgr module. The IOMgr module processes the reconstruction task, reads the data (reconstruction bitmap) from the mm module, and determines whether there is data that needs to be reconstructed in a certain area of the faulty member disk. For the data area that needs to be reconstructed, reconstruction is performed, and the data of the member disk is updated through the IOReecive module. After the reconstruction is completed, the metadata of the primary and backup controllers (controller 1 and controller 2) is updated through the mmgr module. Furthermore, the IOMgr module notifies the SCH module that the task is complete, and the SCH module will read the next stripe that needs to be reconstructed. The above steps are repeated until all stripes that need to be reconstructed are reconstructed.
[0066] In a specific embodiment, when the IOReeve module receives a read / write request, it checks whether the current controller is in a silent state. If not, it forwards the read request to the IOmgr module. The IOmgr module then reads the metadata of the mm module to determine whether the current stripe needs initialization / reconstruction. Correspondingly, when reconstruction is in progress, it reads the metadata of the mm module's reconstruction bitmap and initialization bitmap to obtain information on whether the relevant stripe needs reconstruction / initialization. Similarly, when initialization is in progress, it reads the metadata of the mm module's reconstruction bitmap and initialization bitmap; if any bitmap has a (first or second) initialization flag, the stripe is considered to need initialization. The IOmgr module performs reconstruction and initialization based on whether reconstruction / initialization is needed, and processes host IO requests after reconstruction / initialization is complete.
[0067] In a specific embodiment, if a controller malfunctions and needs to exit (e.g., controller 1 fails), controller 2 becomes silent, completing any unfinished I / O. After controller 2 finishes its silent state, the new configuration information is updated to controller 2, and the process transitions to the preparation phase for SCH (Screen Structure Configuration) reconfiguration. Specifically, controller 2 prepares the structures required by the scheduler (performing reconfiguration or initialization of relevant stripes) and updates the stripes requiring reconfiguration / initialization to the scheduler. Then, controller 2 enters the running phase, begins processing host services normally, and the scheduler starts running.
[0068] In a specific implementation, when a controller needs to be added after recovery, for example, if controller 1 recovers, controller 2 begins to remain silent, completing any unfinished I / O. While waiting for controller 2 to finish its silent state, controller 1 copies controller 2's power-loss protected memory to its own. After the copy is complete, the new configuration information is updated to controllers 1 and 2, and the process moves to the preparation phase. Specifically, controller 2 enters silent mode, and newly added controllers are also in silent mode. The controller updates the cluster view and constructs domain (primary / backup) relationships according to rules. Once this view and domain relationship are constructed, they need to be applied to both controllers. In silent mode, both controllers resynchronize their metadata based on this relationship. Then, based on the new metadata and domain relationships, they find their own stripes (finding several for concurrent execution). The silent state ends when all controllers have reached this step, effectively starting all controllers simultaneously. Furthermore, during the preparation phase, controllers 1 and 2 prepare the structures required by the scheduler, updating the stripes that need to be synchronized into the scheduler. The scheduler contains an array `o[]` to store its own stripes, a variable `valid` to indicate the validity of `o[]`, a variable `active` to indicate that `o[]` is executing, and a variable `fail` to indicate that `o[]` has failed. The scheduler may contain partial identification information of the RAID for binding with a specific RAID, and may also contain partial information about that RAID to accelerate logic execution. The scheduler may contain a timer for executing scheduling logic. The scheduler may also contain some scheduling policies for controlling traffic. Afterward, controllers 1 and 2 enter the operation phase and begin processing host services normally.
[0069] In a specific embodiment, the data copying operation during the normal operation initialization process of the controller is triggered periodically by a timer to check whether the reconstructed bitmap is valid. If the reconstructed bitmap is valid, the current migration progress position is read, and the corresponding stripe's metadata is copied: when a stripe is found to be marked in the reconstructed bitmap (carrying a first initialization flag), the corresponding position in the initialization bitmap is also marked (a second initialization flag), and then the mark in the reconstructed bitmap (the first initialization flag) is deleted. If the metadata copy is complete, the reconstructed bitmap is marked as invalid, and the current copy position is reset to 0; otherwise, the current migration progress position is recorded.
[0070] Therefore, this application ignores the second stripe that does not contain data during the disk data reconstruction process, and only reconstructs the data of the first stripe containing data to the new disk. After reconstructing the data of the first stripe to the new disk, a metadata copy operation is performed to copy the metadata corresponding to the second stripe in the reconstruction bitmap to a pre-built initialization bitmap. Subsequently, the stripe corresponding to the new disk can be initialized through the initialization bitmap, which can minimize the occupation of the reconstruction bitmap during the disk reconstruction process. Furthermore, during the metadata copy process, this application can initialize the relevant stripes of the new disk based on the metadata corresponding to the stripe to be initialized in the reconstruction bitmap or the initialization bitmap, which can further speed up the stripe initialization speed, reduce the reconstruction time and computational resources consumed, and improve disk performance during the reconstruction process.
[0071] like Figure 3 As shown in the figure, this application discloses a disk reconstruction apparatus applied to a controller, comprising:
[0072] The stripe classification module 11 is used to classify each stripe in the target member disk based on the reconstructed bitmap when the target member disk in the disk array fails, so as to obtain a first stripe containing data and a second stripe not containing data.
[0073] Data reconstruction module 12 is used to reconstruct the data of relevant stripes in the new disk based on the reconstruction bitmap and the first stripe;
[0074] The stripe initialization module 13 is used to copy the metadata corresponding to the second stripe in the reconstruction bitmap to the initialization bitmap corresponding to the new disk after the reconstruction operation is completed. During the copying process, the module checks the reconstruction bitmap and the initialization bitmap to determine the stripe to be initialized in the new disk, and then initializes the stripe to be initialized to obtain the reconstructed disk corresponding to the target member disk.
[0075] Therefore, this application ignores the second stripe that does not contain data during the disk data reconstruction process, and only reconstructs the data of the first stripe containing data to the new disk. After reconstructing the data of the first stripe to the new disk, a metadata copy operation is performed to copy the metadata corresponding to the second stripe in the reconstruction bitmap to a pre-built initialization bitmap. Subsequently, the stripe corresponding to the new disk can be initialized through the initialization bitmap, which can minimize the occupation of the reconstruction bitmap during the disk reconstruction process. Furthermore, during the metadata copy process, this application can initialize the relevant stripes of the new disk based on the metadata corresponding to the stripe to be initialized in the reconstruction bitmap or the initialization bitmap, which can further speed up the stripe initialization speed, reduce the occupation of the reconstruction bitmap, and improve the disk reconstruction efficiency.
[0076] In one specific embodiment, the strip classification module 11 may include:
[0077] The stripe classification unit is used to determine the index corresponding to each stripe in the target member disk based on the reconstruction bitmap when the target member disk in the disk array fails, and classify each stripe according to whether the index indicates that it contains data, so as to obtain a first stripe containing data and a second stripe not containing data.
[0078] In one specific embodiment, the data reconstruction module 12 may include:
[0079] A space partitioning unit is used to determine the data to be reconstructed contained in the target member disk based on the first stripe, and to partition the space of the new disk based on the reconstruction bitmap to obtain a number of corresponding stripes.
[0080] The data reconstruction submodule is used to perform reconstruction operations on the data to be reconstructed on the new disk based on the reconstruction bitmap, so as to reconstruct the data to be reconstructed into the relevant stripes of the new disk.
[0081] In another specific embodiment, the data reconstruction submodule may include:
[0082] The reconstruction task determination unit is used to determine the reconstruction task to be executed at the current time through the scheduler; the reconstruction task is a task targeting any one of the first stripes in the reconstruction bitmap;
[0083] A reconstruction task execution unit is used to execute the reconstruction task to reconstruct the data to be reconstructed in the corresponding first stripe to the corresponding stripe of the new disk, and to perform a synchronization operation on the metadata corresponding to the first stripe between the primary and backup controllers after the reconstruction task is completed; the primary and backup controllers include the current controller and another controller that is processing the reconstruction operation of the target member disk.
[0084] In one specific embodiment, the strip initialization module 13 may include:
[0085] The copy progress position determination unit is used to determine the execution time period of the copy operation corresponding to the metadata of the second strip in the reconstructed bitmap by using a pre-set timer, and to determine the copy progress position of the metadata of the next second strip corresponding to the last second strip copied in the previous execution time period at the beginning of the execution time period; the second strip carries a first initialization flag indicating that it is to be initialized;
[0086] The target strip lookup unit is used to search for the second strip carrying the first initialization flag starting from the second strip corresponding to the metadata at the copy progress position of the reconstructed bitmap, and obtain the target strip of the metadata to be copied;
[0087] The metadata copying unit is used to add a second initialization flag to the stripe corresponding to the target stripe in the new disk, copy the metadata of the target stripe from the reconstruction bitmap to the initialization bitmap, and delete the first initialization flag of the target stripe in the reconstruction bitmap.
[0088] In another specific embodiment, the strip initialization module 13 may include:
[0089] The stripe determination unit is used to determine, during the copying process, whether there is a second stripe carrying the first initialization marker in the stripe corresponding to the reconstructed bitmap at the current moment, and to obtain the corresponding determination result;
[0090] The first current stripe determination unit is used to determine a second stripe carrying the first initialization mark from the stripes corresponding to the reconstructed bitmap as the current stripe to be initialized at the current time when the judgment result indicates that there is a second stripe carrying the first initialization mark.
[0091] The first initialization unit is used to initialize the corresponding stripe in the new disk based on the metadata corresponding to the current stripe in the reconstructed bitmap, delete the first initialization flag corresponding to the current stripe, and then jump to the step of determining whether there is a second stripe carrying the first initialization flag in the stripe corresponding to the reconstructed bitmap at the current time.
[0092] The second current stripe determination unit is used to determine a stripe carrying the second initialization flag from the stripe corresponding to the initialization bitmap as the current stripe to be initialized at the current time when the judgment result indicates that there is no second stripe carrying the first initialization flag in the stripe corresponding to the reconstructed bitmap at the current time, and there is a stripe carrying the second initialization flag in the stripe corresponding to the initialization bitmap.
[0093] The second initialization unit is used to initialize the corresponding stripe in the new disk based on the metadata corresponding to the current stripe in the initialization bitmap, delete the second initialization flag corresponding to the current stripe, and then jump to the step of determining a stripe carrying the second initialization flag from the stripes corresponding to the initialization bitmap by the scheduler as the current stripe to be initialized at the current moment.
[0094] The disk determination unit is used to determine that each of the second stripes corresponding to the reconstructed bitmap has completed the corresponding initialization process when the determination result indicates that there is no second stripe carrying the first initialization mark in the stripe corresponding to the reconstructed bitmap and there is no stripe carrying the second initialization mark in the stripe corresponding to the initialization bitmap, and finally determines the new disk obtained as the reconstructed disk corresponding to the target member disk.
[0095] In one specific embodiment, the device may further include:
[0096] If a new member disk in the disk array fails during the copying process, the timer is stopped, and the maximum copying performance of the controller at the current moment is used to perform a copying operation on the metadata corresponding to several second stripes in the reconstruction bitmap, so as to copy the relevant metadata to the initialization bitmap corresponding to the new disk.
[0097] This embodiment also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the disk reconstruction method described above.
[0098] Furthermore, embodiments of this application also disclose an electronic device, Figure 4This is a structural diagram of an electronic device according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the disk reconstruction method disclosed in any of the foregoing embodiments. Furthermore, the electronic device in this embodiment may specifically be an electronic computer.
[0099] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0100] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0101] The operating system 221 is used to manage and control the various hardware devices on the electronic device and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the disk reconstruction method executed by the electronic device as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0102] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disk reconstruction method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0103] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0104] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0105] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0106] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0107] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A disk reconstruction method, characterized in that, Applied to controllers, including: When a target member disk in the disk array fails, the stripes in the target member disk are classified based on the reconstructed bitmap to obtain a first stripe containing data and a second stripe not containing data. Based on the reconstructed bitmap and the first stripe, the data of the relevant stripes in the new disk are reconstructed; After the reconstruction operation is completed, the metadata corresponding to the second stripe in the reconstruction bitmap is copied to the initialization bitmap corresponding to the new disk. During the copying process, the stripe to be initialized in the new disk is determined by checking the reconstruction bitmap and the initialization bitmap. Then, the stripe to be initialized is initialized to obtain the reconstructed disk corresponding to the target member disk. The step of copying the metadata corresponding to the second stripe in the reconstructed bitmap to the initialization bitmap corresponding to the new disk includes: The execution time period of the copy operation corresponding to the metadata of the second strip in the reconstructed bitmap is determined by a pre-set timer, and the copy progress position of the metadata of the next second strip corresponding to the last second strip copied in the previous execution time period is determined at the beginning of the execution time period; each of the second strips carries a first initialization flag indicating that it is to be initialized; Starting from the second stripe corresponding to the metadata at the copy progress position of the reconstructed bitmap, search for the second stripe carrying the first initialization flag to obtain the target stripe of the metadata to be copied; A second initialization flag is added to the stripe in the new disk that corresponds to the target stripe, and the metadata of the target stripe is copied from the reconstructed bitmap to the initialization bitmap, while the first initialization flag of the target stripe is deleted from the reconstructed bitmap.
2. The disk reconstruction method according to claim 1, characterized in that, When a target member disk in the disk array fails, the stripes in the target member disk are classified based on the reconstructed bitmap to obtain a first stripe containing data and a second stripe not containing data, including: When a target member disk in the disk array fails, the index corresponding to each stripe in the target member disk is determined based on the reconstructed bitmap, and each stripe is classified according to whether the index indicates that it contains data, so as to obtain the first stripe containing data and the second stripe not containing data.
3. The disk reconstruction method according to claim 1, characterized in that, The reconstruction operation based on the reconstructed bitmap and the first stripe to reconstruct the data of the relevant stripes in the new disk includes: Based on the first stripe, the data to be reconstructed contained in the target member disk is determined, and the space of the new disk is divided based on the reconstruction bitmap to obtain a number of corresponding stripes; Based on the reconstructed bitmap, the data to be reconstructed is reconstructed on the new disk to reconstruct the data to the relevant stripes on the new disk.
4. The disk reconstruction method according to claim 3, characterized in that, The step of reconstructing the data to be reconstructed on the new disk based on the reconstructed bitmap, so as to reconstruct the data to be reconstructed into the relevant stripes of the new disk, includes: The scheduler determines the reconstruction task to be executed at the current moment; the reconstruction task is a task targeting any one of the first stripes in the reconstruction bitmap; The reconstruction task is executed to reconstruct the data to be reconstructed in the corresponding first stripe to the corresponding stripe of the new disk, and after the reconstruction task is completed, the metadata corresponding to the first stripe is synchronized between the primary and backup controllers; the primary and backup controllers include the current controller and another controller that is processing the reconstruction operation of the target member disk.
5. The disk reconstruction method according to claim 1, characterized in that, During the copying process, the uninitialized stripes in the new disk are determined by examining the reconstructed bitmap and the initialization bitmap, and then the uninitialized stripes are initialized to obtain the reconstructed disk corresponding to the target member disk, including: During the copying process, it is determined whether there is a second strip carrying the first initialization marker in the strip corresponding to the reconstructed bitmap at the current moment, and the corresponding determination result is obtained; If the judgment result indicates that there is a second stripe carrying the first initialization flag, then the scheduler determines a second stripe carrying the first initialization flag from the stripes corresponding to the reconstructed bitmap as the current stripe to be initialized at the current time. Based on the metadata corresponding to the current stripe in the reconstructed bitmap, the corresponding stripe in the new disk is initialized, and the first initialization flag corresponding to the current stripe is deleted. Then, the process jumps to the step of determining whether there is a second stripe carrying the first initialization flag in the stripe corresponding to the reconstructed bitmap at the current moment. If the judgment result indicates that there is no second strip carrying the first initialization flag in the strip corresponding to the reconstructed bitmap at the current time, and there is a strip carrying the second initialization flag in the strip corresponding to the initialization bitmap, then the scheduler determines a strip carrying the second initialization flag from the strip corresponding to the initialization bitmap as the current strip to be initialized at the current time. Based on the metadata corresponding to the current stripe in the initialization bitmap, the corresponding stripe in the new disk is initialized, and the second initialization flag corresponding to the current stripe is deleted. Then, the process jumps to the step of determining a stripe carrying the second initialization flag from the stripes corresponding to the initialization bitmap through the scheduler as the current stripe to be initialized at the current moment. If the determination result indicates that there is no second stripe carrying the first initialization mark in the stripe corresponding to the reconstructed bitmap, and there is no stripe carrying the second initialization mark in the stripe corresponding to the initialization bitmap, then it is determined that each second stripe corresponding to the reconstructed bitmap has completed the corresponding initialization process, and the final new disk is determined as the reconstructed disk corresponding to the target member disk.
6. The disk reconstruction method according to claim 1, characterized in that, Also includes: During the copying process, if a new member disk in the disk array fails, the timer is stopped, and the maximum copying performance of the controller at the current moment is used to perform a copying operation on the metadata corresponding to several second stripes in the reconstructed bitmap, so as to copy the relevant metadata to the initialization bitmap corresponding to the new disk.
7. A disk reconstruction apparatus, characterized in that, Applied to controllers, including: The stripe classification module is used to classify the stripes in the target member disk based on the reconstructed bitmap when the target member disk in the disk array fails, so as to obtain a first stripe containing data and a second stripe not containing data. The data reconstruction module is used to reconstruct the data of relevant stripes in the new disk based on the reconstruction bitmap and the first stripe; The stripe initialization module is used to copy the metadata corresponding to the second stripe in the reconstruction bitmap to the initialization bitmap corresponding to the new disk after the reconstruction operation is completed. During the copying process, the module checks the reconstruction bitmap and the initialization bitmap to determine the stripe to be initialized in the new disk, and then initializes the stripe to be initialized to obtain the reconstructed disk corresponding to the target member disk. The strip initialization module includes: The copy progress position determination unit is used to determine the execution time period of the copy operation corresponding to the metadata of the second strip in the reconstructed bitmap by using a pre-set timer, and to determine the copy progress position of the metadata of the next second strip corresponding to the last second strip copied in the previous execution time period at the beginning of the execution time period; the second strip carries a first initialization flag indicating that it is to be initialized; The target strip lookup unit is used to search for the second strip carrying the first initialization flag starting from the second strip corresponding to the metadata at the copy progress position of the reconstructed bitmap, and obtain the target strip of the metadata to be copied; The metadata copying unit is used to add a second initialization flag to the stripe corresponding to the target stripe in the new disk, copy the metadata of the target stripe from the reconstruction bitmap to the initialization bitmap, and delete the first initialization flag of the target stripe in the reconstruction bitmap.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the disk reconstruction method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the disk reconstruction method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
RAID reconstruction method, storage medium and device
CN109739436A
Systems and methods for mapping for solid-state memory
US9009565B1