Functional testing method, device and equipment for redundant array of independent disks

By obtaining data blocks written into the stripe in the RAID and comparing the calculated blocks with the check blocks and the reconstructed blocks, the uncertainty problem of the existing RAID test method is solved, and a more accurate and reliable functional test is achieved.

CN119851732BActive Publication Date: 2025-09-23INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202412000462.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-09-23
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

Existing RAID functional testing methods rely on pure black box testing, which cannot truly reflect the data recovery capability when multiple disks fail simultaneously. In addition, data consistency verification through large file hash value comparison is not accurate enough and has great uncertainty.

Method used

By obtaining the data blocks written to the stripe, comparing the calculation blocks with the verification blocks to determine whether the verification function is normal, and reconstructing the blocks when the disk is offline to obtain the reconstructed blocks, comparing the reconstructed blocks with the original blocks to determine whether the reconstruction function is normal.

Benefits of technology

It improves the accuracy and reliability of RAID functional testing, can accurately detect minor changes in data, reduce troubleshooting time, and achieve more transparent and targeted testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119851732B_ABST
    Figure CN119851732B_ABST
Patent Text Reader

Abstract

The present invention discloses a functional testing method, device and equipment for an independent disk redundant array, which is applied to the field of testing, including: obtaining a write stripe of written data in the independent disk redundant array to be tested; determining 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; determining 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 present invention solves the problems of poor test accuracy, authenticity and reliability by comparing blocks as the basic unit. This method can detect slight changes in data, can accurately identify problems, effectively improve problem location efficiency, and reduce troubleshooting time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing, and in particular to a method, device and equipment for testing the function of a redundant array of independent disks. Background Art

[0002] Currently, RAID (Redundant Array of Independent Disks) testing primarily relies on pure black box testing methods. By comparing the original and reconstructed hash values ​​of large files, the system determines whether the RAID can recover data even when multiple drives fail simultaneously. Black box testing methods fail to reflect real-world conditions, specifically, they cannot confirm whether multiple drives fail simultaneously. Furthermore, comparing the hash values ​​of large files does not accurately reflect data consistency, resulting in significant uncertainty.

[0003] Therefore, how to improve the accuracy, authenticity and reliability of RAID functional 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, apparatus and device 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] To solve the above technical problems, the present invention provides a functional testing method for 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 redundant array of independent disks to be tested is normal by comparing a calculation block with a 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 redundant array of independent disks to be tested is normal is determined by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested; the reconstructed blocks are reconstructed when a disk in the redundant array of independent disks 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 write data based on the write request issued by the host;

[0011] Determine a stripe address of the write data from the storage area according to a mapping manner;

[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, the method further 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] Accordingly, 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, obtaining a preset calculation method corresponding to the independent redundant array to be tested, determining the parity 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 parity blocks on each write stripe, the parity function of the independent redundant array to be tested is normal; if the calculation blocks on each write stripe are inconsistent with the parity blocks on each write stripe, the parity 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 N of offline disks 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 check 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 check 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, configured to determine whether the verification function of the redundant array of independent disks to be tested is normal by comparing a calculation block with a 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 array to be tested is normal by comparing the reconstructed blocks with the original blocks in the independent disk array to be tested; the reconstructed blocks are obtained by reconstructing when a disk in the independent disk array to be tested is offline.

[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 configured to implement the above-mentioned functional testing method of the redundant array of independent disks when executing the computer program.

[0044] The present invention also provides a computer-readable storage medium having computer-executable instructions stored therein. 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 above-mentioned functional testing method for redundant array of independent disks when executed by a processor.

[0046] As can be seen from the above technical solution, the present invention obtains the write stripe of written data in the independent disk redundant array to be tested; determines whether the checksum 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; and 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 a disk in the independent disk redundant array to be tested is offline. The beneficial effects of the present invention are as follows: the present invention implements the checksum function test by comparing the calculation block with the check block on the write stripe; and implements the reconstruction function test by comparing the reconstructed block with the original block in the independent disk redundant array to be tested. Compared with existing testing methods, this testing method is more transparent and reliable; the method uses blocks as the basic unit for comparison, making the test more accurate and targeted; and the direct comparison of the reconstructed block with the original block can detect subtle changes in data, accurately identify problems, effectively improve problem location efficiency, and reduce 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 following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0049] Figure 1 A flowchart of a functional testing method for a redundant array of independent disks provided by an embodiment of the present invention;

[0050] Figure 2 A schematic diagram of the 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 RAID verification process 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 for reconstructing a 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 structural diagram of a functional testing 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 testing device for a redundant array of independent disks provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying 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 making creative efforts shall fall within the scope of protection of the present invention.

[0058] First, some terms involved in this 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 increasing global informatization is accelerating the generation of massive amounts of high-value data. The amount of data generated and required to be stored within enterprises is increasing dramatically. This exponential growth in high-value data poses numerous challenges to enterprise IT (Information Technology) departments. In the era of big data, data growth is exponentially increasing, and data consistency in storage systems has become a key challenge in ensuring data reliability and system stability. Centralized storage systems achieve centralized data management and maintenance by centrally storing all data on one or more high-performance storage devices. This storage approach not only simplifies data management and improves data access efficiency, but also effectively ensures data consistency through centralized control mechanisms. Data consistency verification demonstrates the reconstruction capabilities of RAID.

[0064] Currently, 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 set to multiple-check 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 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 is highly random and cannot be used to test RAID functions and requirements. It has the following main 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 performing verification testing cannot be reflected through the test steps; (2) Using large files to calculate MD5 values ​​for comparison to determine data consistency 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 issues. 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 functional testing method for a redundant array of independent disks provided in 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 entity of this embodiment is a test terminal. This embodiment does not specifically limit the redundant array of independent disks. For example, it can be RAID1, RAID5, RAID6, or other redundant arrays of independent disks. The write stripe in this embodiment refers to the stripe of written data.

[0069] Furthermore, the above-mentioned acquisition 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 the stripe address of the written data from the storage area according to the mapping method;

[0072] Step 23: Determine the write stripe according to the stripe address.

[0073] Specifically, you can refer to Figure 2. There is business interaction IO between the host and the storage system. The storage system includes an upper-layer module, a cache and pool volume module, a RAID array management module, and other modules such as the lower-layer hard disk and boot of the storage system. In this embodiment, the host sends a write request to the storage system, preliminarily determines the storage area through the upper-layer module and the cache and pool volume module, and further determines the stripe address of the write data from the storage area through the RAID array management module and other modules such as the lower-layer hard disk and drive of the storage system according to the mapping method, and determines the write stripe 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 for performing a checksum function test on the independent redundant array of disks to be tested. The checksum function in this embodiment can be understood as checking whether the checksum blocks on the stripe are actually calculated according to the preset calculation method, rather than being arbitrarily written. Therefore, this embodiment first obtains the checksum blocks from the stripe, in which the original checksum values ​​are stored, and then recalculates the calculation blocks based on the data blocks on the stripe, in which the new checksum values ​​are stored. Whether the checksum function of the independent redundant array of disks to be tested is normal is determined by comparing the original checksum value and the new checksum value to see if they are consistent. If they are consistent, it means that the checksum function is normal; if they are inconsistent, it means that the checksum 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, this embodiment can obtain a preset number of stripes; select a target write stripe with a preset number of stripes from the write stripes; and determine whether the check function of the independent disk redundant array to be tested is normal by comparing the check blocks on the calculated blocks and the target write stripes. 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] Furthermore, 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 number of parity blocks based on 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, a preset calculation method corresponding to the independent redundant array to be tested is obtained, and the parity blocks and data blocks on each write stripe in the independent redundant array to be tested are determined according to the spatial distribution of the independent redundant array to be tested. The data blocks on each write stripe are calculated 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 parity blocks on each write stripe, the parity function of the independent redundant array to be tested is normal. If the calculation blocks on each write stripe are inconsistent with the parity blocks on each write stripe, the parity 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 RAID parity check function test of this embodiment can be divided into two parts: checking the data volume of the parity blocks and verifying the consistency of the values ​​in the parity blocks with the calculation blocks. If the Redundant Array of Independent Disks to be tested is a three-disk parity RAID, each stripe should contain three parity blocks, and the preset calculation method for each parity block is different. If the number of parity blocks in the write stripe of the RAID is not three, it can be directly determined that the parity check function of the RAID is abnormal. If the number of parity blocks in the write stripe of the RAID is three, namely p, q, and r, the data blocks on each write stripe are further calculated using various preset calculation algorithms (P, Q, and R) to obtain three calculation blocks (p', q', and r'). p', q', and r' are then compared with p, q, and r, respectively. If they are consistent, the parity check function of the RAID is normal; otherwise, the parity check function of the RAID is abnormal. This embodiment performs a two-step verification function test. When the number of verification blocks does not meet the requirements, the verification function is directly determined to be abnormal, eliminating the need to recalculate the calculation blocks. This saves time, reduces the amount of calculation, and also conserves computing resources, improving the speed of the verification function test. Furthermore, by comparing the calculation blocks with the verification blocks, it is possible to directly determine which verification block has an abnormality, achieving precise location.

[0085] S103: Determine 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 reconstructed blocks are reconstructed when a disk in the redundant array of independent disks to be tested is offline.

[0086] Step S103 is a step for performing a reconstruction function test on the redundant array of independent disks to be tested. When performing the reconstruction function test, the disks in the redundant array of independent disks to be tested need to be processed offline. The original blocks and the reconstructed blocks before and after the offline process are compared to determine whether the reconstruction function of the redundant array of independent 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 be further included:

[0088] Step 41: If the check 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 checksum function of the redundant array of independent disks to be tested is abnormal, the test ends.

[0090] Specifically, when the checksum function of the independent disk array to be tested is normal, data writing is stopped. This ensures that all blocks in the independent disk array to be tested have completed the checksum function. At this point, the reconstruction function test continues. If the checksum function of the independent disk array to be tested is not normal, the test ends. In other words, this embodiment first performs the checksum function test, and when the checksum function is correct, the reconstruction function test is performed. This is because the reconstruction function test relies on the correct data blocks and checksum blocks. If the checksum value in the checksum block is incorrect, the reconstruction function test is meaningless, wasting time and computing power.

[0091] Furthermore, the above-mentioned reconstruction to obtain the 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 block using a preset reconstruction method to obtain a reconstructed block corresponding to the missing block, wherein the reconstructed block contains a reconstruction value.

[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 offline, and the write stripes are analyzed to determine the missing blocks caused by the disk offline. The existing blocks are used for reconstruction to obtain reconstructed blocks. It can be understood that the reconstructed blocks are the blocks corresponding to the missing blocks.

[0097] Furthermore, 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 value is stored in the original block;

[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 values ​​of each block in each written stripe can be recorded while offline. This allows the original blocks corresponding to missing blocks to be found from the recorded information. The original values ​​of the original blocks can be compared with the reconstructed values ​​of the reconstructed blocks to test the reconstruction function. This method of comparing with the original values ​​is more rigorous and can detect even minor changes in the data.

[0102] Furthermore, 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, it is determined whether the reconstruction function of the redundant array of independent disks to be tested is normal, which may specifically include the following steps:

[0103] Step 71: Filter the write stripes according to the number of missing blocks to obtain the target stripe;

[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 select a stripe with a preset number of missing blocks as the target stripe. Alternatively, the write stripes can be sorted according to the number of missing blocks and the write stripes with the top M missing blocks can be selected as the target stripe. In this way, only the missing blocks in the target stripe need to be reconstructed to obtain their corresponding reconstructed blocks, which can be compared with the original blocks to determine the reconstruction function status. This ensures the accuracy of the reconstruction function verification while also reducing the number of reconstructions, reducing the amount of calculation, and accelerating the efficiency of the reconstruction function test.

[0107] The functional testing method for a redundant array of independent disks provided by an embodiment of the present invention obtains a write stripe of written data in the redundant array of independent disks to be tested; determines whether the checksum 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; and determines whether the reconstruction function of the redundant array of independent disks to be tested is normal by comparing the reconstruction block with the original block in the redundant array of independent disks to be tested; the reconstruction block is reconstructed when a disk in the redundant array of independent disks to be tested is offline. The beneficial effects of this method are as follows: the method implements the checksum function test by comparing the calculation block with the check block on the write stripe; and implements the reconstruction function test by comparing the reconstruction block with the original block in the redundant array of independent disks to be tested. Compared with existing testing methods, this testing method is more transparent and reliable; the method uses blocks as the basic unit for comparison, making the test more accurate and targeted; and the direct comparison of the reconstructed block with the original block can detect subtle changes in data, accurately identify problems, effectively improve problem location efficiency, and reduce troubleshooting time.

[0108] In order to make the present invention easier to understand, the following examples may be referred to:

[0109] Centralized storage management disks use RAID technology, which combines multiple independent physical disks into a virtual disk group in various ways. This overcomes the shortcomings of a single disk, such as small capacity, low performance, and poor reliability. With the widespread adoption of relatively inexpensive and unreliable SATA hard drives in data centers, developers must improve the reliability of the entire storage system from a software perspective. These inexpensive disks generally have a high failure rate. Coupled with the disks' large capacity, the likelihood of partial or full disk failures is significantly increased. As data security requirements increase, conventional RAID 5 (which tolerates one drive failure) and RAID 6 (which tolerates two drive failures) are increasingly unable to meet the requirements of simultaneous multiple drive failures. Consequently, various vendors have begun developing RAID with three-drive parity (tolerant of three drive failures). Therefore, this embodiment will illustrate the Redundant Array of Independent Disks (RAID) under test using a three-drive parity RAID, meaning that the RAID can operate normally even with three simultaneous drive failures. Table 1 shows the spatial distribution table for a three-drive parity RAID, provided by an embodiment of the present invention. D1-4 represents data blocks, and PQR represents parity blocks.

[0110] Table 1: 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 as follows: 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 there are no abnormalities in the storage system;

[0115] 3. Configure the host.

[0116] After the configuration is completed, please 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 a 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 details can be determined according to actual conditions.

[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 using the set spatial distribution method, identify 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 the 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 and 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 reconstructing the functional test script can be referred to Figure 5 , Figure 5 An example diagram of the logic flow of a reconstructed functional test script provided by an embodiment of the present invention:

[0124] (1) According to the RAID member disk information, 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 corresponding to the missing stripe (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 recorded stripe missing block information. 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 in an embodiment of the present invention:

[0128] (1) Receive and read the data recorded by the "Reconstruction 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 the stripe number + D1`\D2`\D3`\D4`\P`\Q`\R` (only the missing block data needs to be read);

[0130] (3) Compare the data of the same stripe at byte granularity (i.e., block granularity, one 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 report an error;

[0131] (4) Execute in a loop until the number of executions reaches the preset number of verification strips, end the script and return the test information.

[0132] During the actual test execution phase, the calculation method in the test script can be designed based on 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 refined 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 check function of RAID works according to the design, so as to ensure the integrity and accuracy of the verification. During the verification function verification phase, the verified stripe information is recorded, and the recorded stripe data is read and recorded after the disk is removed. After the reconstruction is completed, the data consistency is verified through the stripe mark, and the stripe granularity data is verified for the area that needs to be verified.

[0133] The following describes 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 structural diagram of a functional testing device for a redundant array of independent disks provided in an embodiment of the present invention may include:

[0135] The write stripe acquisition module 100 is used to acquire the write stripe of the written data in the redundant array of independent disks to be tested;

[0136] A verification function test module 200 is configured to determine whether the verification function of the redundant array of independent disks to be tested is normal by comparing a calculation block with a verification block on the write stripe; the calculation block is calculated based on the data blocks on the write stripe;

[0137] The reconstruction function test module 300 is used to determine whether the reconstruction function of the independent disk array to be tested is normal by comparing the reconstructed blocks with the original blocks in the independent disk array to be tested; the reconstructed blocks are reconstructed when a disk in the independent disk array to be tested is offline.

[0138] Based on the above embodiment, the functional testing device for the redundant array of independent disks may further include:

[0139] A storage area determination module, configured to determine a storage area for writing data according to a write request sent by a host;

[0140] a stripe address determining module, configured to determine a stripe address of the write data from the storage area according to a mapping manner;

[0141] A write stripe determination module is configured to determine the write stripe according to the stripe address.

[0142] Based on the above embodiment, the functional testing device for the redundant array of independent disks may further include:

[0143] A preset stripe quantity acquisition module, configured 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 determining module, configured to select target writing stripes of the preset stripe quantity from the writing stripes;

[0145] Accordingly, the function test module 200 may include:

[0146] The testing unit is configured to 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 target write stripe.

[0147] Based on the above embodiment, the verification function test module 200 may include:

[0148] a target parity block quantity determination unit, configured to determine the target parity block quantity according to the type of the redundant array of independent disks to be tested;

[0149] A check block quantity determination unit, configured to obtain the number of check blocks corresponding to each write stripe;

[0150] A first comparison unit is 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, configured to determine that the check function of the redundant array of independent disks to be tested is abnormal if there is no consistency;

[0152] The second comparison result unit is configured to, if the comparison results are consistent, obtain a preset calculation method corresponding to the independent redundant array to be tested, determine the parity blocks and data blocks on each write stripe in the independent redundant array to be tested based on the spatial distribution 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 parity blocks on each write stripe, the parity function of the independent redundant array to be tested is normal; if the calculation blocks on each write stripe are inconsistent with the parity blocks on each write stripe, the parity function of the independent redundant array to be tested is abnormal; the number of target parity blocks is consistent with the number of the preset calculation method; the parity blocks on each write stripe correspond one-to-one to the preset calculation method; the calculation blocks store new parity values; and the number of calculation blocks on each write stripe is consistent with the number of parity blocks on each write stripe.

[0153] Based on the above embodiment, the reconstruction function test module 300 may include:

[0154] a disk offline number determining unit, configured to determine the number N of offline disks according to the type of the redundant array of independent disks to be tested;

[0155] An offline unit, configured to perform offline processing on N disks in the redundant array of independent disks to be tested;

[0156] A missing block determining unit, configured to analyze the write stripe when the disk is offlined, and determine the missing blocks on the write stripe;

[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 obtaining unit, configured to obtain 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, configured to determine 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 configured to determine 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 for a redundant array of independent disks may further include:

[0163] a judgment unit, configured to stop writing data if the check 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 configured to end the test if the check 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 an embodiment of the present invention uses a write stripe acquisition module 100 for acquiring a write stripe in which data is written in the independent disk redundant array to be tested; a verification function test module 200 for determining whether the verification function of the independent disk redundant array to be tested is normal by comparing a calculation block with a verification block on the write stripe; the calculation block is calculated based on the data block on the write stripe; and a reconstruction function test module 300 for determining whether the reconstruction function of the independent disk redundant array to be tested is normal by comparing a reconstruction block with the original block in the independent disk redundant array to be tested; the reconstruction block is reconstructed when a disk in the independent disk redundant array to be tested is offline. This device implements verification function testing by comparing calculation blocks with verification blocks on the write stripe; and implements reconstruction function testing by comparing reconstruction blocks with original blocks in the independent disk redundant array to be tested. This testing method is more transparent and reliable than existing testing methods. This 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, which can 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 for redundant array of independent disks includes:

[0168] Memory 60, for storing computer programs;

[0169] The processor 61 is configured 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 for 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] The processor 61 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 61 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a 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), which is responsible for rendering and drawing content required to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor for handling computational 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 high-speed random access memory, and 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, it can implement the relevant steps of the functional testing method of the independent disk redundant array disclosed in any of the aforementioned embodiments. 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 testing method of the independent disk redundant array, etc.

[0173] In some embodiments, the functional testing device for a 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 shown in the figure.

[0175] It is understood that if the functional testing method for the redundant array of independent disks in the above-mentioned embodiment is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the current technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the various embodiments of the method of the present invention. The aforementioned storage medium includes: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable ROM, a register, a hard drive, a removable disk, a CD-ROM, a magnetic disk, or an optical disk, and other media that can store program code.

[0176] Based on this, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. 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 referenced with other embodiments described herein.

[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 the computer program / instruction is executed by a processor.

[0179] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[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 above description has generally described the components and steps of each example according to their functions. 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 document, relationships such as first and second, etc., are used solely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0182] The functional testing method, apparatus, device, and computer-readable storage medium for a redundant array of independent disks provided by the present invention are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is intended only to help understand the method and core concept of the present invention. At the same time, those skilled in the art will appreciate that the specific implementation methods and application scopes may vary based on the concepts of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.

Claims

1. A functional testing method for 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 redundant array of independent disks to be tested is normal by comparing a calculation block with a 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 redundant array of independent disks to be tested is normal is determined by comparing the reconstructed blocks with the original blocks in the redundant array of independent disks to be tested; the reconstructed blocks are reconstructed when a disk in the redundant array of independent disks to be tested is offline.

2. The functional testing method of a redundant array of independent disks according to claim 1, wherein: Obtain the write stripe of the written data in the redundant array of independent disks to be tested, including: Determine the storage area for write data based on the write request issued by the host; Determine a stripe address of the write data from the storage area according to a mapping manner; 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, wherein: 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; Accordingly, 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 functional testing method of a redundant array of independent disks according to claim 1, wherein: 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, obtaining a preset calculation method corresponding to the independent disk redundant array to be tested, determining the parity blocks and data blocks on each write stripe in the independent disk redundant array to be tested according to the spatial distribution mode of the independent disk 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 parity blocks on each write stripe, the parity function of the independent disk redundant array to be tested is normal; if the calculation blocks on each write stripe are inconsistent with the parity blocks on each write stripe, the parity function of the independent disk 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 functional testing method of a redundant array of independent disks according to claim 1, wherein: When a disk in the redundant array of independent disks to be tested is offline, reconstruction is performed to obtain reconstructed blocks, including: Determine the number N of offline disks according to the type of the redundant array of independent disks to be tested; Performing offline processing on N disks in the redundant array of independent disks to be tested; 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 check 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 check 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, configured to determine whether the verification function of the redundant array of independent disks to be tested is normal by comparing a calculation block with a 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 array to be tested is normal by comparing the reconstructed blocks with the original blocks in the independent disk array to be tested; the reconstructed blocks are obtained by reconstructing when a disk in the independent disk array to be tested is offline.

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 of a redundant array of independent disks according to 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 according to 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