Skip to content

Fix AddConfigNode retry idempotency#17874

Merged
CRZbulabula merged 1 commit into
masterfrom
fix/add-confignode-idempotent-retry
Jun 9, 2026
Merged

Fix AddConfigNode retry idempotency#17874
CRZbulabula merged 1 commit into
masterfrom
fix/add-confignode-idempotent-retry

Conversation

@CRZbulabula

Copy link
Copy Markdown
Contributor

Summary

This PR makes ConfigNode membership changes idempotent during AddConfigNodeProcedure retry paths.

When ADD_CONSENSUS_GROUP times out, the first request may have already created the local ConfigRegion peer on the joining ConfigNode. A retry then sees the consensus group already exists and previously failed the procedure, which could leave the new ConfigNode process alive but not registered in the cluster.

Changes:

  • Treat ConsensusGroupAlreadyExistException from createLocalPeer as success.
  • Treat PeerAlreadyInConsensusGroupException from addRemotePeer as success.
  • Treat PeerNotInConsensusGroupException from rollback removeRemotePeer as success.
  • Allow deleteConfigNodePeer to clean up a local peer even before the ConfigNode is present in registeredConfigNodes, while still rejecting requests targeting a different ConfigNode id.

Tests

mvn spotless:apply -pl iotdb-core/confignode
mvn test -pl iotdb-core/confignode -Dtest=ConsensusManagerTest,ConfigNodeRPCServiceProcessorTest

Both commands passed. The local sandbox logs Develocity cache/write warnings for ~/.m2/.develocity, but Maven reports BUILD SUCCESS.

@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.86%. Comparing base (3d98ea5) to head (8a2485a).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...confignode/manager/consensus/ConsensusManager.java 86.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17874      +/-   ##
============================================
+ Coverage     40.85%   40.86%   +0.01%     
  Complexity     2611     2611              
============================================
  Files          5201     5201              
  Lines        354010   354028      +18     
  Branches      45313    45314       +1     
============================================
+ Hits         144626   144679      +53     
+ Misses       209384   209349      -35     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CRZbulabula CRZbulabula merged commit c3e74a2 into master Jun 9, 2026
47 of 48 checks passed
@CRZbulabula CRZbulabula deleted the fix/add-confignode-idempotent-retry branch June 9, 2026 08:54
MileaRobertStefan pushed a commit to MileaRobertStefan/iotdb that referenced this pull request Jun 26, 2026
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.

1 participant