Log-based high-availability erasure code updating method
By using a log-based highly available erasure coding update method, the update can be completed as long as only some verification nodes respond successfully. This solves the problem of excessively long update time caused by slow response or failure of verification nodes, and achieves fast and reliable erasure coding updates.
Patent Information
- Application Number
- CN202410964648.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-18
AI Technical Summary
Existing erasure coding update technology suffers from excessively long update times or failures when the verification node responds too slowly or malfunctions, affecting update availability.
The log-based high-availability erasure coding update method is adopted, which can complete the update only if some check nodes respond successfully. The update is completed within time t' through a new check block incremental calculation method, and refactoring is used when necessary to ensure the update is successful.
It reduces the latency of erasure coding updates, improves update speed and availability, ensures the fault tolerance of stripes, and avoids the impact of long-tail latency and check node failures.
Smart Images

Figure CN118971895A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a log-based high-availability erasure code update method. Background Art
[0002] Erasure codes provide data fault tolerance while having low storage overhead, and are widely used in storage systems. The classic Reed-Solomon Codes (RS Codes) divide the file into k data blocks, multiply the encoding matrix by the k data blocks to calculate m check blocks, and can tolerate any m errors. Erasure codes need to frequently update the check blocks when updating data blocks, which generates a large amount of network transmission and I / O operations, and the update overhead is huge. There are two conventional update technologies, reconstruction writing and read-modify writing. Reconstruction writing needs to read and transmit all old data blocks when updating, and the network traffic and I / O overhead are huge; read-modify writing requires frequent reading and writing of old check blocks, and the I / O overhead is also very high. Existing log technologies, such as parity logging and full logging, are optimized on the basis of read-modify-write, and the update information is appended to the log. After multiple updates, the update information in the log is merged to update the check blocks, reducing the I / O overhead of frequently reading old check blocks. The specific process is as follows:
[0003] After receiving the new data block, the data node reads the related old data block, uses the new data block and the old data block to calculate the data block increment, and then calculates the check block increment. Both Parity Logging and Full Logging need to send the check block increment to the check node. After receiving the check block increment, the check node saves it in the log and then returns a successful response message. After all check nodes respond successfully, Parity Logging will use the new data block to overwrite the old data block on the corresponding data node, and Full Logging will save the new data block in the log of the corresponding data node while retaining the old data block.
[0004] Both Parity Logging and Full Logging require all check nodes to respond successfully to complete the update process, so there are some problems: when some check nodes respond too slowly or fail, the erasure code update needs to wait for all check nodes to respond successfully, which will be affected by long-tail delays and cause the update time to be too long; or the update cannot be completed due to failures of some check nodes, resulting in problems such as long update time and low availability. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a log-based high-availability erasure code update method. For RS coding, based on log technology and a proposed new check block increment calculation method, only a part of the check nodes need to respond successfully to complete the update; when some check nodes respond too slowly or fail, the erasure code update can still be completed quickly and effectively, thereby accelerating the update speed and improving the update availability.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] A log-based high-availability erasure code update method is based on log technology. When the Reed-Solomon code is updated, only some check nodes need to respond successfully to complete the update. Specifically, the following steps are included:
[0008] Step 1: Write the update information to the log: Each time a data block is updated, set the expected update time t ′ , the minimum fault tolerance m during the update process ′ ;
[0009] When a single data block in a stripe is updated, determine whether there is information that multiple data blocks are updated at the same time in the data node log and the check node log. If so, merge the update information in the data node log and the check node log, and then execute process A; if not, directly execute process A; process A is: using Parity Logging technology, send the calculated check block increment to the check node and save it in the log of the corresponding check node. If at time t ′ There is m ′ If a check node responds successfully, the new data block is used to overwrite the old data block, and the number of stripe updates increases by 1;
[0010] When multiple data blocks in a stripe are updated, the Full Logging technology is used to send the calculated check block increment to the check node and save it in the log of the corresponding check node. ′ There is m ′ If a check node responds successfully, the new data block is saved in the log of the corresponding data node, and the number of stripe updates increases by 1;
[0011] Step 2, determine whether to merge logs: Repeat step 1 and determine whether the number of stripe updates reaches the threshold τ. If so, merge the update information in the data node log and the check node log and end the update process; if not, end the update process directly.
[0012] Furthermore, in step 1, when a single data block in a stripe is updated, or when multiple data blocks in a stripe are updated, if time t ′ The number of successful verification nodes in the internal response is less than m ′If there are no new check blocks, reconstruction write is used to write all new check blocks to the node that was not a data node or check node before, as a new check node, and the new data block is used to overwrite the old data block, reset the stripe update count to 0, and clear the update information about the stripe in the log of the data node, and end the update process.
[0013] Furthermore, in step 1, for the case where a single data block in a stripe is updated, the calculation method of the check block increment of the check node that did not respond successfully is as follows:
[0014] Use m ′ The check block increments saved by the check nodes that responded successfully are used to calculate the check block increments that are not saved by the remaining check nodes:
[0015] Suppose that during the rth update, a single data block in the stripe Updated to The m stored in the log of the verification node ′ The check block increment is Unsaved checksum increment is The unsaved check block increment can be calculated using any saved check block increment, where The calculation method for calculating the unsaved check block increment is:
[0016]
[0017] in, express generate The coding coefficient at .
[0018] Furthermore, in step 1, in the case where multiple data blocks in a stripe are updated, the calculation method of the check block increment of the check node that failed to respond successfully is as follows:
[0019] The new data block and part of the check block increment are saved in the data node log and the check node log respectively. The unsaved check block increment is calculated using the new data block, old data block and saved check block increment on the data node:
[0020] The data node saves the old data blocks before each update and the new data blocks after the update, and can calculate the data block increment. Suppose the increment of u data blocks updated for the rth time is Verify the number of nodes that have saved logs ′ The check block increment is If the data node is not faulty when calculating the unsaved check block increment, then u data block increments are calculated from the data node, and then the unsaved check block increment is calculated; if the data node fails, and the node failure does not exceed m ′Then the total number of remaining data block increments and check block increments is not less than u, and u increments are taken. Use u increments to calculate all data block increments Right now
[0021]
[0022] Then calculate the unsaved check block increment, that is,
[0023]
[0024] The increment calculation method of the unsaved check block is:
[0025]
[0026] express generate The coding coefficient at .
[0027] Furthermore, in step 1 and step 2, the merging of update information in the data node log and the check node log specifically includes:
[0028] For each update of the Reed-Solomon code, the unsaved check block increment is calculated using the new data block, the old data block and the saved check block increment on the data node, and then the old check block is read out and merged with all related check block increments to obtain a new check block;
[0029] Then, the new check block is used to overwrite the old check block on each check node. If the latest data block exists in the log of the data node, the latest data block is used to overwrite the old data block.
[0030] Finally, reset the stripe update count to 0 and clear the related update information in the log.
[0031] Compared with the prior art, the beneficial technical effects of the present invention are:
[0032] Compared with Parity Logging and Full Logging, the present invention only requires a portion of check nodes to respond successfully when updating the erasure code, thereby reducing update delay, accelerating update speed, and improving update availability.
[0033] The new check block increment calculation method ensures that the update mechanism can accommodate any m stripes during the update process. ′ In addition, using reconstruction write-back can ensure the update success when too many check nodes respond too slowly or fail, and improve the fault tolerance of the stripe. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of a log writing process for updating a single data block according to an embodiment of the present invention;
[0035] Figure 2 A schematic diagram of a log writing result of updating a single data block according to an embodiment of the present invention;
[0036] Figure 3 A schematic diagram of the log writing result of updating a single data block multiple times according to an embodiment of the present invention;
[0037] Figure 4 A schematic diagram of an incremental result of updating and completing a check block for a single data block according to an embodiment of the present invention;
[0038] Figure 5 A schematic diagram of a single data block update and merging log results according to an embodiment of the present invention;
[0039] Figure 6 A schematic diagram of the update and write log results of two data blocks according to an embodiment of the present invention;
[0040] Figure 7 A schematic diagram of the log writing results of updating two data blocks multiple times according to an embodiment of the present invention;
[0041] Figure 8 A schematic diagram of an incremental result of updating and completing a check block by two data blocks according to an embodiment of the present invention;
[0042] Fig. 9 A schematic diagram of a method for calculating an incremental update check block for a single data block according to an embodiment of the present invention;
[0043] Fig.10 A schematic diagram of an incremental calculation method for updating a check block by two data blocks according to an embodiment of the present invention;
[0044] Fig.11 This is a flow chart of the update mechanism of the present invention. DETAILED DESCRIPTION
[0045] A specific implementation of the present invention is described in detail below with reference to the accompanying drawings.
[0046] The log-based high-availability erasure code update method of the present invention includes a high-availability erasure code update mechanism and a new check block increment calculation method, and specifically includes the following steps:
[0047] Step 1: Write the update information to the log:
[0048] Each update input update expected time t ′ , the minimum fault tolerance m during the update process ′ , m ′ The default setting is half the number of check blocks, that is, During the update process, any m ′ wrong.
[0049] When a single data block in a stripe is updated, if there is no information in the log that multiple data blocks are updated at the same time, Parity Logging is used to send the calculated check block increment to the check node and save it in its log. ′ There is m ′ If a check node responds successfully, the new data block is used to overwrite the old data block, and the number of stripe updates is increased by 1; if when a single data block is updated, there is information that multiple data blocks are updated at the same time in the log, first execute step 3 to merge the existing update information in the log, and then execute the current step.
[0050] When multiple data blocks in a stripe are updated, Full Logging is used to send the calculated check block increments to the check nodes. ′ There is m ′ If a check node responds successfully, the new data block is saved in the log of the corresponding data node, and the number of stripe updates is increased by 1.
[0051] Regardless of whether a single data block or multiple data blocks are updated, if time t ′ The number of successful verification nodes in the internal response is less than m ′ If there are too many check nodes in the stripe that cannot respond in time, the required fault tolerance cannot be met. Use reconstruction write to write all new check blocks to other nodes, and use new data blocks to overwrite old data blocks, reset the stripe update count to 0, and clear the update information of this stripe in the data node log. The update is successful and the update process ends.
[0052] Unlike Parity Logging and Full Logging, the present invention only requires m ′ The update is successful when the check nodes respond successfully, which can effectively solve the problem of long update time due to long tail delay or low update availability due to check node failure. Different from directly using reconstruction writing, the present invention only performs reconstruction writing when there are too few check nodes that respond successfully, avoiding the large amount of overhead caused by using direct reconstruction writing.
[0053] Step 2: Determine whether to merge logs:
[0054] Step 1: After the verification node responds successfully and stores the new data block in the data node, the corresponding update information is saved in the log, and it is determined whether the number of stripe updates reaches the threshold value τ. If the number of stripe updates does not reach the threshold value τ, the update is successful and the update process ends; if the number of stripe updates reaches the threshold value τ, step 3 is executed to merge the update information in the log. After merging the logs, the update is successful and the update process ends.
[0055] Step 3: Merge the update information in the log:
[0056] Use the update information in the log to update the data block and the check block to the latest state. Step 1: Write log process Each update only requires m ′ The check nodes receive and save the check block increments, and some check nodes may not receive the required check block increments. At this stage, the check block increment calculation method proposed by the present invention is used to calculate the unsaved check block increments on other check nodes using the updated information saved in the log, and merge them with the old check blocks.
[0057] First, the existing check block increment calculation method is formalized, and then the check block increment calculation method used for single data block update and multi-data block update as well as the log merging process are given.
[0058] 3.1, the existing check block increment calculation method: Assume that the first update adds u data blocks in the stripe Updated to The updated value of the i-th check block is P i (1) , using the existing check block increment calculation formula, the i-th check block increment ΔP updated this time i (1) for:
[0059]
[0060] in express Generate P i The coding coefficient when for Indicates the jth updated in the first time t The data block increments and all the check block increment calculations can be expressed in matrix form, namely:
[0061]
[0062] 3.2, single data block update check block incremental calculation:
[0063] For a single data block update, m ′ The check block increments are saved on the check nodes that respond successfully. These saved check block increments are used to calculate the remaining unsaved check block increments. The specific calculation method is as follows:
[0064] Assume that the rth update will Updated to The m stored in the log of the verification node ′ The check block increment is Unsaved checksum increments It can be calculated using an already saved checksum block increment. Assuming that The calculation method is:
[0065]
[0066] For each update of a single data block, an unsaved check block increment can be calculated using an already saved check block increment.
[0067] 3.3, Multi-block update check block incremental calculation:
[0068] For multiple data block updates, the new data block and some check block increments are saved in the log. The remaining unsaved check block increments can be calculated using the new and old data blocks on the data node and the saved check block increments. The specific calculation method is as follows:
[0069] The data node saves the old data block before each update and the new data block after the update, and the data block increment can be calculated. Suppose the increment of u data blocks updated for the rth time is Verify the number of nodes that have saved logs ′ The check block increment is If the data node is not faulty when calculating the rest of the check block increments, the u data block increments can be calculated from the data node, and then the rest of the check block increments can be calculated; if the data node fails, and the node failure does not exceed m ′ Then the total number of remaining data block increments and check block increments is not less than u. Suppose u of them are taken Using these u increments, we can first calculate the increments of all data blocks Right now:
[0070]
[0071] Then calculate the unsaved check block increment, that is:
[0072]
[0073] The increment calculation method of the unsaved check block is:
[0074]
[0075] By using the above method, the unsaved check block increment can be calculated each time multiple data blocks are updated.
[0076] 3.4, merge logs:
[0077] For each update, the unsaved check block increment is calculated using the above calculation method, and then the old check block is read out and merged with all related check block increments to obtain a new check block. For example, starting from the first update until the number of updates reaches the threshold τ, the merge log, the i-th check block is After that, the new check block is used to overwrite the old check block on each check node. If the latest data block exists in the log of the data node, the latest data block is used to overwrite the old data block. Finally, the number of stripe updates is reset to 0, and after clearing the relevant information in the log, the update is successful and the update process ends.
[0078] The present invention takes RS(10,4) erasure code as an example and gives Figures 1 to 10 Instances in .
[0079] Embodiment 1:
[0080] This embodiment describes the update of a single data block in a stripe based on a high-availability erasure code update mechanism.
[0081] Step 1: Write the update information to the log:
[0082] Figure 1 The log writing process is given, a single data block in the RS(10,4) stripe Updated to The log of the check node (node11 to node14) does not store information about the simultaneous update of multiple data blocks. The check block increment is calculated using read-modify-write and sent to the check node. The check node receives the check block increment, saves it in the log, and returns a successful response message. ′ There is m ′ = 2 check nodes (node11, node12) respond successfully and use the new data block Overwrite old data blocks Figure 2 Given the log writing result, data node node1 only saves the new data block The logs of check nodes node11 and node12 store the check block increments. The number of stripe updates before the update was 0, and after this update, the number of stripe updates increased by 1 and became 1. After 2 updates, it becomes The load of each node is different at different times, and the verification nodes that respond successfully are different. Figure 3 The results of multiple updates and log writes are given. Only the latest data block is saved on node1 The logs of node11 to node14 store the check block increments received for each update. At the same time, the number of stripe updates is increased by 1 for each subsequent update.
[0083] Step 2: Determine whether to merge logs:
[0084] Assume that the stripe update count threshold is 3. The stripe update counts for the first two updates are 1 and 2 respectively. The stripe update count threshold is not reached, so the update is successful and the update process ends. Updated to The number of stripe updates is 3, reaching the threshold, and the log merge process is started.
[0085] Step 3: Merge the update information in the log:
[0086] Figure 3 The log on the check node does not save the check block increment required for each update, and there is a gap. The check block increment needs to be supplemented to ensure the correctness of the check block. According to the proposed single data block update check block increment calculation method, all required check block increments are calculated using the check block increment saved for each update. Figure 4 The information saved in the log after completing the check block increment is given. Each node from node11 to node14 saves all the required check block increments. By merging the check block with the corresponding check block increment on each check node, the check block can be successfully updated. There is no latest data block in the log of the data node, and no operation is required. Figure 5 The merged result is given, and all check blocks reach the latest status. Then the number of stripe updates is reset to 0, and the update information in the log is cleared. The update is successful and the update process ends.
[0087] Embodiment 2:
[0088] This embodiment describes the update of two data blocks in a stripe based on a high-availability erasure code update mechanism.
[0089] Step 1: Write the update information to the log:
[0090] The two data blocks in the RS(10,4) stripe Updated to The check block increment is calculated using read-modify-write, and the check block increment is sent to the check nodes (node11 to node14). The check nodes receive the check block increment, save it in the log, and return a successful response message. ′ There is m ′ = 2 check nodes (node11, node12) respond successfully, Save them to the logs of the corresponding data nodes respectively. Figure 6 The log writing result is given. The logs of data nodes node1 and node2 store new data blocks respectively. The logs of check nodes node11 and node12 store the check block increments. The number of stripe updates before the update was 0, and after this update, the number of stripe updates increased by 1 and became 1. After 2 updates, it becomes The verification node that successfully responds to each log write is different. Figure 7 The results of multiple updates and log writing are given. The logs on node1 and node2 save the new data blocks of each update, and the logs on node11 to node14 save the received check block increments. At the same time, the number of stripe updates is increased by 1 for each subsequent update.
[0091] Step 2: Determine whether to merge logs:
[0092] Assume that the stripe update count threshold is 3. The stripe update counts for the first two updates are 1 and 2 respectively, which do not reach the stripe update count threshold. The update is successful and the update process ends. For the third update, the stripe update count is 3, which reaches the threshold, and the log merge process is started.
[0093] Step 3: Merge the update information in the log:
[0094] Figure 7 The log on the check node does not save the check block increment required for each update, and there is a gap. The check block increment needs to be supplemented to ensure the correctness of the check block. According to the proposed multi-block update check block increment calculation method, all required check block increments are calculated using the information saved in each update log. Figure 8 The information saved in the log after completing the check block increment is given. Each node from node11 to node14 saves all the required check block increments. On each check node, the check block is merged with the corresponding check block increment to update the check block. The latest data block exists in the logs of data nodes node1 and node2. The latest data block is used to overwrite the write data block. After that, the stripe update count is reset to 0, the update information saved in the log is cleared, the update is successful, and the update process ends. The final state of the stripe is the same as Figure 5 Similarly, all data blocks and check blocks are brought up to date.
[0095] Embodiment 3:
[0096] This embodiment is based on Embodiment 1 and illustrates a specific method for calculating the increment of the check block that is not saved when a single data block is updated.
[0097] Figure 2 Given Updated to As a result of writing logs, node13 and node14 do not save the required check block increments Use the saved logs when merging logs Calculate it. Fig. 9 The calculation method is given. According to the calculation formula given above, the subscript of the existing block is substituted into the corresponding coding coefficient α 31,α 41 ,α 11 , and perform matrix operations to obtain the required check block increment.
[0098] Embodiment 4:
[0099] This embodiment is based on Embodiment 2 and illustrates a specific method for calculating the increment of unsaved check blocks during multi-block update.
[0100] Figure 6 Given Updated to As a result of writing logs, node13 and node14 do not save the required check block increments. When merging logs, use the information in the logs to calculate. Use the It can be calculated use calculate Fig.10 The calculation method is given. According to the calculation formula given above, the subscript of the existing block is substituted into the matrix operation to obtain the required check block increment.
[0101] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention, and any reference numerals in the claims should not be regarded as limiting the claims involved.
[0102] In addition, it should be understood that although the present specification is described in terms of implementation modes, not every implementation mode contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A high-availability erasure code update method based on logs, characterized in that: Based on log technology, when the Reed-Solomon code is updated, only some check nodes need to respond successfully to complete the update, which includes the following steps: Step 1: Write the update information to the log: Each time a data block is updated, set the expected update time t ′ , the minimum fault tolerance m during the update process ′ ; When a single data block in a stripe is updated, determine whether there is information that multiple data blocks are updated at the same time in the data node log and the check node log. If so, merge the update information in the data node log and the check node log, and then execute process A; if not, directly execute process A; process A is: using Parity Logging technology, send the calculated check block increment to the check node and save it in the log of the corresponding check node. If at time t ′ There is m ′ If a check node responds successfully, the new data block is used to overwrite the old data block, and the number of stripe updates increases by 1; When multiple data blocks in a stripe are updated, the FullLogging technology is used to send the calculated check block increment to the check node and save it in the log of the corresponding check node. ′ There is m ′ If a check node responds successfully, the new data block is saved in the log of the corresponding data node, and the number of stripe updates increases by 1; Step 2, determine whether to merge logs: Repeat step 1 and determine whether the number of stripe updates reaches the threshold τ. If so, merge the update information in the data node log and the check node log and end the update process; if not, end the update process directly.
2. The log-based high-availability erasure code update method according to claim 1, characterized in that: In step 1, when a single data block in a stripe is updated, or when multiple data blocks in a stripe are updated, if time t ′ The number of successful verification nodes in the internal response is less than m ′ If there are no new check blocks, reconstruction write is used to write all new check blocks to the node that was not a data node or check node before, as a new check node, and the new data block is used to overwrite the old data block, reset the stripe update count to 0, and clear the update information about the stripe in the log of the data node, and end the update process.
3. The log-based high-availability erasure code update method according to claim 1, characterized in that: In step 1, for the case of updating a single data block in a stripe, the calculation method of the check block increment of the unsuccessful response check node is as follows: Use m ′ The check block increments saved by the check nodes that responded successfully are used to calculate the check block increments that are not saved by the remaining check nodes: Suppose that during the rth update, a single data block in the stripe Updated to The m stored in the log of the verification node ′ The check block increment is Unsaved checksum increment is The unsaved check block increment can be calculated using any saved check block increment, where The calculation method for calculating the unsaved check block increment is: in, express generate The coding coefficient at .
4. The log-based high-availability erasure code update method according to claim 1, characterized in that: In step 1, when multiple data blocks in a stripe are updated, the calculation method of the check block increment of the check node that failed to respond is as follows: The new data block and part of the check block increment are saved in the data node log and the check node log respectively. The unsaved check block increment is calculated using the new data block, old data block and saved check block increment on the data node: The data node saves the old data blocks before each update and the new data blocks after the update, and can calculate the data block increment. Suppose the increment of u data blocks updated for the rth time is Verify the number of nodes that have saved logs ′ The check block increment is If the data node is not faulty when calculating the unsaved check block increment, then u data block increments are calculated from the data node, and then the unsaved check block increment is calculated; If a data node fails, and the number of node failures does not exceed m ′ Then the total number of remaining data block increments and check block increments is not less than u, and u increments are taken. Use u increments to calculate all data block increments Right now Then calculate the unsaved check block increment, that is, The increment calculation method of the unsaved check block is: express generate The coding coefficient at .
5. The log-based high-availability erasure code update method according to claim 1, characterized in that: In step 1 and step 2, the merging of update information in the data node log and the check node log specifically includes: For each update of the Reed-Solomon code, the unsaved check block increment is calculated using the new data block, the old data block and the saved check block increment on the data node, and then the old check block is read out and merged with all related check block increments to obtain a new check block; Then, on each check node, the new check block is used to overwrite the old check block. If the latest data block exists in the log of the data node, the latest data block is used to overwrite the old data block. Finally, reset the stripe update count to 0 and clear the related update information in the log.
Citation Information
Patent Citations
Distributed storage CEPH based erasure correction code overwriting method
CN105930103A
Erasure code updating method and device as well as electronic device
CN106788468A
Differential log type erasure code updating method for single storage pool
CN107766170A
Erasure code updating method and system based on copy data logs
CN110262922A
Methods and systems for efficient erasure-coded storage systems
US11385806B1
