Skip to content

Retry peer-list reset during AddRegionPeer rollback - #19118

Open
d-wang-commit wants to merge 1 commit into
apache:masterfrom
d-wang-commit:fix-add-region-peer-rollback-retry
Open

d-wang-commit wants to merge 1 commit into
apache:masterfrom
d-wang-commit:fix-add-region-peer-rollback-retry

Conversation

@d-wang-commit

Copy link
Copy Markdown
Contributor

Description

Retry rollback cleanup while DataNodes restart

After a whole-cluster restart during region migration, AddRegionPeer rollback can reach the target DataNode before its internal RPC service is ready. All six immediate RPC attempts can fail, leaving the target consensus group directory behind. This occurred in IoTDBRegionMigrateClusterCrashIoTV2StreamIT#clusterCrash2.

Retry incomplete or unsuccessful peer-list reset batches up to three additional times, waiting five seconds between batches. Stop when all requested nodes return success, or stop waiting and preserve the interrupt flag when interrupted. Keep the existing rollback flow and completion behavior.

Tests

  • UT: Added four cases to AddRegionPeerProcedureTest for delayed success, retry exhaustion, immediate success and interruption. All five tests, including the existing serialization test, passed.
  • IT: No integration test changes. The existing IoTDBRegionMigrateClusterCrashIoTV2StreamIT#clusterCrash2 passed with a full 3-ConfigNode/3-DataNode restart. Reset succeeded in the first batch in this run; delayed retries are covered by the unit tests.
  • Spotless checks passed.

Side effects and risks

Failed rollback cleanup can occupy a procedure worker for up to 15 additional seconds of waiting, plus RPC time. Retries repeat the idempotent reset on all related nodes. Cleanup remains best effort if retries are exhausted; procedure states and serialization are unchanged.


This PR has:

  • been self-reviewed.
  • added unit tests or modified existing tests to cover new code paths.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR
  • AddRegionPeerProcedure: add bounded delayed retries around rollback peer-list reset RPCs.
  • AddRegionPeerProcedureTest: cover retry timing, attempt limits, early success and interruption.

Wait five seconds between up to three additional reset RPC batches.
Cover retry success, exhaustion, early completion and interruption.
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