Caideyipi commented on code in PR #18895:
URL: https://github.com/apache/iotdb/pull/18895#discussion_r4282108174


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusPrefetchingQueue.java:
##########
@@ -2469,6 +2516,10 @@ private void resetSubscriptionWALPosition(final long 
startSearchIndex) {
     reportedSkippedBrokenWalFileCount = 0;
     reportedSkippedBrokenWalEntryCount = 0L;
     subscriptionWALIterator = createSubscriptionWALIterator(startSearchIndex);
+    if (Objects.nonNull(subscriptionWALIterator)) {
+      subscriptionWALIterator.advanceTo(
+          startSearchIndex, this::isWriterProgressCoveredForWalFastForward);
+    }
   }

Review Comment:
   Moved the coverage-aware `advanceTo()` into 
`createSubscriptionWALIterator(startSearchIndex)` and removed the separate 
initialization step from `resetSubscriptionWALPosition()` in 
60e3ae390ef403f5000af7d024b9c24ebab0aedc.
   
   The constructor argument only sets the local search-index filtering lower 
bound. Skipping whole WAL files also requires the queue's writer-progress 
coverage check, since those files may contain uncovered follower requests. The 
factory now completes both steps before returning the iterator.
   
   Extended the regression to call the factory directly and reach the target 
within a two-entry WAL scan budget; it fails before this change and passes 
afterward. Validation: 87 targeted tests, 0 failures/errors, 1 opt-in 
performance test skipped; full-reactor English and Chinese `test-compile` 
builds passed.



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