A method, device, equipment and medium for TP-RAID to RAID5 degradation
By storing data blocks and parity blocks in TP-RAID, dividing them into move groups and recalculation groups, and using formulas to calculate new parity blocks, the problems of slow read and write speeds and high bandwidth consumption during the downgrade process from TP-RAID to RAID5 are solved, achieving efficient downgrade operations.
Patent Information
- Application Number
- CN202310386089.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-07
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2043-04-07
AI Technical Summary
Existing technologies suffer from slow read/write speeds, high bandwidth consumption, and severe performance degradation during the downgrade process from TP-RAID to RAID5.
By storing data blocks and parity blocks in TP-RAID in a preset manner, recording the data of the first and second disks in TP-RAID, dividing the stripes encoded by TP-RAID into moving groups and recalculation groups, calculating the new parity block of RAID5 after degradation using a preset formula, and storing the new parity block and data blocks in the parity block location of TP-RAID, the parity disk calculation is simplified.
By reducing disk read operations, the downgrade process was completed, which improved the calculation speed of the parity disk after downgrade, reduced bandwidth consumption, and enhanced the performance of the downgrade operation.
Smart Images

Figure CN116400864B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically to a method, apparatus, device, and readable medium for downgrading TP-RAID to RAID5. Background Technology
[0002] With technological advancements, increased disk lifespan, and larger data volumes stored in servers, RAID technology has gradually become insufficient to meet current storage demands. This has led to the emergence of TP-RAID. Compared to RAID 5 and RAID 6, TP-RAID, as the name suggests, can simultaneously support three different RAID algorithms. A few manufacturers have begun researching TP-RAID, so a fixed implementation method has not yet been established. However, based on the algorithmic principle—that the constructed cubic equation system has a unique solution—a RAID relationship can be established. An example storage scenario is a TP-RAID array built with user data from three disks. Figure 1 As shown, p1p2p3, p4p5p6, and p7p8p9 are the check blocks obtained from the stripe 123 operation. In actual disk placement, load balancing needs to be considered. Therefore, four algorithms are commonly used to calculate the disk placement position: left-rotation misalignment, left-rotation alignment, right-rotation misalignment, and right-rotation alignment. Figure 1 For example, the left-hand rotation misalignment method is used. The four load balancing algorithms only affect the choice of specific parameters and have no difference in performance. Therefore, only the left-hand rotation misalignment method is used as an example here.
[0003] RAID level downgrading refers to scenarios where users request a reduction in the RAID level. Taking TP-RAID as an example, this means downgrading it to RAID 5 or RAID 6, and then freeing up a disk for other uses through data migration. The RAID 6 downgrading operation is relatively simple and will not be discussed here. Downgrading to RAID 5 involves more complex algorithms and more scenarios, so it is often implemented by directly recoding the RAID. The recoding implementation is as follows... Figure 2 As shown, the process typically involves discarding all verification information first, then migrating the data, and then re-reading all the data for encoding. This operation requires reading and writing all the data twice, which is very slow and has a huge overhead. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a method, apparatus, device and readable medium for downgrading TP-RAID to RAID5. By using the technical solution of this invention, downgrading can be completed with a significant reduction in disk read volume, and the calculation of the parity disk after downgrading is simplified, the calculation speed of the parity disk after downgrading is improved, the bandwidth consumption caused by the downgrading operation is reduced, and the performance of the downgrading operation is improved.
[0005] To achieve the above objectives, one aspect of the present invention provides a method for downgrading TP-RAID to RAID5, comprising the following steps:
[0006] Data blocks and parity blocks are stored in TP-RAID in a preset manner;
[0007] In response to receiving a command to downgrade TP-RAID to RAID5, record the data on the first and second disks in the TP-RAID;
[0008] The TP-RAID encoded stripes are divided into moving groups and recalculation groups;
[0009] Read the data from the first and second disks in each stripe of the moving group, calculate the new parity block of the downgraded RAID5 using a preset formula, and store the new parity block and the data blocks from the read data in the parity block location of TP-RAID.
[0010] According to one embodiment of the present invention, calculating the new parity block of the downgraded RAID5 using a preset formula includes:
[0011] The new parity block of the downgraded RAID5 is calculated using the formula p′=p+q+r, where p′ is the new parity block, p is the first parity block of TP-RAID, q is the second parity block of TP-RAID, and r is the third parity block of TP-RAID.
[0012] According to one embodiment of the present invention, storing data blocks and parity blocks in TP-RAID in a preset manner includes:
[0013] Data blocks and parity blocks are stored in TP-RAID with a left-rotated, non-aligned configuration.
[0014] According to one embodiment of the present invention, dividing TP-RAID encoded stripes into moving groups and recalculation groups includes:
[0015] Divide the first data block count plus 1 stripe in the TP-RAID encoded stripe into moving groups;
[0016] The remaining stripes are divided into recalculation groups.
[0017] According to one embodiment of the present invention, it further includes:
[0018] Calculate the parity blocks for the data blocks in the recalculation group according to the RAID5 method;
[0019] The data blocks in the recalculation group and the calculated parity blocks are stored in RAID5.
[0020] According to one embodiment of the present invention, storing the new parity block and the data block in the read data to the parity block location of TP-RAID includes:
[0021] Store the new parity block in the location of the first parity block of TP-RAID on the remaining disk;
[0022] The read data blocks are stored in the location of the second and / or third parity blocks of the TP-RAID on the remaining disk.
[0023] According to one embodiment of the present invention, it further includes:
[0024] In response to the completion of the TP-RAID to RAID5 downgrade, the first and second disks are removed and their data is cleared.
[0025] In another aspect, embodiments of the present invention also provide an apparatus for downgrading TP-RAID to RAID5, the apparatus comprising:
[0026] The computing module is configured to store data blocks and parity blocks into TP-RAID in a preset manner;
[0027] The recording module is configured to record data from the first and second disks in the TP-RAID in response to a command to downgrade from TP-RAID to RAID5.
[0028] The grouping module is configured to divide TP-RAID encoded stripes into moving groups and recalculation groups;
[0029] The storage module is configured to read data from the first and second disks in each stripe of the moving group, calculate the new parity block of the downgraded RAID5 using a preset formula, and store the new parity block and the data blocks in the read data at the parity block location of TP-RAID.
[0030] Another aspect of the embodiments of the present invention also provides a computer device, the computer device comprising:
[0031] At least one processor; and
[0032] The memory stores computer instructions that can be executed by a processor, which, when executed by the processor, implement the steps of any of the methods described above.
[0033] In another aspect, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above methods.
[0034] The present invention has the following beneficial technical effects: The method for downgrading TP-RAID to RAID5 provided by the embodiments of the present invention stores data blocks and parity blocks in TP-RAID in a preset manner; in response to receiving the instruction to downgrade TP-RAID to RAID5, records the data in the first and second disks in TP-RAID; divides the TP-RAID encoded stripes into a moving group and a recalculation group; reads the data in the first and second disks in each stripe in the moving group, calculates the new parity block of the downgraded RAID5 using a preset formula, and stores the new parity block and the data blocks in the read data at the position of the parity block of TP-RAID. This technical solution can complete the downgrading with a significant reduction in disk read volume, simplifies the calculation of the parity disk after downgrading, improves the calculation speed of the parity disk after downgrading, reduces the bandwidth consumption caused by the downgrading operation, and improves the performance of the downgrading operation. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.
[0036] Figure 1 A schematic diagram of a TP-RAID array constructed using three disks and three stripes, based on existing technology;
[0037] Figure 2 A schematic diagram illustrating the downgrade of existing TP-RAID to RAID5;
[0038] Figure 3 This is a schematic flowchart illustrating a method for downgrading TP-RAID to RAID5 according to an embodiment of the present invention;
[0039] Figure 4 This is a schematic diagram of the disk placement method of TP-RAID under left-hand misalignment according to an embodiment of the present invention;
[0040] Figure 5 This is a schematic diagram illustrating the division of movement groups and recalculation groups and the data movement within movement groups according to an embodiment of the present invention.
[0041] Figure 6 This is a schematic diagram of the data distribution of a downgraded RAID5 according to an embodiment of the present invention;
[0042] Figure 7 A schematic diagram of an apparatus for downgrading TP-RAID to RAID5 according to an embodiment of the present invention;
[0043] Figure 8 This is a schematic diagram of a computer device according to an embodiment of the present invention;
[0044] Figure 9 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.
[0046] Based on the above objectives, a first aspect of the embodiments of the present invention provides an embodiment of a method for downgrading TP-RAID to RAID5. Figure 3 The diagram shown is a schematic flowchart of the method.
[0047] like Figure 3 As shown, the method may include the following steps:
[0048] S1 stores data blocks and parity blocks in TP-RAID in a preset manner. Data blocks and parity blocks are stored in TP-RAID in a left-hand, non-aligned manner, such as... Figure 4 As shown, q, r, and p represent check blocks, d1-dk represent k data blocks, and a total of k+3 stripes are contained.
[0049] S2 responds to a TP-RAID downgrade command to RAID5 by recording the data on the first and second disks in the TP-RAID. Upon receiving the downgrade command, the first and second disks can be removed. The data on these disks is needed during the downgrade process, hence the need to record the data. Alternatively, the disks can be removed after the downgrade is complete.
[0050] S3 divides the TP-RAID encoded stripes into move groups and recalculation groups. The first stripe containing the number of data blocks plus one is assigned to a move group, and the remaining stripes are assigned to recalculation groups. In the example above, with k data blocks, stripes 1, 2, 3, ..., k, k+1 are assigned to move groups, and stripes k+2 and k+3 are assigned to recalculation groups.
[0051] S4 reads data from the first and second disks in each stripe of the moving group, calculates the new parity block of the downgraded RAID5 using a preset formula, and stores the new parity block and the data blocks from the read data into the parity block location of the TP-RAID. The data from the first and second disks, including data blocks and parity blocks, is read. For each stripe, the new parity block of the downgraded RAID5 is calculated according to the formula p′=p+q+r, where p′ is the new parity block, p is the first parity block of the TP-RAID, q is the second parity block of the TP-RAID, and r is the third parity block of the TP-RAID. The new parity block is stored in the location of the first parity block of the TP-RAID on the remaining disks (not removed), and the read data blocks are stored in the locations of the second and / or third parity blocks of the TP-RAID on the remaining disks. Figure 5 As shown.
[0052] By using the technical solution of this invention, downgrading can be completed with a significant reduction in disk read volume, and the calculation of the parity disk after downgrading is simplified, the calculation speed of the parity disk after downgrading is improved, the bandwidth consumption caused by the downgrading operation is reduced, and the performance of the downgrading operation is improved.
[0053] In a preferred embodiment of the present invention, calculating the new parity block of the downgraded RAID5 using a preset formula includes:
[0054] The new parity block of the downgraded RAID5 is calculated using the formula p′=p+q+r, where p′ is the new parity block, p is the first parity block of TP-RAID, q is the second parity block of TP-RAID, and r is the third parity block of TP-RAID.
[0055] For stripes 1, 2, 3, ..., k, k+1 in the moving group, update the degraded parity block p' according to the original encoding formula of TP-RAID and the existing encoding formula of RAID5. The specific update formula and derivation process are as follows:
[0056] Note: In the RAID5 encoding formula of TP-RAID and the decoding operation based on the encoding formula, the "+" in (k+1), (k+2), and (k+3) are all operations in the number field. When k = 10, (k+1), (k+2), and (k+3) are 11, 12, and 13 respectively. The other operations are operations in the Galois field.
[0057] For stripe 1 of TP-RAID:
[0058] The original TP-RAID encoding is:
[0059]
[0060] The RAID5 encoding after downgrading is as follows:
[0061] d1+d2+...+d k-1 +d k +p'=0 (2)
[0062] Combining equations (1) and (2), we can establish an equation.
[0063] p'=p+q+r (3)
[0064] As in the example above, for stripe 1, no data block needs to be moved. The original check block p, q, r is read, and the new check block p' can be obtained through formula (3). The check block p' is then written into the position of the original check block p.
[0065] For stripe 2 of TP-RAID:
[0066] The original TP-RAID encoding is:
[0067]
[0068] The RAID5 encoding after downgrading is as follows:
[0069] d1+d2+...+d k-1 +p'+d k =0 (5)
[0070] Combining equations (4) and (5), we can establish an equation.
[0071] p'=p+q+r (6)
[0072] As in the example above, for stripe 2, it is only necessary to move the data block d1 to the position of the original TP-RAID parity block q, read the original parity blocks p,q,r, and obtain the current parity block p' through formula (6). Then, write the new parity block p' to the position of the original parity block p.
[0073] Similarly, for stripe 3 of TP-RAID:
[0074] The original TP-RAID encoding is:
[0075]
[0076] The RAID5 encoding after downgrading is as follows:
[0077] d3+...+d k +p'+d1+d2=0 (8)
[0078] Combining equations (7) and (8), we can establish an equation.
[0079] p'=p+q+r (9)
[0080] As in the example above, for stripe 3, we only need to move the data blocks d1 and d2 to the positions of the original TP-RAID parity blocks q and r, read the original parity blocks p, q, and r, and obtain the new parity block p' through formula (9). Then, we can write the new parity block p' to the position of the original parity block p.
[0081] Similarly, for TP-RAID stripes 4, 5, ... k+1, it is only necessary to move data blocks d1, d2 to the positions of the original TP-RAID parity blocks q, r, read the original parity blocks p, q, r, and obtain the new parity block p' using formula (9). Then, write the new parity block p' to the position of the original parity block p. The downgraded RAID 5 is as follows: Figure 6 As shown.
[0082] Based on the above operations, TP-RAID can be downgraded to RAID5. Stripe 1 does not need to move data blocks, but only needs to read three parity blocks. Stripe 2 only needs to move one data block d1 and only needs to read three parity blocks. Other stripes only need to move two data blocks d1 and d2 and only need to read three parity blocks.
[0083] Therefore, each stripe can calculate the new parity block of the downgraded RAID5 according to the formula p′=p+q+r, and move the data blocks that need to be moved to the corresponding positions of the original parity block.
[0084] In a preferred embodiment of the present invention, storing data blocks and parity blocks in TP-RAID in a preset manner includes:
[0085] Data blocks and parity blocks can be stored in TP-RAID with left-rotated unaligned configuration. Data blocks and parity blocks can also be stored in TP-RAID with left-rotated alignment, right-rotated unaligned configuration, and right-rotated alignment.
[0086] In a preferred embodiment of the present invention, dividing the TP-RAID encoded stripes into a moving group and a recalculation group includes:
[0087] Divide the first data block count plus 1 stripe in the TP-RAID encoded stripe into moving groups;
[0088] The remaining stripes are divided into recalculation groups.
[0089] In a preferred embodiment of the present invention, it further includes:
[0090] Calculate the parity blocks for the data blocks in the recalculation group according to the RAID5 method;
[0091] The data blocks in the recalculation group and the calculated parity blocks are stored in RAID5.
[0092] For recalculation groups, because two disks are left unused when transitioning from TP-RAID to RAID5, complete load balancing cannot be guaranteed through simple shifting. Therefore, every K+3 stripe groups will always have two stripes that cannot directly achieve load balancing. For n stripe groups that satisfy K+3, a total of 2n stripes will be generated to enter the recalculation group. After the other stripes have completed load balancing and reorganization, these stripes will uniformly begin to recalculate (encode) the disk write and parity blocks that satisfy load balancing.
[0093] In a preferred embodiment of the present invention, storing the new parity block and the data block in the read data to the parity block location of TP-RAID includes:
[0094] Store the new parity block in the location of the first parity block of TP-RAID on the remaining disk;
[0095] The read data blocks are stored in the locations of the second and / or third parity blocks of the TP-RAID on the remaining disks. If only one data block is read, it is stored in the original location of the second parity block; if two data blocks are read, they are stored in the original locations of the second and third parity blocks, respectively.
[0096] In a preferred embodiment of the present invention, it further includes:
[0097] In response to the completion of the TP-RAID to RAID5 downgrade, the first and second disks are removed and their data is cleared.
[0098] This invention proposes an improved scheme for downgrading from TP-RAID to RAID5. This scheme divides stripes into a moving group and a recalculation group, and then performs different operations, minimizing data reads. For the moving group stripes, by rationally utilizing the relationship between the original TP-RAID parity block and the parity of the downgraded RAID5, an expression is established between the TP-RAID parity block and the downgraded RAID5 parity. This significantly reduces disk reads compared to traditional downgrading operations, simplifies the calculation of the parity disk after downgrading, improves the calculation speed of the downgraded parity disk, reduces bandwidth consumption during downgrading operations, and improves the performance of the downgrading operation.
[0099] It should be noted that those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The embodiments of the computer program described above can achieve the same or similar effects as any of the corresponding foregoing method embodiments.
[0100] Furthermore, the method disclosed in the embodiments of the present invention can also be implemented as a computer program executed by a CPU, which may be stored in a computer-readable storage medium. When the computer program is executed by the CPU, it performs the functions defined in the method disclosed in the embodiments of the present invention.
[0101] Based on the above objectives, a second aspect of the embodiments of the present invention provides an apparatus for downgrading TP-RAID to RAID5, such as... Figure 7 As shown, the device 200 includes:
[0102] The computing module is configured to store data blocks and parity blocks into TP-RAID in a preset manner;
[0103] The recording module is configured to record data from the first and second disks in the TP-RAID in response to a command to downgrade from TP-RAID to RAID5.
[0104] The grouping module is configured to divide TP-RAID encoded stripes into moving groups and recalculation groups;
[0105] The storage module is configured to read data from the first and second disks in each stripe of the moving group, calculate the new parity block of the downgraded RAID5 using a preset formula, and store the new parity block and the data blocks in the read data at the parity block location of TP-RAID.
[0106] In view of the above objectives, a third aspect of the present invention provides a computer device. Figure 8 The diagram shown is a schematic representation of an embodiment of the computer device provided by the present invention. Figure 8 As shown, embodiments of the present invention include the following apparatus: at least one processor 21; and a memory 22 storing computer instructions 23 executable on the processor, which, when executed by the processor, implement the following method:
[0107] Data blocks and parity blocks are stored in TP-RAID in a preset manner;
[0108] In response to receiving a command to downgrade TP-RAID to RAID5, record the data on the first and second disks in the TP-RAID;
[0109] The TP-RAID encoded stripes are divided into moving groups and recalculation groups;
[0110] Read the data from the first and second disks in each stripe of the moving group, calculate the new parity block of the downgraded RAID5 using a preset formula, and store the new parity block and the data blocks from the read data in the parity block location of TP-RAID.
[0111] In a preferred embodiment of the present invention, calculating the new parity block of the downgraded RAID5 using a preset formula includes:
[0112] The new parity block of the downgraded RAID5 is calculated using the formula p′=p+q+r, where p′ is the new parity block, p is the first parity block of TP-RAID, q is the second parity block of TP-RAID, and r is the third parity block of TP-RAID.
[0113] In a preferred embodiment of the present invention, storing data blocks and parity blocks in TP-RAID in a preset manner includes:
[0114] Data blocks and parity blocks are stored in TP-RAID with a left-rotated, non-aligned configuration.
[0115] In a preferred embodiment of the present invention, dividing the TP-RAID encoded stripes into a moving group and a recalculation group includes:
[0116] Divide the first data block count plus 1 stripe in the TP-RAID encoded stripe into moving groups;
[0117] The remaining stripes are divided into recalculation groups.
[0118] In a preferred embodiment of the present invention, it further includes:
[0119] Calculate the parity blocks for the data blocks in the recalculation group according to the RAID5 method;
[0120] The data blocks in the recalculation group and the calculated parity blocks are stored in RAID5.
[0121] In a preferred embodiment of the present invention, storing the new parity block and the data block in the read data to the parity block location of TP-RAID includes:
[0122] Store the new parity block in the location of the first parity block of TP-RAID on the remaining disk;
[0123] The read data blocks are stored in the location of the second and / or third parity blocks of the TP-RAID on the remaining disk.
[0124] In a preferred embodiment of the present invention, it further includes:
[0125] In response to the completion of the TP-RAID to RAID5 downgrade, the first and second disks are removed and their data is cleared.
[0126] In view of the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium. Figure 9 The diagram illustrates an embodiment of the computer-readable storage medium provided by the present invention. Figure 9 As shown, computer-readable storage medium 31 stores a computer program 32 that, when executed by a processor, performs the following methods:
[0127] Data blocks and parity blocks are stored in TP-RAID in a preset manner;
[0128] In response to receiving a command to downgrade TP-RAID to RAID5, record the data on the first and second disks in the TP-RAID;
[0129] The TP-RAID encoded stripes are divided into moving groups and recalculation groups;
[0130] Read the data from the first and second disks in each stripe of the moving group, calculate the new parity block of the downgraded RAID5 using a preset formula, and store the new parity block and the data blocks from the read data in the parity block location of TP-RAID.
[0131] In a preferred embodiment of the present invention, calculating the new parity block of the downgraded RAID5 using a preset formula includes:
[0132] The new parity block of the downgraded RAID5 is calculated using the formula p′=p+q+r, where p′ is the new parity block, p is the first parity block of TP-RAID, q is the second parity block of TP-RAID, and r is the third parity block of TP-RAID.
[0133] In a preferred embodiment of the present invention, storing data blocks and parity blocks in TP-RAID in a preset manner includes:
[0134] Data blocks and parity blocks are stored in TP-RAID with a left-rotated, non-aligned configuration.
[0135] In a preferred embodiment of the present invention, dividing the TP-RAID encoded stripes into a moving group and a recalculation group includes:
[0136] Divide the first data block count plus 1 stripe in the TP-RAID encoded stripe into moving groups;
[0137] The remaining stripes are divided into recalculation groups.
[0138] In a preferred embodiment of the present invention, it further includes:
[0139] Calculate the parity blocks for the data blocks in the recalculation group according to the RAID5 method;
[0140] The data blocks in the recalculation group and the calculated parity blocks are stored in RAID5.
[0141] In a preferred embodiment of the present invention, storing the new parity block and the data block in the read data to the parity block location of TP-RAID includes:
[0142] Store the new parity block in the location of the first parity block of TP-RAID on the remaining disk;
[0143] The read data blocks are stored in the location of the second and / or third parity blocks of the TP-RAID on the remaining disk.
[0144] In a preferred embodiment of the present invention, it further includes:
[0145] In response to the completion of the TP-RAID to RAID5 downgrade, the first and second disks are removed and their data is cleared.
[0146] Furthermore, the method disclosed in the embodiments of the present invention can also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. When the computer program is executed by the processor, it performs the functions defined in the method disclosed in the embodiments of the present invention.
[0147] Furthermore, the above-described method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to perform the functions of the above-described steps or units.
[0148] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the system as a whole. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.
[0149] In one or more exemplary designs, functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, functionality may be stored as one or more instructions or code on or transmitted via a computer-readable medium. Computer-readable media include computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one location to another. Storage media may be any available medium accessible to a general-purpose or special-purpose computer. By way of example, and not limitation, computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, disk storage devices or other magnetic storage devices, or any other medium that may be used to carry or store the required program code in the form of instructions or data structures and is accessible to a general-purpose or special-purpose computer or a general-purpose or special-purpose processor. Furthermore, any connection may be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the aforementioned coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media. As used herein, disks and optical discs include compact discs (CDs), laser discs, optical discs, digital multifunction discs (DVDs), floppy disks, and Blu-ray discs, wherein disks typically reproduce data magnetically, while optical discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0150] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.
[0151] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.
[0152] The embodiment numbers disclosed in the above embodiments of the present invention are merely for description and do not represent the superiority or inferiority of the embodiments.
[0153] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0154] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A method for downgrading TP-RAID to RAID5, characterized in that, Includes the following steps: Data blocks and parity blocks are stored in TP-RAID in a preset manner; In response to receiving a command to downgrade TP-RAID to RAID5, record the data on the first and second disks in the TP-RAID; The TP-RAID encoded stripes are divided into moving groups and recalculation groups. The process of dividing the TP-RAID encoded stripes into moving groups and recalculation groups includes: dividing the first number of data blocks plus 1 stripe in the TP-RAID encoded stripe into moving groups; and dividing the remaining stripes into recalculation groups. Data is read from the first and second disks in each stripe of the moving group, and a new parity block for the downgraded RAID5 is calculated using a preset formula. The new parity block and the data blocks from the read data are then stored in the parity block location of TP-RAID. The calculation of the new parity block for the downgraded RAID5 using the preset formula includes: [Formula omitted for brevity]. Calculate the new parity block after downgrading RAID5, where p' is the new parity block, p is the first parity block of TP-RAID, q is the second parity block of TP-RAID, and r is the third parity block of TP-RAID. Store the new parity block and the data blocks read from the data into the TP-RAID parity block locations, including: storing the new parity block in the location of the first parity block of TP-RAID on the remaining disks; if only one data block is read, store the data block in the original location of the second parity block; if two data blocks are read, store the data blocks in the original locations of the second and third parity blocks respectively.
2. The method according to claim 1, characterized in that, Storing data blocks and parity blocks into TP-RAID in a preset manner includes: Data blocks and parity blocks are stored in TP-RAID with a left-rotated, non-aligned configuration.
3. The method according to claim 1, characterized in that, Also includes: Calculate the parity blocks for the data blocks in the recalculation group according to the RAID5 method; The data blocks in the recalculation group and the calculated parity blocks are stored in RAID5.
4. The method according to claim 1, characterized in that, Also includes: In response to the completion of the TP-RAID to RAID5 downgrade, the first and second disks are removed and their data is cleared.
5. A device for downgrading TP-RAID to RAID5, characterized in that, The device includes: A computing module, configured to store data blocks and parity blocks into TP-RAID in a preset manner; A recording module, configured to record data from the first and second disks in the TP-RAID in response to receiving a command to downgrade from TP-RAID to RAID5; The grouping module is configured to divide TP-RAID encoded stripes into moving groups and recalculation groups, wherein dividing TP-RAID encoded stripes into moving groups and recalculation groups includes: dividing the first number of data blocks plus 1 stripe in the TP-RAID encoded stripe into moving groups; and dividing the remaining stripes into recalculation groups; The storage module is configured to read data from the first and second disks in each stripe of the mobile group, calculate a new parity block for the downgraded RAID5 using a preset formula, and store the new parity block and the data blocks from the read data in the parity block location of TP-RAID. The calculation of the new parity block for the downgraded RAID5 using the preset formula includes: using the formula... Calculate the new parity block after downgrading RAID5, where p' is the new parity block, p is the first parity block of TP-RAID, q is the second parity block of TP-RAID, and r is the third parity block of TP-RAID. Store the new parity block and the data blocks read from the data into the TP-RAID parity block locations, including: storing the new parity block in the location of the first parity block of TP-RAID on the remaining disks; if only one data block is read, store the data block in the original location of the second parity block; if two data blocks are read, store the data blocks in the original locations of the second and third parity blocks respectively.
6. A computer device, characterized in that, include: At least one processor; as well as A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the method according to any one of claims 1-4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-4.
Citation Information
Patent Citations
Method, system and equipment for degrading RAID (Redundant Array of Independent Disks) into RAID5 (Redundant Array of Independent Disks)
CN114546272A
Data transfer method, system and equipment and computer readable storage medium
CN115167787A
