Disk array fault data recovery method and device and product
By optimizing the X-Code check encoding, the data blocks of the diagonal check chain in the RAID6 disk array are continuously distributed, which solves the problem of low recovery efficiency of faulty data in the RAID6 disk array and achieves more efficient data recovery.
Patent Information
- Application Number
- CN202410693052.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-27
AI Technical Summary
The low efficiency of fault data recovery caused by X-Code parity encoding in RAID6 disk arrays is mainly due to the fact that data blocks in the same diagonal parity chain are evenly distributed in different stripes of different disks, which increases the overhead cost of read operations.
By generating optimized X-Code verification codes, the data blocks in any diagonal verification chain form a peer verification chain, and the data blocks in the peer verification chain are continuously distributed among multiple disks, thereby ensuring that the Continuously read data blocks in the disk array to perform XOR calculations to recover lost data.
The overhead cost of read operations is reduced, the efficiency of the fault data recovery process is improved, and the delay in data recovery is shortened.
Smart Images

Figure CN118708402A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of data processing, and in particular to a method, device and product for recovering data from a disk array failure. Background Art
[0002] RAID (Redundant Array of Independent Disks) technology combines multiple hard disk devices into a disk array with larger capacity and better security. The stored data is divided into multiple segments and stored on different physical hard disk devices respectively. At the same time, copies of multiple important data are synchronized to different physical hard disk devices, thereby achieving a very good data redundancy backup effect.
[0003] With the development of RAID technology, RAID6 has the concept of double verification. Data can be restored after any two disks in the RAID6 disk array fail at the same time, which can improve the reliability of the storage system. The fault tolerance of the RAID6 array comes from the underlying RAID6 coding, one of which is the use of X-Code verification coding.
[0004] There are two verification rules in X-Code verification code: diagonal verification chain and anti-diagonal verification chain. Each block in each verification chain is evenly distributed in each disk. When recovering data from a failed disk, XOR operation of the diagonal verification chain and the anti-diagonal verification chain can recover the lost data. However, in the verification rules of X-Code verification code, since multiple blocks in the same verification chain are evenly distributed in different stripes of each disk, when data is recovered based on the verification chain, the overhead cost of the read operation is large, resulting in low efficiency of the fault data recovery process. Summary of the invention
[0005] The embodiments of the present application provide a disk array failure data recovery method, device and product, aiming to improve the efficiency of the failure data recovery process.
[0006] In a first aspect, an embodiment of the present application provides a method for recovering data from a disk array failure, which is applied to a disk array of RAID6, wherein the disk array adopts an X-Code checksum, wherein the X-Code checksum includes a plurality of diagonal checksum chains and a plurality of anti-diagonal checksum chains, and the method includes:
[0007] Generate an optimized X-Code check code according to multiple diagonal check chains in the X-Code check code, wherein in the optimized X-Code check code, all data blocks in any diagonal check chain form a same-row check chain, and all data blocks in the same-row check chain are continuously distributed in multiple disks of the disk array;
[0008] When two failed disks are detected in the disk array that performs data storage according to the optimized X-Code checksum code, a failed data recovery strategy is executed according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains to recover all lost data on the two failed disks.
[0009] Optionally, generating an optimized X-Code check code according to a plurality of diagonal check chains in the X-Code check code includes:
[0010] Constructing multiple in-line check chains in the optimized X-Code check code, wherein in the optimized X-Code check code, the number of in-line check chains is consistent with the number of diagonal check chains in the X-Code check code, and the number of data blocks included in any check chain is the same;
[0011] Determine a target diagonal check chain corresponding to any in-line check chain in the optimized X-Code check code, migrate all data blocks in the target diagonal check chain to the in-line check chain, and all data blocks in the in-line check chain are continuously distributed in multiple disks of the disk array.
[0012] Optionally, determining a target diagonal check chain corresponding to any same-row check chain in the optimized X-Code check code includes:
[0013] Obtaining the serial number of the diagonal check chain corresponding to each data block in the X-Code check code of the disk array, and determining the serial number of the diagonal check chain not included in any disk in the disk array;
[0014] According to the serial number of any in-line check chain, the disk corresponding to the serial number of the in-line check chain is determined, and the diagonal check chain corresponding to the serial number of the diagonal check chain not included in the disk is used as the target diagonal check chain of the in-line check chain.
[0015] Optionally, migrating all data blocks in the target diagonal check chain to the same row check chain includes:
[0016] For any peer check chain, determine the target location corresponding to the data block in the peer check chain in any hard disk;
[0017] Obtaining the sequence number of the diagonal checksum chain corresponding to the current data block at the target position in the disk;
[0018] When the sequence number of the diagonal check chain corresponding to the current data block at the target position in the disk is not the sequence number of the target diagonal check chain corresponding to the same line check chain, the data block exchange strategy is executed.
[0019] Optionally, a data block exchange strategy is executed, including:
[0020] Obtaining the actual location of the data block of the target diagonal checksum chain in the disk;
[0021] The data block at the actual position is exchanged with the data block at the target position.
[0022] Optionally, according to the serial number of any peer check chain, the formula for determining the disk corresponding to the serial number of the peer check chain is:
[0023] j=((i+1)*(p-2)+1)%p
[0024] Wherein, j is the serial number of the disk; i is the serial number of the same-row check chain; and p is the total number of disks in the disk array.
[0025] Optionally, for any peer check chain, the formula for determining the target position corresponding to the data block in the peer check chain in any hard disk is:
[0026] r=((p-2)*i+k) / p
[0027] c=((p-2)*i+k)%p
[0028] In the formula, r is the row number of the target position; c is the column number of the target position; p is the total number of disks in the disk array; i is the sequence number of the same-row check chain; k represents the kth data block in the same-row check chain, and k is less than p-2.
[0029] Optionally, generating an optimized X-Code check code according to a plurality of diagonal check chains in the X-Code check code includes:
[0030] Inputting the data block layout in the plurality of diagonal check chains in the X-Code check code into the optimization model;
[0031] The optimization model outputs the optimized X-Code checksum coded data block layout according to the data block layout in the multiple diagonal checksum chains;
[0032] Combining the optimized X-Code check code with the data block layout of the optimized X-Code check code and the two check rows in the X-Code check code to obtain the optimized X-Code check code, wherein the two check rows include a check row composed of the check blocks of the multiple diagonal check chains and a check row composed of the check blocks of the multiple anti-diagonal check chains;
[0033] The optimization model is used to migrate data blocks on the same diagonal check chain of the X-Code check code to the same in-line check chain, and all data blocks in the in-line check chain are continuously distributed in multiple disks of the disk array.
[0034] Optionally, when two failed disks are detected, a failed data recovery strategy is executed according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains, including:
[0035] According to the optimized X-Code checksum encoding, if there is a missing data in any one-line checksum chain, all non-missing data in the same-line checksum chain are continuously read in the disk array;
[0036] Perform an XOR calculation on all non-missing data in the same peer check chain to obtain the missing data in the same peer check chain.
[0037] Optionally, when two failed disks are detected, a failed data recovery strategy is executed according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains, including:
[0038] According to the optimized X-Code check code, if there are two missing data in any same-row check chain, a system of equations is constructed based on the optimized X-Code check code and the multiple anti-diagonal check chains to obtain the two missing data in the same-row check chain.
[0039] Optionally, based on the optimized X-Code check code and the multiple anti-diagonal check chains, a system of equations is constructed to obtain the two missing data in the same check chain, including:
[0040] For a first lost data of the two lost data, obtaining all non-lost data in an anti-diagonal check chain corresponding to the first lost data in the disk array, and establishing a first XOR equation according to all the non-lost data in the anti-diagonal check chain;
[0041] For the second lost data of the two lost data, all non-lost data of the same line check chain are obtained in the disk array, and a second XOR equation is established according to all the non-lost data of the same line check chain and the first lost data;
[0042] Solve the equation group consisting of the first XOR equation and the second XOR equation to obtain the two missing data in the same row check chain.
[0043] Optionally, when two failed disks are detected, a failed data recovery strategy is executed according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains, including:
[0044] When two failed disks are detected, all data loss is confirmed;
[0045] Acquire, in the disk array, all non-lost data in the same row check chain and all non-lost data in the anti-diagonal check chain corresponding to all the lost data;
[0046] Establishing a joint XOR calculation equation group according to all non-lost data in the same parity check chain corresponding to all the lost data and all non-lost data in the anti-diagonal parity check chain;
[0047] Solve the joint XOR calculation equation group to obtain all the missing data.
[0048] Optionally, the method further comprises:
[0049] When a single faulty disk is detected in the disk array that performs data storage according to the optimized X-Code checksum coding, for any lost data, a faulty data recovery strategy is executed according to the same-row checksum chain or the anti-diagonal checksum chain where the lost data is located to recover the lost data.
[0050] Optionally, the method further comprises:
[0051] When a single failed disk is detected in the disk array that performs data storage according to the optimized X-Code checksum coding, for any lost data, all non-lost data in the same checksum chain where the lost data is located are continuously read in the disk array;
[0052] Perform an XOR calculation on all non-missing data in the same peer check chain to obtain the missing data in the same peer check chain.
[0053] In a second aspect, an embodiment of the present application provides a disk array failure data recovery device, which is applied to a RAID6 disk array, wherein the disk array adopts an X-Code check code, wherein the X-Code check code includes a plurality of diagonal check chains and a plurality of anti-diagonal check chains, and the device includes:
[0054] An optimization module, configured to generate an optimized X-Code check code according to a plurality of diagonal check chains in the X-Code check code, wherein in the optimized X-Code check code, all data blocks in any diagonal check chain form a same-row check chain, and all data blocks in the same-row check chain are continuously distributed in the disk array;
[0055] The recovery module is used to execute a fault data recovery strategy according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains to recover all lost data on the two faulty disks when two faulty disks are detected in the disk array that performs data storage according to the optimized X-Code checksum code.
[0056] In a third aspect, an embodiment of the present application provides a disk array, which is a RAID6 disk array, and the disk array adopts X-Code checksum coding, and the X-Code checksum coding includes multiple diagonal check chains and multiple anti-diagonal check chains. The disk array is used to execute the disk array failure data recovery method described in the first aspect of the embodiment.
[0057] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the disk array failure data recovery method described in the first aspect of the embodiment is implemented.
[0058] In a fifth aspect, an embodiment of the present application provides a non-volatile readable storage medium, wherein the non-volatile readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the disk array failure data recovery method described in the first aspect of the embodiment is executed.
[0059] In a sixth aspect, an embodiment of the present application provides a computer device, comprising: at least one processor, and a memory, wherein the memory stores a computer program that can be run on the processor, wherein when the processor executes the program, the disk array failure data recovery method described in the first aspect of the embodiment is executed.
[0060] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the disk array failure data recovery method described in the first aspect of the embodiment.
[0061] Beneficial effects:
[0062] An optimized X-Code check code is generated according to a plurality of diagonal check chains in the X-Code check code, in which all data blocks in any diagonal check chain constitute an in-line check chain, and all data blocks in the in-line check chain are continuously distributed in a plurality of disks in the disk array; when two faulty disks are detected in the disk array in which data storage is performed according to the optimized X-Code check code, a fault data recovery strategy is executed according to the optimized X-Code check code and the plurality of anti-diagonal check chains to recover all lost data in the two faulty disks.
[0063] This method optimizes multiple diagonal check chains in the X-Code check code, and swaps the positions of data blocks in the same diagonal check chain that are evenly distributed in different strips of the disk array, so that the data blocks in the same diagonal check chain are located in the same check chain, and all data blocks in the same check chain are continuously distributed in multiple disks of the disk array. In the recovery process when a disk failure occurs, the data blocks in the same check chain can be continuously read in the disk array to perform XOR calculation to recover the lost data, which reduces the overhead cost of the read operation and improves the efficiency of the fault data recovery process. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0065] Figure 1 A flowchart showing the steps of a disk array failure data recovery method provided by an embodiment of the present application is shown;
[0066] Figure 2 A flowchart of the steps for generating an optimized X-Code verification code provided by an embodiment of the present application is shown;
[0067] Figure 3 A functional module diagram of a disk array failure data recovery device provided by an embodiment of the present application is shown;
[0068] Figure 4 A schematic diagram of a non-volatile readable storage medium provided in an embodiment of the present application is shown;
[0069] Figure 5 A schematic diagram of a computer device provided in an embodiment of the present application is shown;
[0070] Figure 6A schematic diagram of a computer program product provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0071] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0072] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, each embodiment of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in each embodiment of the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not constitute any limitation, and the various embodiments can be combined with each other and referenced to each other without contradiction.
[0073] RAID6 has the concept of double verification. Data can be recovered even if any two disks in the RAID6 disk array fail at the same time, which can improve the reliability of the storage system. The fault tolerance of the RAID6 disk array comes from the underlying RAID6 coding, one of which is the use of X-Code verification coding.
[0074] When using the RAID6 disk array with X-Code checksum coding, the data distribution in the disk array has the check rules of the diagonal check chain and the anti-diagonal check chain. The blocks in each check chain of the diagonal check chain and the anti-diagonal check chain are evenly distributed in each disk. When recovering the data of the failed disk, the diagonal check chain and the anti-diagonal check chain can be combined for XOR operation.
[0075] The X-Code checksum code is composed of a p×p array, where p is the number of member disks in the RAID6 disk array. In this embodiment, p=7 is taken as an example, that is, the multiple disks in the disk array include D0, D1, D2, D3, D4, D5 and D6, wherein each row in the p×p array is a stripe, and each stripe is composed of 7 data blocks; each column is composed of p-2=5 data blocks and 2 check blocks, that is, each disk includes 5 data blocks and 2 check blocks; any diagonal check chain or any anti-diagonal check chain includes p-1=6 blocks, wherein the 6 blocks in any check chain include p-2 data blocks and 1 check block; an example of a diagonal check chain in the X-Code checksum code is shown in Table 1, and an example of an anti-diagonal check chain is shown in Table 2.
[0076] For ease of understanding in this embodiment, the numbers in the check chain are used to represent the serial numbers of the diagonal check chains, and the Greek letters in the check chain are used to represent the serial numbers of the anti-diagonal check chains.
[0077] Table 1 Diagonal check chain example
[0078] D0 D1 D2 D3 D4 D5 D6 (α,6) (β,5) (c, 4) (d, 3) (e, 2) (g, 1) (n, 0) (β,0) (c, 6) (d, 5) (e, 4) (g, 3) (h, 2) (α,1) (c, 1) (d, 0) (e, 6) (g, 5) (h, 4) (α,3) (β,2) (d, 2) (e, 1) (ζ, 0) (h, 6) (α,5) (β,4) (c, 3) (e, 3) (g, 2) (h, 1) (α,0) (β,6) (c, 5) (d, 4) 4 3 2 1 0 6 5 g or α β c d e
[0079] For example, in Table 1, the five data blocks (α, 6), (γ, 6), (ε, 6), (η, 6), and (β, 6) and the check block 6 constitute a diagonal check chain 6; the six data elements in the same diagonal check chain are evenly distributed in different rows of each disk.
[0080] For example, in the diagonal check chain 6, (α, 6) is located in the first row of disk D0, (γ, 6) is located in the second row of disk D1, (ε, 6) is located in the third row of disk D2, (η, 6) is located in the fourth row of disk D3, (β, 6) is located in the fifth row of disk D4, and 6 is located in the sixth row of disk D5.
[0081] Table 2 Anti-diagonal check chain example
[0082] D0 D1 D2 D3 D4 D5 D6 (α,6) (β,5) (c, 4) (d, 3) (e, 2) (g, 1) (n, 0) (β,0) (c, 6) (d, 5) (e, 4) (g, 3) (h, 2) (α,1) (c, 1) (d, 0) (e, 6) (g, 5) (h, 4) (α,3) (β,2) (d, 2) (e, 1) (ζ, 0) (h, 6) (α,5) (β,4) (c, 3) (e, 3) (g, 2) (h, 1) (α,0) (β,6) (c, 5) (d, 4) g or α β c d e 4 3 2 1 0 6 5
[0083] For example, in Table 2, the five data blocks (α, 6), (α, 1), (α, 3), (α, 5), and (α, 0) and the check block α constitute the anti-diagonal check chain α.
[0084] When the RAID6 disk array is in X-Code verification coding, after the data is stored, the verification rules of the data block are based on the diagonal check chain and the anti-diagonal check chain. When data is lost in the RAID6 disk array due to disk failure, an XOR operation can be performed based on the diagonal check chain and the anti-diagonal check chain to recover the lost data in the failed disk. The symbol of the XOR operation is XOR, represented by "⊕"; for example, taking the lost data in the diagonal check chain 6 as check block 6, and the lost data in the anti-diagonal check chain α as check block α, the operation to recover the lost data is as follows:
[0085] 6=(α,6)⊕(γ,6)⊕(ε,6)⊕(η,6)⊕(β,6)
[0086] α=(α,6)⊕(α,1)⊕(α,3)⊕(α,5)⊕(α,0)
[0087] When two storage drives fail in a RAID6 disk array, or two disks fail, the diagonal checksum chain and the anti-diagonal checksum chain in the X-Code checksum code can be combined to establish a set of equations to recover the data in the failed disk.
[0088] For example, if two disks D2 and D4 fail in a RAID6 disk array consisting of 7 hard disks, resulting in the loss of all data elements stored in D2 and D4, the diagonal check chain and the anti-diagonal check chain shown in Table 1 and Table 2 can be combined to establish the following set of equations:
[0089] 1. (δ,5)=(δ,3)⊕(δ,0)⊕(δ,2)⊕(δ,4)⊕δ
[0090] 2. (η,1)=(γ,1)⊕(ε,1)⊕(ζ,1)⊕(α,1)⊕1
[0091] 3. (η, 4) = (η, 0) ⊕ ( η , 2) ⊕ ( η , 6) ⊕ ( η , 1) ⊕ η
[0092] 4. (γ, 4) = (ε, 4) ⊕ ( η , 4) ⊕ ( β , 4) ⊕ ( δ , 4) ⊕ 4
[0093] 5. γ=(γ,4)⊕(γ,6)⊕(γ,1)⊕(γ,3)⊕(γ,5)
[0094] 6. (ζ,3)=(δ,3)⊕(α,3)⊕(γ,3)⊕(ε,3)⊕3
[0095] 7. (ζ,0)=(ζ,1)⊕(ζ,3)⊕(ζ,5)⊕(ζ,2)⊕ζ
[0096] 8. 0=(η,0)⊕(β,0)⊕(δ,0)⊕(ζ,0)⊕(α,0)
[0097] 9. (α,5)=(β,5)⊕(δ,5)⊕(ζ,5)⊕(γ,5)⊕5
[0098] 10. α=(α,6)⊕(α,1)⊕(α,3)⊕(α,5)⊕(α,0)
[0099] 11. (β,6)=(β,5)⊕(β,0)⊕(β,2)⊕(β,4)⊕β
[0100] 12. (ε, 6) = (α, 6) ⊕ (γ, 6) ⊕ (η, 6) ⊕ (β, 6) ⊕ 6
[0101] 13. (ε, 2) = (ε, 4) ⊕ (ε, 6) ⊕ (ε, 1) ⊕ (ε, 3) ⊕ε
[0102] 14. 2=(η,2)⊕(β,2)⊕(δ,2)⊕(ζ,2)⊕(ε,2)
[0103] However, when a RAID6 disk array using X-Code checksum coding recovers data from a failed disk when two disks fail, multiple data blocks on the same diagonal checksum chain are distributed on different rows of different disks, thereby increasing the I / O overhead of the read operation. The longer the length of a checksum chain, the greater the total amount of data that needs to be retrieved when reading data on the same checksum chain, resulting in inefficient data recovery process.
[0104] In order to improve the efficiency of the fault data recovery process, an embodiment of the present application provides a disk array fault data recovery method.
[0105] Reference Figure 1 , shows a flowchart of a method for recovering data from a disk array failure provided by an embodiment of the present application, the method is applied to a disk array of RAID6, the disk array uses an X-Code checksum, the X-Code checksum includes multiple diagonal checksum chains and multiple anti-diagonal checksum chains, the method may include the following steps:
[0106] S101: Generate an optimized X-Code check code according to multiple diagonal check chains in the X-Code check code, in which all data blocks in any diagonal check chain constitute an in-line check chain, and all data blocks in the in-line check chain are continuously distributed in multiple disks of the disk array.
[0107] Considering that if multiple data blocks on the same diagonal checksum chain can be continuously distributed in multiple disks of the disk array, the distance between data blocks in the same diagonal checksum chain can be shortened, thereby reducing the overhead of read operations during data recovery.
[0108] Therefore, this embodiment first optimizes the disk array X-Code check code to generate an optimized X-Code check code, so that all data blocks in the same diagonal check chain form a same-row check chain, and all data blocks in the same-row check chain are continuously distributed in multiple disks of the disk array.
[0109] Reference Figure 2 , shows a flowchart of steps for generating an optimized X-Code check code provided by an embodiment of the present application. In a feasible implementation, according to multiple diagonal check chains in the X-Code check code, the process of generating an optimized X-Code check code includes the following steps:
[0110] B1: Construct multiple peer verification chains in the optimized X-Code verification code.
[0111] First, the purpose of optimizing the X-Code check code is to rearrange the storage positions of the data blocks on the same diagonal check chain in the X-Code check code. Therefore, the number of in-line check chains in the optimized X-Code check code is consistent with the number of diagonal check chains in the X-Code check code, and the number of data blocks contained in any check chain is the same.
[0112] For example, when the total number of disks in the disk array is p=7, the number of diagonal check chains, anti-diagonal check chains and in-line check chains is 7, and the number of data blocks included in any check chain is p-2=5. An example of the optimized X-Code check encoding is shown in Table 3.
[0113] Table 3 Example of optimized X-Code verification code
[0114] D0 D1 D2 D3 D4 D5 D6 a0_0 a0_1 a0_2 a0_3 a0_4 a1_0 a1_1 a1_2 a1_3 a1_4 a2_0 a2_1 a2_2 a2_3 a2_4 …… …… …… …… …… ai_0 ai_1 ai_2 ai_3 ai_4 …… …… …… …… …… a6_0 a6_1 a6_2 a6_4 a6_5 4 3 2 1 0 6 5 g or α β c d e
[0115] In the optimized X-Code checksum code shown in Table 3, ai_0-ai_4 are 5 data blocks of the i-th same-row checksum chain, i∈{0, 1, 2, 3, 4, 5, 6}, and the last two rows in the optimized X-Code checksum code are checksum rows composed of checksum blocks of 7 diagonal checksum chains in the X-Code checksum code (checksum rows composed of 4, 3, 2, 1, 0, 6, and 5) and checksum rows composed of checksum blocks of 7 anti-diagonal checksum chains (checksum rows composed of ζ, η, α, β, γ, δ, and ε); as shown in Table 3, the 5 data blocks in any same-row checksum chain in the optimized X-Code checksum code are continuously distributed in 7 disks.
[0116] B2: Determine a target diagonal check chain corresponding to any in-line check chain in the optimized X-Code check code, migrate all data blocks in the target diagonal check chain to the in-line check chain, and all data blocks in the in-line check chain are continuously distributed in multiple disks of the disk array.
[0117] After constructing the layout of the same-peer check chain i in the optimized X-Code check encoding, i∈{0, 1, 2, 3, 4, 5, 6}, it is necessary to determine the target diagonal check chain m corresponding to each same-peer check chain i, m∈{0, 1, 2, 3, 4, 5, 6}, and then migrate the data blocks in the target diagonal check chain m to the layout of the same-peer check chain i.
[0118] Specifically, when determining the target diagonal check chain corresponding to any same-row check chain in the optimized X-Code check code, the following sub-steps are included:
[0119] C1: Obtain the serial number of the diagonal check chain corresponding to each data block in the X-Code check code of the disk array, and determine the serial number of the diagonal check chain not included in any disk in the disk array.
[0120] By obtaining the serial numbers of the diagonal check chains corresponding to the five data blocks and one check block contained in any disk in the X-Code check code, the serial numbers of the diagonal check chains not contained in any disk can be determined.
[0121] As shown in Table 1, the five data blocks and one check block contained in disk D0 are:
[0122] (α, 6), (β, 0), (γ, 1), (δ, 2), (ε, 3), 4
[0123] Further, it can be determined that the serial number of the diagonal check chain not included in the disk D0 is 5, that is, the data block in the diagonal check chain 5 is not stored in the disk D0.
[0124] C2: According to the serial number of any in-line check chain, determine the disk corresponding to the serial number of the in-line check chain, and use the diagonal check chain corresponding to the serial number of the diagonal check chain not included in the disk as the target diagonal check chain of the in-line check chain.
[0125] Specifically, according to the serial number of any peer check chain, the formula for determining the disk corresponding to the serial number of the peer check chain is:
[0126] j=((i+1)*(p-2)+1)%p
[0127] Wherein, j is the serial number of the disk; i is the serial number of the same peer check chain; p is the total number of disks in the disk array; j∈{0, 1, 2, 3, 4, 5, 6}.
[0128] For example, taking p=7 as an example, the serial number j of the disk Dj corresponding to the same peer check chain 0 is:
[0129] ((i+1)*(p-2)+1)%p=((0+1)*(7-2)+1)%7=6
[0130] The serial number of the diagonal parity chain not included in disk D6 is 6, so the target diagonal parity chain of the same parity chain 0 is diagonal parity chain 6.
[0131] Taking the diagonal check chain example shown in Table 1 as an example, the disk Dj corresponding to the same check chain i, and the target diagonal check chain m corresponding to the same check chain i, have the corresponding relationship shown in Table 4.
[0132] Table 4 Example of the correspondence between the same parity chain i, disk Dj and target diagonal parity chain m
[0133] i 0 1 2 3 4 5 6 j 6 4 2 0 5 3 1 m 6 1 3 5 0 2 4
[0134] That is, in the optimized X-Code checksum code, the same-peer checksum chains 0-6 are the rearranged diagonal checksum chains 6, 1, 3, 5, 0, 2, and 4 respectively. After determining the diagonal checksum chains corresponding to each same-peer checksum chain in the optimized X-Code checksum code, for any same-peer checksum chain, all data blocks in the target diagonal checksum chain corresponding to the same-peer checksum chain need to be migrated to the same-peer checksum chain.
[0135] Specifically, when all data blocks in the target diagonal check chain are migrated to the same-row check chain, the following sub-steps are included:
[0136] D1: For any peer check chain, determine the target location corresponding to the data block in the peer check chain in any hard disk.
[0137] For example, for any peer check chain, the formula for determining the target position corresponding to the data block in the peer check chain in any hard disk is:
[0138] r=((p-2)*i+k) / p
[0139] c=((p-2)*i+k)%p
[0140] In the formula, r is the row number of the target position; c is the column number of the target position; p is the total number of disks in the disk array; i is the sequence number of the same-row check chain; k represents the kth data block in the same-row check chain, and k is less than p-2.
[0141] In this embodiment, all data blocks in the X-Code verification code are sorted by row. For example, the 7 data blocks in the first row of Table 1 are recorded as 0-6 from left to right, the 7 data blocks in the second row are recorded as 7-13 from left to right, the 7 data blocks in the third row are recorded as 14-20 from left to right, the 7 data blocks in the fourth row are recorded as 21-27 from left to right, and the 7 data blocks in the fifth row are recorded as 28-34 from left to right.
[0142] Taking p=7 as an example, the corresponding target position of the first data block of the same check chain 0 (i.e. k=0) is:
[0143] r=((p-2)*i+k) / p=((7-2)*0+0) / 7=0
[0144] c=((p-2)*i+k)%p=((7-2)*0+0)%7=0
[0145] That is, the target position of the first data block in the same row check chain 0 is row 0, column 0, that is, the first data block in hard disk D0.
[0146] The corresponding target position for the second data block of the same check chain 1 (i.e. k=1) is:
[0147] r=((p-2)*i+k) / p=((7-2)*1+1) / 7=0
[0148] c=((p-2)*i+k)%p=((7-2)*1+1)%7=6
[0149] That is, the target position of the second data block in the same peer check chain 1 is row 0, column 6, which is the first data block in hard disk D6.
[0150] D2: Obtain the sequence number of the diagonal checksum chain corresponding to the current data block at the target position in the disk.
[0151] After determining the target location corresponding to the data block of the same parity check chain i in any hard disk, obtain the serial number of the diagonal parity check chain to which the current data block at the target location belongs in the X-Code parity check code to determine whether data exchange is required.
[0152] For example, the target position of the first data block in the same check chain 0 is row 0, column 0, that is, the first data block in hard disk D0, and at this time the X-Code check code encodes the target position as data block (α, 6), and the corresponding diagonal check chain serial number is 6.
[0153] The target position of the second data block in the same peer check chain 1 is row 0, column 6, that is, the first data block in hard disk D6, and at this time the X-Code checksum encoding of the target position is (η, 0), and the corresponding diagonal checksum chain sequence number is 0.
[0154] Since the target diagonal check chain of the same peer check chain 0 is diagonal check chain 6, and the target position of the first data block in this same peer check chain 0 is already (α, 6) in diagonal check chain 6, there is no need to replace data.
[0155] Since the target diagonal check chain of the same peer check chain 1 is: diagonal check chain 1, and the target position of the second data block in the same peer check chain 1 is (η, 0) in diagonal check chain 0, data replacement is required.
[0156] D3: When the sequence number of the diagonal check chain corresponding to the current data block at the target position in the disk is not the sequence number of the target diagonal check chain corresponding to the same line check chain, execute the data block exchange strategy.
[0157] Specifically, the actual position of the data block of the target diagonal check chain is obtained in the disk; and the data block at the actual position is exchanged with the data block at the target position.
[0158] For example, the target position of the second data block in the same peer check chain 1 is row 0, column 6, that is, the first data block in hard disk D6. The current data block (η, 0) at the target position belongs to diagonal check chain 0, and does not belong to the target diagonal check chain 1 of the same peer check chain. Therefore, polling is performed in disk D6 to find the location of the data block belonging to diagonal check chain 1, that is, the data block (α, 1) in disk D6 is located at row 2, column 6. Therefore, the data block (α, 1) at row 2, column 6 is replaced with the data block (η, 0) at row 0, column 6.
[0159] Until the data blocks in the target diagonal check chain corresponding to each same-peer check chain are replaced to the target position, the optimized X-Code check code is obtained. Since in the process of B1-B2, only the data blocks in the original X-Code check code are reordered, the optimized X-Code check code includes the data block parts of all the same-peer check chains after the reordering. The last two rows of the optimized X-Code check code are the check rows composed of the check blocks of the 7 diagonal check chains in the X-Code check code and the check rows composed of the check blocks of the 7 anti-diagonal check chains.
[0160] In another feasible implementation manner, when generating an optimized X-Code check code according to multiple diagonal check chains in the X-Code check code, the data block layout in the multiple diagonal check chains in the X-Code check code can be input into an optimization model; the optimization model outputs the data block layout of the optimized X-Code check code according to the data block layout in the multiple diagonal check chains; the optimized X-Code check code is obtained by combining the data block layout of the optimized X-Code check code with two check rows in the X-Code check code, the two check rows including a check row composed of check blocks of the multiple diagonal check chains and a check row composed of check blocks of the multiple anti-diagonal check chains, wherein the optimization model is used to migrate data blocks on the same diagonal check chain of the X-Code check code to the same in-line check chain, and all data blocks in the in-line check chain are continuously distributed in multiple disks of the disk array.
[0161] Specifically, taking the diagonal check chain example shown in Table 1 as an example, the pseudo code of the optimized X-Code check code generated by the optimization model is as follows:
[0162]
[0163]
[0164]
[0165] For example, taking the diagonal checksum chain example shown in Table 1 as an example, the optimized X-Code checksum code generated by the optimization model is shown in Table 5.
[0166] Table 5 Optimized X-Code verification code example
[0167] D0 D1 D2 D3 D4 D5 D6 (α,6) (c, 6) (e, 6) (h, 6) (β,6) (g, 1) (α,1) (c, 1) (e, 1) (h, 1) (d, 3) (g, 3) (α,3) (c, 3) (e, 3) (β,5) (d, 5) (g, 5) (α,5) (c, 5) (n, 0) (β,0) (d, 0) (ζ, 0) (α,0) (e, 2) (h, 2) (β,2) (d, 2) (g, 2) (c, 4) (e, 4) (h, 4) (β,4) (d, 4) 4 3 2 1 0 6 5 g or α β c d e
[0168] In the optimized X-Code checksum shown in Table 5, multiple data blocks in the same diagonal checksum chain are continuously distributed in multiple disks. For example, the data blocks (α, 6), (γ, 6), (ε, 6), (η, 6), and (β, 6) in the diagonal checksum chain 6 are distributed in D0, D1, D2, D3, and D4 respectively.
[0169] When storing data in a disk array, after the data is divided into blocks, it is stored continuously and compactly in multiple disks of the storage array according to the diagonal checksum chain to which each data block belongs and the optimized X-Code checksum coding, so as to facilitate fast reading during the data recovery process.
[0170] S102: When two failed disks are detected in the disk array that performs data storage according to the optimized X-Code checksum code, a failed data recovery strategy is executed according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains to recover all lost data on the two failed disks.
[0171] In a feasible implementation, according to the optimized X-Code checksum encoding, if there is a missing data in any one-line checksum chain, all non-missing data in the same-line checksum chain are continuously read in the disk array; and all non-missing data in the same-line checksum chain are XOR-calculated to obtain the missing data in the same-line checksum chain.
[0172] For example, in the optimized X-Code checksum shown in Table 5, if disks D2 and D3 fail, there is only one missing data (δ, 3) in the same checksum chain to which (δ, 3) belongs, and then (ζ, 3), (α, 3), (γ, 3), (ε, 3) of the same checksum chain can be read continuously from disks D4, D5, D6, and D0, and check block 3 can be read in the diagonal check row. All non-missing data (ζ, 3), (α, 3), (γ, 3), (ε, 3) and 3 in the same checksum chain are XORed to obtain the missing data (δ, 3):
[0173] (δ,3)=(ζ,3)⊕(α,3)⊕(γ,3)⊕(ε,3)⊕3.
[0174] In a feasible implementation, according to the optimized X-Code check code, if there are two missing data in any same-row check chain, a set of equations is constructed based on the optimized X-Code check code and the multiple anti-diagonal check chains to obtain the two missing data in the same-row check chain.
[0175] Specifically, for the first lost data among the two lost data, all non-lost data in the anti-diagonal check chain corresponding to the first lost data are obtained in the disk array, and a first XOR equation is established based on all the non-lost data in the anti-diagonal check chain; for the second lost data among the two lost data, all non-lost data in the same line check chain are obtained in the disk array, and a second XOR equation is established based on all the non-lost data in the same line check chain and the first lost data; the equation group consisting of the first XOR equation and the second XOR equation is solved to obtain the two lost data in the same line check chain.
[0176] For example, in the optimized X-Code checksum code shown in Table 5, if disks D2 and D3 fail, (ε, 6) and (η, 6) in the same checksum chain corresponding to the diagonal checksum chain 6 are both lost data, and (ε, 6) is taken as the first lost data, and all non-lost data in the anti-diagonal checksum chain where (ε, 6) is located are obtained: (ε, 2), (ε, 4), (ε, 1), (ε, 3) and ε; (η, 6) is taken as the second lost data, and all non-lost data in the same checksum chain of (η, 6) are obtained: (α, 6), (γ, 6), (β, 6) and 6, and the first XOR equation and the second XOR equation constructed are as follows:
[0177] (ε,6)=(ε,2)⊕(ε,4)⊕(ε,1)⊕(ε,3)⊕ε
[0178] (η,6)=(ε,6)⊕(α,6)⊕(γ,6)⊕(β,6)⊕6
[0179] By jointly solving the first XOR equation and the second XOR equation, the lost data (ε, 6) and (η, 6) can be recovered.
[0180] In a feasible implementation, when two failed disks are detected, when executing a failed data recovery strategy based on the optimized X-Code checksum and the multiple anti-diagonal check chains, first determine all lost data; obtain all non-lost data in the same row check chain corresponding to all the lost data and all non-lost data in the anti-diagonal check chain in the disk array; establish a joint XOR calculation equation group based on all non-lost data in the same row check chain corresponding to all the lost data and all non-lost data in the anti-diagonal check chain; solve the joint XOR calculation equation group to obtain all the lost data.
[0181] For example, in the optimized X-Code checksum shown in Table 5, if disks D2 and D3 fail, all lost data include: (ε, 6), (η, 6), (η, 1), (δ, 3), (δ, 5), (ζ, 5), (ζ, 0), (α, 0), (γ, 4), (ε, 4), 2, 1, α, and β. Based on all non-lost data in the same parity check chain corresponding to all lost data and all non-lost data in the anti-diagonal parity check chain, a joint XOR calculation equation group is established. The joint XOR calculation equation group is as follows:
[0182] (γ,4)=(γ,6)⊕(γ,1)⊕(γ,3)⊕(γ,5)⊕γ
[0183] (ε, 4) = (γ, 4) ⊕ ( η , 4) ⊕ ( β , 4) ⊕ ( δ , 4) ⊕ 4
[0184] (ε,6)=(ε,2)⊕(ε,4)⊕(ε,1)⊕(ε,3)⊕ε
[0185] (η,6)=(α,6)⊕(γ,6)⊕(ε,6)⊕(β,6)⊕6
[0186] (n,1)=(n,0)⊕(n,2)⊕(n,4)⊕(n,6)⊕n
[0187] 1=(η,1)⊕(ζ,1)⊕(α,1)⊕(γ,1)⊕(ε,1)
[0188] 2=(ε,2)⊕(η,2)⊕(β,2)⊕(δ,2)⊕(ζ,2)
[0189] (δ,3)=(ζ,3)⊕(α,3)⊕(γ,3)⊕(ε,3)⊕3
[0190] (δ,5)=(δ,3)⊕(δ,0)⊕(δ,2)⊕(δ,4)⊕δ
[0191] (ζ,5)=(β,5)⊕(δ,5)⊕(α,5)⊕(γ,5)⊕5
[0192] (ζ,0)=(ζ,1)⊕(ζ,3)⊕(ζ,5)⊕(ζ,2)⊕ζ
[0193] (α,0)=(η,0)⊕(β,0)⊕(δ,0)⊕(ζ,0)⊕0
[0194] α=(α,1)⊕(α,3)⊕(α,5)⊕(α,0)⊕(α,6)
[0195] β=(β,5)⊕(β,0)⊕(β,2)⊕(β,4)⊕(β,6)
[0196] After comparing the dual-disk fault recovery process based on the optimized X-Code check code shown in Table 5 with the dual-disk fault recovery process based on the X-Code check code shown in Tables 1 and 2, the number of equations in the dual-disk fault recovery process is consistent, that is, the method for recovering the disk array based on the optimized X-Code check code in this embodiment does not increase the amount of calculation, but because when data is stored, the data blocks on the same diagonal check chain are optimized from being distributed in different rows of different disks to being continuously and compactly distributed in multiple disks of the disk array, that is, the method optimizes the X-Code check code to make the distance between blocks in the same diagonal check chain closer, so that the read operation cost in the data recovery process is significantly reduced, thereby reducing the delay of fault recovery and improving the efficiency of disk array fault recovery.
[0197] In a feasible implementation, the method further includes: when a single faulty disk is detected in the disk array that performs data storage according to the optimized X-Code checksum encoding, for any lost data, a faulty data recovery strategy is executed according to the same-row checksum chain or the anti-diagonal checksum chain where the lost data is located to recover the lost data.
[0198] In order to reduce the cost of read operations during data recovery, a peer check chain can be used to perform data recovery when a single disk fails. That is, when a single failed disk is detected in the disk array that performs data storage according to the optimized X-Code check code, for any lost data, all non-lost data in the peer check chain where the lost data is located are continuously read in the disk array; all non-lost data in the peer check chain are XORed to obtain the lost data in the peer check chain.
[0199] Reference Figure 3 , shows a functional module diagram of a disk array fault data recovery device provided in an embodiment of the present application, the device is applied to a RAID6 disk array, the disk array adopts an X-Code check code, the X-Code check code includes a plurality of diagonal check chains and a plurality of anti-diagonal check chains, the device includes:
[0200] The optimization module 100 is used to generate an optimized X-Code check code according to a plurality of diagonal check chains in the X-Code check code, wherein in the optimized X-Code check code, all data blocks in any diagonal check chain form a same-row check chain, and all data blocks in the same-row check chain are continuously distributed in the disk array;
[0201] The recovery module 200 is used to execute a fault data recovery strategy according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains to recover all lost data on the two faulty disks when two faulty disks are detected in the disk array that performs data storage according to the optimized X-Code checksum code.
[0202] Optionally, the optimization module includes:
[0203] A construction unit, configured to construct a plurality of in-line check chains in the optimized X-Code check code, wherein in the optimized X-Code check code, the number of in-line check chains is consistent with the number of diagonal check chains in the X-Code check code, and the number of data blocks included in any check chain is the same;
[0204] The optimization unit is used to determine a target diagonal check chain corresponding to any in-line check chain in the optimized X-Code check code, and migrate all data blocks in the target diagonal check chain to the in-line check chain, wherein all data blocks in the in-line check chain are continuously distributed in multiple disks of the disk array.
[0205] Optionally, the optimization unit includes:
[0206] A diagonal check chain acquisition subunit is used to obtain the serial number of the diagonal check chain corresponding to each data block in the X-Code check code of the disk array, and determine the serial number of the diagonal check chain not included in any disk in the disk array;
[0207] The target diagonal check chain determination subunit is used to determine the disk corresponding to the serial number of any same-in-line check chain according to the serial number of the same-in-line check chain, and use the diagonal check chain corresponding to the serial number of the diagonal check chain not included in the disk as the target diagonal check chain of the same-in-line check chain.
[0208] Optionally, the optimization unit includes:
[0209] The target position determination subunit is used to determine, for any peer check chain, the target position corresponding to the data block in the peer check chain in any hard disk;
[0210] The exchange subunit is used to obtain the serial number of the diagonal check chain corresponding to the current data block at the target position in the disk; when the serial number of the diagonal check chain corresponding to the current data block at the target position in the disk is not the serial number of the target diagonal check chain corresponding to the same line check chain, execute the data block exchange strategy.
[0211] Optionally, the switching subunit is further used for:
[0212] Obtaining the actual location of the data block of the target diagonal checksum chain in the disk;
[0213] The data block at the actual position is exchanged with the data block at the target position.
[0214] Optionally, the optimization module includes:
[0215] A model optimization unit, configured to input the data block layouts in the multiple diagonal check chains in the X-Code check code into an optimization model; the optimization model outputs the data block layout of the optimized X-Code check code according to the data block layouts in the multiple diagonal check chains; the optimized X-Code check code is obtained by combining the data block layout of the optimized X-Code check code with two check rows in the X-Code check code, wherein the two check rows include a check row composed of check blocks of the multiple diagonal check chains and a check row composed of check blocks of the multiple anti-diagonal check chains;
[0216] The optimization model is used to migrate data blocks on the same diagonal check chain of the X-Code check code to the same in-line check chain, and all data blocks in the in-line check chain are continuously distributed in multiple disks of the disk array.
[0217] Optionally, the recovery module includes:
[0218] The first recovery unit is used for, according to the optimized X-Code check code, if there is a missing data in any one-line check chain, continuously reading all non-missing data in the same-line check chain in the disk array; performing XOR calculation on all non-missing data in the same-line check chain to obtain the missing data in the same-line check chain.
[0219] Optionally, the recovery module includes:
[0220] The second recovery unit is used to construct a system of equations based on the optimized X-Code check code and the multiple anti-diagonal check chains to obtain the two missing data in any same-row check chain according to the optimized X-Code check code.
[0221] Optionally, the second recovery unit is further used for:
[0222] For a first lost data of the two lost data, obtaining all non-lost data in an anti-diagonal check chain corresponding to the first lost data in the disk array, and establishing a first XOR equation according to all the non-lost data in the anti-diagonal check chain;
[0223] For the second lost data of the two lost data, all non-lost data of the same line check chain are obtained in the disk array, and a second XOR equation is established according to all the non-lost data of the same line check chain and the first lost data;
[0224] Solve the equation group consisting of the first XOR equation and the second XOR equation to obtain the two missing data in the same row check chain.
[0225] Optionally, the recovery module includes a third recovery unit, and the third recovery unit is used to:
[0226] When two failed disks are detected, all data loss is confirmed;
[0227] Acquire, in the disk array, all non-lost data in the same row check chain and all non-lost data in the anti-diagonal check chain corresponding to all the lost data;
[0228] Establishing a joint XOR calculation equation group according to all non-lost data in the same parity check chain corresponding to all the lost data and all non-lost data in the anti-diagonal parity check chain;
[0229] Solve the joint XOR calculation equation group to obtain all the missing data.
[0230] Optionally, the device further comprises:
[0231] The first single disk failure recovery module is used to, when a single failed disk is detected in the disk array that performs data storage according to the optimized X-Code checksum coding, execute a failed data recovery strategy for any lost data according to the same parity chain or the opposite diagonal parity chain where the lost data is located to recover the lost data.
[0232] Optionally, the device further comprises:
[0233] A second single disk failure recovery module is used for, when a single failed disk is detected in the disk array for performing data storage according to the optimized X-Code checksum code, continuously reading all non-lost data in the same checksum chain where the lost data is located in the disk array for any lost data;
[0234] Perform an XOR calculation on all non-missing data in the same peer check chain to obtain the missing data in the same peer check chain.
[0235] Reference Figure 4, shows a schematic diagram of a non-volatile readable storage medium provided in an embodiment of the present application, wherein the non-volatile readable storage medium 400 stores a computer program 401, wherein the computer program 401, when executed by a processor, executes the disk array failure data recovery method described in the embodiment.
[0236] Reference Figure 5 , shows a schematic diagram of a computer device provided in an embodiment of the present application, including: at least one processor 501, and a memory 502, wherein the memory 502 stores a computer program that can be run on the processor 501, wherein the processor 501 executes the disk array failure data recovery method described in the embodiment when executing the program.
[0237] Reference Figure 6 , shows a schematic diagram of a computer program product provided in an embodiment of the present application, wherein the computer program product 600 includes a computer program / instruction 601, which, when executed by a processor, implements the disk array failure data recovery method described in the embodiment.
[0238] An embodiment of the present application also provides a disk array, which is a RAID6 disk array. The disk array adopts X-Code check code, and the X-Code check code includes multiple diagonal check chains and multiple anti-diagonal check chains. The disk array is used to execute the disk array failure data recovery method described in the embodiment.
[0239] An embodiment of the present application also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the disk array failure data recovery method described in the embodiment.
[0240] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0241] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0242] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure one A process or multiple processes and / or boxes Figure one A device that provides the functions specified in a block or multiple blocks.
[0243] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure one A process or multiple processes and / or boxes Figure one A function specified in one or more boxes.
[0244] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure one A process or multiple processes and / or boxes Figure one The steps for the functions specified in one or more boxes.
[0245] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0246] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0247] Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A disk array failure data recovery method, characterized in that: A disk array applied to RAID6, wherein the disk array adopts an X-Code check code, wherein the X-Code check code includes a plurality of diagonal check chains and a plurality of anti-diagonal check chains, and the method includes: Generate an optimized X-Code check code according to multiple diagonal check chains in the X-Code check code, wherein in the optimized X-Code check code, all data blocks in any diagonal check chain form a same-row check chain, and all data blocks in the same-row check chain are continuously distributed in multiple disks of the disk array; When two failed disks are detected in the disk array that performs data storage according to the optimized X-Code checksum code, a failed data recovery strategy is executed according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains to recover all lost data on the two failed disks.
2. The method according to claim 1, characterized in that According to the multiple diagonal check chains in the X-Code check code, an optimized X-Code check code is generated, including: Constructing multiple in-line check chains in the optimized X-Code check code, wherein in the optimized X-Code check code, the number of in-line check chains is consistent with the number of diagonal check chains in the X-Code check code, and the number of data blocks included in any check chain is the same; Determine a target diagonal check chain corresponding to any in-line check chain in the optimized X-Code check code, migrate all data blocks in the target diagonal check chain to the in-line check chain, and all data blocks in the in-line check chain are continuously distributed in multiple disks of the disk array.
3. The method according to claim 2, characterized in that Determining a target diagonal check chain corresponding to any same-row check chain in the optimized X-Code check code includes: Obtaining the serial number of the diagonal check chain corresponding to each data block in the X-Code check code of the disk array, and determining the serial number of the diagonal check chain not included in any disk in the disk array; According to the serial number of any in-line check chain, the disk corresponding to the serial number of the in-line check chain is determined, and the diagonal check chain corresponding to the serial number of the diagonal check chain not included in the disk is used as the target diagonal check chain of the in-line check chain.
4. The method according to claim 3, characterized in that Migrating all data blocks in the target diagonal check chain to the same-row check chain includes: For any peer check chain, determine the target location corresponding to the data block in the peer check chain in any hard disk; Obtaining the sequence number of the diagonal checksum chain corresponding to the current data block at the target position in the disk; When the sequence number of the diagonal check chain corresponding to the current data block at the target position in the disk is not the sequence number of the target diagonal check chain corresponding to the same line check chain, the data block exchange strategy is executed.
5. The method according to claim 4, characterized in that Executes block exchange policies, including: Obtaining the actual location of the data block of the target diagonal checksum chain in the disk; The data block at the actual position is exchanged with the data block at the target position.
6. The method according to claim 3, characterized in that According to the serial number of any peer check chain, the formula for determining the disk corresponding to the serial number of the peer check chain is: j=((i+1)*(p-2)+1)%p Wherein, j is the serial number of the disk; i is the serial number of the same-row check chain; and p is the total number of disks in the disk array.
7. The method according to claim 4, characterized in that For any peer check chain, the formula for determining the target location of the data block in the peer check chain in any hard disk is: r=((p-2)*i+k) / p c=((p-2)*i+k)%p In the formula, r is the row number of the target position; c is the column number of the target position; p is the total number of disks in the disk array; i is the sequence number of the same-row check chain; k represents the kth data block in the same-row check chain, and k is less than p-2.
8. The method according to claim 1, characterized in that According to the multiple diagonal check chains in the X-Code check code, an optimized X-Code check code is generated, including: Inputting the data block layout in the plurality of diagonal check chains in the X-Code check code into the optimization model; The optimization model outputs the optimized X-Code checksum coded data block layout according to the data block layout in the multiple diagonal checksum chains; Combining the optimized X-Code check code with the data block layout of the optimized X-Code check code and the two check rows in the X-Code check code to obtain the optimized X-Code check code, wherein the two check rows include a check row composed of the check blocks of the multiple diagonal check chains and a check row composed of the check blocks of the multiple anti-diagonal check chains; The optimization model is used to migrate data blocks on the same diagonal check chain of the X-Code check code to the same in-line check chain, and all data blocks in the in-line check chain are continuously distributed in multiple disks of the disk array.
9. The method according to any one of claims 1 to 8, characterized in that: When two failed disks are detected, a failed data recovery strategy is executed according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains, including: According to the optimized X-Code checksum encoding, if there is a missing data in any one-line checksum chain, all non-missing data in the same-line checksum chain are continuously read in the disk array; Perform an XOR calculation on all non-missing data in the same peer check chain to obtain the missing data in the same peer check chain.
10. The method according to claim 9, characterized in that When two failed disks are detected, a failed data recovery strategy is executed according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains, including: According to the optimized X-Code check code, if there are two missing data in any same-row check chain, a system of equations is constructed based on the optimized X-Code check code and the multiple anti-diagonal check chains to obtain the two missing data in the same-row check chain.
11. The method according to claim 10, characterized in that Based on the optimized X-Code check code and the multiple anti-diagonal check chains, a system of equations is constructed to obtain the two missing data in the same check chain, including: For a first lost data of the two lost data, obtaining all non-lost data in an anti-diagonal check chain corresponding to the first lost data in the disk array, and establishing a first XOR equation according to all the non-lost data in the anti-diagonal check chain; For the second lost data of the two lost data, all non-lost data of the same line check chain are obtained in the disk array, and a second XOR equation is established according to all the non-lost data of the same line check chain and the first lost data; Solve the equation group consisting of the first XOR equation and the second XOR equation to obtain the two missing data in the same row check chain.
12. The method according to any one of claims 1 to 8, characterized in that: When two failed disks are detected, a failed data recovery strategy is executed according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains, including: When two failed disks are detected, all data loss is confirmed; Acquire, in the disk array, all non-lost data in the same row check chain and all non-lost data in the anti-diagonal check chain corresponding to all the lost data; Establishing a joint XOR calculation equation group according to all non-lost data in the same parity check chain corresponding to all the lost data and all non-lost data in the anti-diagonal parity check chain; Solve the joint XOR calculation equation group to obtain all the missing data.
13. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: When a single faulty disk is detected in the disk array that performs data storage according to the optimized X-Code checksum coding, for any lost data, a faulty data recovery strategy is executed according to the same-row checksum chain or the anti-diagonal checksum chain where the lost data is located to recover the lost data.
14. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: When a single failed disk is detected in the disk array that performs data storage according to the optimized X-Code checksum coding, for any lost data, all non-lost data in the same checksum chain where the lost data is located are continuously read in the disk array; Perform an XOR calculation on all non-missing data in the same peer check chain to obtain the missing data in the same peer check chain.
15. A disk array failure data recovery device, characterized in that: A disk array applied to RAID6, wherein the disk array adopts X-Code check code, wherein the X-Code check code includes multiple diagonal check chains and multiple anti-diagonal check chains, and the device includes: An optimization module, configured to generate an optimized X-Code check code according to a plurality of diagonal check chains in the X-Code check code, wherein in the optimized X-Code check code, all data blocks in any diagonal check chain form a same-row check chain, and all data blocks in the same-row check chain are continuously distributed in the disk array; The recovery module is used to execute a fault data recovery strategy according to the optimized X-Code checksum code and the multiple anti-diagonal checksum chains to recover all lost data on the two faulty disks when two faulty disks are detected in the disk array that performs data storage according to the optimized X-Code checksum code.
16. A disk array, characterized in that: The disk array is a RAID6 disk array, the disk array adopts X-Code check code, the X-Code check code includes multiple diagonal check chains and multiple anti-diagonal check chains, and the disk array is used to execute the disk array failure data recovery method described in any one of claims 1-14.
17. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the disk array failure data recovery method according to any one of claims 1 to 14.
18. A non-volatile readable storage medium, characterized in that: The non-volatile readable storage medium stores a computer program, wherein the computer program, when executed by a processor, executes the disk array failure data recovery method according to any one of claims 1 to 14.
19. A computer device, characterized in that: include: At least one processor, and a memory, wherein the memory stores a computer program that can be run on the processor, wherein when the processor executes the program, the disk array failure data recovery method according to any one of claims 1-14 is executed.
20. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the disk array failure data recovery method described in any one of claims 1 to 14 is implemented.
Citation Information
Cited By
Abnormal data positioning method and device, equipment, program product and storage medium
CN120469849A
