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/10/15 02:25:22 UTC
[PR] [Test] Fix Ratis mini-cluster shutdown race [iotdb]
Caideyipi opened a new pull request, #18879:
URL: https://github.com/apache/iotdb/pull/18879
## Description
`RecoverReadTest.consistentReadWithSlowApply` can pass its read assertions and then fail in teardown with `Unexpected exit`. The [Windows CI failure](https://github.com/apache/iotdb/actions/runs/38550272247/job/115806242034) shows `LeaderStateImpl.checkPeersForYieldingLeader()` reading a `SegmentedRaftLog` that shutdown has already closed.
Pause elections on live mini-cluster peers and wait for leader stepdown before closing the servers. The stepdown runs through the leader event processor, allowing in-flight leadership checks to finish while the log is still open. Handle repeated stops and peers stopped earlier by a test, and retain cleanup in a `finally` block. The unexpected-exit assertion remains active.
Add a regression that holds the leader's monitor during a simulated in-flight log check while another thread stops the cluster. It verifies that the state machine stays open until the check completes and that the log remains readable.
## Validation
- The new regression fails against the original `MiniCluster.stop()` and passes with this change.
- Windows / JDK 17: `mvn -nsu -B -ntp -Ddevelocity.off=true -pl iotdb-core/consensus clean test` — 78 tests passed, 0 failures/errors/skips.
- Spotless formatting and Checkstyle.
This PR has:
- [x] been self-reviewed.
- [x] added comments explaining the shutdown ordering.
- [x] added a concurrency regression test.
Key changed classes: `TestUtils.MiniCluster`, `RecoverReadTest`.
--
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] [Test] Fix Ratis mini-cluster shutdown race [iotdb]
Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 merged PR #18879:
URL: https://github.com/apache/iotdb/pull/18879
--
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