Caideyipi opened a new pull request, #18810: URL: https://github.com/apache/iotdb/pull/18810
## Description The WAL reader reports the last written local search index, while the subscription replay cursor stores the next index to read. When replay lookup found every local entry covered and returned `AT_END`, it used the last index as the cursor. This could reread the final record and report a spurious one-entry WAL gap. Advance the `AT_END` cursor to the index after the last WAL record. Apply the same boundary to `seekToEnd()`. Add regression coverage for a covered tail record, an empty replay scan, and initialization at the tail with zero raw WAL gap. ## Verification - `mvn -o spotless:check -pl iotdb-core/datanode` passed. - Compiled the changed production and test classes against the cached `2.0.11-SNAPSHOT` artifacts. - The three boundary regression tests failed against the original class with `expected:<6> but was:<5>` and passed against the fixed class. - The standard module `mvn test` could not finish because this workspace's mixed existing build cache causes unrelated generated query classes to fail compilation. A direct run of the whole test class had six other failures; the three boundary tests passed. <hr> This PR has: - [x] been self-reviewed. - [x] added comments explaining the index boundary. - [x] added or updated unit tests for the changed path. <hr> ##### Key changed/added classes in this PR - `ConsensusPrefetchingQueue` - `ConsensusPrefetchingQueueTest` -- 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]
