Skip to content

[To dev/1.3] [Test] Fix Ratis mini-cluster shutdown race (#18879) - #18885

Merged
jt2594838 merged 1 commit into
apache:dev/1.3from
Caideyipi:cp-18879-dev-1.3
Oct 15, 2026
Merged

jt2594838 merged 1 commit into
apache:dev/1.3from
Caideyipi:cp-18879-dev-1.3

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

dev/1.3 has the same Ratis mini-cluster shutdown race as master: an in-flight leader check can access a log that teardown has already closed, causing an unexpected Ratis exit after the test assertions pass. The branch uses Ratis 3.2.1, and the new regression fails against its existing shutdown implementation.

Backport #18879 (f8135bb728497934771f708ce4dac21572137ae7). Pause elections on live peers and wait for leader stepdown through the leader event processor before closing servers. Preserve the unexpected-exit checks, repeated-stop handling, and cleanup of peers stopped earlier by a test. The only adaptation to the original patch is updating the Ratis version in the shutdown-order comment to 3.2.1.

Validation

  • The new RecoverReadTest.stopWaitsForInFlightLeaderCheck regression fails against the original dev/1.3 helper and passes with this backport.
  • Windows / JDK 17 / Ratis 3.2.1: mvn -nsu -B -ntp -Ddevelocity.off=true -pl iotdb-core/consensus clean test — 47 tests passed, 0 failures/errors/skips.
  • mvn -nsu -B -ntp -Ddevelocity.off=true -pl iotdb-core/consensus spotless:apply; Spotless and Checkstyle checks passed during the clean test build.

This PR has:

  • been self-reviewed.
  • added comments explaining the shutdown ordering.
  • added a concurrency regression test.

Key changed classes: TestUtils.MiniCluster, RecoverReadTest.

@jt2594838
jt2594838 merged commit 08a7c89 into apache:dev/1.3 Oct 15, 2026
15 of 16 checks passed
@jt2594838
jt2594838 deleted the cp-18879-dev-1.3 branch October 15, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants