You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "Caideyipi (via GitHub)" <gi...@apache.org> on 2026/08/04 08:33:50 UTC

[PR] Fix repeated WAL scans during subscription catch-up [iotdb]

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

   ## Description
   
   ### Reuse the WAL iterator during historical catch-up
   
   A bounded consensus-subscription prefetch round recreated `ProgressWALIterator` at `nextExpectedSearchIndex` before reading each batch. The iterator still opens retained WAL files from the beginning and applies `startSearchIndex` only after request deserialization, so every batch repeatedly scanned all earlier WAL entries. The resulting read amplification grew with catch-up progress and made consumption progressively slower.
   
   This change keeps the existing iterator, including its WAL reader cursor and buffered look-ahead request, across normal bounded prefetch rounds. Explicit resets remain in place for seek, WAL-gap recovery, exhausted live WAL refresh, and memory rollback.
   
   ### Regression coverage
   
   A real sealed-WAL test limits each batch to one entry and verifies that three consecutive catch-up rounds:
   
   - reuse the same `ProgressWALIterator`;
   - advance the read search index contiguously;
   - deliver writer local sequences 1, 2, and 3 exactly once.
   
   ### Verification
   
   ```text
   mvn -o test -pl iotdb-core/datanode -am -Dtest=ProgressWALIteratorTest,ConsensusPrefetchingQueueTest,ConsensusPrefetchingQueueWalBackpressureTest -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false
   ```
   
   Tests run: 29, Failures: 0, Errors: 0, Skipped: 0.
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added comments explaining the why and intent of the code.
   - [x] added unit tests covering the regression.
   
   ##### Key changed/added classes
   
   - `ConsensusPrefetchingQueue`
   - `ConsensusPrefetchingQueueWalBackpressureTest`


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix repeated WAL scans during subscription catch-up [iotdb]

Posted by "Caideyipi (via GitHub)" <gi...@apache.org>.
Caideyipi commented on PR #18392:
URL: https://github.com/apache/iotdb/pull/18392#issuecomment-5290653354

   Closing as superseded by #18402, which already includes this WAL iterator reuse fix and a more complete solution for refresh handling, pending-cursor fast-forwarding, and late-ACK lock contention.


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix repeated WAL scans during subscription catch-up [iotdb]

Posted by "Caideyipi (via GitHub)" <gi...@apache.org>.
Caideyipi closed pull request #18392: Fix repeated WAL scans during subscription catch-up
URL: https://github.com/apache/iotdb/pull/18392


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org