Repository navigation
Fix subscription prefetch wakeups for late replicated WAL entries - #19194
Conversation
Wake an existing idle prefetch task after an empty poll so replicated WAL entries can be discovered without another local write. Preserve initialization, seek, lifecycle and executor-binding guards. Add a regression covering delivery and acknowledgement without advancing the local WAL cursor.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #19194 +/- ##
============================================
+ Coverage 48.80% 49.04% +0.24%
- Complexity 674 689 +15
============================================
Files 5574 5590 +16
Lines 412836 413988 +1152
Branches 54448 54636 +188
============================================
+ Hits 201480 203056 +1576
+ Misses 211356 210932 -424 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jt2594838
left a comment
There was a problem hiding this comment.
Is it possible to sense the repication of WAL via WALNode, like recording the lastReplicatedNano in it.
|
Review follow-up for @jt2594838, addressed your WALNode suggestion. Regarding the Codecov report: the root Surefire configuration excludes Validation: clean compilation of the required IoTDB dependency closure in the 28-module reactor, Spotless, Checkstyle, and Reviewed SHA: |
|




Description
Replicated WAL entries can arrive after a subscription prefetch worker becomes idle without advancing the local WAL search index or entering the realtime queue. Previously, repeated polls could remain empty until another event woke the worker.
Expose a replicated-batch version through
WALNode, published byWALBufferonly after a successful flush/force. An empty poll wakes an idle worker only when that version differs from the version captured before its last prefetch round. Capturing it before scanning preserves replication that arrives after the final iterator check. This replaces the periodic 100 ms retry while preserving initialization, seek, close, and executor-binding guards.For example, on an idle follower whose local WAL search index remains
0, a replicated entry from writer8with sequence10and timestamp10now becomes available for delivery and acknowledgement after an empty poll triggers replay. With no new replicated batch, empty polls leave the idle worker unscheduled.Validation
At commit
cabaa63fc95f7c0d897ffb938c0cb2374b00d479:WALBufferRollRecoveryTest: 11 tests passed;ConsensusPrefetchingQueueSeekTest: 9 tests passed in Surefire.ConsensusPrefetchingQueueReplicationTest: both tests passed using JUnitCore with the same reactor classes and JVM options and immutable copies of the TsFile dependencies. Their first Surefire attempt hit class-loading errors while the dependency JARs were being replaced during the run.git diff --checkpassed.Subscription was temporarily enabled in the verification source and restored before committing. The submitted diff does not change the subscription switch. The full test suite and distributed integration tests have not been run.