Function test method, device and equipment for redundant array of independent disks
By comparing the verification blocks on the calculation block and the write band, and reconstructing the blocks with the original blocks, the accuracy and reliability problems of the existing RAID functional testing methods are solved, and more efficient functional testing is achieved.
Patent Information
- Application Number
- CN202412000462.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The existing RAID functional testing methods have accuracy, authenticity and reliability problems, and it is impossible to effectively determine whether the redundant array of independent disks can recover data normally when multiple disks fail at the same time.
By obtaining the write strips of the data written in the redundant array of independent disks to be tested, comparing the calculation blocks and the verification blocks on the write strips, and determining whether the verification function is normal; at the same time, by comparing the reconstruction blocks with the original blocks, determining whether the reconstruction function is normal.
It improves the accuracy and reliability of RAID functional testing, can more accurately detect data consistency problems and reconstruction function abnormalities, and reduces troubleshooting time.
Smart Images

Figure CN119851732A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing, and in particular to a method, a device and equipment for testing the function of an independent disk redundant array. Background Art
[0002] At present, RAID testing (Redundant Array of Independent Disks) mainly relies on pure black box testing methods, which compare the original hash value of a large file with the reconstructed hash value to determine whether the RAID can recover data normally when multiple disks fail at the same time. The black box testing method cannot reflect the actual situation, that is, it cannot determine whether multiple disks fail at the same time, and the comparison of the hash value of a large file cannot truly reflect the consistency of the data, so this testing method has a lot of uncertainty.
[0003] Therefore, how to improve the accuracy, authenticity and reliability of RAID function testing is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a method, device and equipment for functional testing of a redundant array of independent disks, which solves the problems of accuracy, authenticity and reliability of RAID functional testing in the prior art.
[0005] In order to solve the above technical problems, the present invention provides a functional testing method of a redundant array of independent disks, comprising:
[0006] Obtaining a write stripe of written data in the redundant array of independent disks to be tested;
[0007] Determining whether the check function of the independent disk redundant array to be tested is normal by comparing the calculation block with the check block on the write stripe; the calculation block is calculated based on the data block on the write stripe;
[0008] Whether the reconstruction function of the independent disk redundant array to be tested is normal is determined by comparing the reconstructed blocks with the original blocks in the independent disk redundant array to be tested; the reconstructed blocks are reconstructed when a disk in the independent disk redundant array to be tested is offline.
[0009] On the one hand, obtaining a write stripe of written data in a redundant array of independent disks to be tested includes:
[0010] Determine the storage area for writing data according to the write request sent by the host;
[0011] Determine a stripe address of the write data from the storage area according to a mapping method;
[0012] The write stripe is determined according to the stripe address.
[0013] On the one hand, after obtaining the write stripe of the written data in the redundant array of independent disks to be tested, it also includes:
[0014] Obtaining a preset number of stripes, where the preset number of stripes is less than or equal to the number of write stripes;
[0015] Selecting the target write stripes of the preset stripe quantity from the write stripes;
[0016] Correspondingly, determining whether the check function of the redundant array of independent disks to be tested is normal by comparing the calculation block with the check block on the write stripe includes:
[0017] Whether the check function of the redundant array of independent disks to be tested is normal is determined by comparing the calculation block with the check block on the target write stripe.
[0018] On the one hand, determining whether the check function of the redundant array of independent disks to be tested is normal by comparing the calculation block with the check block on the write stripe includes:
[0019] Determining the target number of check blocks according to the type of the redundant array of independent disks to be tested;
[0020] Get the number of check blocks corresponding to each write stripe;
[0021] Determine whether the number of check blocks corresponding to each write stripe is consistent with the target number of check blocks;
[0022] If they are inconsistent, the check function of the redundant array of independent disks to be tested is abnormal;
[0023] If they are consistent, then obtain a preset calculation method corresponding to the independent redundant array to be tested, determine the check blocks and data blocks on each write stripe in the independent redundant array to be tested according to the spatial distribution mode of the independent redundant array to be tested, calculate the data blocks on each write stripe according to the preset calculation method, and obtain the calculation blocks on each write stripe. If the calculation blocks on each write stripe are consistent with the check blocks on each write stripe, the check function of the independent redundant array to be tested is normal; if the calculation blocks on each write stripe are inconsistent with the check blocks on each write stripe, the check function of the independent redundant array to be tested is abnormal;
[0024] The number of target check blocks is consistent with the number of the preset calculation method; the check blocks on each write stripe correspond one-to-one to the preset calculation method; the new check value is stored in the calculation block; the number of calculation blocks on each write stripe is consistent with the number of check blocks on each write stripe.
[0025] On the one hand, when a disk in the redundant array of independent disks to be tested is offline, reconstruction is performed to obtain reconstructed blocks, including:
[0026] Determine the number of offline disks N according to the type of the redundant array of independent disks to be tested;
[0027] Performing offline processing on N disks in the redundant array of independent disks to be tested;
[0028] When the disk is offline, the write stripe is analyzed to determine missing blocks on the write stripe;
[0029] The missing block is reconstructed using a preset reconstruction method to obtain a reconstructed block corresponding to the missing block, wherein the reconstructed block stores a reconstruction value.
[0030] On the one hand, determining whether the reconstruction function of the redundant array of independent disks to be tested is normal by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested includes:
[0031] Obtaining an original block corresponding to the missing block from the redundant array of independent disks to be tested; the original block stores an original value;
[0032] If the original block is consistent with the reconstructed block, the reconstruction function of the redundant array of independent disks to be tested is normal;
[0033] If the original block is inconsistent with the reconstructed block, the reconstruction function of the redundant array of independent disks to be tested is abnormal.
[0034] On the one hand, before determining whether the reconstruction function of the redundant array of independent disks to be tested is normal by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested, the method further includes:
[0035] If the verification function of the redundant array of independent disks to be tested is normal, stop writing data, and perform the step of determining whether the reconstruction function of the redundant array of independent disks to be tested is normal by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested;
[0036] If the verification function of the redundant array of independent disks to be tested is abnormal, the test ends.
[0037] The present invention also provides a functional testing device for a redundant array of independent disks, comprising:
[0038] A write stripe acquisition module is used to acquire the write stripe of the written data in the redundant array of independent disks to be tested;
[0039] A verification function test module, used to determine whether the verification function of the independent disk redundant array to be tested is normal by comparing the calculation block with the verification block on the write stripe; the calculation block is calculated based on the data block on the write stripe;
[0040] The reconstruction function test module is used to determine whether the reconstruction function of the independent disk redundant array to be tested is normal by comparing the reconstructed blocks with the original blocks in the independent disk redundant array to be tested; the reconstructed blocks are reconstructed when there is a disk offline in the independent disk redundant array to be tested.
[0041] The present invention also provides a functional test device for a redundant array of independent disks, comprising:
[0042] Memory for storing computer programs;
[0043] The processor is used to implement the functional testing method of the redundant array of independent disks as described above when executing the computer program.
[0044] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the functional testing method of the redundant array of independent disks as described above is implemented.
[0045] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the functional testing method of the redundant array of independent disks when executed by a processor.
[0046] It can be seen from the above technical scheme that the present invention obtains the write stripe of the written data in the independent disk redundant array to be tested; determines whether the check function of the independent disk redundant array to be tested is normal by comparing the calculation block with the check block on the write stripe; the calculation block is calculated based on the data block on the write stripe; determines whether the reconstruction function of the independent disk redundant array to be tested is normal by comparing the reconstruction block with the original block in the independent disk redundant array to be tested; the reconstruction block is reconstructed when there is a disk offline in the independent disk redundant array to be tested. The beneficial effect of the present invention is that the present invention realizes the verification function test by comparing the calculation block with the check block on the write stripe; and realizes the reconstruction function test by comparing the reconstruction block with the original block in the independent disk redundant array to be tested. Such a test method is more transparent and more reliable than the existing test method; the method uses the block as the basic unit for comparison to make the test more accurate and more targeted; and the reconstruction block is directly compared with the original block, which can find small changes in data, can accurately find problems, effectively improve the problem location efficiency, and reduce the troubleshooting time.
[0047] In addition, the present invention also provides a functional testing device and equipment for a redundant array of independent disks, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0049] Figure 1 A flowchart of a method for functional testing of a redundant array of independent disks provided by an embodiment of the present invention;
[0050] Figure 2 A schematic diagram of a host and storage system architecture provided by an embodiment of the present invention;
[0051] Figure 3 An example flow chart of a functional test of a three-disk verification RAID provided by an embodiment of the present invention;
[0052] Figure 4 An example diagram of the logic flow of a three-disk check function verification script provided by an embodiment of the present invention;
[0053] Figure 5 An example diagram of a logic flow of a reconstructed functional test script provided by an embodiment of the present invention;
[0054] Figure 6 An example diagram of the logic flow of a data verification script provided by an embodiment of the present invention;
[0055] Figure 7 A schematic diagram of the structure of a functional test device for a redundant array of independent disks provided by an embodiment of the present invention;
[0056] Figure 8 A schematic structural diagram of a functional test device for a redundant array of independent disks provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] First, several nouns involved in the present invention are analyzed:
[0059] IO (Input / Output): read request / write request;
[0060] Vdbench: IO load reading and writing tool;
[0061] RAID (Redundant Arrays of Inexpensive Disks): Redundant Array of Independent Disks.
[0062] MD5: is a widely used cryptographic hash function that can generate a 128-bit (16-byte) hash value to ensure the integrity and consistency of information transmission.
[0063] The continuous improvement of global informatization is accelerating the generation of massive amounts of high-value data. The amount of data generated and required to be saved within enterprises has increased dramatically, and these exponentially growing high-value data have posed many challenges to the IT (information technology) departments of enterprises. In the era of big data, data is growing explosively, and the data consistency problem of storage systems has become a key challenge to ensure data reliability and system stability. Centralized storage systems achieve centralized management and maintenance of data by storing all data on one or more high-performance storage devices. This storage method not only simplifies the data management process and improves data access efficiency, but also effectively ensures data consistency through a centralized control mechanism. Data consistency verification can reflect the reconstruction function of RAID.
[0064] At present, RAID functional testing generally relies on a pure black box testing method: in the system management interface of the device under test, the RAID level is a RAID group with multiple verification RAID, and the RAID group capacity is recorded; a volume is created using the full capacity provided by the RAID, recorded as LUN1; LUN1 is mapped to the host, and a file system is created to mount it; a large file (File1) is written to LUN1, and the MD5 value (hash value) of File1 is calculated; the host uses the Vdbench test tool for continuous reading and writing; at the same time, any block (one, two or three) of the member disks in the RAID group or storage pool are unplugged, the status of the RAID group or storage pool is checked in the storage management interface, and the running status of the Vdbench tool is checked on the host side; the MD5 value of the file File1 is calculated, and compared with the MD5 value of File1 calculated above to determine whether the data is consistent.
[0065] The above test method has a large degree of randomness and cannot test RAID functions and requirements in a targeted manner. There are mainly the following problems: (1) The verification test is not sufficient: it is judged only by the host Vdbench and the reconstruction task progress display actively provided by the software, which lacks objectivity and rigor. In fact, whether the RAID is actually doing verification testing cannot be reflected through the test steps; (2) Using large files to calculate MD5 values for comparison to determine whether the data is consistent has great uncertainty and limitations. Verifying data consistency by calculating the MD5 value of a large file is an effective method, but it may not be enough to discover all potential data consistency problems. For example, if there are subtle errors in the RAID system during the reconstruction process, these errors may not affect the MD5 value, but may cause subtle changes in the data content.
[0066] In order to solve the above problems, the present invention proposes a functional testing method for a redundant array of independent disks. Figure 1 , Figure 1 A flowchart of a method for functional testing of a redundant array of independent disks provided by an embodiment of the present invention. The method may include:
[0067] S101: Obtain a write stripe of written data in a redundant array of independent disks to be tested.
[0068] The execution subject of this embodiment is a test terminal. This embodiment does not specifically limit the independent disk redundant array. For example, it can be RAID1, RAID5, RAID6 and other independent disk redundant arrays. The write stripe in this embodiment is a stripe of written data.
[0069] Furthermore, the above-mentioned obtaining of the write stripe of the written data in the redundant array of independent disks to be tested may specifically include the following steps:
[0070] Step 21: Determine the storage area for writing data according to the write request sent by the host;
[0071] Step 22: Determine a stripe address for writing data from the storage area according to the mapping method;
[0072] Step 23: Determine the write stripe according to the stripe address.
[0073] Specifically, please refer to Figure 2. There is business interaction IO between the host and the storage system. The storage system includes an upper module, a cache and pool volume module, a RAID array management module, and other modules such as the lower hard disk and boot of the storage system. In this embodiment, the host sends a write request to the storage system, and preliminarily determines the storage area through the upper module and the cache and pool volume module. According to the mapping method, the stripe address of the write data is further determined from the storage area through the RAID array management module and other modules such as the lower hard disk and drive of the storage system, and the write stripe is determined according to the stripe address.
[0074] S102: Determine whether the check function of the redundant array of independent disks to be tested is normal by comparing the calculation block with the check block on the write stripe; the calculation block is calculated based on the data block on the write stripe.
[0075] Step S102 is a step of testing the verification function of the independent disk redundant array to be tested. The verification function in this embodiment can be understood as whether the verification block on the stripe is actually calculated according to the preset calculation method, rather than being written arbitrarily. Therefore, this embodiment first obtains the verification block from the stripe, and the original verification value is stored in the verification block, and then recalculates the calculation block based on the data block on the stripe, and the new verification value is stored in the calculation block. Whether the verification function of the independent disk redundant array to be tested is normal is determined by comparing whether the original verification value and the new verification value are consistent. If they are consistent, it means that the verification function is normal; if they are inconsistent, it means that the verification function is abnormal.
[0076] It is understandable that the number of write stripes may be too many, and each write stripe contains data blocks and check blocks. If the check value is recalculated for each write stripe (i.e., the new check value of the block is calculated), the amount of calculation is large, which affects the test efficiency. Therefore, in this embodiment, the preset number of stripes can be obtained; the target write stripe with a preset number of stripes is selected from the write stripes; and the check block on the calculated block and the target write stripe is compared to determine whether the check function of the independent disk redundant array to be tested is normal. Among them, the preset number of stripes is less than or equal to the number of write stripes. In this embodiment, the preset number of stripes can be set by the user. If the RAID application scenario has higher data security requirements for RAID, the preset number of stripes can be set larger, so that the original check value and the new check value of the larger number of stripes are more reliable. This can not only ensure the reliability of the check function, but also improve the test efficiency of the check function.
[0077] Further, the above-mentioned determination of whether the check function of the redundant array of independent disks to be tested is normal by comparing the calculation block with the check block on the write stripe may specifically include the following steps:
[0078] Step 31: Determine the target check block quantity according to the type of the redundant array of independent disks to be tested;
[0079] Step 32: Obtain the number of check blocks corresponding to each write stripe;
[0080] Step 33: Determine whether the number of check blocks corresponding to each write stripe is consistent with the target number of check blocks;
[0081] Step 34: If they are inconsistent, the checksum function of the redundant array of independent disks to be tested is abnormal;
[0082] Step 35: If they are consistent, then obtain the preset calculation method corresponding to the independent redundant array to be tested, determine the check blocks and data blocks on each write stripe in the independent redundant array to be tested according to the spatial distribution mode of the independent redundant array to be tested, calculate the data blocks on each write stripe according to the preset calculation method, and obtain the calculation blocks on each write stripe. If the calculation blocks on each write stripe are consistent with the check blocks on each write stripe, the check function of the independent redundant array to be tested is normal. If the calculation blocks on each write stripe are inconsistent with the check blocks on each write stripe, the check function of the independent redundant array to be tested is abnormal.
[0083] Among them, the number of target check blocks is consistent with the number of preset calculation methods; the check blocks on each write stripe correspond one-to-one to the preset calculation method; the new check value is stored in the calculation block; the number of calculation blocks on each write stripe is consistent with the number of check blocks on each write stripe.
[0084] Specifically, the verification function test of the RAID of this embodiment can be divided into two parts: verification of the data volume of the verification block and whether the values in the verification block and the calculation block are consistent. If the independent disk redundant array to be tested is a RAID with three disk verification, each stripe should contain 3 verification blocks, and the preset calculation method of each verification block is different. If the number of verification blocks in the write stripe in the RAID is not 3, it can be directly determined that the verification function of the RAID is abnormal. If the number of verification blocks in the write stripe in the RAID is 3, which are p, q, and r respectively, then further use each preset calculation algorithm (P, Q, R) to calculate the data blocks on each write stripe to obtain 3 calculation blocks (p', q', r'), and compare p', q', r' with p, q, r respectively. If they are consistent, it means that the verification function of the RAID is normal; otherwise, the verification function of the RAID is abnormal. This embodiment performs the verification function test in two steps. When the number of verification blocks does not meet the conditions, the verification function is directly determined to be abnormal, and there is no need to calculate the calculation blocks, which saves time, reduces the amount of calculation, and also saves computing resources, and improves the test speed of the verification function. In addition, by comparing the calculation blocks with the verification blocks, it is possible to directly determine which verification block has an abnormality, thereby achieving accurate positioning.
[0085] S103: Determine whether the reconstruction function of the independent disk redundant array to be tested is normal by comparing the reconstructed blocks with the original blocks in the independent disk redundant array to be tested; the reconstructed blocks are reconstructed when a disk in the independent disk redundant array to be tested is offline.
[0086] Step S103 is a step of performing a reconstruction function test on the independent redundant array of disks to be tested. When performing the reconstruction function test, the disks in the independent redundant array of disks to be tested need to be processed offline, and the original blocks and the reconstructed blocks before and after the offline process are compared to determine whether the reconstruction function of the independent redundant array of disks to be tested is normal: if they are consistent, the reconstruction function is normal; if they are inconsistent, the reconstruction function is abnormal.
[0087] Furthermore, before determining whether the reconstruction function of the redundant array of independent disks to be tested is normal by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested, the following steps may also be included:
[0088] Step 41: If the verification function of the redundant array of independent disks to be tested is normal, stop writing data, and perform a step of determining whether the reconstruction function of the redundant array of independent disks to be tested is normal by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested;
[0089] Step 42: If the verification function of the redundant array of independent disks to be tested is abnormal, the test ends.
[0090] Specifically, when the check function of the independent disk redundant array to be tested is normal, data writing is stopped, so that the blocks in the independent disk redundant array to be tested are all blocks that have completed the check function, and then the reconstruction function test is continued; when the check function of the independent disk redundant array to be tested is not normal, the test ends. That is to say, this embodiment first performs a check function test, and when there is no problem with the check function, the reconstruction function test is performed. The reason is that the reconstruction function test depends on the correct data block and check block. If the check value in the check block is wrong, the reconstruction function test is meaningless, which wastes time and computing power.
[0091] Further, the above-mentioned reconstructing to obtain reconstructed blocks when a disk in the redundant array of independent disks to be tested is offline may specifically include the following steps:
[0092] Step 51: Determine the number N of offline disks according to the type of the redundant array of independent disks to be tested;
[0093] Step 52: Offline processing of N disks in the redundant array of independent disks to be tested;
[0094] Step 53: When the disk is offline, the write stripe is analyzed to determine the missing blocks on the write stripe;
[0095] Step 54: Reconstruct the missing blocks using a preset reconstruction method to obtain reconstructed blocks corresponding to the missing blocks, wherein the reconstructed blocks contain reconstruction values.
[0096] Specifically, if the independent disk redundant array to be tested is RAID5, the number of offline disks is 2. At this time, any two disks in the independent disk redundant array to be tested are processed offline, and the write stripes are analyzed to determine the missing blocks caused by the disk offline, and the existing blocks are used to reconstruct them to obtain reconstructed blocks. It can be understood that the reconstructed blocks are the blocks corresponding to the missing blocks.
[0097] Further, the above-mentioned determination of whether the reconstruction function of the redundant array of independent disks to be tested is normal by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested may specifically include the following steps:
[0098] Step 61: Obtain the original block corresponding to the missing block from the redundant array of independent disks to be tested; the original block stores the original value;
[0099] Step 62: If the original block is consistent with the reconstructed block, the reconstruction function of the redundant array of independent disks to be tested is normal;
[0100] Step 63: If the original block is inconsistent with the reconstructed block, the reconstruction function of the redundant array of independent disks to be tested is abnormal.
[0101] Specifically, the value of each block in each written stripe can be recorded offline, so that the original block corresponding to the missing block can be found from the recorded information, and the original value of the original block can be compared with the reconstructed value of the reconstructed block to implement the reconstruction function test. This method of comparing with the original value is more rigorous and can detect even slight changes in the data.
[0102] Further, in order to improve the accuracy and efficiency of the reconstruction function test, by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested, determining whether the reconstruction function of the redundant array of independent disks to be tested is normal, specifically the following steps may be included:
[0103] Step 71: Filter the write stripes according to the number of missing blocks to obtain the target stripes;
[0104] Step 72: reconstruct the missing blocks in the target stripe to obtain target reconstructed blocks;
[0105] Step 73: Compare the target reconstructed block with the original block corresponding to the missing block on the target stripe to determine whether the reconstruction function of the redundant array of independent disks to be tested is normal.
[0106] Specifically, this embodiment can use the stripe with the number of missing blocks reaching a preset number as the target stripe, or can also sort the write stripes according to the number of missing blocks, and select the write stripes with the top M missing blocks as the target stripe. In this way, it is only necessary to reconstruct the missing blocks in the target stripe, obtain the corresponding reconstructed blocks, and compare them with the original blocks to determine the reconstruction function status. In this way, while ensuring the accuracy of the reconstruction function verification, it can also reduce the number of reconstructions, reduce the amount of calculation, and speed up the test efficiency of the reconstruction function.
[0107] The functional test method of the independent disk redundant array provided by the embodiment of the present invention is applied, by obtaining the write stripe of the written data in the independent disk redundant array to be tested; by comparing the calculation block with the check block on the write stripe, it is determined whether the check function of the independent disk redundant array to be tested is normal; the calculation block is calculated based on the data block on the write stripe; by comparing the reconstruction block with the original block in the independent disk redundant array to be tested, it is determined whether the reconstruction function of the independent disk redundant array to be tested is normal; the reconstruction block is reconstructed when there is a disk offline in the independent disk redundant array to be tested. The beneficial effect of this method is that the method realizes the verification function test by comparing the calculation block with the check block on the write stripe; and realizes the reconstruction function test by comparing the reconstruction block with the original block in the independent disk redundant array to be tested. Such a test method is more transparent and more reliable than the existing test method; the method uses the block as the basic unit for comparison to make the test more accurate and more targeted; and the reconstruction block is directly compared with the original block, which can find small changes in data, can accurately find problems, effectively improve the problem location efficiency, and reduce the troubleshooting time.
[0108] In order to make the present invention easier to understand, the following examples may be referred to:
[0109] The centralized storage management disk uses RAID technology, which combines multiple independent physical disks into a virtual disk group in different ways, thereby solving the shortcomings of small single disk capacity, low performance and poor reliability. With the large-scale adoption of relatively cheap and unreliable SATA hard disks in data centers, developers must improve the reliability of the entire storage system from a software perspective. The failure rate of these cheap disks is generally high, and coupled with the large capacity of the disk itself, the possibility of the hard disk encountering partial errors or full disk errors is greatly increased. As the requirements for data security gradually increase, conventional RAID5 (allowing 1 disk failure) and RAID6 (allowing double disk failure) gradually fail to meet the requirements of multiple disk failures at the same time, so various manufacturers have begun to develop RAID with three-disk verification function (RAID that allows three disk failures). Therefore, this embodiment is described as a RAID with three-disk verification of the independent disk redundant array to be tested, that is, the RAID allows three disk failures at the same time and can also operate normally. Table 1 is a spatial distribution table of a 3-disk verification RAID provided by an embodiment of the present invention. Among them, D1-4 are data blocks, and PQR are verification blocks.
[0110] Table 1 A space distribution table of a 3-disk check RAID provided by an embodiment of the present invention
[0111]
[0112] During the test, the host uses the Vdbench tool to perform IO load operations on the storage system. The principle of the Vdbench tool is: Vdbench supports the use of VR parameters for data verification during IO reading and writing. The VR parameters can verify the readability and integrity of the data written by the host to the RAID in real time during the operation of the storage system. Before the formal test, preparation work is carried out:
[0113] 1. Configure the storage end, provide read-write volumes to the host, and establish a read-write channel with the host;
[0114] 2. Configure the storage end to ensure that the storage system can perform normal data writing operations and that there are no abnormalities in the storage system;
[0115] 3. Configure the host.
[0116] After the configuration is complete, you can refer to Figure 3 , Figure 3An example flow chart of a functional test of a three-disk verification RAID provided in an embodiment of the present invention. The host starts vdbench to issue IO pressure to the storage system. Functional test scripts are started, such as 1-disk verification function verification script, 2-reconstruction function test script, and 3-data verification script, to obtain test results. It should be noted that the above-mentioned functional test script can be understood as the corresponding test script written for the above-mentioned functional test. This embodiment does not limit the number of scripts. For example, it can be written as one script as a whole; or it can be written as two scripts; or it can be written as three scripts. The specific number can be determined according to the actual situation.
[0117] The execution process of the three-disk verification function verification script can be referred to Figure 4 , Figure 4 An example diagram of the logic flow of a three-disk check function verification script provided by an embodiment of the present invention:
[0118] (1) Obtain the address sent by the host Vdbench in real time, calculate the location in the storage based on the area written by the Vdbench tool (the specific implementation depends on the storage method of the information), and calculate the address of the stripe written in the RAID module based on the mapping method (the specific implementation depends on the RAID configuration and mapping method);
[0119] (2) Analyze the stripes through the set spatial distribution method, confirm the data blocks and check blocks in the stripes, read the data blocks and check blocks respectively and save them in the form of stripe number + D1\D2\D3\D4\P\Q\R (the specific implementation depends on the stripe spatial distribution method of RAID);
[0120] (3) Read the data blocks and check blocks, perform three different calculations on the data blocks according to the preset calculation method to obtain P1, Q1, and R1, and compare them with the three check blocks P, Q, and R respectively. If the comparison is inconsistent, stop the test;
[0121] (4) Perform cyclic calculation verification according to the preset number of verification strips, and save the verified strip information to the specified location;
[0122] (5) After the above verification is correct, Vdbench is adjusted to a pure read mode to issue Io pressure to ensure that no new data will overwrite the original data, trigger the reconstruction function test script, and pass the storage path for saving the stripe information to the reconstruction function test script.
[0123] The execution process of refactoring functional test scripts can be referred to Figure 5 , Figure 5 An example diagram of a logic flow of a reconstructed functional test script provided by an embodiment of the present invention:
[0124] (1) According to the member disk (disk) information of RAID, three member disks are randomly selected, and the hard disks are directly set to offline mode at the software level, and the reconstruction task progress is suspended through commands;
[0125] (2) Receive and read the stripe information recorded by the "Three-disk Verification Function Verification Script", perform stripe analysis, analyze and record the blocks missing due to disk drop, and record the block information of the corresponding stripe missing (such as DDD, DDP, DDQ, DDR, DPQ, DPR, DQR, PQR, etc.);
[0126] (3) Start the reconstruction task and continuously monitor the running status of Vdbench on the host until the reconstruction task is completed. Stop the vdbench tool and start the data verification script to pass the storage path of the missing block information of the recorded stripe. If there is an Io interruption or data inconsistency alarm during the reconstruction process, stop the test immediately.
[0127] The execution process of the data validation script can be referred to Figure 6 , Figure 6 An example diagram of the logic flow of a data verification script provided by an embodiment of the present invention:
[0128] (1) Receive and read the data recorded by the "Refactoring Functional Test Script"
[0129] (2) Read the missing block data from the record strip according to the recorded data (this data is the reconstructed and recovered data) and save it as strip number + D1`\D2`\D3`\D4`\P`\Q`\R` (only the missing block data needs to be read);
[0130] (3) Compare the data in the same stripe at the byte granularity (i.e., block granularity, where a block contains 128 bytes) to detect whether the newly read data (i.e., the reconstructed value corresponding to the missing block) is consistent with the block data saved by the "three-disk verification function verification script" (the original value corresponding to the missing block). If they are consistent, continue to detect the next stripe; if they are inconsistent, collect relevant information and then issue an error alarm;
[0131] (4) The script is executed in a loop until the number of executions reaches the preset number of verification strips, then the script ends and the test information is returned.
[0132] In the actual test execution phase, the calculation method in the test script can be designed according to the different calculation methods of each check block in the three-disk check provided by the R&D personnel, and the stripe granularity composition method of RAID can be used to perform more sophisticated test operations. The functional block identification strategy is implemented according to the internal space distribution method of RAID provided by the R&D personnel, and the data blocks and check blocks are clearly distinguished. On this basis, detailed calculation verification is carried out for each check block data to ensure that the RAID verification function works according to the design to ensure the integrity and accuracy of the verification. The verified stripe information is recorded in the verification function verification phase. After the disk is pulled out, the recorded stripe data is read and recorded. After the reconstruction is completed, the data consistency is verified through the stripe mark, and the stripe granularity data verification is performed on the area that needs to be verified.
[0133] The following is an introduction to a functional testing device for a redundant array of independent disks provided by an embodiment of the present invention. The functional testing device for a redundant array of independent disks described below and the functional testing method for a redundant array of independent disks described above can be referred to each other.
[0134] Please refer to Figure 7 , Figure 7 A schematic diagram of a functional test device for a redundant array of independent disks provided by an embodiment of the present invention may include:
[0135] A write stripe acquisition module 100 is used to acquire a write stripe of written data in a redundant array of independent disks to be tested;
[0136] A verification function test module 200 is used to determine whether the verification function of the independent disk redundant array to be tested is normal by comparing the calculation block with the verification block on the write stripe; the calculation block is calculated based on the data block on the write stripe;
[0137] The reconstruction function test module 300 is used to determine whether the reconstruction function of the independent disk redundant array to be tested is normal by comparing the reconstructed blocks with the original blocks in the independent disk redundant array to be tested; the reconstructed blocks are reconstructed when there is a disk offline in the independent disk redundant array to be tested.
[0138] Based on the above embodiment, the functional testing device of the redundant array of independent disks may further include:
[0139] A storage area determination module, used to determine a storage area for writing data according to a write request sent by a host;
[0140] A stripe address determination module, used to determine the stripe address of the write data from the storage area according to a mapping method;
[0141] The write stripe determination module is used to determine the write stripe according to the stripe address.
[0142] Based on the above embodiment, the functional testing device of the redundant array of independent disks may further include:
[0143] A preset stripe quantity acquisition module, used to acquire a preset stripe quantity, where the preset stripe quantity is less than or equal to the number of write stripes;
[0144] A target writing stripe determination module, used for selecting the target writing stripes of the preset stripe quantity from the writing stripes;
[0145] Accordingly, the function testing module 200 may include:
[0146] The testing unit is used to determine whether the verification function of the independent disk redundant array to be tested is normal by comparing the calculation block with the verification block on the target write stripe.
[0147] Based on the above embodiment, the verification function test module 200 may include:
[0148] A target check block quantity determination unit, used to determine the target check block quantity according to the type of the redundant array of independent disks to be tested;
[0149] A check block quantity determination unit, used to obtain the number of check blocks corresponding to each write stripe;
[0150] A first comparison unit, configured to determine whether the number of check blocks corresponding to each write stripe is consistent with the target number of check blocks;
[0151] A comparison result unit, used for, if there is inconsistency, indicating that the check function of the redundant array of independent disks to be tested is abnormal;
[0152] The second comparison result unit is used for obtaining the preset calculation method corresponding to the independent redundant array to be tested if they are consistent, determining the check blocks and data blocks on each write stripe in the independent redundant array to be tested according to the spatial distribution mode of the independent redundant array to be tested, calculating the data blocks on each write stripe according to the preset calculation method to obtain the calculation blocks on each write stripe, if the calculation blocks on each write stripe are consistent with the check blocks on each write stripe, the check function of the independent redundant array to be tested is normal, if the calculation blocks on each write stripe are inconsistent with the check blocks on each write stripe, the check function of the independent redundant array to be tested is abnormal; the number of the target check blocks is consistent with the number of the preset calculation method; the check blocks on each write stripe correspond to the preset calculation method one by one; the calculation blocks have new check values; the number of the calculation blocks on each write stripe is consistent with the number of the check blocks on each write stripe.
[0153] Based on the above embodiment, the reconstruction function test module 300 may include:
[0154] A disk offline number determination unit, used to determine the number N of disk offline according to the type of the redundant array of independent disks to be tested;
[0155] An offline unit, used for performing offline processing on N disks in the redundant array of independent disks to be tested;
[0156] A missing block determination unit, used to analyze the write stripe and determine the missing blocks on the write stripe when the disk is offline;
[0157] The reconstruction unit is used to reconstruct the missing block by using a preset reconstruction method to obtain a reconstructed block corresponding to the missing block, wherein the reconstructed block stores a reconstruction value.
[0158] Based on the above embodiment, the reconstruction function test module 300 may include:
[0159] An original block acquisition unit is used to acquire an original block corresponding to the missing block from the redundant array of independent disks to be tested; the original block stores an original value;
[0160] A normal reconstruction function unit, used for confirming that the reconstruction function of the redundant array of independent disks to be tested is normal if the original block is consistent with the reconstructed block;
[0161] The reconstruction function abnormality unit is used for determining that the reconstruction function of the redundant array of independent disks to be tested is abnormal if the original block is inconsistent with the reconstructed block.
[0162] Based on any of the above embodiments, the functional testing device of the redundant array of independent disks may further include:
[0163] A judgment unit, configured to stop writing data if the verification function of the redundant array of independent disks to be tested is normal, and execute the step of determining whether the reconstruction function of the redundant array of independent disks to be tested is normal by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested;
[0164] The test ending unit is used to end the test if the verification function of the redundant array of independent disks to be tested is abnormal.
[0165] It should be noted that the order of the modules and units in the functional testing device for redundant array of independent disks can be changed without affecting the logic.
[0166] The functional testing device for an independent disk redundant array provided by the embodiment of the present invention uses a write stripe acquisition module 100 to acquire the write stripe of the written data in the independent disk redundant array to be tested; a verification function test module 200 is used to determine whether the verification function of the independent disk redundant array to be tested is normal by comparing the calculation block with the verification block on the write stripe; the calculation block is calculated based on the data block on the write stripe; a reconstruction function test module 300 is used to determine whether the reconstruction function of the independent disk redundant array to be tested is normal by comparing the reconstruction block with the original block in the independent disk redundant array to be tested; the reconstruction block is reconstructed when a disk is offline in the independent disk redundant array to be tested. The device implements the verification function test by comparing the calculation block with the verification block on the write stripe; and implements the reconstruction function test by comparing the reconstruction block with the original block in the independent disk redundant array to be tested. This testing method is more transparent and reliable than existing testing methods. The device uses blocks as the basic unit for comparison, making the test more accurate and targeted. The reconstructed blocks are directly compared with the original blocks to detect slight changes in the data, accurately identify problems, effectively improve problem location efficiency, and reduce troubleshooting time.
[0167] Figure 8 A schematic diagram of a functional test device for a redundant array of independent disks provided by an embodiment of the present invention is shown in FIG. Figure 8 As shown, the functional test equipment of the redundant array of independent disks includes:
[0168] A memory 60, for storing computer programs;
[0169] The processor 61 is used to implement the steps of the functional testing method of the redundant array of independent disks in the above embodiment when executing the computer program.
[0170] The functional testing device of the redundant array of independent disks provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.
[0171] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0172] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, the relevant steps of the functional test method of the independent disk redundant array disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include, but is not limited to, data of the functional test method of the independent disk redundant array, etc.
[0173] In some embodiments, the functional testing device for redundant array of independent disks may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0174] Those skilled in the art will understand that Figure 8The structure shown in the figure does not constitute a limitation on the functional test device of the redundant array of independent disks, and may include more or less components than those shown in the figure.
[0175] It is understandable that if the functional test method of the independent disk redundant array in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the current technology or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and executes all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program codes.
[0176] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the functional testing method of the redundant array of independent disks are implemented.
[0177] A computer program product provided in an embodiment of the present application is introduced below. The computer program product described below can be cross-referenced with other embodiments described in this document.
[0178] A computer program product includes a computer program / instruction, which implements the steps of the functional testing method of the redundant array of independent disks disclosed above when executed by a processor.
[0179] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0180] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0181] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0182] The above is a detailed introduction to a method, device, equipment and computer-readable storage medium for testing a redundant array of independent disks provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for testing the function of a redundant array of independent disks, characterized in that: include: Obtaining a write stripe of written data in the redundant array of independent disks to be tested; Determining whether the check function of the independent disk redundant array to be tested is normal by comparing the calculation block with the check block on the write stripe; the calculation block is calculated based on the data block on the write stripe; Whether the reconstruction function of the independent disk redundant array to be tested is normal is determined by comparing the reconstructed blocks with the original blocks in the independent disk redundant array to be tested; the reconstructed blocks are reconstructed when a disk in the independent disk redundant array to be tested is offline.
2. The method for testing the function of a redundant array of independent disks according to claim 1, characterized in that: Obtain the write stripe of the written data in the redundant array of independent disks to be tested, including: Determine the storage area for writing data according to the write request sent by the host; Determine a stripe address of the write data from the storage area according to a mapping method; The write stripe is determined according to the stripe address.
3. The functional testing method of a redundant array of independent disks according to claim 1, characterized in that: After obtaining the write stripe of the written data in the redundant array of independent disks to be tested, the following steps are also included: Obtaining a preset number of stripes, where the preset number of stripes is less than or equal to the number of write stripes; Selecting the target write stripes of the preset stripe quantity from the write stripes; Correspondingly, determining whether the check function of the redundant array of independent disks to be tested is normal by comparing the calculation block with the check block on the write stripe includes: Whether the check function of the redundant array of independent disks to be tested is normal is determined by comparing the calculation block with the check block on the target write stripe.
4. The method for functional testing of a redundant array of independent disks according to claim 1, characterized in that: Determining whether the check function of the redundant array of independent disks to be tested is normal by comparing the calculation block with the check block on the write stripe includes: Determining the target number of check blocks according to the type of the redundant array of independent disks to be tested; Get the number of check blocks corresponding to each write stripe; Determine whether the number of check blocks corresponding to each write stripe is consistent with the target number of check blocks; If they are inconsistent, the check function of the redundant array of independent disks to be tested is abnormal; If they are consistent, then obtain a preset calculation method corresponding to the independent redundant array to be tested, determine the check blocks and data blocks on each write stripe in the independent redundant array to be tested according to the spatial distribution mode of the independent redundant array to be tested, calculate the data blocks on each write stripe according to the preset calculation method, and obtain the calculation blocks on each write stripe. If the calculation blocks on each write stripe are consistent with the check blocks on each write stripe, the check function of the independent redundant array to be tested is normal; if the calculation blocks on each write stripe are inconsistent with the check blocks on each write stripe, the check function of the independent redundant array to be tested is abnormal; The number of target check blocks is consistent with the number of the preset calculation method; the check blocks on each write stripe correspond one-to-one to the preset calculation method; the new check value is stored in the calculation block; the number of calculation blocks on each write stripe is consistent with the number of check blocks on each write stripe.
5. The method for functional testing of a redundant array of independent disks according to claim 1, characterized in that: When a disk in the independent disk redundant array to be tested is offline, reconstruction is performed to obtain reconstruction blocks, including: Determine the number of offline disks N according to the type of the redundant array of independent disks to be tested; Processing N disks in the redundant array of independent disks to be tested offline; When the disk is offline, the write stripe is analyzed to determine missing blocks on the write stripe; The missing block is reconstructed using a preset reconstruction method to obtain a reconstructed block corresponding to the missing block, wherein the reconstructed block contains a reconstruction value.
6. The functional testing method of a redundant array of independent disks according to claim 5, characterized in that: Determining whether the reconstruction function of the redundant array of independent disks to be tested is normal by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested, including: Obtaining an original block corresponding to the missing block from the redundant array of independent disks to be tested; the original block stores an original value; If the original block is consistent with the reconstructed block, the reconstruction function of the redundant array of independent disks to be tested is normal; If the original block is inconsistent with the reconstructed block, the reconstruction function of the redundant array of independent disks to be tested is abnormal.
7. The functional testing method of a redundant array of independent disks according to any one of claims 1 to 6, characterized in that: Before determining whether the reconstruction function of the redundant array of independent disks to be tested is normal by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested, the method further includes: If the verification function of the redundant array of independent disks to be tested is normal, stop writing data, and perform the step of determining whether the reconstruction function of the redundant array of independent disks to be tested is normal by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested; If the verification function of the redundant array of independent disks to be tested is abnormal, the test ends.
8. A functional test device for a redundant array of independent disks, characterized in that: include: A write stripe acquisition module is used to acquire the write stripe of the written data in the redundant array of independent disks to be tested; A verification function test module, used to determine whether the verification function of the independent disk redundant array to be tested is normal by comparing the calculation block with the verification block on the write stripe; the calculation block is calculated based on the data block on the write stripe; The reconstruction function test module is used to determine whether the reconstruction function of the independent disk redundant array to be tested is normal by comparing the reconstructed blocks with the original blocks in the independent disk redundant array to be tested; the reconstructed blocks are reconstructed when there is a disk offline in the independent disk redundant array to be tested.
9. A functional test device for a redundant array of independent disks, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the functional testing method for a redundant array of independent disks as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, the functional testing method of the redundant array of independent disks as claimed in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
RAID (redundant array of independent disk) system and data recovery method thereof
CN102043685A
RAID (redundant array of independent disk) automation test system and method
CN102637141A
Disk redundant array inspection method, device and equipment and storage medium
CN112148221A
Method and system for repairing inconsistent stripe data in RAID
CN113626248A
Multi-disk reconstruction method and device, electronic equipment and storage medium
CN115237675A