CN117149096B - Disk reconstruction method, device, equipment and storage medium - Google Patents

Disk reconstruction method, device, equipment and storage medium Download PDF

Info

Publication number
CN117149096B
CN117149096B CN202311426549.2A CN202311426549A CN117149096B CN 117149096 B CN117149096 B CN 117149096B CN 202311426549 A CN202311426549 A CN 202311426549A CN 117149096 B CN117149096 B CN 117149096B
Authority
CN
China
Prior art keywords
reconstructed
disk
stripe
determining
blocks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311426549.2A
Other languages
Chinese (zh)
Other versions
CN117149096A (en
Inventor
朱红玉
夏方健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202311426549.2A priority Critical patent/CN117149096B/en
Publication of CN117149096A publication Critical patent/CN117149096A/en
Application granted granted Critical
Publication of CN117149096B publication Critical patent/CN117149096B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0626Reducing size or complexity of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of centralized storage and discloses a disk reconstruction method, a device, equipment and a storage medium, wherein the method queries disks to be reconstructed contained in a stripe group to obtain a disk set to be reconstructed corresponding to the stripe group; determining a stripe set to be reconstructed based on stripes of disk blocks corresponding to the disks to be reconstructed in the disk set to be reconstructed; the disk blocks to be reconstructed are the disk blocks to be reconstructed; and determining the disk blocks to be reconstructed contained in the strip to be reconstructed based on the disk set to be reconstructed and the strip set to be reconstructed, and reconstructing the disk blocks to be reconstructed. Therefore, the method can screen the to-be-reconstructed strips corresponding to the to-be-reconstructed disk, screen the to-be-reconstructed blocks in the to-be-reconstructed strips and reconstruct the to-be-reconstructed blocks, so that traversing of all the strips is avoided, the disk reconstruction time is shortened, resources occupied by reconstruction are reduced, and the storage performance of the storage system is improved.

Description

Disk reconstruction method, device, equipment and storage medium
Technical Field
The present invention relates to the field of centralized storage technologies, and in particular, to a disk reconstruction method, apparatus, device, and storage medium.
Background
In a centralized storage system, a disk array is formed by combining a plurality of independent hard disks into a large-capacity hard disk group, and the efficiency of the whole hard disk system is improved by utilizing the addition effect generated by providing data by individual hard disks. When a member disk in a hard disk group fails, the entire member disk cannot be reconstructed at one time due to the limitation of the computing capacity and the memory size, so that the member disk is generally divided into equal-sized blocks, and all the stripes are reconstructed by taking the blocks as units, thereby completing the reconstruction of the entire member disk. This requires traversing all stripes, resulting in longer reconstruction times for member disks, more resources being occupied by the reconstruction process, and resulting in reduced storage performance of the storage system.
Disclosure of Invention
In view of the above, the present invention provides a disk reconstruction method, apparatus, device and storage medium, so as to solve the problem that the storage performance of the storage system is reduced due to the long reconstruction time for the disk and the large resources occupied by the reconstruction process when the disk fails.
In a first aspect, the present invention provides a disk reconstruction method, including:
inquiring the disk to be reconstructed contained in the stripe group to obtain a disk set to be reconstructed corresponding to the stripe group;
Determining a stripe set to be reconstructed based on stripes of disk blocks corresponding to the disks to be reconstructed in the disk set to be reconstructed;
and screening the disk blocks of each stripe to be reconstructed in the disk set to be reconstructed based on the stripe set to be reconstructed, determining the disk blocks to be reconstructed contained in the stripe to be reconstructed, and reconstructing the disk blocks to be reconstructed.
Therefore, the method can screen the to-be-reconstructed strips corresponding to the to-be-reconstructed disk, screen the to-be-reconstructed blocks in the to-be-reconstructed strips and reconstruct the to-be-reconstructed blocks, so that traversing of all the strips is avoided, the disk reconstruction time is shortened, resources occupied by reconstruction are reduced, and the storage performance of the storage system is improved.
In an optional implementation manner, querying a disk to be reconstructed included in a stripe group to obtain a disk set to be reconstructed corresponding to the stripe group includes:
inquiring a disk to be reconstructed contained in the disk array;
respectively determining the reconstruction conditions of the magnetic disks to be reconstructed corresponding to each array row contained in the stripe group;
determining the elements of the disk to be reconstructed corresponding to the array rows based on the disk to be reconstructed corresponding to the array rows and the reconstruction conditions of the disk to be reconstructed corresponding to the array rows;
And obtaining a disk set to be reconstructed based on the disk elements to be reconstructed corresponding to each array row contained in the stripe group.
Therefore, the disk to be reconstructed corresponding to each row array can be determined according to the division form of the row arrays in the stripe group.
In an alternative embodiment, determining the disk element to be reconstructed corresponding to the array row based on the disk to be reconstructed corresponding to the array row and the reconstruction condition of the disk to be reconstructed corresponding to the array row includes:
adding the disk number of the disk to be reconstructed, which is not reconstructed, into the disk number element of the disk element to be reconstructed;
determining a disk number element of the disk element to be reconstructed based on the number of disk numbers contained in the disk number element;
and obtaining the disk element to be reconstructed based on the disk number element and the disk number element.
Therefore, the disk to be reconstructed, namely the disk to be reconstructed, can be screened out from the disks corresponding to each row array, and is added into the disk elements to be reconstructed of the corresponding row array, so that the screening of the disk to be reconstructed is realized.
In an alternative embodiment, determining the stripe set to be reconstructed based on the stripe where the disk block corresponding to the disk to be reconstructed is located in the disk set to be reconstructed includes:
Based on the disk set to be reconstructed, determining the conditions to be reconstructed of the disk blocks contained in each stripe in the stripe group respectively;
determining a to-be-reconstructed strip element corresponding to the to-be-reconstructed strip based on the to-be-reconstructed condition of the disk partition;
and obtaining a to-be-reconstructed band set based on to-be-reconstructed band elements corresponding to the to-be-reconstructed band contained in the band group.
Therefore, the strips to be reconstructed can be further screened from the strips contained in the strip group based on the disc set to be reconstructed obtained by screening the disc to be reconstructed.
In an alternative embodiment, based on the set of disks to be reconstructed, determining the to-be-reconstructed condition of the disk blocks included in each stripe in the stripe group respectively includes:
determining an array row where the disk block is located based on the block number of the disk block and the stripe number of the stripe where the disk block is located;
searching disk elements to be reconstructed corresponding to array rows where disk blocks are located in a disk set to be reconstructed;
and determining the to-be-reconstructed condition of the disk blocks based on the to-be-reconstructed disk elements.
In an alternative embodiment, determining a to-be-reconstructed condition of a disk partition based on to-be-reconstructed disk elements includes:
when the value of the disk number element of the disk element to be reconstructed is 0, determining that the disk partition is not required to be reconstructed;
When the value of the disk number element of the disk element to be reconstructed is not 0, determining the disk number of the disk where the disk block is located based on the block number of the disk block and the stripe number of the stripe where the disk block is located;
searching a disk number of a disk where the disk block is located in a disk number element of the disk element to be reconstructed;
when the disk number of the disk where the disk block is located is found, determining that the to-be-reconstructed condition of the disk block is to be reconstructed;
when the disk number of the disk where the disk partition is located is not found, determining that the disk partition is to be reconstructed as not needing to be reconstructed.
In an alternative embodiment, determining a stripe element to be reconstructed corresponding to a stripe to be reconstructed based on a to-be-reconstructed condition of disk partitioning includes:
when the condition to be reconstructed of the disk blocks is that reconstruction is needed, determining the stripe where the disk blocks are positioned as a stripe to be reconstructed;
and adding the partition numbers of the disk partitions contained in the to-be-reconstructed stripe into the to-be-reconstructed stripe elements corresponding to the to-be-reconstructed stripe.
In an optional implementation manner, after adding the partition number of the disk partition included in the stripe to be reconstructed into the stripe to be reconstructed corresponding to the stripe to be reconstructed, the method further includes:
And subtracting one from the value of the disk number element in the disk elements to be reconstructed corresponding to the array row where the disk block is located.
In an alternative embodiment, based on the stripe set to be reconstructed, disk blocks of each stripe to be reconstructed in the disk set to be reconstructed are screened, disk blocks to be reconstructed included in the stripe to be reconstructed are determined, and the disk blocks to be reconstructed are reconstructed, including:
distributing a strip management structure for the strip to be reconstructed;
based on the strip elements to be reconstructed contained in the strip set to be reconstructed, determining partition numbers of disk partitions contained in the strip to be reconstructed respectively;
based on the partition numbers of the disk partitions and the disk set to be reconstructed, screening the disk partitions, and determining the disk partitions to be reconstructed contained in the stripe to be reconstructed;
updating the reconstruction information of the disk blocks to be reconstructed contained in the strips to be reconstructed to a strip management structure corresponding to the strips to be reconstructed; the reconstruction information is used for representing that the disk blocks to be reconstructed need to be reconstructed;
and reconstructing the disk blocks to be reconstructed based on the reconstruction information contained in the stripe management structure.
Therefore, the disk block to be reconstructed can be determined from the disk set to be reconstructed according to the disk block number contained in the stripe to be reconstructed, so that the disk block to be reconstructed is reconstructed.
In an alternative embodiment, based on the partition number and the set of disks to be reconstructed, the method filters the disk partitions, and determines the disk partitions to be reconstructed contained in the stripe to be reconstructed, including:
determining an array row and a disk where the disk block is located based on the block number of the disk block and the stripe number of the stripe to be reconstructed where the disk block is located;
searching disk elements to be reconstructed corresponding to array rows where disk blocks are located in a disk set to be reconstructed;
when the disk number element of the disk element to be reconstructed contains the disk number of the disk where the disk block is located, determining the disk block as the disk block to be reconstructed.
In an alternative embodiment, before determining the partition numbers of the disk partitions included in the stripe to be reconstructed respectively based on the stripe elements to be reconstructed included in the stripe set to be reconstructed, the method further includes:
acquiring a strip lock corresponding to a strip to be reconstructed;
and storing the stripe lock corresponding to the stripe to be reconstructed in the stripe management structure corresponding to the stripe to be reconstructed.
In an alternative embodiment, after reconstructing the disk partition to be reconstructed based on the reconstruction information included in the stripe management structure, the method further includes:
And taking out the strip lock corresponding to the strip to be reconstructed from the strip management structure corresponding to the strip to be reconstructed.
In a second aspect, the present invention provides a disk reconstruction apparatus, comprising:
the to-be-reconstructed disk set determining module is used for querying to-be-reconstructed disks contained in the stripe group to obtain a to-be-reconstructed disk set corresponding to the stripe group;
the to-be-reconstructed stripe set determining module is used for determining a to-be-reconstructed stripe set based on stripes of disk blocks corresponding to the to-be-reconstructed disks in the to-be-reconstructed disk set;
the disk block reconstruction module to be reconstructed is used for screening the disk blocks of each to-be-reconstructed strip in the to-be-reconstructed disk set based on the to-be-reconstructed strip set, determining the to-be-reconstructed disk blocks contained in the to-be-reconstructed strip, and reconstructing the to-be-reconstructed disk blocks.
In a third aspect, the present invention provides a computer device comprising: the memory and the processor are in communication connection with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the disk reconstruction method according to the first aspect or any implementation manner corresponding to the first aspect.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon computer instructions for causing a computer to perform the disk reconstruction method of the first aspect or any of its corresponding embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a disk array partition in the related art;
FIG. 2 is a flow chart of a disk reconstruction method according to an embodiment of the present invention;
FIG. 3 is a flow chart of another disk reconstruction method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a structure of a set of disks to be reconstructed according to an embodiment of the invention;
FIG. 5 is a flowchart of obtaining a set of disks to be reconstructed according to an embodiment of the present invention;
FIG. 6 is a flow chart of yet another disk reconstruction method according to an embodiment of the present invention;
FIG. 7 is a flow chart of obtaining a set of stripes to be reconstructed according to an embodiment of the present invention;
FIG. 8 is a flow chart of yet another disk reconstruction method according to an embodiment of the present invention;
FIG. 9 is a schematic flow chart of obtaining and reconstructing a disk partition to be reconstructed according to an embodiment of the present invention;
FIG. 10 is a block diagram of a disk reconstruction device according to an embodiment of the present invention;
fig. 11 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the related art, in a centralized storage system, when a member disk in a disk array fails, the entire member disk cannot be reconstructed at one time due to the limitation of the computing power and the memory size, and generally, the member disk is divided into equal-sized partitions, and all the stripes are reconstructed in the unit of the partitions, so that the reconstruction of the entire member disk is completed. Fig. 1 shows a schematic diagram of partitioning a disk array in the related art, where, as shown in fig. 1, the disk array includes a plurality of member disks, each member disk is partitioned into partitions with equal sizes, the plurality of partitions form a stripe, and the partitions of different member disks located in the same row form an array row. The band group is composed of a plurality of bands; since stripes and array rows are only different divisions of blocks of disks in a disk array, stripe groups may also be divided by array rows, consisting of multiple array rows. It should be noted that, the blocks included in the stripe shown in fig. 1 are located in the same array row and located in adjacent member disks, but the blocks included in the stripe may be dispersed on each member disk during actual division, and may be located in different array rows respectively. In the related art, when the member disk is reconstructed, all the stripes need to be traversed to find out the blocks needing to be reconstructed for reconstruction, and although the calculation result may be that some stripes do not need to be reconstructed, but the stripes still need to undergo steps such as metadata inquiry, scheduling and the like; meanwhile, when a partition of a certain stripe is located in a plurality of array rows, metadata of the plurality of array rows need to be read for a plurality of times when whether the stripe needs to be reconstructed is calculated. The above problems not only lead to long reconfiguration time when the member disk fails and reduce the security of the storage device, but also lead to resource consumption preemption in the reconfiguration process and to degradation of storage performance.
Based on the above, the embodiment of the invention provides a disk reconstruction method, which queries disks to be reconstructed contained in a stripe group to obtain a disk set to be reconstructed corresponding to the stripe group; determining a stripe set to be reconstructed based on stripes of disk blocks corresponding to the disks to be reconstructed in the disk set to be reconstructed; and screening the disk blocks of each stripe to be reconstructed in the disk set to be reconstructed based on the stripe set to be reconstructed, determining the disk blocks to be reconstructed contained in the stripe to be reconstructed, and reconstructing the disk blocks to be reconstructed. Therefore, the method can screen the to-be-reconstructed strips corresponding to the to-be-reconstructed disk, screen the to-be-reconstructed blocks in the to-be-reconstructed strips and reconstruct the to-be-reconstructed blocks, so that traversing of all the strips is avoided, the disk reconstruction time is shortened, resources occupied by reconstruction are reduced, and the storage performance of the storage system is improved.
In accordance with an embodiment of the present invention, there is provided a disk reconstruction method embodiment, it being noted that the steps illustrated in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and, although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order other than that illustrated herein.
In this embodiment, a disk reconstruction method is provided, which may be used in the above-mentioned centralized storage system, and fig. 2 is a flowchart of the disk reconstruction method according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
step S201, inquiring the disk to be reconstructed contained in the stripe group to obtain a disk set to be reconstructed corresponding to the stripe group.
In the embodiment of the invention, the disk array can be managed in the form of the stripe group, the disk array can divide the member disks contained in the disk array into one or more stripe groups, and when the member disk in one stripe group fails, the disk to be reconstructed contained in the stripe group is queried, so that a disk set to be reconstructed corresponding to the stripe group is obtained. Wherein the disk to be reconstructed, i.e. the disk that has failed, needs to be reconstructed.
In the embodiment of the invention, the stripe groups can be queried according to the sequence of the row array. In general, when determining whether a stripe or a disk partition in the stripe needs to be reconstructed, it is necessary to calculate an array row in which the disk partition is located and a disk number corresponding to the array row, and only when the array row needs to be reconstructed and the disk number corresponding to the disk partition in the array row is equal to the disk number that needs to be reconstructed, it is able to determine that the disk partition and the stripe corresponding to the disk partition need to be reconstructed. That is, determining whether a stripe or a disk partition in a stripe needs to be reconstructed is based on the correlation of its corresponding array row. Then, the stripe group is queried according to the sequence of the row array, and the disks to be reconstructed obtained by the query are arranged according to the sequence of the row array to form a disk set to be reconstructed, so that the relevant conditions and information of disk reconstruction corresponding to each row array in the stripe group can be integrated in the disk set to be reconstructed, and the disk set to be reconstructed can be directly queried to determine whether the stripe and each disk partition block in the stripe need to be reconstructed.
Step S202, determining a stripe set to be reconstructed based on stripes of disk blocks corresponding to the disks to be reconstructed in the disk set to be reconstructed.
In the embodiment of the invention, the stripe set to be reconstructed is used for representing the stripe to be reconstructed and the disk blocks contained in the stripe to be reconstructed, wherein the stripe to be reconstructed contains the disk blocks to be reconstructed, and the disk blocks to be reconstructed are the disk blocks to be reconstructed. And determining a to-be-reconstructed band set based on bands of the to-be-reconstructed disc set, where the disc blocks corresponding to the to-be-reconstructed disc are located, so that bands which do not need to be reconstructed in the band set are screened out, and the bands which need to be reconstructed, namely the bands to be reconstructed, are screened out, and the to-be-reconstructed band set is obtained.
Step S203, based on the stripe set to be reconstructed, screening the disk blocks of each stripe to be reconstructed in the disk set to be reconstructed, determining the disk blocks to be reconstructed contained in the stripe to be reconstructed, and reconstructing the disk blocks to be reconstructed.
In the embodiment of the invention, based on the disk set to be reconstructed, the disk blocks in each to-be-reconstructed stripe in the to-be-reconstructed stripe set are screened, the disk blocks to be reconstructed, namely the disk blocks to be reconstructed, are screened from the to-be-reconstructed stripe set, and the disk blocks to be reconstructed are reconstructed.
In the related art, when reconstructing a failed disk, it is necessary to traverse all disk blocks contained in all stripes to find out that the disk blocks need to be reconstructed, so that on one hand, some stripes do not need to be reconstructed, but still need to be traversed in the reconstruction process, and still need to undergo metadata inquiry and scheduling steps, so that a great number of unnecessary operations exist in the reconstruction process, not only the reconstruction time is increased, but also the security of the storage device is reduced; on the other hand, when the partition of a stripe is located in a plurality of array rows, metadata of the plurality of array rows need to be read for multiple times when the stripe needs to be reconstructed, and correspondingly, the plurality of stripes may access metadata of the same array row at the same time, so that a great amount of resources are occupied in the reconstruction process, and finally, the storage performance of the storage system is reduced. In the embodiment of the invention, the stripe groups are screened step by step according to the sequence of the disk to be reconstructed, the stripe to be reconstructed and the disk to be reconstructed, so that the related metadata of the disk to be reconstructed is queried only when the disk set to be reconstructed is determined, the traversing operation of the stripe which does not need to be reconstructed can be avoided, the operation steps in the reconstruction process are greatly reduced, the disk reconstruction time is reduced, the resources occupied by the reconstruction are reduced, and the storage performance of the storage system is improved.
In this embodiment, a disk reconstruction method is provided, which may be used in the above-mentioned centralized storage system, and fig. 3 is a flowchart of another disk reconstruction method according to an embodiment of the present invention, as shown in fig. 3, where the flowchart includes the following steps:
step S301, inquiring the disk to be reconstructed contained in the stripe group to obtain a disk set to be reconstructed corresponding to the stripe group.
Specifically, step S301 includes:
step S3011, query the disk to be reconstructed included in the disk array.
In the embodiment of the invention, all the disks needing to be reconstructed in the disk array are inquired to obtain the disks to be reconstructed contained in the disk array.
Step S3012, determining a reconstruction condition of the to-be-reconstructed disk corresponding to each array row included in the stripe group.
In the embodiment of the invention, the reconstruction conditions of the disk to be reconstructed corresponding to each array row contained in the stripe group are respectively determined according to the sequence of the row arrays. As shown in fig. 1, one array row may correspond to a disk partition in a plurality of disks, for the same disk to be reconstructed, the disk partition corresponding to one array row may fail and need to be reconstructed, but the disk partition corresponding to another array row may fail and need not be reconstructed, so that the reconstruction condition of the disk to be reconstructed needs to be reconstructed corresponding to each array row, so as to determine the reconstruction condition of each array row corresponding to each disk to be reconstructed, and thus, the following accurate positioning of the disk partition needing to be reconstructed is facilitated.
Step S3013, determining the disk elements to be reconstructed corresponding to the array rows based on the disks to be reconstructed corresponding to the array rows and the reconstruction conditions of the disks to be reconstructed corresponding to the array rows.
In the embodiment of the invention, the disk elements to be reconstructed may include a disk number element and a disk number element, wherein the disk number element is a disk number of a disk to be reconstructed in the array row, and the disk number element is a number of the disk to be reconstructed in the array row. Specifically, step S3013 may include the following steps:
and a step a1, adding the disk number of the disk to be reconstructed, which is not reconstructed, into the disk number element of the disk element to be reconstructed.
And a step a2 of determining the disk number element of the disk element to be reconstructed based on the number of the disk numbers contained in the disk number element.
And a step a3, obtaining a disk element to be reconstructed based on the disk number element and the disk number element.
Therefore, the disks which are needed to be reconstructed and correspond to each array row can be screened out from the disks which correspond to each row array, namely the disks to be reconstructed are added to the disk elements to be reconstructed of the corresponding row array, and screening of the disks to be reconstructed is achieved.
Step S3014, obtaining a disk set to be reconstructed based on the disk elements to be reconstructed corresponding to each array row included in the stripe group.
Fig. 4 is a schematic structural diagram of a to-be-reconstructed disk set according to an embodiment of the present invention, where, as shown in fig. 4, a length of the to-be-reconstructed disk set is a stripe length of a stripe group, that is, a number of array rows included in the stripe group, and the to-be-reconstructed disk set is composed of to-be-reconstructed disk elements of each array row included in the stripe group. The disk elements to be reconstructed are divided into disk number elements corresponding to the sub-elements under the "member disk number to be reconstructed" of the array row in fig. 4, and disk number elements corresponding to the sub-elements under the "number of partitions to be reconstructed".
Fig. 5 is a flowchart of obtaining a set of disks to be reconstructed according to an embodiment of the present invention, and the above step S301 is further described with reference to fig. 5. In the view of figure 5 of the drawings,xthe number of array rows that are included for a stripe group, is in fact equal to the length of the set of disks to be reconstructed,athe first array row of the stripe group is numbered,snumbering the array rows currently being queried in the query process, i.e., the first in the stripe group sThe number of array rows, GRC is the set of disks to be reconstructed, where GRC [s][0]Is the first in the stripe groupsDisk number element corresponding to array row number, GRCs][1]Is the first in the stripe groupsDisk number elements corresponding to the array row numbers. As shown in fig. 5, according to the numbering sequence of the array rows, the metadata of the array rows are queried, so as to determine whether the disk to be reconstructed corresponding to the array rows needs to be reconstructed or whether the reconstruction is completed, that is, determine the reconstruction condition of the disk to be reconstructed corresponding to the array rows; then the numbers of the disks to be reconstructed are combined in 8-bit space and stored in the disk number element GRCs][0]The number of numbers of disks to be reconstructed is counted at the same time, and the number element GRC of the disk is storeds][1]. And repeating the inquiry of the array rows until the inquiry of all the array rows contained in the stripe group is completed, so as to obtain a disk set to be reconstructed.
According to the method, the device and the system, the disk numbers and the number of the disks to be reconstructed corresponding to each array row are contained in the disk set to be reconstructed, so that metadata of the array rows do not need to be queried any more when the strips to be reconstructed and the blocks of the disks to be reconstructed are further determined according to the disk set to be reconstructed, and only the disk numbers in corresponding disk elements to be reconstructed need to be searched in the disk set to be reconstructed, and therefore occupation of disk resources is reduced, and storage performance of a storage system is improved.
Step S302, determining a stripe set to be reconstructed based on stripes of disk blocks corresponding to the disks to be reconstructed in the disk set to be reconstructed. Please refer to step S202 in the embodiment shown in fig. 2, which is not described herein.
Step S303, based on the stripe set to be reconstructed, screening the disk blocks of each stripe to be reconstructed in the disk set to be reconstructed, determining the disk blocks to be reconstructed contained in the stripe to be reconstructed, and reconstructing the disk blocks to be reconstructed. Please refer to step S203 in the embodiment shown in fig. 2 in detail, which is not described herein.
In this embodiment, a disk reconstruction method is provided, which may be used in the above-mentioned centralized storage system, and fig. 6 is a flowchart of another disk reconstruction method according to an embodiment of the present invention, as shown in fig. 6, where the flowchart includes the following steps:
step S601, inquiring the disk to be reconstructed contained in the stripe group to obtain a disk set to be reconstructed corresponding to the stripe group. Please refer to step S201 in the embodiment shown in fig. 2 in detail, which is not described herein.
Step S602, determining a stripe set to be reconstructed based on the stripe of the disk partition corresponding to the disk to be reconstructed in the disk set to be reconstructed. Please refer to step S202 in the embodiment shown in fig. 2, which is not described herein.
Specifically, step S602 includes:
step S6021, based on the disk set to be reconstructed, determining the disk blocks to be reconstructed in each stripe in the stripe group respectively.
In an alternative embodiment, step S6021 may include the steps of:
and b1, determining an array row where the disk block is located based on the block number of the disk block and the stripe number of the stripe where the disk block is located.
When the disk array is created, a certain space rule is specified, that is, the blocks of the stripes in the stripe group are not sequentially allocated, but for a certain stripe, a plurality of blocks are randomly selected as the blocks of the stripe, the random space rule is recorded, and the array row where the disk blocks are located can be determined by the stripe number of the stripe and the block number of the disk block.
And b2, searching disk elements to be reconstructed corresponding to the array row where the disk blocks are located in the disk set to be reconstructed.
Specifically, an array row where the disk block is located is searched in the disk set to be reconstructed, and disk elements to be reconstructed corresponding to the array row where the disk block is located are obtained.
And b3, determining the condition to be reconstructed of the disk blocks based on the disk elements to be reconstructed.
Specifically, the conditions to be reconstructed of the disk blocks are divided into two types, namely, the conditions which do not need to be reconstructed and the conditions which do need to be reconstructed. When the value of the disk number element of the disk element to be reconstructed is 0, determining that the disk partition is not required to be reconstructed; when the value of the disk number element of the disk element to be reconstructed is not 0, determining the disk number of the disk where the disk block is located based on the block number of the disk block and the stripe number of the stripe where the disk block is located; searching a disk number of a disk where the disk block is located in a disk number element of the disk element to be reconstructed; when the disk number of the disk where the disk block is located is found, determining that the to-be-reconstructed condition of the disk block is to be reconstructed; when the disk number of the disk where the disk partition is located is not found, determining that the disk partition is to be reconstructed as not needing to be reconstructed.
Step S6022, determining a strip element to be reconstructed corresponding to the strip to be reconstructed based on the condition to be reconstructed of the disk partition.
In the embodiment of the invention, when the condition of the disk partition to be reconstructed is that the disk partition needs to be reconstructed, determining the stripe where the disk partition is positioned as the stripe to be reconstructed, and simultaneously adding the partition number of the disk partition contained in the stripe to be reconstructed into the stripe element to be reconstructed corresponding to the stripe to be reconstructed.
In an alternative embodiment, after the block number of the disk block included in the stripe to be reconstructed is added to the stripe element to be reconstructed corresponding to the stripe to be reconstructed, the value of the disk number element in the disk element to be reconstructed corresponding to the array row where the disk block is located may be reduced by one, so as to indicate that one stripe to be reconstructed has been extracted according to the disk element to be reconstructed corresponding to the array row. When the value of the disk number element in the disk element to be reconstructed is reduced to 0, the fact that the stripe to be reconstructed corresponding to the disk element to be reconstructed is found completely is indicated, and at the moment, the fact that the disk block to be reconstructed is not required to be reconstructed can be directly determined according to the disk number element when the operation of inquiring the disk element to be reconstructed is carried out, so that the inquiring operation of the disk element to be reconstructed is reduced, and the reconstruction time is shortened.
Step S6023, obtaining a to-be-reconstructed band set based on to-be-reconstructed band elements corresponding to the to-be-reconstructed band included in the band group.
In the embodiment of the invention, the strip number of the strip to be reconstructed and the strip element to be reconstructed corresponding to the strip to be reconstructed are taken as a whole and added into the strip set to be reconstructed. The number of the condition sets to be reconstructed is the number of the strips to be reconstructed contained in the strip group. Therefore, the strips in the strip group are screened to obtain the strips needing to be reconstructed, and operations such as traversing, inquiring, scheduling and the like of the strips needing not to be reconstructed are avoided.
Fig. 7 is a schematic flow chart of obtaining a set of strips to be reconstructed according to an embodiment of the present invention, and the above step S602 is further described with reference to fig. 7. In fig. 7, a is the last stripe number of the stripe group, B is the last block number of the stripe, and C is the first array row number of the stripe group; the initial value of a is the first stripe number of the stripe group, and the initial value of b is the first block number of the stripe; GRS is the set of strips to be reconstructed. As shown in fig. 7, the disk blocks of the stripes in the stripe group are traversed sequentially according to the numbering sequence of the stripes in the stripe group; calculating an array row where the disk block is located according to the block number and the stripe number of the disk block; and then, whether the disk block needs to be reconstructed or not is preliminarily determined according to the disk number element corresponding to the array row, when the disk data element is 0, the next disk block in the stripe is directly confirmed, when the disk data element is not 0, the disk number corresponding to the disk block is calculated, the disk number corresponding to the disk block is searched in the disk number element corresponding to the array row, when the disk number corresponding to the disk block is searched, the stripe number of the stripe and the block number of the disk block contained in the stripe are recorded in a stripe set to be reconstructed, meanwhile, the value of the disk number element corresponding to the array row is reduced by one, the next stripe is confirmed, and when the disk number corresponding to the disk block is not searched, the next disk block in the stripe is confirmed. And confirming all the strips in the strip group to obtain a condition set to be reconstructed.
Step S603, based on the stripe set to be reconstructed, screening the disk blocks of each stripe to be reconstructed in the disk set to be reconstructed, determining the disk blocks to be reconstructed contained in the stripe to be reconstructed, and reconstructing the disk blocks to be reconstructed. Please refer to step S203 in the embodiment shown in fig. 2 in detail, which is not described herein.
In this embodiment, a disk reconstruction method is provided, which may be used in the above-mentioned centralized storage system, and fig. 8 is a flowchart of another disk reconstruction method according to an embodiment of the present invention, as shown in fig. 8, where the flowchart includes the following steps:
step S801, inquiring the disk to be reconstructed contained in the stripe group to obtain a disk set to be reconstructed corresponding to the stripe group. Please refer to step S201 in the embodiment shown in fig. 2 in detail, which is not described herein.
Step S802, determining a stripe set to be reconstructed based on stripes of disk blocks corresponding to the disks to be reconstructed in the disk set to be reconstructed. Please refer to step S202 in the embodiment shown in fig. 2, which is not described herein.
Step 803, based on the stripe set to be reconstructed, the disk blocks of each stripe to be reconstructed in the disk set to be reconstructed are screened, the disk blocks to be reconstructed contained in the stripe to be reconstructed are determined, and the disk blocks to be reconstructed are reconstructed.
Specifically, step S803 includes:
step S8031, allocating a stripe management structure for the stripe to be reconstructed.
In the embodiment of the invention, the stripe management structure can be pre-placed in the stripe cache, and can be directly taken out from the stripe cache when the stripe cache needs to be used. The stripe management structure is used to manage and control the reconstruction of disk partitions in the stripe.
Step S8032, based on the stripe elements to be reconstructed contained in the stripe set to be reconstructed, determines the partition numbers of the disk partitions contained in the stripe to be reconstructed, respectively.
In the embodiment of the invention, the band number of the band to be reconstructed is searched in the band set to be reconstructed, so that the block number of the disk block contained in the band to be reconstructed is obtained from the corresponding band element to be reconstructed.
In an alternative embodiment, before step S8032, the method further includes a step of locking the strip to be reconstructed, specifically as follows: acquiring a strip lock corresponding to a strip to be reconstructed; and storing the stripe lock corresponding to the stripe to be reconstructed in the stripe management structure corresponding to the stripe to be reconstructed. The strip lock is used for locking the strip to be reconstructed before the strip to be reconstructed is reconstructed, so that other controllers in the storage system are prevented from operating the strip to be reconstructed to influence the reconstruction of the strip to be reconstructed.
Step S8033, based on the partition numbers of the disk partitions and the disk set to be reconstructed, screens the disk partitions, and determines the disk partitions to be reconstructed contained in the stripe to be reconstructed.
In the embodiment of the invention, firstly, based on the partition number of the disk partition and the stripe number of the stripe to be reconstructed of the disk partition, determining the array row and the disk of the disk partition; then, searching disk elements to be reconstructed corresponding to the array row where the disk blocks are located in the disk set to be reconstructed; when the disk number element of the disk element to be reconstructed contains the disk number of the disk where the disk block is located, determining the disk block as the disk block to be reconstructed.
Step S8034, updating the reconstruction information of the disk blocks to be reconstructed contained in the stripe to be reconstructed to the stripe management structure corresponding to the stripe to be reconstructed.
In the embodiment of the invention, the reconstruction information is used for representing that the disk blocks to be reconstructed need to be reconstructed. When the reconfiguration information of the disk partition to be reconfigured is queried, the reconfiguration information is reconfigured by the stripe management structure.
Step S8035, reconstructing the disk blocks to be reconstructed based on the reconstruction information contained in the stripe management structure.
In the embodiment of the invention, after determining all the disk blocks to be reconstructed in the stripe group, reconstructing the corresponding disk blocks to be reconstructed according to the reconstruction information stored in the stripe management structure. After the reconfiguration is complete, the stripe management structure is released and placed back into the stripe cache.
In an alternative embodiment, the method further includes a step of unlocking the to-be-reconstructed stripe after step S8035, specifically, taking out the stripe lock corresponding to the to-be-reconstructed stripe from the stripe management structure corresponding to the to-be-reconstructed stripe.
Fig. 9 is a schematic flow chart of obtaining and reconstructing a disk partition to be reconstructed according to an embodiment of the present invention, and the above step S803 is further described with reference to fig. 9. As shown in fig. 9, first, memory and a stripe management structure are allocated according to the number of stripes to be reconstructed, stripe locks corresponding to the stripes to be reconstructed are acquired, and the stripe locks are stored in the stripe management structure. Then traversing the strip to be reconstructed, finding out the disk blocks to be reconstructed in the strip to be reconstructed, and updating the reconstruction information of the disk blocks to be reconstructed, namely the information of the block numbers to be reconstructed, into a strip management structure; specifically, for each stripe to be reconstructed, traversing all disk blocks in the stripe to be reconstructed according to the sequence of block numbers, and calculating an array row where the disk blocks are located according to the block numbers and the stripe numbers of the disk blocks; and then, whether the disk block needs to be reconstructed or not is preliminarily determined according to the disk number element corresponding to the array row, when the disk data element is 0, the next disk block in the stripe is directly confirmed, when the disk data element is not 0, the disk number corresponding to the disk block is calculated, the disk number corresponding to the disk block is searched in the disk number element corresponding to the array row, when the disk number corresponding to the disk block is searched, the disk block is determined to be the disk block to be reconstructed, meanwhile, the value of the disk number element corresponding to the array row is reduced by one, the next disk block is confirmed, and when the disk number corresponding to the disk block is not searched, the next disk block in the stripe is confirmed. And confirming all the strips in the strip group, finding all the disk blocks to be reconstructed, and reconstructing the disk blocks to be reconstructed according to reconstruction information placed in the strip management structure. After the reconfiguration is completed, the stripe lock of the stripe to be reconfigured is released, along with the stripe management structure, and the stripe management structure is placed back into the stripe cache.
The embodiment also provides a disk reconstruction device, which is used for implementing the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the terms "module," "unit" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides a disk reconstruction apparatus, as shown in fig. 10, including:
the to-be-reconstructed disk set determining module 1001 is configured to query to-be-reconstructed disks included in the stripe group, and obtain a to-be-reconstructed disk set corresponding to the stripe group;
the to-be-reconstructed stripe set determining module 1002 is configured to determine a to-be-reconstructed stripe set based on a stripe where a disk partition corresponding to a to-be-reconstructed disk in the to-be-reconstructed disk set is located;
the to-be-reconstructed disk block reconstruction module 1003 is configured to screen, based on the to-be-reconstructed stripe set, disk blocks of each to-be-reconstructed stripe in the to-be-reconstructed disk set, determine to-be-reconstructed disk blocks contained in the to-be-reconstructed stripe, and reconstruct the to-be-reconstructed disk blocks.
In an alternative embodiment, the disk set to be reconstructed determining module 1001 includes:
the disk to be reconstructed determining unit is used for inquiring the disk to be reconstructed contained in the disk array;
the disk reconstruction condition determining unit is used for determining the reconstruction condition of the disk to be reconstructed corresponding to each array row contained in the stripe group respectively;
the to-be-reconstructed disk element determining unit is used for determining to-be-reconstructed disk elements corresponding to the array rows based on to-be-reconstructed disks corresponding to the array rows and the reconstruction conditions of the to-be-reconstructed disks corresponding to the array rows;
and the reconstruction disk set determining unit is used for obtaining a disk set to be reconstructed based on the disk elements to be reconstructed corresponding to each array row contained in the stripe group.
In an alternative embodiment, the disk element determining unit to be reconstructed includes:
a disk number element determination subunit, configured to add a disk number of the disk to be reconstructed, where the disk number is reconstructed as an unreconstructed disk, to a disk number element of the disk element to be reconstructed;
a disk number element determining subunit, configured to determine a disk number element of the disk element to be reconstructed based on the number of disk numbers included in the disk number element;
and the disk element to be reconstructed determines a subunit, which is used for obtaining the disk element to be reconstructed based on the disk number element and the disk number element.
In an alternative embodiment, the to-be-reconstructed stripe set determination module 1002 includes:
the block reconstruction condition determining unit is used for respectively determining the to-be-reconstructed conditions of the disk blocks contained in each stripe in the stripe group based on the to-be-reconstructed disk set;
the to-be-reconstructed strip element determining unit is used for determining to-be-reconstructed strip elements corresponding to the to-be-reconstructed strips based on the to-be-reconstructed condition of the disk blocks;
and the to-be-reconstructed band set determining unit is used for obtaining the to-be-reconstructed band set based on the to-be-reconstructed band elements corresponding to the to-be-reconstructed bands contained in the band group.
In an alternative embodiment, the block reconstruction instance determination unit comprises:
an array row determining subunit, configured to determine an array row in which the disk block is located based on the block number of the disk block and the stripe number of the stripe in which the disk block is located;
the to-be-reconstructed disk element searching subunit is used for searching to-be-reconstructed disk elements corresponding to the array row where the disk blocks are located in the to-be-reconstructed disk set;
and the to-be-reconstructed condition determining subunit is used for determining the to-be-reconstructed condition of the disk blocks based on the to-be-reconstructed disk elements.
In an alternative embodiment, the condition to be reconstructed determines the subunit for:
When the value of the disk number element of the disk element to be reconstructed is 0, determining that the disk partition is not required to be reconstructed;
when the value of the disk number element of the disk element to be reconstructed is not 0, determining the disk number of the disk where the disk block is located based on the block number of the disk block and the stripe number of the stripe where the disk block is located;
searching a disk number of a disk where the disk block is located in a disk number element of the disk element to be reconstructed;
when the disk number of the disk where the disk block is located is found, determining that the to-be-reconstructed condition of the disk block is to be reconstructed;
when the disk number of the disk where the disk partition is located is not found, determining that the disk partition is to be reconstructed as not needing to be reconstructed.
In an alternative embodiment, the stripe element determination unit to be reconstructed comprises:
the to-be-reconstructed strip determining subunit is used for determining the strip where the disk block is located as the to-be-reconstructed strip when the to-be-reconstructed condition of the disk block is to be reconstructed;
the to-be-reconstructed strip element determining subunit is used for adding the partition numbers of the disk partitions contained in the to-be-reconstructed strip into the to-be-reconstructed strip elements corresponding to the to-be-reconstructed strip.
In an alternative embodiment, the to-be-reconstructed stripe element determining unit further comprises:
and the disk number element modification subunit is used for subtracting one value of the disk number element in the disk elements to be reconstructed corresponding to the array row where the disk blocks are located.
In an alternative embodiment, the disk partition reconstruction module to be reconstructed 1003 includes:
the strip management structure allocation unit is used for allocating a strip management structure to the strip to be reconstructed;
the block number determining unit is used for determining the block numbers of the disk blocks contained in the stripe to be reconstructed based on the stripe elements to be reconstructed contained in the stripe set to be reconstructed;
the to-be-reconstructed disk block determining unit is used for screening the disk blocks based on the block numbers of the disk blocks and the to-be-reconstructed disk set to determine to-be-reconstructed disk blocks contained in the to-be-reconstructed strip;
the reconfiguration information updating unit is used for updating the reconfiguration information of the disk blocks to be reconfigured contained in the to-be-reconfigured stripe to the stripe management structure corresponding to the to-be-reconfigured stripe; the reconstruction information is used for representing that the disk blocks to be reconstructed need to be reconstructed;
the disk block reconstruction unit to be reconstructed is used for reconstructing the disk block to be reconstructed based on the reconstruction information contained in the stripe management structure.
In an alternative embodiment, the disk partition determining unit to be reconstructed includes:
the disk block positioning subunit is used for determining an array row and a disk where the disk block is located based on the block number of the disk block and the stripe number of the stripe to be reconstructed where the disk block is located;
the to-be-reconstructed disk element searching subunit is used for searching to-be-reconstructed disk elements corresponding to the array row where the disk blocks are located in the to-be-reconstructed disk set;
and the to-be-reconstructed disk block determining subunit is used for determining the disk block as the to-be-reconstructed disk block when the disk number element of the to-be-reconstructed disk element contains the disk number of the disk where the disk block is located.
In an alternative embodiment, the disk partition reconstruction module to be reconstructed 1003 further includes:
the strip lock acquisition unit is used for acquiring the strip lock corresponding to the strip to be reconstructed;
and the stripe lock storage unit is used for storing the stripe lock corresponding to the stripe to be reconstructed in the stripe management structure corresponding to the stripe to be reconstructed.
In an alternative embodiment, the disk partition reconstruction module to be reconstructed 1003 further includes:
and the strip lock releasing unit is used for taking out the strip lock corresponding to the strip to be reconstructed from the strip management structure corresponding to the strip to be reconstructed.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The disk reconstruction means in this embodiment are presented in the form of functional units, here referred to as ASICs (Application Specific Integrated Circuit, application specific integrated circuits), processors and memories executing one or more software or fixed programs, and/or other devices that can provide the above described functionality.
The embodiment of the invention also provides computer equipment, which is provided with the disk reconstruction device shown in the figure 10.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a computer device according to an alternative embodiment of the present invention, as shown in fig. 11, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 10.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform a method for implementing the embodiments described above.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The computer device also includes a communication interface 30 for the computer device to communicate with other devices or communication networks.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.

Claims (14)

1. A method of disk reconstruction, the method comprising:
inquiring a disk to be reconstructed contained in a stripe group to obtain a disk set to be reconstructed corresponding to the stripe group;
determining a stripe set to be reconstructed based on stripes of the disk blocks corresponding to the disks to be reconstructed in the disk set to be reconstructed; the stripe set to be reconstructed is used for representing a stripe to be reconstructed and a disk partition contained in the stripe to be reconstructed;
screening the disk blocks of each to-be-reconstructed stripe in the to-be-reconstructed disk set based on the to-be-reconstructed stripe set, determining to-be-reconstructed disk blocks contained in the to-be-reconstructed stripe, and reconstructing the to-be-reconstructed disk blocks;
the filtering the disk blocks of each to-be-reconstructed stripe in the to-be-reconstructed disk set based on the to-be-reconstructed stripe set, determining the to-be-reconstructed disk blocks contained in the to-be-reconstructed stripe, and reconstructing the to-be-reconstructed disk blocks, including: distributing a strip management structure for the strip to be reconstructed; based on the strip elements to be reconstructed contained in the strip set to be reconstructed, determining partition numbers of disk partitions contained in the strip to be reconstructed respectively; screening the disk blocks based on the block numbers of the disk blocks and the disk set to be reconstructed, and determining the disk blocks to be reconstructed contained in the stripe to be reconstructed; updating the reconstruction information of the to-be-reconstructed disk blocks contained in the to-be-reconstructed stripe to the stripe management structure corresponding to the to-be-reconstructed stripe; the reconstruction information is used for representing that the disk blocks to be reconstructed need to be reconstructed; and reconstructing the disk blocks to be reconstructed based on the reconstruction information contained in the stripe management structure.
2. The method of claim 1, wherein the querying the disks to be reconstructed included in the stripe group to obtain the set of disks to be reconstructed corresponding to the stripe group includes:
inquiring the disk to be reconstructed contained in the disk array;
respectively determining the reconstruction conditions of the magnetic disk to be reconstructed corresponding to each array row contained in the stripe group;
determining a disk element to be reconstructed corresponding to the array row based on the disk to be reconstructed corresponding to the array row and the reconstruction condition of the disk to be reconstructed corresponding to the array row;
and obtaining the disk set to be reconstructed based on the disk elements to be reconstructed corresponding to each array row contained in the stripe group.
3. The method of claim 2, wherein the determining the element of the disk to be reconstructed corresponding to the array row based on the reconstruction conditions of the disk to be reconstructed corresponding to the array row and the disk to be reconstructed corresponding to the array row comprises:
adding the disk number of the disk to be reconstructed, which is not reconstructed, into the disk number element of the disk element to be reconstructed;
determining a disk number element of the disk element to be reconstructed based on the number of disk numbers contained in the disk number element;
And obtaining the disk element to be reconstructed based on the disk number element and the disk number element.
4. The method of claim 1, wherein the determining the set of stripes to be reconstructed based on the stripes in which the disk blocks corresponding to the disks to be reconstructed are located in the set of disks to be reconstructed comprises:
based on the disk set to be reconstructed, determining the conditions to be reconstructed of the disk blocks contained in each stripe in the stripe group respectively;
determining a to-be-reconstructed strip element corresponding to the to-be-reconstructed strip based on the to-be-reconstructed condition of the disk partition;
and obtaining the to-be-reconstructed band set based on the to-be-reconstructed band elements corresponding to the to-be-reconstructed band contained in the band group.
5. The method according to claim 4, wherein the determining, based on the set of disks to be reconstructed, the to-be-reconstructed condition of the disk blocks included in each stripe in the stripe group includes:
determining an array row where the disk block is located based on the block number of the disk block and the stripe number of the stripe where the disk block is located;
searching a disk element to be reconstructed corresponding to an array row where the disk block is located in the disk set to be reconstructed;
And determining the to-be-reconstructed condition of the disk partition based on the to-be-reconstructed disk element.
6. The method of claim 5, wherein the determining a to-be-reconstructed instance of the disk partition based on the to-be-reconstructed disk element comprises:
when the value of the disk number element of the disk element to be reconstructed is 0, determining that the disk block to be reconstructed does not need to be reconstructed;
when the value of the disk number element of the disk element to be reconstructed is not 0, determining the disk number of the disk where the disk block is located based on the block number of the disk block and the stripe number of the stripe where the disk block is located;
searching the disk number of the disk where the disk block is located in the disk number element of the disk element to be reconstructed;
when the disk number of the disk where the disk block is located is found, determining that the condition to be reconstructed of the disk block needs to be reconstructed;
when the disk number of the disk where the disk block is located is not found, determining that the condition to be reconstructed of the disk block does not need to be reconstructed.
7. The method according to claim 4, wherein the determining the to-be-reconstructed stripe element corresponding to the to-be-reconstructed stripe based on the to-be-reconstructed condition of the disk partition includes:
When the condition to be reconstructed of the disk blocks is that reconstruction is needed, determining that the stripe where the disk blocks are positioned is the stripe to be reconstructed;
and adding the partition numbers of the disk partitions contained in the to-be-reconstructed stripe into to-be-reconstructed stripe elements corresponding to the to-be-reconstructed stripe.
8. The method of claim 7, wherein the adding the partition number of the disk partition included in the stripe to be reconstructed to the stripe to be reconstructed corresponding to the stripe to be reconstructed further comprises:
and subtracting one from the value of the disk number element in the disk elements to be reconstructed corresponding to the array row where the disk block is located.
9. The method of claim 1, wherein the screening the disk partitions based on the partition number and the set of disks to be reconstructed, determining the disk partitions to be reconstructed included in the stripe to be reconstructed, comprises:
determining an array row and a disk where the disk block is located based on the block number of the disk block and the stripe number of a stripe to be reconstructed where the disk block is located;
searching a disk element to be reconstructed corresponding to an array row where the disk block is located in the disk set to be reconstructed;
And when the disk number element of the disk element to be reconstructed contains the disk number of the disk where the disk block is located, determining the disk block as the disk block to be reconstructed.
10. The method according to claim 1, wherein before determining the partition numbers of the disk partitions included in the stripe to be reconstructed, based on the stripe elements to be reconstructed included in the stripe set to be reconstructed, respectively, the method further comprises:
acquiring a strip lock corresponding to the strip to be reconstructed;
and storing the stripe lock corresponding to the stripe to be reconstructed in the stripe management structure corresponding to the stripe to be reconstructed.
11. The method of claim 10, wherein after reconstructing the disk partition to be reconstructed based on the reconstruction information contained in the stripe management structure, further comprising:
and taking out the strip lock corresponding to the strip to be reconstructed from the strip management structure corresponding to the strip to be reconstructed.
12. A data reading and writing apparatus, the apparatus comprising:
the to-be-reconstructed disk set determining module is used for querying to-be-reconstructed disks contained in the stripe group to obtain a to-be-reconstructed disk set corresponding to the stripe group;
The to-be-reconstructed stripe set determining module is used for determining a to-be-reconstructed stripe set based on stripes of disk blocks corresponding to the to-be-reconstructed disks in the to-be-reconstructed disk set;
the to-be-reconstructed disk block reconstruction module is used for screening the disk blocks of each to-be-reconstructed stripe in the to-be-reconstructed disk set based on the to-be-reconstructed stripe set, determining to-be-reconstructed disk blocks contained in the to-be-reconstructed stripe, and reconstructing the to-be-reconstructed disk blocks; the filtering the disk blocks of each to-be-reconstructed stripe in the to-be-reconstructed disk set based on the to-be-reconstructed stripe set, determining the to-be-reconstructed disk blocks contained in the to-be-reconstructed stripe, and reconstructing the to-be-reconstructed disk blocks, including: distributing a strip management structure for the strip to be reconstructed; based on the strip elements to be reconstructed contained in the strip set to be reconstructed, determining partition numbers of disk partitions contained in the strip to be reconstructed respectively; screening the disk blocks based on the block numbers of the disk blocks and the disk set to be reconstructed, and determining the disk blocks to be reconstructed contained in the stripe to be reconstructed; updating the reconstruction information of the to-be-reconstructed disk blocks contained in the to-be-reconstructed stripe to the stripe management structure corresponding to the to-be-reconstructed stripe; the reconstruction information is used for representing that the disk blocks to be reconstructed need to be reconstructed; and reconstructing the disk blocks to be reconstructed based on the reconstruction information contained in the stripe management structure.
13. A computer device, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the disk reconstruction method of any one of claims 1 to 11.
14. A computer readable storage medium having stored thereon computer instructions for causing a computer to perform the disk reconstruction method of any one of claims 1 to 11.
CN202311426549.2A 2023-10-31 2023-10-31 Disk reconstruction method, device, equipment and storage medium Active CN117149096B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311426549.2A CN117149096B (en) 2023-10-31 2023-10-31 Disk reconstruction method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311426549.2A CN117149096B (en) 2023-10-31 2023-10-31 Disk reconstruction method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117149096A CN117149096A (en) 2023-12-01
CN117149096B true CN117149096B (en) 2024-02-06

Family

ID=88912509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311426549.2A Active CN117149096B (en) 2023-10-31 2023-10-31 Disk reconstruction method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117149096B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528003A (en) * 2016-12-09 2017-03-22 曙光信息产业(北京)有限公司 Method and device for rebuilding disk array
CN113687790A (en) * 2021-09-06 2021-11-23 锐捷网络股份有限公司 Data reconstruction method, device, equipment and storage medium
CN115543696A (en) * 2022-11-30 2022-12-30 苏州浪潮智能科技有限公司 Disk array reconstruction task acceleration method, system, storage medium and equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220148B (en) * 2016-03-21 2020-12-04 伊姆西Ip控股有限责任公司 Reconstruction method and device for redundant array of independent disks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528003A (en) * 2016-12-09 2017-03-22 曙光信息产业(北京)有限公司 Method and device for rebuilding disk array
CN113687790A (en) * 2021-09-06 2021-11-23 锐捷网络股份有限公司 Data reconstruction method, device, equipment and storage medium
CN115543696A (en) * 2022-11-30 2022-12-30 苏州浪潮智能科技有限公司 Disk array reconstruction task acceleration method, system, storage medium and equipment

Also Published As

Publication number Publication date
CN117149096A (en) 2023-12-01

Similar Documents

Publication Publication Date Title
CN107608773B (en) Task concurrent processing method and device and computing equipment
CN106407207B (en) Real-time newly-added data updating method and device
CN108509462B (en) Method and device for synchronizing activity transaction table
CN105893188A (en) Method and device for speeding up data reconstruction of disk array
US11194762B2 (en) Spatial indexing using resilient distributed datasets
CN111095217B (en) RAID mechanism-based data storage system with global sharing of resources
WO2017050064A1 (en) Memory management method and device for shared memory database
DE112016000776T5 (en) Efficiently performing insert and point query operations in a column store
CN117149096B (en) Disk reconstruction method, device, equipment and storage medium
CN106708865B (en) Method and device for accessing window data in stream processing system
CN116662019B (en) Request distribution method and device, storage medium and electronic device
US11119703B2 (en) Utilizing a set of virtual storage units distributed across physical storage units
CN104598171B (en) Array method for reconstructing and device based on metadata
WO2023098641A1 (en) Systems and methods for data storage in storage device
US20130080481A1 (en) Extreme large space allocation
CN110990207A (en) BPS memory test method, system, terminal and storage medium based on Whitley platform
CN113849317B (en) Memory pool resource using method and related device
CN115756955A (en) Data backup and data recovery method and device and computer equipment
CN113905014B (en) Method, server and storage medium for assigning ID number to terminal device
CN105939218A (en) Statistical method and device for network traffic
CN115757066A (en) Hard disk performance test method, device, equipment, storage medium and program product
CN104317820A (en) Statistical method and device of report
CN112988696B (en) File sorting method and device and related equipment
CN114020214A (en) Storage cluster capacity expansion method and device, electronic equipment and readable storage medium
US20210064575A1 (en) Data storage method and method for executing an application with reduced access time to the stored data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant