HTHou opened a new pull request, #19287:
URL: https://github.com/apache/iotdb/pull/19287

   ## Description
   
   ### WAL initialization
   
   If a V2/V3 header write or an extension provider fails after opening a new 
WAL, the writer closes the file but can leave the empty file or partial header 
on disk. For example, if initialization writes two bytes to `_1-1-1.wal` and 
then throws, the next roll rejects that nonempty successor.
   
   The writer now uses exclusive creation to identify files it owns. On failure 
it closes the channel and format resources, removes a file created by that 
attempt, and propagates the original exception with any cleanup errors 
suppressed. Retrying can create `_1-1-1.wal` again. Existing files retain their 
append behavior and are kept on failure.
   
   ### Checkpoint rolling
   
   If the write of `GLOBAL_MEMORY_TABLE_INFO` fails after the maximum memtable 
ID has been written to `_1.checkpoint`, the old roll path can still force the 
incomplete file and delete `_0.checkpoint`. For example, recovery could skip an 
already forced insert at timestamp 10 for memtable 1 because it lost the 
mapping from `_0.checkpoint`.
   
   The manager now writes and forces the complete recovery snapshot under a 
temporary name, atomically publishes it, and then switches writers and retires 
the old checkpoint. If creation, either write, forcing, or publishing fails, 
`_0.checkpoint` stays active and recovery can replay the insert. Recovery skips 
temporary candidates and falls back past a checkpoint from the previous roll 
path that contains incremental entries without an initial global snapshot. A 
snapshot that exceeds the roll threshold waits for an incremental checkpoint 
before the next roll.
   
   ## Validation
   
   - DataNode Spotless passed.
   - DataNode WAL tests reported 178 passed and 2 existing performance tests 
skipped. This includes the `WALFormatExtensionTest` wrapper, which ran all 20 
isolated cases, and 7 checkpoint rolling and replay tests.
   - Full reactor `mvn test-compile -DskipTests` passed with the default locale 
and with `-P with-zh-locale`.
   
   - [x] Self-reviewed the patch.
   - [x] Added regression tests for the new code paths.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to