Method and device for fast switching tp-raid to raid 6, storage server and medium
By analyzing the load balancing strategies of TP-RAID and RAID 6, a minimum data migration scheme was determined. K+2 TP-RAID stripe groups were divided into moving groups and the parity blocks were recalculated, which solved the problems of slow speed and complexity when switching from TP-RAID to RAID 6 and achieved a fast and efficient switching process.
Patent Information
- Application Number
- CN202310315002.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-24
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-03-24
AI Technical Summary
In existing technologies, switching from TP-RAID to RAID 6 requires large-scale data migration and re-encoding, resulting in slow and complex switching speeds that are difficult to meet current storage needs.
By analyzing the load balancing strategies of TP-RAID and RAID 6, a minimum data migration scheme was determined. K+2 TP-RAID stripe groups were divided into moving groups and the parity blocks were recalculated, directly converting them into RAID 6 stripe groups to avoid large-scale data migration. Minor modifications were made to the original TP-RAID encoding.
It significantly reduced the amount of data migration, improved switching speed and efficiency, reduced coding modification time, and maintained the original TP-RAID load balancing strategy.
Smart Images

Figure CN116339631B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of RAID storage technology, and in particular to a method, apparatus, storage server, and medium for quickly switching TP-RAID to RAID 6. Background Technology
[0002] RAID (Redundant Arrays of Independent Disks) is a disk array with redundancy capabilities. It combines multiple independent disks to create a large-capacity disk group. Specifically, RAID primarily utilizes three technologies: data striping, data parity, and / or mirroring to achieve stronger performance, higher reliability, better fault tolerance, and stronger scalability. Depending on different data application requirements, these three technologies can be used individually or in combination. Based on different strategies and architectures, RAID can be divided into different levels: RAID 0, RAID 1, RAID 5, RAID 6, and RAID 10. RAID 5 (distributed parity independent disk structure) and RAID 6 (independent disk structure with two types of distributed parity codes) are two RAID strategies that use data parity technology individually, and each stripe group in both consists of several data blocks and two parity blocks.
[0003] With technological advancements, increased disk lifespan, and larger data volumes stored in servers, RAID technology has gradually become insufficient to meet current storage demands, leading to the emergence of TP-RAID. Compared to RAID5 and RAID6, TP-RAID is a RAID algorithm capable of simultaneously supporting three error blocks. Each stripe in a TP-RAID array consists of several data blocks and three parity blocks. The general explanation of the TP-RAID algorithm is that the constructed cubic equations have a unique solution. However, considering the need for product implementation to support multiple solutions for customers, when users need to switch from TP-RAID to RAID5 or RAID6, a re-encoding method can be used. The re-encoding process and its drawbacks include: first, discarding all parity information, then migrating the data, and then re-reading and re-encoding all the data. This operation requires two read / write operations on all the data, resulting in slow speed and significant data loss. Furthermore, since the RAID6 algorithm is more complex than RAID5, re-encoding is more difficult, further limiting the speed of switching to RAID6. Therefore, how to achieve a fast TP-RAID to RAID6 switch is a pressing technical problem that needs to be solved in this field. Summary of the Invention
[0004] To provide a simpler and faster solution for switching TP-RAID to RAID 6, in a first aspect of the present invention, a method for quickly switching TP-RAID to RAID 6 is proposed. The method includes performing the following steps on every K+3 consecutive TP-RAID stripe groups in a TP-RAID disk: comparing the TP-RAID disk persistence method and the RAID 6 disk persistence method using the same load balancing strategy; determining the K+2 TP-RAID stripe groups that require the fewest data block migrations when switching from the TP-RAID disk persistence method to the RAID 6 disk persistence method, where K is the number of data blocks in the TP-RAID stripe group; assigning the K+2 TP-RAID stripe groups to a move group and assigning the remaining TP-RAID stripe groups to a recalculation group; determining the TP-RAID disks that need to be freed up; performing data migration within the stripe group on the first data blocks stored in the TP-RAID disks to be freed up in the move group, and recalculating new parity blocks to convert the K+2 TP-RAID stripe groups into RAID 6 stripe groups; and reallocating the load on all the second data blocks in the recalculation group.
[0005] In one or more embodiments, when a left-handed unaligned load balancing strategy is adopted, the K+2 TP-RAID stripe groups are assigned to the moving group, and the remaining TP-RAID stripe groups are assigned to the recalculation group, including: assigning the first TP-RAID stripe group to the recalculation group, and assigning the second to the K+3 TP-RAID stripe groups to the moving group; the disk format of the first TP-RAID stripe group includes: in ascending order of disk number, the second parity block, the third parity block, K data blocks, and the first parity block.
[0006] In one or more embodiments, the TP-RAID disk to be freed up includes any one of K+3 TP-RAID disks.
[0007] In one or more embodiments, data migration within a stripe group is performed on the first data block stored in the TP-RAID disk to be vacated in the moving group, including: migrating each first data block to the disk location where the third parity block of its TP-RAID stripe group is located and replacing the third parity block; wherein, the third parity block is the third parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K.
[0008] In one or more embodiments, the method further includes recording the third parity block before the first data block replaces the third parity block, wherein recalculating the new parity block to convert the K+2 TP-RAID stripe groups into RAID 6 stripe groups includes: recalculating a new parity block belonging to the RAID 6 stripe group based on the original parity blocks in the TP-RAID stripe group; replacing the original first parity block and second parity block of the TP-RAID stripe group with the new parity block; wherein the first parity block is the first parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K, and the second parity block is the second parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K.
[0009] In one or more embodiments, recalculating new parity blocks belonging to the RAID 6 stripe group based on the original parity blocks in the TP-RAID stripe group includes: substituting the disk write method of the TP-RAID stripe group into the TP-RAID relation to obtain a first set of equations; substituting the disk write method of the RAID 6 stripe group corresponding to the TP-RAID stripe group into the RAID6 relation to obtain a second set of equations; and obtaining a fourth parity block and a fifth parity block belonging to the RAID 6 stripe group based on the first set of equations and the second set of equations.
[0010] In one or more embodiments, the TP-RAID relation is determined by the data blocks, parity blocks, and their disk locations in each TP-RAID stripe group; the RAID6 relation is determined by the data blocks, parity blocks, and their disk locations in each RAID6 stripe group; the TP-RAID relation and the RAID6 relation are constructed using the same Reed-Solomon code; the load balancing strategy includes: left-rotation misalignment, right-rotation misalignment, left-rotation alignment, and right-rotation alignment.
[0011] In one or more embodiments, the apparatus is configured to process K+3 consecutive TP-RAID stripe groups in a TP-RAID disk as a group. The apparatus includes: an analysis module configured to compare TP-RAID disk persistence methods and RAID 6 disk persistence methods under the same load balancing strategy, and determine the K+2 TP-RAID stripe groups with the fewest data block migrations when switching from the TP-RAID disk persistence method to the RAID 6 disk persistence method, where K is the number of data blocks in the TP-RAID stripe group; a grouping module configured to divide the K+2 TP-RAID stripe groups into a moving group and divide the remaining TP-RAID stripe groups into a recalculation group; an empty disk module configured to select TP-RAID disks to be emptied; an intra-group migration module configured to migrate the first data blocks stored in the TP-RAID disks to be emptied within the stripe group and recalculate new parity blocks to convert the K+2 TP-RAID stripe groups into RAID 6 stripe groups; and a load distribution module configured to reallocate the load of all second data blocks in the recalculation group.
[0012] In a second aspect of the invention, a storage server for fast TP-RAID to RAID 6 switching is provided, comprising: one or more controllers, a system memory, and a plurality of data memories; wherein the system memory stores an executable computer program, which, when executed by the one or more controllers, is used to implement the steps of the method for fast TP-RAID to RAID 6 switching as described in any of the above embodiments, to switch the storage mode of the plurality of data memories from TP-RAID to RAID 6.
[0013] In a third aspect of the invention, a readable storage medium is provided, comprising: an executable computer program, which, when executed, implements the steps of the method for fast switching of TP-RAID to RAID 6 as described in any of the above embodiments.
[0014] The beneficial effects of this invention include: by analyzing the disk-writing methods of TP-RAID and RAID 6 under the same load balancing strategy, the method of this invention determines the minimum data migration scheme—migrating data blocks within K+2 TP-RAID stripe groups and recalculating the parity blocks to directly convert the K+2 TP-RAID stripe groups into RAID6 stripe groups, thereby avoiding large-scale data migration; and since this application does not change the original TP-RAID load balancing strategy, it can directly make minor modifications to the original TP-RAID encoding, thereby further improving the overall switching speed. Attached Figure Description
[0015] 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.
[0016] Figure 1 This is a flowchart illustrating the process of a method for quickly switching TP-RAID to RAID 6 according to the present invention.
[0017] Figure 2 This is a schematic diagram illustrating the division of the moving group and recalculation group and the data movement of the moving group according to the present invention.
[0018] Figure 3 This is a schematic diagram of the data distribution of RAID6 according to the present invention;
[0019] Figure 4 This is a schematic diagram of the structure of a device for quickly switching TP-RAID to RAID 6 according to the present invention;
[0020] Figure 5 This is a schematic diagram of the structure of a storage server for quickly switching from TP-RAID to RAID 6 according to the present invention;
[0021] Figure 6 This is a schematic diagram of the structure of a readable storage medium according to the present invention. Detailed Implementation
[0022] 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.
[0023] It should be noted that all uses of "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two entities or parameters with the same name but different names. It is clear that "first" and "second" are only for the convenience of expression and should not be construed as limiting the embodiments of the present invention. Subsequent embodiments will not explain this in detail.
[0024] Existing technologies typically employ re-encoding when switching from TP-RAID to RAID6. This method not only involves a large amount of encoding but also requires a redistribution of all stored data across the RAID disks, necessitating large-scale data migration, thus hindering rapid implementation. To address this technical problem, this invention proposes a method for rapid TP-RAID to RAID6 switchover. This method analyzes the disk persistence methods of TP-RAID and RAID6 under the same load balancing strategy to determine the minimum data migration scheme—migrating data blocks within K+2 TP-RAID stripe groups and recalculating parity blocks to directly convert the K+2 TP-RAID stripe groups into RAID6 stripe groups, thereby avoiding large-scale data migration. Furthermore, since this application does not alter the original TP-RAID load balancing strategy, only minor modifications to the original TP-RAID encoding are needed, thus saving significant time in encoding modifications. To more clearly illustrate the technical solution of this invention, the following description is provided in conjunction with the accompanying drawings:
[0025] Figure 1 This is a flowchart illustrating the workflow of a method for quickly switching TP-RAID to RAID 6 according to the present invention. Figure 1 As shown, the workflow of a method for quickly switching TP-RAID to RAID 6 according to the present invention includes: Step S1, performing the following steps on every K+3 consecutive TP-RAID stripe groups in the TP-RAID disk; Step S2, comparing the TP-RAID disk persistence method and the RAID 6 disk persistence method under the same load balancing strategy; Step S3, determining the K+2 TP-RAID stripe groups with the fewest data block migrations when switching from the TP-RAID disk persistence method to the RAID 6 disk persistence method, where K is the number of data blocks in the TP-RAID stripe group; Step S4, assigning the K+2 TP-RAID stripe groups to the move group and assigning the remaining TP-RAID stripe groups to the recalculation group; Step S5, determining the TP-RAID disks that need to be vacated; Step S6, performing data migration within the stripe group on the first data block stored in the TP-RAID disk to be vacated in the move group, and recalculating new parity blocks to convert the K+2 TP-RAID stripe groups into RAID 6 stripe groups; Step S7, reallocating the load on all the second data blocks in the recalculation group.
[0026] Specifically, since TP-RAID stripes have K+3 disk write methods (K is the number of data blocks, 3 is the number of parity blocks), which is one more than RAID6 stripes (K+2 disk write methods), for every K+3 TP-RAID stripes, the data blocks in one TP-RAID stripe need to be redistributed to form a new RAID6 stripe. Although the method of this invention also requires redistribution of some TP-RAID stripes, compared to the traditional method that requires redistribution of all TP-RAID stripes, the method of this invention can still greatly reduce the overall amount of data migration.
[0027] In a further embodiment, when a left-rotating unaligned load balancing strategy is adopted, K+2 TP-RAID stripe groups are assigned to the moving group, and the remaining TP-RAID stripe groups are assigned to the recalculation group, including: assigning the first TP-RAID stripe group to the recalculation group, and assigning the second to the K+3 TP-RAID stripe groups to the moving group.
[0028] Specifically, in order to further reduce the overall amount of data migration, this invention will selectively select K+2 TP-RAID stripe groups based on different load balancing strategies. Please refer to [link / reference] for details. Figure 2 , Figure 2 This is a schematic diagram illustrating the division of the moving group and recalculation group and the data movement of the moving group according to the present invention. Figure 2 The left side shows the disk placement method for K+3 TP-RAID stripes that conform to the left-hand asymmetric load balancing scheme. Figure 2 The right side shows the disk write method for a K+2 RAID6 stripe group that conforms to the left-hand asymmetric load balancing scheme; see also... Figure 2 In this embodiment, the last TP-RAID disk is left empty. If the first to the (K+2)th TP-RAID stripe groups are to be converted to RAID6 stripe groups, the disk placement of all data blocks (D1 to DK) in each TP-RAID stripe group needs to be shifted one position to the left. However, if the second to the (K+3)th TP-RAID stripe groups are to be converted to RAID6 stripe groups, only data block DK in the last TP-RAID disk needs to be migrated. It should be noted that the selection of the (K+2)th TP-RAID stripe groups may vary depending on the load balancing strategy. Other load balancing strategies may select other (K+2)th TP-RAID stripe groups, but the principle remains the same: to ensure the minimum number of data blocks migrated within the group.
[0029] In a further embodiment, the disk placement format of the first TP-RAID stripe group includes: a second parity block, a third parity block, K data blocks, and a first parity block, arranged in ascending order of disk number. Specifically, once the load balancing strategy is determined, the disk placement position of the stripe group is fixed. For a left-hand misalignment strategy, the disk placement format of the first TP-RAID stripe group is as described above.
[0030] In a further embodiment, the TP-RAID disk to be vacated includes any one of the K+3 TP-RAID disks. Specifically, the present invention can vacate any one TP-RAID disk, but it is preferred to vacate the last TP-RAID disk. The advantage is that the continuity of the disk numbers will not be changed, thereby reducing the subsequent disk number modification work.
[0031] In a further embodiment, the data migration within the stripe group of the first data block stored in the TP-RAID disk to be vacated in the moving group includes: migrating each first data block to the disk location where the third parity block of its TP-RAID stripe group is located and replacing the third parity block; wherein, the third parity block is the third parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K.
[0032] Specifically, such as Figure 2 As shown, P is the first check block, q is the second check block, and r is the third check block. The order of the three check blocks is such that when moving from the first data block D1 towards DK and back to data block D1, the order of p, q, and r remains unchanged. Figure 2 In this invention, the data migration within a TP-RAID stripe group to a RAID6 stripe group can be completed simply by replacing the parity block r with the data block Dk in the last TP-RAID disk. After that, the conversion can be completed simply by recalculating the new parity block for the RAID6 stripe group.
[0033] In a further embodiment, the method of the present invention further includes: recording the third parity block before replacing the third parity block with the first data block. As can be seen from the formula derivation in subsequent embodiments, the present invention requires the use of three parity blocks in the TP-RAID stripe group to calculate the two parity blocks in the converted RAID6 stripe group. Therefore, the third parity block (including its disk location) needs to be recorded and saved before replacing the third parity block with the first data block.
[0034] In a further embodiment, recalculating new parity blocks to convert K+2 TP-RAID stripe groups into RAID6 stripe groups includes: recalculating new parity blocks belonging to the RAID6 stripe group based on the original parity blocks in the TP-RAID stripe group; replacing the original first and second parity blocks of the TP-RAID stripe group with the new parity blocks; wherein the first parity block is the first parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K, and the second parity block is the second parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K. The recalculation of new parity blocks belonging to the RAID6 stripe group based on the original parity blocks in the TP-RAID stripe group includes: substituting the disk write method of the TP-RAID stripe group into the TP-RAID relation to obtain the first set of equations; substituting the disk write method of the corresponding RAID6 stripe group into the RAID6 relation to obtain the second set of equations; and obtaining the fourth and fifth parity blocks belonging to the RAID6 stripe group based on the first and second sets of equations.
[0035] Specifically, the traditional TP-RAID relationship is as follows:
[0036]
[0037] In this invention, p1, p2, and p3 represent the three checksums generated during TP-RAID encoding, and 'a' represents the parameters used in the encoding. To achieve the goal of a solvable cubic equation, the key lies in the selection of 'a'. Traditional TP-RAID only needs to consider the functional requirement that any three errors in TP-RAID can be solved, where 'a' can be selected from various algorithms conforming to MDS characteristics. In contrast, the method of this invention needs to consider not only the switch from TP-RAID to RAID6, but also ensure that the switch method is simpler than direct encoding and faster than re-encoding.
[0038] Therefore, in order for RAID groups to be able to switch between each other, that is, to ensure that TP-RAID can switch to RAID6 (or RAID5), the first two lines of equation (1) must satisfy the RAID6 characteristics. Furthermore, based on the equivalent scalability of RS (Reed-Solomon Code), the equation in the third line also needs to be constructed using a similar RS code. Based on the above requirements, the TP-RAID relationship adopted in this invention can be obtained as follows:
[0039]
[0040] Where d1 to dk are data blocks, p1 to p3 are parity blocks, and the coefficients before each data block and parity block are their corresponding disk locations; where, since the RAID relationship of the present invention is constructed using RS, all operations in the above formula (2) are operations in the Galois domain.
[0041] More specifically, the derivation process for recalculating the new parity block belonging to the RAID 6 stripe group based on the original parity block in the TP-RAID stripe group is as follows:
[0042] For TP-RAID stripe group 2
[0043] The original coding equations (first set of equations) for TP-RAID are:
[0044]
[0045] The encoding equations (second set of equations) for the RAID-6 to be converted are as follows:
[0046]
[0047] Combining the two systems of equations above, we can obtain:
[0048]
[0049] Solving the above system of equations (5) yields:
[0050]
[0051] Where p' and q' are the two parity blocks of the converted RAID-6. As shown in formula (6) above, for TP-RAID stripe group 2, no data blocks need to be moved. It is only necessary to read the original parity blocks p, q, and r, and calculate the new parity blocks p' and q' to obtain the converted RAID-6 stripe group.
[0052] Similarly, for TP-RAID stripe group 3:
[0053] The original coding equation for TP-RAID is:
[0054]
[0055] The encoding equation for the RAID-6 to be converted is as follows:
[0056]
[0057] Combining the two systems of equations above, we get:
[0058]
[0059] Solving the above system of equations (9) yields:
[0060]
[0061] As shown in formula (10), for TP-RAID stripe group 3, no data blocks need to be moved. It is only necessary to read the original parity blocks p, q, r and calculate the new parity blocks p' and q' to obtain the converted TP-RAID stripe group.
[0062] Similarly, for TP-RAID stripe group 4:
[0063] The original coding equation for TP-RAID is:
[0064]
[0065] The encoding equation for the RAID-6 to be converted is as follows:
[0066]
[0067] Combining the two systems of equations above, we get:
[0068]
[0069] Solving the above system of equations yields:
[0070]
[0071] As shown in formula (14) above, for TP-RAID stripe group 4, data block d needs to be moved. k Go to the original parity block r, and read the original parity blocks p, q, r and data block d. k Then, by calculating the new parity blocks p' and q', the converted RAID6 stripe group can be obtained. Similarly, for stripes 5, 6, ... k+1, k+3, we have:
[0072]
[0073] For stripe groups 4, 5, ... k+1, k+3, data block d needs to be moved. k Move to the original parity block r and read the original parity blocks p, q, r and data block d. kThe new parity block is calculated using the corresponding expressions in the above formulas, which yield the parity blocks p' and q' of the RAID6 stripe to be converted. It should be noted that the operations within parentheses "()" in the above formulas are arithmetic operations, while other operations are operations within the Galois domain. As can be seen from the above formulas, the converted RAID-6 parity block is only related to the original TP-RAID parity blocks p, q, and r; and each TP-RAID relationship is determined by the data blocks, parity blocks, and their disk locations in each TP-RAID stripe; each RAID6 relationship is determined by the data blocks, parity blocks, and their disk locations in each RAID6 stripe.
[0074] The specific embodiments described above target left-hand asymmetric load balancing strategies. When the load balancing strategy is right-hand asymmetric, left-hand aligned, or right-hand aligned, the calculation process is similar and will not be repeated in this invention. However, the TP-RAID switching RAID6 scheme under the above-mentioned right-hand asymmetric, left-hand aligned, and right-hand aligned loads using the method of this invention is still within the protection scope of this invention.
[0075] For the recalculation group, because a disk is left unused when transitioning from TP-RAID to RAID6, complete load balancing cannot be guaranteed through simple shifting. Therefore, in every K+3 stripe groups, one stripe will always be unused and unable to achieve load balancing directly. From n stripe groups satisfying K+3, a total of n stripes are generated and enter the recalculation group. After the other stripes have completed load balancing and reorganization, these stripes are recalculated for disk writes and parity blocks to satisfy load balancing. The final RAID6 disk write method is shown in Figure 3. Figure 3 This is a schematic diagram of the data distribution of RAID6 according to the present invention.
[0076] As described in the embodiments above, this invention proposes an improved scheme for switching from TP-RAID to RAID6. This scheme re-divides the stripe group into a moving group and a recalculation group, and then performs data block migration or load redistribution within the stripe group respectively, thereby minimizing the amount of data migration. For the stripe group in the moving group, by reasonably utilizing the relationship between the original TP-RAID parity block and the parity block of the switched RAID6, an expression is established between the TP-RAID parity block and the parity code of the switched RAID6. Compared with the traditional switching operation, this greatly reduces the amount of disk reads and the bandwidth consumption caused by the switching operation, thereby helping to improve the efficiency of the switching operation.
[0077] In a second aspect of the invention, an apparatus for quickly switching TP-RAID to RAID 6 is provided. Figure 4 This is a schematic diagram of a device for quickly switching TP-RAID to RAID 6 according to the present invention. Figure 4As shown, the apparatus of the present invention includes: an analysis module 10, configured to compare TP-RAID disk persistence method and RAID 6 disk persistence method under the same load balancing strategy, and determine the K+2 TP-RAID stripe groups with the fewest data block migrations when switching from TP-RAID disk persistence method to RAID 6 disk persistence method, where K is the number of data blocks in the TP-RAID stripe group; a grouping module 20, configured to divide the K+2 TP-RAID stripe groups into a moving group and divide the remaining TP-RAID stripe groups into a recalculation group; an empty disk module 30, configured to select the TP-RAID disks to be emptied; an intra-group migration module 40, configured to perform intra-strip group data migration on the first data blocks stored in the TP-RAID disks to be emptied in the moving group, and recalculate new parity blocks to convert the K+2 TP-RAID stripe groups into RAID 6 stripe groups; and a load distribution module 50, configured to redistribute the load on all the second data blocks in the recalculation group.
[0078] In one embodiment, when a left-rotating unaligned load balancing strategy is adopted, the grouping module is further configured to: assign the first TP-RAID stripe group to the recalculation group, and assign the second to the K+3rd TP-RAID stripe groups to the moving group;
[0079] In one embodiment, the disk format of the first TP-RAID stripe group includes: in ascending order of disk number, the second parity block, the third parity block, K data blocks, and the first parity block.
[0080] In one embodiment, the empty disk module is further configured to: select any one of the K+3 TP-RAID disks as the TP-RAID disk to be emptied.
[0081] In one embodiment, the intra-group migration module is further configured to: migrate each first data block to the disk location where the third parity block of its TP-RAID stripe group is located and replace the third parity block; wherein the third parity block is the third parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K.
[0082] In one embodiment, the intra-group migration module is further configured to: record the third parity block before the first data block replaces the third parity block; recalculate the new parity block belonging to the RAID 6 stripe group based on the original parity blocks in the TP-RAID stripe group; and replace the original first and second parity blocks of the TP-RAID stripe group with the new parity block; wherein the first parity block is the first parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K, and the second parity block is the second parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K.
[0083] In one embodiment, the intra-group migration module is further configured to: substitute the disk write method of the TP-RAID stripe group into the TP-RAID relation to obtain the first set of equations; substitute the disk write method of the RAID 6 stripe group corresponding to the TP-RAID stripe group into the RAID 6 relation to obtain the second set of equations; and obtain the fourth and fifth parity blocks belonging to the RAID 6 stripe group based on the first and second sets of equations.
[0084] In a third aspect of the invention, a storage server for fast switching from TP-RAID to RAID 6 is proposed. Figure 5 This is a schematic diagram of the structure of a storage server for fast switching from TP-RAID to RAID 6 according to the present invention. Figure 5 As shown, the storage server 100 of the present invention includes: one or more controllers 101, a system memory 102, and a plurality of data storage devices 103; wherein, the system memory 102 stores an executable computer program, which, when executed by one or more controllers 101, is used to implement the steps of the method for fast switching from TP-RAID to RAID 6 as described in any of the above embodiments, so as to switch the storage mode of the plurality of data storage devices 103 from TP-RAID to RAID 6.
[0085] In a fourth aspect of the invention, a readable storage medium is proposed. Figure 6 This is a schematic diagram of the structure of a readable storage medium 200 according to the present invention. Figure 6 As shown, the readable storage medium of the present invention includes: an executable computer program 201, which, when executed, is used to implement the steps of the method for quickly switching TP-RAID to RAID 6 as described in any of the above embodiments.
[0086] 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.
[0087] 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.
[0088] The embodiment numbers disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0089] 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 quickly switching TP-RAID to RAID 6, characterized in that, The method includes performing the following steps on every K+3 consecutive TP-RAID stripe groups in a TP-RAID disk: Compare the disk persistence methods of TP-RAID and RAID 6 using the same load balancing strategy; Identify the K+2 TP-RAID stripe groups that require the fewest data block migrations when switching from the TP-RAID disk persistence method to the RAID 6 disk persistence method, where K is the number of data blocks in the TP-RAID stripe group; The K+2 TP-RAID stripe groups are assigned to the moving group, and the remaining TP-RAID stripe groups are assigned to the recalculation group; Determine which TP-RAID disks need to be freed up; The first data block stored in the TP-RAID disk to be vacated in the moving group is migrated within the stripe group, and a new parity block is recalculated to convert the K+2 TP-RAID stripe groups into RAID 6 stripe groups; The load is redistributed to all second data blocks in the recalculation group; Specifically, when employing a left-hand unaligned load balancing strategy, the K+2 TP-RAID stripe groups are assigned to the moving group, and the remaining TP-RAID stripe groups are assigned to the recalculation group. This includes assigning the first TP-RAID stripe group to the recalculation group and assigning the second to K+3 TP-RAID stripe groups to the moving group. The disk format of the first TP-RAID stripe group includes, in ascending order of disk number, the second parity block, the third parity block, K data blocks, and the first parity block. The data migration within the stripe group for the first data block stored in the TP-RAID disk to be vacated in the moving group includes: migrating each first data block to the disk location where the third parity block of its TP-RAID stripe group is located and replacing the third parity block; wherein, the third parity block is the third parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K.
2. The method for quickly switching TP-RAID to RAID 6 according to claim 1, characterized in that, The TP-RAID disk that needs to be freed up includes any one of the K+3 TP-RAID disks.
3. The method for quickly switching TP-RAID to RAID 6 according to claim 1, characterized in that, The method further includes recording the third parity block before it is replaced by the first data block, and recalculating the new parity block to convert the K+2 TP-RAID stripes into RAID 6 stripes, including: The new parity blocks belonging to the RAID 6 stripe group are recalculated based on the original parity blocks in the TP-RAID stripe group. The new parity block replaces the original first and second parity blocks of the TP-RAID stripe group. The first parity block is the first parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K, and the second parity block is the second parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K.
4. The method for quickly switching TP-RAID to RAID 6 according to claim 3, characterized in that, Based on the existing parity blocks in the TP-RAID stripe group, a new parity block belonging to the RAID 6 stripe group is recalculated, including: Substituting the disk placement method of the TP-RAID stripe group into the TP-RAID relational formula, we obtain the first set of equations; Substituting the disk write method of the RAID 6 stripe group corresponding to the TP-RAID stripe group into the RAID 6 relational formula, we obtain the second set of equations; The fourth and fifth parity blocks belonging to the RAID 6 stripe group are obtained based on the first and second sets of equations.
5. A method for quickly switching TP-RAID to RAID 6 according to claim 4, characterized in that, The TP-RAID relationship is determined by the data blocks, parity blocks, and their disk locations in each TP-RAID stripe group; the RAID6 relationship is determined by the data blocks, parity blocks, and their disk locations in each RAID6 stripe group. The TP-RAID relation and the RAID 6 relation are constructed using the same Reed-Solomon code; The load balancing strategies include: left-aligned, right-aligned, left-aligned, and right-aligned.
6. A device for quickly switching TP-RAID to RAID 6, characterized in that, The device is configured to process TP-RAID stripes in groups of K+3 consecutive stripes from a TP-RAID disk, and the device includes: The analysis module is configured to compare the TP-RAID disk writing method and the RAID 6 disk writing method under the same load balancing strategy, and determine the K+2 TP-RAID stripe groups with the fewest data block migrations when switching from the TP-RAID disk writing method to the RAID 6 disk writing method, where K is the number of data blocks in the TP-RAID stripe group; The grouping module is configured to assign the K+2 TP-RAID stripe groups to the moving group and assign the remaining TP-RAID stripe groups to the recalculation group. Empty disk module, configured to select the TP-RAID disks that need to be emptied; The intra-group migration module is configured to perform intra-group data migration on the first data block stored in the TP-RAID disk to be vacated in the moving group, and recalculate a new parity block to convert the K+2 TP-RAID stripe groups into RAID 6 stripe groups; A load distribution module is configured to redistribute the load of all second data blocks in the recalculation group. The grouping module is further configured to assign the first TP-RAID stripe group to the recalculation group and the second to the (K+3)th TP-RAID stripe groups to the moving group; the disk format of the first TP-RAID stripe group includes: in ascending order of disk number, the second parity block, the third parity block, K data blocks, and the first parity block; The intra-group migration module is further configured to migrate each of the first data blocks to the disk location of the third parity block in its TP-RAID stripe group and replace the third parity block; wherein the third parity block is the third parity block encountered in the TP-RAID stripe group along the direction from data block 1 to data block K.
7. A storage server that can quickly switch from TP-RAID to RAID 6, characterized in that, include: One or more controllers, system memory; as well as Multiple data storage devices; The system memory stores an executable computer program, which, when executed by the one or more controllers, implements the steps of the method for quickly switching TP-RAID to RAID6 as described in any one of claims 1-5, to switch the storage mode of the plurality of data stores from TP-RAID to RAID 6.
8. A readable storage medium, characterized in that, include: An executable computer program, when executed, for implementing the steps of the method for fast switching of TP-RAID to RAID 6 as described in any one of claims 1-5.
Citation Information
Patent Citations
Data transfer method, system and equipment and computer readable storage medium
CN115167787A