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

   ## Description
   
   Subscription WAL replay can remain in `WAITING_FOR_READABLE_WAL` 
indefinitely after a reader-open failure: refreshing the file list filters out 
a sealed header-only WAL, but the retry path keeps waiting for that version to 
reappear. Rotation can also pair an old file with metadata from its successor 
because the writer and current-version fields are published separately.
   
   This change:
   
   - Resolves retries against the unfiltered directory listing so a verified 
empty sealed WAL can finish without reporting a gap. A missing historical file 
requires a visible successor, two successful directory scans, and a confirmed 
absent path before replay reports the missing file and continues. Active files 
and ambiguous I/O failures remain retryable.
   - Applies the existing stable truncation check when reopening at a saved 
entry offset. Confirmed missing or truncated files use the existing 
unreadable-WAL reporting path and discard incomplete request fragments. A file 
that previously contained entries cannot be mistaken for a normal empty WAL 
after truncation.
   - Binds live metadata snapshots to the captured writer's file version, and 
exposes reader-open attempts, the retry file, and the retry reason in replay 
diagnostics.
   
   Adds regression coverage for filtered empty files, temporarily missing 
active files, confirmed missing historical files, truncated reopen offsets, 
header-only truncation, and rotation during metadata capture. The WALBuffer 
test also covers the interval between publishing a successor writer and 
publishing its version.
   
   ## Validation
   
   - Full-reactor `test-compile` passed in English and with `-Pwith-zh-locale` 
(53 modules each).
   - Recompiled the final changed production sources and selected test classes 
against the master reactor outputs, then ran eight classes with JUnitCore: 
**134 tests, 133 passed, 1 existing failure**. All seven newly added regression 
tests passed.
   - The remaining failure, 
`ConsensusPrefetchingQueueWalBackpressureTest.testWalGapRecoveryPreservesFollowerBeforePendingBoundary`,
 was reproduced with the unmodified production sources and test class from base 
commit `4c34a253927`: the same memory assertion expects 1318 bytes and observes 
0. Its assertion is unchanged in this PR.
   - Spotless, `git diff --check`, locale key parity, and the new messages' 
placeholder/hash checks passed.
   
   The original long-running workload has not been rerun with this patch. This 
PR addresses reproducible retry-state defects; it does not establish that every 
replay stall under memory pressure has the same cause.
   
   ## Review checklist
   
   - [x] Self-reviewed, including concurrent WAL rotation and metadata reads.
   - [x] Added regression tests and adapted existing metadata mocks.
   - [x] Added comments explaining recovery and incomplete-request handling.
   
   Key classes: `ProgressWALIterator`, `WALBuffer`, `WALNode`, 
`ConsensusPrefetchingQueue`.
   


-- 
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