This disclosure claims the priority based on Chinese Patent Application No. 202210887332.0, filed with the Chinese Patent Office on Jul. 26, 2002 and entitled “Encoding Method and Device For RAID6 Disk Array, Decoding Method and Device for RAID6 Disk Array, and Medium”, which is incorporated herein by reference in its entirety.
Embodiments of the present disclosure relate to the storage field, and in particular, to an encoding method and apparatus for an RAID6 disk array, a decoding method and apparatus for an RAID6 disk array, and a medium.
With the rapid development of communication technology and network science, there has been an exponential explosion in digital information, posing significant challenges to data storage technology. The reliability of data in storage systems and the energy consumption of storage systems are increasingly drawing people's attention. In the face of such massive data volumes today, there is an inverse relationship between the reliability of data in storage systems and the number of components contained within them. That is to say, the more components there are in a storage system, the lower the reliability of the data stored within it. According to relevant surveys, in an Internet data center composed of 600 disks, approximately 30 disks are reported to fail each month, and in a large-scale storage system, the decrease in data reliability caused by disk failures is a significant issue. In response, people have started researching relevant fault-tolerant techniques.
In 1988, Patterson and others from the University of California, Berkeley, proposed the RAID structure, which became a key technology for improving storage space. RAID (Redundant Arrays of Independent Disks) refers to disk arrays with redundancy capabilities. These arrays are created by combining multiple independent disks to form a single, large-capacity disk group. By using the RAID storage technology, storage capacity can be significantly increased, the system's input/output request processing capability is improved, and data reliability is improved by using a data distributed storage technique, a parallel access method and an information redundancy technique. After the design concept of RAID was proposed, it was quickly adopted by the industry. RAID technology, as a high-performance and highly reliable storage technology, has now been widely applied in people's production and daily life. RAID mainly utilizes techniques such as data striping, data parity, and mirroring to achieve strong performance, higher reliability, better fault tolerance, and high scalability. According to different data application requirements, strategies and architectures using or combining the three techniques may be used. Therefore, according to different strategies and architectures, RAID may be classified into different levels: RAID0, 1, 5, 6, 10.
RAID0 is the earliest RAID mode, known as Data Striping technology. RAID0 is the simplest form of constructing a disk array, requiring only 2 or more hard disks. It has low cost and can enhance the performance and throughput of the entire disk array. RAID0 does not provide redundancy or error recovery capability, but it has the lowest implementation cost. The simplest way to implement RAID0 is to connect N identical hard disks either through a hardware method using an intelligent disk controller or through a software method using disk drivers within the operating system, to create a large volume set. During use, computer data is sequentially written to each hard disk, and its greatest advantage is that it can effectively increase the storage capacity of the hard disks by a multiple. If three 80 GB hard disks are used to configure a RAID0 array, the disk capacity will be 240 GB. In terms of speed, it is exactly the same as that of a single hard disk. The major drawback is that if any one hard disk fails, the entire system will be damaged, and the reliability will be only 1/N of a single hard disk.
RAID1 is known as disk mirroring, where the principle involves mirroring the data from one disk onto another. This means that while data is being written to one disk, a mirror image of that data is simultaneously created on another idle disk. This ensures maximum system reliability and recoverability without compromising performance. As long as at least one disk in any pair of mirror disks in the system can be used, the system can operate normally, even if problems occurs in half of the total number of hard disks. When a hard disk fails, the system will ignore that drive and instead utilize the remaining mirror disk to read and write data, providing excellent disk redundancy capability. Although this approach ensures absolute data safety, it also comes with a significant increase in costs due to the disk utilization rate of 50%, for example, with four 80 GB capacity hard disks, the available disk space would only be 160 GB. In addition, a RAID system in which a hard disk failure occurs is no longer reliable, and a damaged hard disk is replaced in a timely manner; otherwise, a problem also occurs in the remaining mirror disk, and the entire system will crash. After a new disk is replaced, it will take a long time to synchronize the mirror, and external access to the data will not be affected. However, the performance of the entire system may decrease during this time. Therefore, the RAID1 is often used in situations of storing critical and important data.
RAID5 (independent disk structure of distributed parity check). Its parity check codes exist on all disks, where p0 represents the parity check value of the 0th stripe, and the meaning is the same for others. The read efficiency of RAID5 is high, while the write efficiency is moderate, and the block-based collective access efficiency is good. As the parity check codes are on different disks, reliability is improved. However, it doesn't address the parallelism of data transmission well, and the design of controllers is quite challenging. For RAID5, most data transfers involve operations on only one disk, enabling parallel operations. In RAID5, there is a “write penalty,” meaning that each write operation generates four actual read/write operations: two reads for old data and parity information, and two writes for new data and parity information.
RAID6 is an independent disk structure with two types of distributed storage parity check codes. RAID6 extends RAID5 and is mainly used in situations where data must be absolutely error-free. Due to the introduction of the second parity check value, it requires N+2 disks, making the design of controllers extremely complex. However, it enhances the data reliability of the disk array. It requires more space to store the parity check values, and it also incurs higher performance loss during write operations. RAID6 technology is widely used in today's distributed storage servers. RAID6 can recover from the failure of up to two blocks, but each data recovery operation is still constrained by the speed limitations of reading a large amount of data from each disk. Therefore, there is an urgent need to improve the encoding and decoding methods for a RAID6 disk array.
In view of this, it is necessary to solve the problem of data recovery limitations due to the traditional RAID6 encoding and decoding methods being constrained by data read volume. The embodiments of the present disclosure provide an encoding method for a RAID6 disk array, a decoding method for a RAID6 disk array, an encoding apparatus for a RAID6 disk array, a decoding apparatus for a RAID6 disk array, a computer device, and a non-volatile storage medium.
According to a first aspect of the embodiments of the present disclosure, an encoding method for a RAID6 disk array is provided, wherein the encoding method comprises:
In some embodiments, the encoding method further comprises:
In some embodiments, the step of dividing all disks in a RAID6 disk array into two groups to obtain a first disk group and a second disk group comprises:
In some embodiments, the step of equally dividing all disks constituting the RAID6 disk array into two groups comprises:
In some embodiments, the step of equally dividing all disks constituting the RAID6 disk array into two groups comprises:
In some embodiments, the step of dividing all disks constituting the RAID6 disk array into two groups, with one group containing one more disk than the other comprises:
In some embodiments, the step of pairing all stripes of the RAID6 disk array to obtain several stripe pairs comprises:
In some embodiments, the load balancing of the RAID6 disk array can be achieved in any of the following ways: left rotation alignment, left rotation misalignment, right rotation alignment, and right rotation misalignment.
According to a second aspect of the embodiments of the present disclosure, decoding method for a RAID6 disk array is provided, wherein the RAID6 disk array is encoded by using the described encoding method, and the decoding method comprises:
In some embodiments, the decoding method further comprises:
in response to the stripe corresponding to the single disk error not belonging to any stripe pair, second decoded data is read in a manner where the minimum decoding unit consists of one stripe, wherein the second decoded data comprises all data from the other disks, excluding the disk where the single disk error occurred, on the stripe; and
According to a third aspect of the embodiments of the present disclosure, an encoding apparatus for a RAID6 disk array is provided, wherein the encoding apparatus comprises:
According to a fourth aspect of the embodiments of the present disclosure, wherein the RAID6 disk array is encoded by using the described encoding apparatus, and the decoding apparatus comprises:
In some embodiments, the decoding apparatus further comprises:
According to a fifth aspect of the embodiments of the present disclosure, a computer device is further provided, wherein the computer device comprises:
According to a sixth aspect of the embodiments of the present disclosure, a non-volatile readable storage medium is further provided, wherein the non-volatile readable storage medium stores computer programs, wherein when the computer programs are executed by a processor, the processor performs the described encoding method for a RAID6 disk array or the described decoding method for a RAID6 disk array.
The encoding method for a RAID6 disk array comprises: all disks in a RAID6 disk array are divided into two groups to obtain a first disk group and a second disk group; all stripes of the RAID6 disk array are paired to obtain several stripe pairs; and finally two parity codes of each strip in the several stripe pairs are calculated according to a first rule and a second rule. This method enables cross-coding of two stripes belonging to the same stripe pair based on disk grouping, enriching the encoding and decoding methods of RAID 6 disk arrays, reducing the amount of data required to be read for data recovery in the event of a single disk error, and enhancing the performance of RAID6.
In addition, embodiments of the present disclosure further provide a decoding method for a RAID6 disk array, an encoding apparatus for a RAID6 disk array, a decoding apparatus for a RAID6 disk array, a computer device, and a non-volatile readable storage medium, and these can also achieve the described technical effects, and details are not described herein again.
To describe the technical solutions in the embodiments of the present disclosure or in the prior art more clearly, the following briefly introduces the accompanying drawings required for describing the embodiments or the prior art. Apparently, the accompanying drawings in the following description show merely some embodiments of the present disclosure, and a person skilled in the art may still derive other embodiments from these accompanying drawings without creative efforts.
To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure clearer, the following describes the embodiments of the present disclosure in detail in combination with optional embodiments and with reference to the accompanying drawings.
It is noted that, in the embodiments of the present disclosure, all expressions of “first” and “second” are used to distinguish two entities or parameters with the same name but different characteristics. It can be determined that “first” and “second” are merely for convenience of description, and should not be understood as limitations to the embodiments of the present disclosure, and the subsequent embodiments will no longer individually explain this point.
In an embodiment, referring to
The encoding method for a RAID6 disk array comprises: all disks in a RAID6 disk array are divided into two groups to obtain a first disk group and a second disk group; all stripes of the RAID6 disk array are paired to obtain several stripe pairs; and finally two parity codes of each strip in the several stripe pairs are calculated according to a first rule and a second rule. This method enables cross-coding of two stripes belonging to the same stripe pair based on disk grouping, enriching the encoding and decoding methods of RAID 6 disk arrays, reducing the amount of data required to be read for data recovery in the event of a single disk error, and enhancing the performance of RAID6.
In some embodiments, the encoding method further comprises:
In some embodiments, the step of dividing all disks in a RAID6 disk array into two groups to obtain a first disk group and a second disk group comprises:
In some embodiments, the step of equally dividing all disks constituting the RAID6 disk array into two groups comprises:
In some embodiments, the step of equally dividing all disks constituting the RAID6 disk array into two groups comprises:
In some embodiments, the step of dividing all disks constituting the RAID6 disk array into two groups, with one group containing one more disk than the other comprises
In some embodiments, the step of pairing all stripes of the RAID6 disk array to obtain several stripe pairs comprises:
In some embodiments, the load balancing of the RAID6 disk array can be achieved in any of the following ways: left rotation alignment, left rotation misalignment, right rotation alignment, and right rotation misalignment.
In still another embodiment, referring to
The described decoding method for a RAID6 disk array allows for the recovery of erroneous data without the need to read all the data in the event of a single disk error, reducing the amount of data required to be read for data recovery in the event of a single disk error, thereby enhancing RAID6 performance.
In some embodiments, the decoding method further comprises:
In still another embodiment, the design of RAID6 aims to ensure that after the RAID group is assembled, errors in any two or one of the disk groups can be recovered. It is the most widely used erasure coding scheme in today's general storage products. However, for the error recovery of the RAID6, all the remaining data needs to be read for calculation, and therefore performance comparisons between different implementation solutions mainly focuses on the speed of data encoding and decoding. In actual application scenarios, although RAID6 can guarantee recovery from any two arbitrary errors, statistical data from real-world scenarios indicates that single-error situations account for 99.75% of all errors. Therefore, regardless of the optional implementation solution of any RAID, the core speed improvement should focus on enhancing performance in single-error scenarios. To facilitate understanding of the solutions according to the embodiments of the present disclosure, the algorithm principles of traditional RAID6, and the encoding method for a RAID6 disk array and decrypting method for a RAID6 disk array according to the embodiments of the present disclosure are separately described in this embodiment.
First part: the algorithm principles of traditional RAID6 are as follows:
Based on equation (2), the calculation of the parity codes p1 to p6 can be performed, thus completing the encoding configuration of RAID6 in the example as shown in
It can be determined from the equation (4) that, under traditional encoding and decoding methods, in the event of any (one or two) errors, the decoding of RAID6 needs to read and decode all the remaining data blocks. However, in a storage system, data reading is limited by a transmission channel and a protocol, which usually becomes the main limiting reasons for the speed of the operation; and therefore, the core of designing an advanced RAID6 solution is to consider how to reduce the amount of data read during encoding and decoding, thereby enhancing speed.
Second part: an optional implementation method of the encoding method for a RAID6 disk array provided in this embodiment is as follows:
It is suggested in the embodiment of the present disclosure to perform stripe division to obtain an even number of stripes, thus achieving the maximum optimization effect. If the stripe division can be performed only to obtain an odd number of stripes based on practical requirements, the advantages of the embodiment of the present disclosure will be affected to some extent, but can still be implemented, and an odd number is optionally taken as an example for illustration, and the exemplary division is shown in
(2) For the division of disks into two groups, labeled as groups A and B, the division method involves splitting the disks in half; and if the number of disks is an odd number n, the division results in two groups with numbers of
respectively. The division of the two groups can be performed sequentially, with the same division applied to every two stripes. If the total number of stripes is an odd number, for the remaining last stripe, no division is carried out and encoding and decoding are performed by directly using a traditional RAID6 solution, as shown in “remaining odd stripe” example in
It can be determined from equation (5) that the encoding parameter relationship of RAID6 is the same as the original RAID6 assignment method (Vandermonde), the first line of the equation of the encoding is the same, and the satisfaction condition of the second line of the equation, under the same parameter relationship, is adjusted to be AB group interleaving implementation. That is, in the encoding relationship of P1 and P2, the relationship in the first line is implemented using the original encoding relationship, and while the relationship in the second line is implemented using a cross-group method. For the event of an odd number of stripes, every two stripes form a relationship of the described equation (5), the remaining single stripe, as shown in the “remaining odd stripe” in
Third part: an optional implementation method of the method for decrypting the RAID6 disk array provided in this embodiment is as follows:
(a) for decoding in the event of a single error, whether a disk where the error occurred is in group A or group B is firstly determined, all surviving (correct) data blocks in the group where the error occurred are read, and then the data blocks of the odd (or even) stripes from the other group are read, thus completing the decoding process. Taking the situation where an error occurs to disk1 in
Similarly, when the even-numbered stripes are read, the described operation solution is:
It can be determined that when there is a single error, in the embodiment of the present disclosure, all data from the group where the error occurred is read, and additionally, for the data from the other group, only the data blocks from either the odd or even stripes need to be read; the decoding method is based on the relationship described in equation (5); and for different readings of odd or even stripes, it's only necessary to adjust the parameter relationships as shown in equations (6) and (7) (where the parameter relationships correspond to the solid or dashed lines in
(b) In the event of any two errors, the decoding method is similar to the traditional decoding method of RAID6, it is required to read all the remaining data and then decoding is performed based on a method similar to the traditional decoding method of RAID6. For example, if errors occur on disks 1 and 2, the decoding method is as follows: for the scenario of two errors, because the solution of the embodiments of the present disclosure divides all data into two groups during encoding, there are two possible scenarios for two errors: both errors occur within the same group, or each error occurs in a different group. The following provides examples for each scenario.
b1: when two errors occur in the same group, the scenario where errors occur in disk 1 and disk 3 is used as an example for illustration. In this case, for taking the scenario where data blocks d1, d3, d5, and d7 have errors and need recovery as an example, the data relationship is as follows:
It can be determined from equation (8) that when errors occur in the four data blocks within the same group, a decoding relationship conforms to the decoding relationship of RAID6, but when decoding a single stripe, the amount of data read is greater than the amount of data of one stripe. However, as expressed in equation (8), when every two stripe are set as a minimum unit for decoding, the amount of data read is exactly the same as the traditional decoding of RAID6.
b2. When two errors occur in different groups, the scenario where errors occur on disks 1 and 4 is taken as an example for illustration. In this case, for taking the scenario where four data blocks d1, d4, d5 and p3 have errors and need recovery as an example, the data relationship is as follows:
For ease of description, the four relational equations in equation (9) are numbered as “1, 2, 3, 4”. It can be determined that, in this case, if a traditional operation method of RAID6 stripes is used, it would be impossible to perform decoding; and therefore, when two errors occur in different groups, two stripes are decoded in different groups each time, decoding is performed with two stripes as the minimum unit, and thus the relationship shown in equation (9) is obtained. In this case, elimination processing is performed on 1 and 2 based on d2, and elimination processing is performed on 3 and 4 based on d5 (the elimination processing in this step has only a unique solution, or elimination being performed on 2 and 3 and elimination being performed on 1 and 4), thereby obtaining:
If the requirement for the polynomial to have a solution and to have a unique solution is satisfied, d4 and p3 can be decoded based on equation (10) using the method of RAID6, and similarly, d1 and d5 are obtained accordingly, thereby completing the decoding operations for all data. It can be determined that the amount of data read in this case is the same as that in the traditional method of RAID6.
In conclusion, according to the solution provided in the embodiments of the present disclosure, when decoding is performed, the minimum decoding unit is changed to an even number of stripes, so that the requirement for the amount of data block read being reduced by mn/4 (the number of stripes satisfying an even number relationship is m, and the number of disks satisfying an even number relationship is n) when there is a single error can be satisfied; and when there are two errors, the amount of date read during decoding is the same as that of RAID6. In addition, for the stripes that do not conform to an even number of stripes (the remaining one stripe in the case of odd numbers), the traditional operations of RAID6 are used; and in the implementation architecture of the embodiment of the present disclosure, although operations are performed with a minimum unit of two stripes each time, in this case, the operation for the remaining stripe is performed by padding with 0. In practical scenarios, stripe division is determined by design, and therefore this case usually does not occur.
According to the encoding method for a RAID6 disk array and the decoding method for a RAID6 disk array in the embodiments of the present disclosure, when a single error occurs, the amount of data read for recovery can be reduced by about half, thereby achieving the advantage of increasing the speed by about one time; and during encoding or double error decoding, by means of pipeline reuse, the actual speed can reach the characteristic of standard RAID6, thereby achieving the improvement in decoding speed for a single error with relatively small loss.
In still another embodiment, referring to
By using the encoding apparatus 300 for a RAID6 disk array, all disks in a RAID6 disk array are divided into two groups to obtain a first disk group and a second disk group; all stripes of the RAID6 disk array are paired to obtain several stripe pairs; and finally two parity codes of each strip in the several stripe pairs are calculated according to a first rule and a second rule. This apparatus enables cross-coding of two stripes belonging to the same stripe pair based on disk grouping, enriching the encoding and decoding methods of RAID 6 disk arrays, reducing the amount of data required to be read for data recovery in the event of a single disk error, and enhancing the performance of RAID6.
In some embodiments, the encoding apparatus 300 further comprises:
In some embodiments, the disk grouping module 301 is configured to:
In some embodiments, the disk grouping module 301 is configured to:
The disk grouping module 301 is configured to:
In some embodiments, the disk grouping module 301 is configured to:
In some embodiments, the stripe pairing module 302 is configured to:
In some embodiments, the load balancing of the RAID6 disk array can be achieved in any of the following ways: left rotation alignment, left rotation misalignment, right rotation alignment, and right rotation misalignment.
It is noted that, for the definition of an encoding apparatus for a RAID6 disk array, reference may be made to the described definition of the encoding method for a RAID6 disk array, and details are not repeatedly described herein. All or a part of the modules in the described encoding apparatus for a RAID6-disk array may be implemented by software, hardware, or a combination thereof. The described modules may be embedded in or independent from a processor in a computer device in a hardware form, and may also be stored in a memory in the computer device in a software form, so that the processor invokes and executes operations corresponding to the described modules.
In still another embodiment, referring to
The described decoding apparatus 400 for a RAID6 disk array allows for the recovery of erroneous data without the need to read all the data in the event of a single disk error, reduce the amount of data required to be read for data recovery in the event of a single disk error, thereby enhancing RAID6 performance.
In some examples, the decoding apparatus 400 further comprises:
According to another aspect of the embodiments of the present disclosure, a computer device is provided. The computer device may be a server. Please refer to
According to another aspect of the embodiments of the present disclosure, a non-volatile readable storage medium is provided, wherein a computer program is stored on the non-volatile readable storage medium, and the computer program when being executed by a processor, implements the described encoding method for a RAID6 disk array or decoding method for a RAID6 disk array.
A person skilled in the art may understand that all or a part of the processes of the methods in the described embodiments may be implemented by a computer program instructing relevant hardware. The computer program may be stored in a non-transitory computer readable storage medium. The computer program, when being executed, may implement the processes of the methods in the described embodiments. Any reference to memory, storage, database, or other media used in the embodiments of the present disclosure may include non-volatile and/or volatile memory. The non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. The volatile memory may include random access memory (RAM) or external high-speed cache memory. By way of illustration and not limitation, RAM is available in various forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus Direct RAM (RDRAM), Direct Rambus DRAM (DRDRAM), and Rambus Dynamic RAM (RDRAM), among others.
The various technical features of the described embodiments may be combined in any way. For brevity of description, not all possible combinations of the technical features in the described embodiments have been described. However, as long as combinations of these technical features are not contradictory, all these technical features is considered to belong to the scope of the present description.
The described embodiments merely express several implementations of the embodiments of the present disclosure, and the descriptions thereof are relatively rich and detailed, but are not intended to limit the scope of the present disclosure. It is noted that, for a person skilled in the art, various modifications and improvements may be made without departing from the concept of the embodiments of the present disclosure, and all these modifications and improvements belong to the scope of protection of the embodiments of the present disclosure. Therefore, the scope of protection of the embodiments of the present disclosure shall be subject to the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
202210887332.0 | Jul 2022 | CN | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2023/077973 | 2/23/2023 | WO |