Caideyipi opened a new pull request, #18838:
URL: https://github.com/apache/iotdb/pull/18838
## Description
When a consensus subscription event reaches the existing 10-NACK poison
threshold, the queue force-ACKs and disposes of it without committing its
outstanding writer-progress mapping. Later ACKs for that writer cannot advance
the contiguous checkpoint past the discarded event. This can hold back WAL
reclamation based on committed progress and cause already handled events to be
replayed after recovery.
Commit poisoned events through the ordinary `commitAndRefreshWalRetention`
path before disposing of them in explicit NACK, silent client NACK, and timeout
recycling. If the commit is rejected, requeue the event and retain its tablet
memory for retry. The existing poison-event policy and threshold are preserved.
## Validation
- The four regression cases fail against the original implementation: all
three discard paths leave committed progress unset, and a rejected commit still
discards the event.
- All 71 tests pass in `ConsensusPrefetchingQueueTest`,
`ConsensusSubscriptionCommitStateTest`, and
`ConsensusPrefetchingQueueSeekTest`. The new cases also verify that a later
data event remains committable and that retained memory is released only after
a successful commit.
- Full reactor `mvn -Ddevelocity.off=true -nsu test-compile -DskipTests` and
the same command with `-P with-zh-locale`: both passed.
- Spotless, Checkstyle, and `git diff --check`: passed.
```bash
mvn -Ddevelocity.off=true -nsu -pl iotdb-core/datanode -am test \
-Dtest=ConsensusPrefetchingQueueTest,ConsensusSubscriptionCommitStateTest,ConsensusPrefetchingQueueSeekTest
\
-DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false \
-Diotdb.test.skip=false -Diotdb.ut.skip=false
```
This PR has:
- [x] been self-reviewed, including queue locking and per-event ACK/NACK
serialization.
- [x] added a comment explaining why the outstanding mapping must be
consumed before disposal.
- [x] added unit tests for all three discard paths and rejected-commit retry.
Key changed classes: `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]