Atomicity test method based on crossed and overlapped data under multi-NS distributed integration
By using an atomicity testing method based on multi-NS distributed integration, a cross-overlapping address write scenario is simulated to accurately identify intermediate states. This fills the technical gap in atomicity verification under multi-NS integration scenarios, ensuring the stability and data consistency of the storage system and improving resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG SINOCHIP SEMICON CO LTD
- Filing Date
- 2025-12-10
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies lack testing logic adapted to multi-NS integration scenarios, especially in the atomicity verification of cross-overlapping address writes, which leads to risks such as data corruption and consistency loss due to atomicity failures in actual operation of storage systems.
An atomicity testing method based on multi-NS distributed integration is adopted. By simulating the write scenario of overlapping addresses, the intermediate state is accurately identified, and the atomicity of the multi-NS integrated architecture under complex interaction scenarios is verified. The method includes steps S01-S10, with detailed operations such as calculating the unit capacity, creating and verifying the namespace, and enabling atomic write units.
It enables key tests on the stability and data consistency of multi-NS distributed integration systems, improves resource utilization and management flexibility, ensures data accuracy and stability, and allows for early prediction and timely detection of problems.
Smart Images

Figure CN121833367A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of storage, in particular to an atomicity test method for cross-overlapping data based on multi-namespace (NS) distributed integration. BACKGROUND
[0002] With the development of storage technology, multi-namespace (NS) is increasingly common through logical or physical integration into a unified resource pool mode, which has the core advantage of improving resource utilization, but also brings new challenges. The logical addresses of different NSs may be mapped to the same physical storage area, forming cross-overlapping addresses. However, existing test solutions are mostly for single-NS environments, lacking test logic specifically adapted to multi-NS integration scenarios, especially in the atomicity verification of cross-overlapping address writing, which may lead to risks such as data disorder and consistency destruction due to atomicity failure in actual operation of the storage system. SUMMARY
[0003] In view of the defects of the prior art, the present application provides an atomicity test method for cross-overlapping data based on multi-namespace (NS) distributed integration, which provides key test support for the stability and data consistency of multi-NS integrated systems.
[0004] The core of NS distributed integration is to break through the resource wall of single-NS by simulating the writing scenario of cross-overlapping addresses, accurately identifying intermediate states such as partial coverage and data mixing, and verifying the effectiveness of the multi-NS integration architecture in complex interaction scenarios, thereby building a test defense line for system data consistency, achieving aggregated utilization of storage capacity and performance, and improving resource utilization and management flexibility. Atomicity refers to the "indivisibility" of data operations, and in the storage scenario, atomicity is the core of ensuring data consistency.
[0005] To solve the technical problem, the technical solution adopted by the present application is: an atomicity test method for cross-overlapping data based on multi-namespace (NS) distributed integration, comprising the following steps: S01, obtaining the total capacity TCP of the storage device, the total number of supported NSs NN, and the equal division number D0, setting the test number, the number of recombined NSs RZ, and LBAF; S02, calculating the unit capacity EQ_DIV = ((TCP / LBAF)+(D0-1)) / D0; S03, calculating the maximum allocable capacity MC of the equalized single NS = EQ_DIV (D0 / NN); S04, delete all original NS and create NN-1 NS, the capacity of the newly created NS is randomly allocated within MC-EQ_DIV, obtain the remaining capacity of the storage device and create the NNth NS, after successful creation, the remaining capacity is 0; S05, randomly delete N NS, N<NN-1, obtain the remaining capacity RC and determine whether it is equal to N EQ_DIV, if it is equal, create a new NS according to the remaining capacity RC, and the new NS is recorded as N0, if it is not equal, report an error and exit the test; S06, enable the namespace-level atomic write unit NAWUN and the namespace-level atomic write unit power failure protection NAWUPF of the storage device; S07, set the NAWUN value of N0 to U, and execute command 1 write A and command 2 cross-over write B on N0; S08, perform atomicity verification on N0, if the verification is passed, normally power on and off, and then repeat the atomicity verification on N0, if the verification is not passed, report an error and exit the test; S09, write C to N0, and abnormally power on and off during the process of the same position overwrite D; S10, perform atomicity verification on N0, if the verification is passed, start the next round of test, if the verification is not passed, report an error and exit the test.
[0006] Further, step S04 is specifically: S41, randomly select a capacity SC within the range of EQ_DIV, delete all original NS, and create NN-1 NS, each NS has a capacity of MC-SC; S42, according to the multi-NS distribution integration characteristics, when the set capacity is not a multiple of EQ_DIV during the creation of NS, after successful creation, the actual capacity is automatically completed to an integer multiple of EQ_DIV; verify whether the capacity of each NS is MC, otherwise report an error and exit the test, and if yes, execute step S43; S43, obtain the remaining capacity, and verify whether the remaining capacity is equal to TCP-(NN-1) EQ_DIV, if it is equal, create a new NS according to the remaining capacity RC, and the new NS is recorded as N0, if it is not equal, report an error and exit the test; S44, verify whether the remaining capacity is 0, if yes, the verification is passed, and the next step is executed, otherwise, report an error and exit the test.
[0007] Further, in step S07, the process of executing command 1 write A and command 2 cross-over write B on N0 is: S71, randomly select an SLBA within the capacity range of N0; S72, execute command 1 from SLBA to write U units of AAAA to N0, command 2 is compared with command 1 SLBA to move 1 unit backward, write U units of BBBB.
[0008] Further, in step S08, the atomicity check process executed on N0 is: read U units of values from SLBA and check the atomicity, if U-1 units of values are A, the Uth unit of value is B or the 1st unit of value is A, the 2-Uth unit of value is B, then the check passes, otherwise fails.
[0009] Further, in step S10, the atomicity check process executed on N0 is: read the address of the data written in step S09, if all the read data are CCCC or all are DDDD, then the check passes, otherwise fails.
[0010] Further, it also includes: S11, if the number of reorganization NS RZ is greater than 1, then execute steps S12 to S14, otherwise skip steps S12 to S14; S12, execute RZ times of step S05 to obtain new NS: NO, N1…NRZ, repeat step S06; S13, set the NAWUN value of N0 to U, write U units of AAA to N0 and U units of BBB to N1, and after writing, read the check written value whether it remains unchanged after normal power on and off, if it remains unchanged, the check passes, otherwise the check fails; S14, during the process of writing U units of AAA to N0 and U units of BBB to N1, abnormally power on and off, after power on, read the values written by N0, N1…RZ in turn, if all are 0 or the original value, then the check passes, otherwise the check fails.
[0011] Further, the total number of NS NN supported by the NVME device and the total capacity TCP are obtained by id-ctrl command, the equal division number D0 is obtained according to the design document, the obtained information is recorded to the CONFIG file, and the test number, the number of reorganization NS RZ and LBAF are set in the CONFIG file.
[0012] Further, in step S06, enable NAWUN and NAWUPF of the device by set-feature.
[0013] Further, in step S07, set the NAWUN value of N0 to U by admin-passthru.
[0014] Further, in step S71, obtain the capacity of NO by id-ns, and then randomly select a SLBA within the capacity of NO.
[0015] The application breaks the resource wall of a single NS, accurately identifies intermediate states such as partial coverage and data mixing by simulating a write scenario of cross-overlapping addresses, verifies the effectiveness of the atomicity of the multi-NS integration architecture in a complex interaction scenario, builds a test defense line for system data consistency, realizes the aggregated use of storage capacity and performance, and improves resource utilization and management flexibility. Through the above test method, problems can be predicted and discovered in a timely manner. Flexible configuration of different test scenarios can more comprehensively and accurately cover each namespace. The atomicity of cross-overlapping data after multi-NS distribution integration is accurately verified to ensure the correctness and stability of the data. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 A flowchart of the method described in Example 1. DETAILED DESCRIPTION
[0017] The application will be further described below in combination with the drawings and specific examples.
[0018] Example 1 This example discloses a test method for the atomicity of cross-overlapping data based on multi-NS distribution integration, as shown in Figure 1 The method comprises the following steps: 1. Obtain the initial information of the device: obtain the total number of NSs NN supported by the NVME device and the device capacity TCP through the id-ctrl command; obtain the equal division number D0 according to the design document (each manufacturer sets it according to needs); record the initial information to the CONFIG file. Set the test times, LBAF, and the number of recombined NSs in the CONFIG file. LBAF (LBA Format) can be 512 or 4096, and this example takes 4k as LBAF for illustration.
[0019] 2. Read the CONFIG file, and calculate the multi-NS equal division unit capacity of the device according to D0: EQ_DIV = ((TCP / 4096)+(D0-1)) / D0.
[0020] 3. Calculate the maximum allocatable capacity of the equal division of a single NS: MC = EQ_DIV (D0 / NN).
[0021] 4. Randomly select a capacity in the range of EQ_DIV: SC.
[0022] 5. Delete all NSs, and create NN-1 NSs, each with a capacity of MC-SC.
[0023] 6. Check the capacity of each NS in turn by id-ns. If the capacity is MC, the check is passed, and the next step is executed. Otherwise, the check fails, an error is reported, and the test is exited. When creating NS according to the multi-NS distribution integration feature, if the set capacity is not a multiple of EQ_DIV, the actual capacity is automatically completed to an integer multiple of EQ_DIV after creation. This check is to verify whether the NS capacity is completed to an integer multiple of EQ_DIV.
[0024] 7. Get the remaining capacity and check whether it is equal to TCP-(NN-1) EQ_DIV. After the check is passed, the NNth NS is created, and after completion, the remaining capacity is checked. If it is 0, the check is passed, and the next step is executed. If it is not 0, the check fails, an error is reported, and the test is exited.
[0025] 8. Randomly delete N NSs (N<NN-1), and get the remaining capacity RC. Check whether it is equal to N EQ_DIV. If yes, create a new NS according to RC. The new NS is recorded as N0. Otherwise, an error is reported, and the test is exited.
[0026] 9. Enable NAWUN (namespace-level atomic write unit) and NAWUPF (namespace-level atomic write unit power fail) for the device through set-feature.
[0027] 10. Set the NAWUN value of N0 to U (1 unit size is U 4k) through admin-passthru.
[0028] 11. Get the capacity of N0 through id-ns and randomly select an SLBA (start LBA) within the capacity of N0.
[0029] 12. Execute command 1 on N0 to write U units of AAAA from the SLBA, and command 2 to write U units of BBBB by moving the SLBA of command 1 by 1 unit.
[0030] 13. Read U units of values from the SLBA and check their atomicity. If U-1 units of values are A, and the Uth unit of value is B or the 1st unit of value is A and the 2-Uth unit of value is B, the check is passed. Otherwise, it fails.
[0031] 14. Normally power on and off, and repeat step 13.
[0032] 15. Repeat step 11 to write U units of CCCC and read and check; abnormally power on and off during the process of writing U units of DDDD in the same position.
[0033] 16. Read the U unit values of the address in step 15 again, if all are CCCC or all are DDDD, the check passes, otherwise fails.
[0034] 17. If the number of reorganization NSs RZ in the CONFIG file is greater than 1, steps 18-20 are executed, otherwise steps 18-20 are skipped.
[0035] 18. Step 8 is executed RZ times to obtain new NSs: NO, N1..NRZ; steps 9-11 are repeated.
[0036] 19. Write AAA in U units to NO and BBB in U units to N1 (RZ in parallel) and read the written values after writing and normal power on to check whether the written values remain unchanged.
[0037] 20. During the process of writing AAA in U units to NO and BBB in U units to N1, abnormal power on occurs, and after power on, the written values of NO, N1..RZ are read in turn, if all are 0 or the original values, the check passes, otherwise fails.
[0038] 21. If all the above steps pass the test, delete all NSs, read the CONFIG and restore the initial NS state.
[0039] 22. Automatically check DMESG, SMART, VENDOR and other information, if there is no problem, repeat steps 1-21 according to the number of tests set in the CONFIG file. Record the test results and details of each round, and generate a test log.
[0040] DMESG represents system information, and SMART and VENDOR are professional expressions in the NVME protocol, which are part of the log and are used to record the health information of the storage device during the test process.
[0041] This method can verify the accuracy of capacity change after multi-NS distribution integration, and at the same time, based on this, through the simulation of cross-overlapping address writing scenarios, it can accurately identify intermediate states such as partial coverage and data mixing, thereby verifying the atomicity effectiveness of multi-NS distribution integration in complex interaction scenarios, and building a strong test line for the data consistency of the device.
[0042] The above description is only the basic principle and preferred embodiment of the present application, and the improvements and substitutions made by those skilled in the art based on the present application belong to the protection scope of the present application.
Claims
1. An atomicity testing method based on cross-overlapping data integrated under multiple NS distributions, characterized in that: Includes the following steps: S01, Get the total capacity of the storage device TCP, the total number of supported NS NN, the number of equal parts D0, and set the number of tests, the number of reassembled NS RZ, and LBAF; S02, Calculate the cell capacity EQ_DIV = ((TCP / LBAF)+(D0-1)) / D0; S03. Calculate the maximum allocatable capacity MC of a single equally divided NS = EQ_DIV (D0 / NN); S04. After deleting all existing NS, recreate NN-1 NS. The capacity of the recreated NS is randomly allocated within MC-EQ_DIV. Obtain the remaining capacity of the storage device and create the NNth NS. After successful creation, the remaining capacity is 0. S05. Randomly delete N NSs, where N < NN - 1, and check if the remaining capacity RC is equal to N EQ_DIV. If it is equal, create a new NS according to the remaining capacity RC, and denote the new NS as N0. If it is not equal, report an error and exit the test; S06. Enable the namespace-level atomic write unit NAWUN and the namespace-level atomic write unit power-loss protection NAWUPF of the storage device; S07. Set the NAWUN value of N0 to U, and execute command 1 to write A and command 2 to write B in an overlapping manner on N0. S08. Perform an atomicity check on N0. If the check passes, power on and off normally. Then repeat the atomicity check on N0. If the check fails, report an error and exit the test. S09. During the process of writing C to N0 and overwriting D at the same position, an abnormal power-on / off occurred. S10. Perform atomicity verification on N0. If the verification passes, start the next round of testing. If the verification fails, report an error and exit the test.
2. The atomicity testing method for cross-overlapping data based on multi-NS distribution integration according to claim 1, characterized in that: Step S04 is as follows: S41. Randomly select a capacity SC within the range of EQ_DIV, delete all existing NS, and create NN-1 NS, each NS with a capacity of MC-SC; S42. Based on the characteristics of multi-NS distribution integration, if the capacity set when creating an NS is not a multiple of EQ_DIV, the actual capacity will be automatically padded up to an integer multiple of EQ_DIV after successful creation; check whether the capacity of each NS is MC, otherwise report an error and exit the test, otherwise proceed to step S43. S43. Obtain the remaining capacity and verify whether the remaining capacity is equal to TCP-(NN-1). If EQ_DIV is true, the validation passes and the NNth NS is created; otherwise, an error is reported and the test is terminated. S44. Check if the remaining capacity is 0. If yes, the check passes and proceed to the next step; otherwise, report an error and exit the test.
3. The atomicity testing method for cross-overlapping data based on multi-NS distribution integration according to claim 1, characterized in that: In step S07, the process of executing command 1 to write A and command 2 to write B in an overlapping manner on N0 is as follows: S71. Randomly select an SLBA within the NO capacity range; S72. Execute command 1 on N0 to write U units of AAAA from SLBA. Command 2 moves SLBA one unit to the right compared to command 1 and writes U units of BBBB.
4. The atomicity testing method for cross-overlapping data based on multi-NS distribution integration according to claim 3, characterized in that: In step S08, the atomicity verification process for N0 is as follows: read the value of U units from SLBA and verify its atomicity. If the value of U-1 units is A and the value of U units is B, or the value of the 1st unit is A and the value of the 2nd to Uth units is B, then the verification passes; otherwise, it fails.
5. The atomicity testing method for cross-overlapping data based on multi-NS distribution integration according to claim 1, characterized in that: In step S10, the atomicity verification process for N0 is as follows: the address where the data was written in step S09 is read. If the read data is all CCCC or all DDDD, the verification passes; otherwise, it fails.
6. The atomicity testing method for cross-overlapping data based on multi-NS distribution integration according to claim 1, characterized in that: Also includes: S11. If the number of recombined NS RZ is greater than 1, then proceed to steps S12 to S14; otherwise, skip steps S12 to S14. S12. Perform step S05 RZ times to obtain new NS: NO, N1...NRZ, and repeat step S06. S13. Set the NAWUN value of N0 to U, write U units of AAA to N0 and U units of BBB to N1, and read and verify whether the written value remains unchanged after writing and normal power-on and power-off. If it remains unchanged, the verification passes; otherwise, the verification fails. S14. During the process of writing U units of AAA to N0 and U units of BBB to N1, if there is an abnormal power-on or power-off, after power-on, read the values written by N0, N1...RZ in sequence. If all are 0 or the original value, the verification passes; otherwise, it fails.
7. The atomicity testing method for cross-overlapping data based on multi-NS distribution integration according to claim 1, characterized in that: Use the id-ctrl command to obtain the total number of NS (NN) and total TCP capacity supported by the NVME device. Obtain the number of equal parts (D0) according to the design document. Record the obtained information into the CONFIG file and set the number of tests, the number of recombined NS (RZ), and LBAF in the CONFIG file.
8. The atomicity testing method for cross-overlapping data based on multi-NS distribution integration according to claim 1, characterized in that: In step S06, NAWUN and NAWUPF are enabled on the device via set-feature.
9. The atomicity testing method for cross-overlapping data based on multi-NS distribution integration according to claim 1, characterized in that: In step S07, the NAWUN value of N0 is set to U via admin-passthru.
10. The atomicity testing method for cross-overlapping data based on multi-NS distribution integration according to claim 3, characterized in that: In step S71, the NO capacity is obtained through id-ns, and then a random SLBA is selected within the NO capacity range.