A method, device, equipment and readable medium for improving RAID reliability
By adjusting the RAID data reconstruction algorithm, selecting more disks than the number of stripes, and setting up a hot spare disk, the RAID reliability and maintainability issues were resolved, achieving the effect of improving system reliability without increasing the number of disks.
Patent Information
- Application Number
- CN202211034881.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-08-26
AI Technical Summary
As the number of disks increases, the failure rate of RAID rises, and existing technologies struggle to improve the reliability and maintainability of RAID without adding more disks.
By selecting disks with a number of stripes greater than or equal to twice the number of stripes in each RAID configuration, calculating the least common multiple of the stripe size and the number of disks, setting up a hot spare disk, and checking whether the number of stripes in each RAID group exceeds a threshold when a disk fails, the system ensures that the data can be successfully reconstructed.
Significantly improves RAID reliability and maintainability without adding disks, allowing for successful data reconstruction even when more disks fail, thus enhancing overall system reliability.
Smart Images

Figure CN115391088B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computers, and more particularly to a method, device, equipment and readable medium for improving RAID reliability. BACKGROUND
[0002] With the increasing demand for disk capacity, the number of disks is also increasing, and the failure rate caused by the increase in the number will rise sharply. For this reason, the RAID technology emerges as the times require, and different RAID combinations are formed according to different requirements, and the respective demands on IO speed, disk utilization and reliability can be met.
[0003] RAID (Redundant Array of Independent Disks) is a technology that simulates a disk to provide services by arranging and assigning responsibilities to multiple disks (such as 5 disks). SUMMARY
[0004] Therefore, the purpose of the embodiments of the present application is to provide a method, device, equipment and readable medium for improving RAID reliability, which can improve the reliability of the RAID without increasing the number of disks, and can greatly improve the reliability and maintainability of the entire system.
[0005] Based on the above purpose, one aspect of an embodiment of the present application provides a method for improving RAID reliability, comprising the following steps:
[0006] Selecting a corresponding number of disks to form a RAID based on the size of each stripe in the RAID to be formed (the number of stripes contained in the stripe);
[0007] Calculating the number of stripes contained in each group based on the size of the stripe and the number of disks, and dividing the stripes in the RAID into a plurality of groups based on the number of stripes;
[0008] In response to disk damage, checking whether the number of stripes (a piece of data in each disk in the stripe) in each stripe (a technology for distributing data in the RAID to multiple disks for parallel use at the same time) in each group exceeds a threshold value;
[0009] In response to the number of stripes in each stripe in each group not exceeding the threshold value, determining that the data in the RAID can be successfully reconstructed.
[0010] According to one embodiment of the present application, selecting a corresponding number of disks to form a RAID based on the size of each stripe in the RAID to be formed comprises:
[0011] determining the number of stripes in each stripe size in the RAID to be formed;
[0012] selecting disks equal to or greater than twice the number of stripes to form the RAID.
[0013] According to one embodiment of the present application, the number of stripes contained in each group is calculated based on the stripe size and the number of disks, and the stripes in the RAID are divided into several groups based on the number of stripes.
[0014] The least common multiple of the stripe size and the number of disks is calculated to obtain the number of stripes contained in each group.
[0015] According to one embodiment of the present application, it further comprises:
[0016] A hot spare disk is set in the RAID, wherein the number of hot spare disks is calculated according to the formula 2*number of disks / size of stripe.
[0017] Another aspect of the embodiment of the present application further provides a device for improving the reliability of a RAID, the device comprising:
[0018] A selecting module configured to select a corresponding number of disks to form the RAID based on the size of each stripe in the RAID to be formed;
[0019] A calculating module configured to calculate the number of stripes contained in each group based on the stripe size and the number of disks, and divide the stripes in the RAID into several groups based on the number of stripes.
[0020] A judging module configured to check whether the number of stripes in each stripe in each group exceeds a threshold value in the damaged disk in response to disk damage.
[0021] A determining module configured to determine that the data in the RAID can be successfully reconstructed in response to the number of stripes in each stripe in each group not exceeding the threshold value in the damaged disk.
[0022] According to one embodiment of the present application, the selecting module is further configured to:
[0023] determining the number of stripes in each stripe size in the RAID to be formed;
[0024] selecting disks equal to or greater than twice the number of stripes to form the RAID.
[0025] According to one embodiment of the present application, the calculating module is further configured to:
[0026] The least common multiple of the stripe size and the number of disks is calculated to obtain the number of stripes contained in each group.
[0027] According to one embodiment of the present application, the method further comprises a setting module configured to:
[0028] The hot spare disks are set in the RAID, wherein the number of the hot spare disks is calculated according to the formula: 2*number of disks / strip size.
[0029] According to another aspect of the embodiments of the present application, a computer device is further provided, which comprises:
[0030] at least one processor; and
[0031] a memory storing computer instructions executable on the processor, the instructions being executed by the processor to implement the steps of any of the above methods.
[0032] According to another aspect of the embodiments of the present application, a computer readable storage medium is further provided, which stores a computer program, the computer program being executed by a processor to implement the steps of any of the above methods.
[0033] The present application has the following beneficial technical effects: the method for improving the reliability of the RAID provided by the embodiments of the present application can form the RAID by selecting a corresponding number of disks based on the size of each strip in the RAID to be formed; calculate the number of strips contained in each group based on the size of the strip and the number of disks, and divide the strips in the RAID into a plurality of groups based on the number of strips; in response to disk damage, check whether the number of stripes in each strip in each group in the damaged disk exceeds a threshold value; and in response to the number of stripes in each strip in each group in the damaged disk not exceeding the threshold value, determine a technical solution that the data in the RAID can be successfully reconstructed, which can improve the reliability of the RAID without increasing the number of disks, and can greatly improve the reliability and maintainability of the entire system. BRIEF DESCRIPTION OF DRAWINGS
[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other embodiments according to these drawings without creative labor.
[0035] Figure 1 a schematic flow chart of the method for improving the reliability of the RAID according to one embodiment of the present application;
[0036] Figure 2 a schematic diagram of the device for improving the reliability of the RAID according to one embodiment of the present application;
[0037] Figure 3a schematic diagram of a computer device according to an embodiment of the present application;
[0038] Figure 4 a schematic diagram of a computer readable storage medium according to an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the objects, technical solutions and advantages of the present application clearer, further detailed description will be made to the embodiments of the present application with reference to the specific embodiments and the accompanying drawings.
[0040] Based on the above purpose, in a first aspect of the embodiments of the present application, an embodiment of a method for improving RAID reliability is provided. Figure 1 A schematic flow chart of the method is shown.
[0041] As shown in the method shown in the above table 1, the method can include the following steps: Figure 1
[0042] S1, based on the size of each stripe in the RAID to be formed, a corresponding number of disks are selected to form the RAID. Generally, the size of each stripe in the RAID is 5, when selecting the number of disks, the number of disks should be more than 2 times the size of the stripe (including 2 times), that is, at least 10 disks are selected to form the RAID.
[0043] S2, based on the stripe size and the number of disks, the number of stripes contained in each group is calculated, and the stripes in the RAID are divided into several groups based on the number of stripes. A plurality of stripes is formed into a group, and the cycle is performed in units of groups until the entire disk space is occupied, the number of stripes contained in each group = the least common multiple of the stripe size and the number of disks, as shown in the following table 1, the stripe size is 5, the number of disks is 11, and the least common multiple is 55, then a total of 55 stripes are contained in each group, and the cycle is performed in units of groups until the entire disk space is occupied, the number of stripes in each group is the same.
[0044] Table 1 RAID stripe distribution
[0045]
[0046] S3, in response to disk damage, it is checked whether the number of stripes in each stripe in each group exceeds a threshold value. When multiple disks in the RAID fail, each stripe in a group is checked one by one, as long as each stripe does not exceed 2 stripes in the damaged disk, the RAID will not fail.
[0047] S4, in response to the number of stripes in each stripe in each group not exceeding the threshold value, it is determined that the data in the RAID can be successfully reconstructed. As shown in the following table 2, when 4 disks are damaged at the same time, since each stripe does not exceed 2 stripes, the data can still be successfully reconstructed.
[0048] Table 2 RAID 4 disk damage
[0049]
[0050] The present application uses the characteristic that the number of RAID disks is much larger than the number of stripes, adjusts the RAID data recombination algorithm, allows more failed disks than the original number of failed disks, and improves the reliability, especially when a large number of disks form a RAID. Taking RAID6 as an example, it originally allows 2 failed disks, but using the method of the present application, it can allow 3, 4 or even more failed disks.
[0051] By using the technical solution of the present application, the reliability of the RAID can be improved without increasing the number of disks, and the reliability and maintainability of the entire system can be greatly improved.
[0052] In a preferred embodiment of the present application, the corresponding number of disks is selected to form the RAID based on the size of each stripe in the RAID to be formed, including:
[0053] The number of stripes in the size of each stripe in the RAID to be formed is determined.
[0054] At least 10 disks are selected to form the RAID. The number of stripes in the RAID is usually 5, so at least 10 disks are selected to form the RAID.
[0055] In a preferred embodiment of the present application, the number of stripes contained in each group is calculated based on the size of the stripe and the number of disks, and the stripes in the RAID are divided into several groups based on the number of stripes, including:
[0056] The least common multiple of the size of the stripe and the number of disks is calculated to obtain the number of stripes contained in each group. For example, when the size of the stripe is 5 and the number of disks is 11, the number of stripes contained in each group is 55, and the cycle is in units of groups until the entire disk space is occupied, and the number and arrangement of the stripes in each group are the same.
[0057] In a preferred embodiment of the present application, it further includes:
[0058] A hot spare disk is set in the RAID, and the number of hot spare disks is calculated by the formula 2*number of disks / size of stripe. Based on the result of increasing the number of failed disks allowed, a certain number of hot spare disks can be set, the number of hot spare disks is consistent with the number of failed disks allowed, and the number of hot spare disks is: 2*number of disks / size of stripe. When the size of the stripe is 5 and the number of disks is 11, the number of hot spare disks is 4 disks.
[0059] By using the technical solution of the present application, the reliability of the RAID can be improved without increasing the number of disks, and the reliability and maintainability of the entire system can be greatly improved. The method of the present application allows the number of damaged disks to be significantly increased, and when the total number of disks in the system increases, such as 128 disks or even more, the system reliability is significantly increased.
[0060] It should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by a computer program to instruct relevant hardware to complete. The above-mentioned program can be stored in a computer readable storage medium, and when the program is executed, the program can include the processes of the above-mentioned embodiment methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as the corresponding any of the above-mentioned method embodiments.
[0061] In addition, the method disclosed by the embodiment of the present application can also be implemented as a computer program executed by a CPU, which can be stored in a computer readable storage medium. When the computer program is executed by the CPU, the above-mentioned functions defined in the method disclosed by the embodiment of the present application are executed.
[0062] Based on the above-mentioned purpose, a second aspect of the embodiment of the present application proposes a device for improving the reliability of a RAID, as shown in Figure 2 The device 200 includes:
[0063] A selection module, the selection module is configured to select a corresponding number of disks to form a RAID based on the size of each stripe in the RAID to be formed;
[0064] A calculation module, the calculation module is configured to calculate the number of stripes contained in each group based on the stripe size and the number of disks, and divide the stripes in the RAID into a plurality of groups based on the number of stripes;
[0065] A judgment module, the judgment module is configured to check whether the number of stripes in each stripe in each group exceeds a threshold value in the damaged disk in response to the disk damage;
[0066] A determination module, the determination module is configured to determine that the data in the RAID can be successfully reconstructed in response to the number of stripes in each stripe in each group not exceeding the threshold value in the damaged disk.
[0067] In a preferred embodiment of the present application, the selection module is further configured to:
[0068] Determine the number of stripes in each stripe size in the RAID to be formed;
[0069] Select disks greater than or equal to twice the number of the number of bands to form the RAID.
[0070] In a preferred embodiment of the present application, the computing module is further configured to:
[0071] Calculate the least common multiple of the stripe size and the number of disks to obtain the number of stripes contained in each group.
[0072] In a preferred embodiment of the present application, a setting module is further included, which is configured to:
[0073] Set the hot spare disks in the RAID, wherein the number of the hot spare disks is calculated according to the formula 2*number of disks / stripe size.
[0074] Based on the above purpose, a third aspect of the embodiments of the present application provides a computer device. Figure 3 An embodiment of the computer device provided by the present application is shown in the schematic diagram. As shown in the figure, Figure 3 The embodiment of the present application includes the following devices: at least one processor 21; and a memory 22, the memory 22 stores computer instructions 23 that can run on the processor, and the instructions are executed by the processor to implement the following method:
[0075] Select a corresponding number of disks to form the RAID based on the size of each stripe in the RAID to be formed;
[0076] Calculate the number of stripes contained in each group based on the stripe size and the number of disks, and divide the stripes in the RAID into a plurality of groups based on the number of stripes;
[0077] In response to the number of bands in each stripe in each group in the damaged disk exceeding the threshold value, determine that the data in the RAID cannot be successfully reconstructed.
[0078] In response to the number of bands in each stripe in each group in the damaged disk not exceeding the threshold value, determine that the data in the RAID can be successfully reconstructed.
[0079] In a preferred embodiment of the present application, selecting a corresponding number of disks to form the RAID based on the size of each stripe in the RAID to be formed includes:
[0080] Determine the number of bands in each stripe size in the RAID to be formed;
[0081] Select disks greater than or equal to twice the number of the number of bands to form the RAID.
[0082] In a preferred embodiment of the present application, calculating the number of stripes contained in each group based on the stripe size and the number of disks, and dividing the stripes in the RAID into a plurality of groups based on the number of stripes includes:
[0083] The minimum common multiple of the stripe size and the number of disks is calculated to obtain the number of stripes contained in each group.
[0084] In a preferred embodiment of the present application, further comprising:
[0085] Hot spare disks are set in the RAID, wherein the number of hot spare disks is calculated according to the formula 2*number of disks / stripe size.
[0086] To achieve the above object, a fourth aspect of the embodiments of the present application provides a computer readable storage medium. Figure 4 An embodiment of the computer readable storage medium provided by the present application is shown in the schematic diagram. As shown in the figure, Figure 4 The computer readable storage medium 31 stores a computer program 32 which, when executed by a processor, performs the following method:
[0087] Based on the size of each stripe in the RAID to be formed, a corresponding number of disks are selected to form the RAID;
[0088] Based on the stripe size and the number of disks, the number of stripes contained in each group is calculated, and the stripes in the RAID are divided into several groups based on the number of stripes;
[0089] In response to the number of stripes in each stripe in each group in the damaged disk exceeding the threshold value, it is determined that the data in the RAID cannot be successfully reconstructed.
[0090] In response to the number of stripes in each stripe in each group in the damaged disk not exceeding the threshold value, it is determined that the data in the RAID can be successfully reconstructed.
[0091] In a preferred embodiment of the present application, based on the size of each stripe in the RAID to be formed, a corresponding number of disks are selected to form the RAID, which includes:
[0092] The number of stripes in each stripe size in the RAID to be formed is determined;
[0093] A number of disks greater than or equal to twice the number of stripes are selected to form the RAID.
[0094] In a preferred embodiment of the present application, based on the stripe size and the number of disks, the number of stripes contained in each group is calculated, and the stripes in the RAID are divided into several groups based on the number of stripes, which includes:
[0095] The minimum common multiple of the stripe size and the number of disks is calculated to obtain the number of stripes contained in each group.
[0096] In a preferred embodiment of the present application, further comprising:
[0097] Hot spare disks are set in the RAID, wherein the number of hot spare disks is calculated according to the formula 2*number of disks / stripe size.
[0098] Furthermore, the method according to the embodiments of the present application can also be implemented as a computer program executed by a processor, which can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the above-mentioned functions defined in the method according to the embodiments of the present application are performed.
[0099] Furthermore, the above-mentioned method steps and system units can also be implemented by means of a controller and a computer-readable storage medium for storing a computer program which causes the controller to implement the above-mentioned steps or unit functions.
[0100] Those skilled in the art will further understand that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
[0101] In one or more exemplary designs, the functions described can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media can be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code means in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or other wire-based, fiber-based, or wireless technologies, then the coaxial cable, fiber optic cable, twisted pair, DSL, or other wire-based, fiber-based, or wireless technologies are included in the definition of medium. Disk and disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0102] The foregoing is a summary of the example embodiments disclosed herein, but it should be noted that various changes and modifications can be made without departing from the scope of the embodiments disclosed by the claims. The functions, steps and / or actions of the method claims described herein need not be performed in any particular order. Furthermore, although elements of the embodiments disclosed herein can be described or claimed in individual form, other embodiments can also include a plurality of those elements in combination.
[0103] It should be understood that, as used herein, "a" or "an" can mean one or more things unless context clearly indicates otherwise. It should also be understood that "and / or" as used herein means any and all possible combinations of one or more of the associated listed items.
[0104] The above-mentioned example embodiment numbers of the embodiments disclosed herein are merely for description, and do not represent the advantages or disadvantages of the embodiments.
[0105] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by program instructing relevant hardware to complete, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0106] Those skilled in the art shall understand that the above discussion of any embodiment is only exemplary, and is not intended to imply that the scope (including claims) of the embodiments of the present application is limited to these examples; the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes of different aspects of the embodiments of the present application as above. In order to be brief, they are not provided in details. Therefore, any omission, modification, equivalent replacement, improvement, etc. made in the spirit and principle of the embodiments of the present application shall be included in the protection scope of the embodiments of the present application.
Claims
1. A method for improving RAID reliability, characterized in that, Includes the following steps: Select the appropriate number of disks to form a RAID based on the size of each stripe in the RAID to be constructed; The number of stripes in each group is calculated based on the stripe size and the number of disks, and the stripes in the RAID are divided into several groups based on the number of stripes; In response to disk failure, check whether the number of stripes in each stripe within each group on the failed disk exceeds a threshold. If the number of stripes in each stripe within each group on the damaged disk does not exceed a threshold, it is determined that the data in the RAID can be successfully rebuilt.
2. The method according to claim 1, characterized in that, Based on the size of each stripe in the RAID to be constructed, select the appropriate number of disks to form the RAID, including: Determine the number of stripes in each stripe size of the RAID to be constructed; Select disks with a number of stripes or more than twice the number of stripes to form a RAID.
3. The method according to claim 1, characterized in that, The number of stripes in each group is calculated based on the stripe size and the number of disks, and the stripes in the RAID are divided into several groups based on the number of stripes, including: Calculate the least common multiple of the stripe size and the number of disks to obtain the number of stripes contained in each group.
4. The method according to claim 1, characterized in that, Also includes: In RAID, the number of hot spare disks is calculated using the formula: 2 * number of disks / stripe size.
5. A device for improving RAID reliability, characterized in that, The device includes: The selection module is configured to select a corresponding number of disks to form a RAID based on the size of each stripe in the RAID to be formed. The calculation module is configured to calculate the number of stripes in each group based on the stripe size and the number of disks, and to divide the stripes in the RAID into several groups based on the number of stripes. The judgment module is configured to check, in response to disk failure, whether the number of stripes in each stripe within each group on the damaged disk exceeds a threshold. A determination module is configured to determine that data in the RAID can be successfully rebuilt in response to the fact that the number of stripes in each stripe within each group does not exceed a threshold in the damaged disk.
6. The apparatus according to claim 5, characterized in that, The selection module is also configured to: Determine the number of stripes in each stripe size of the RAID to be constructed; Select disks with a number of stripes or more than twice the number of stripes to form a RAID.
7. The apparatus according to claim 5, characterized in that, The computing module is also configured to: Calculate the least common multiple of the stripe size and the number of disks to obtain the number of stripes contained in each group.
8. The apparatus according to claim 5, characterized in that, It also includes a settings module, which is configured as follows: In RAID, the number of hot spare disks is calculated using the formula: 2 * number of disks / stripe size.
9. 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.
10. 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
Disk array data recovery method and device based on RAID6
CN111737049A
Disk array data recovery method and system, storage medium, and equipment
CN114090345A