Skip to content

fix bootstrap retry after transient disconnect - #26414

Closed
gouhongshen wants to merge 2 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-26091
Closed

gouhongshen wants to merge 2 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-26091

Conversation

@gouhongshen

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #26091

What this PR does / why we need it:

Embedded-cluster bootstrap runs all system initialization statements in one transaction. Under heavy CI load, a temporary HAKeeper/TN connection reset can abort that transaction. The bootstrap owner currently returns the connection error immediately, and CN startup converts it into a process-wide panic.

This PR makes the bootstrap owner recover only from errors classified by morpc.IsConnectionError:

  • wait for the connection to recover within the existing five-minute bootstrap context;
  • check durable bootstrap state before retrying, because a lost commit response can hide a successful commit;
  • retry the complete all-or-nothing bootstrap transaction only when the state is definitively incomplete;
  • continue returning non-connection errors immediately.

The bootstrap lock ownership and global timeout behavior are unchanged.

Validation:

  • go test ./pkg/bootstrap -count=1
  • go test -race ./pkg/bootstrap -run 'TestBootstrap(RetriesConnectionError|ChecksStateBeforeRetry|DoesNotRetryNonConnectionError)' -count=1
  • go test ./pkg/embed -run '^TestBasicCluster$' -count=1 in three independent processes

@gouhongshen

Copy link
Copy Markdown
Contributor Author

Closing because this work is already being handled elsewhere.

@gouhongshen
gouhongshen deleted the agent/issue-26091 branch July 30, 2026 02:44

This branch had an error being deployed

1 failed deployment
ci — b7bcb341 Deployed Jul 30, 2026 by mergify[bot] via Matrixone Utils CI / Coverage #43463
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants