Skip to content

test(bootstrap): cover interrupted view metadata upgrade recovery - #29435

Closed
ck89119 wants to merge 1 commit into
matrixorigin:mainfrom
ck89119:issue-29396-main
Closed

ck89119 wants to merge 1 commit into
matrixorigin:mainfrom
ck89119:issue-29396-main

Conversation

@ck89119

@ck89119 ck89119 commented Sep 28, 2026

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:

Related to #29396.

The production catalog-table repair is already present in #28851. This PR adds regression coverage without changing production behavior; it does not claim verification against the original retained QA data directory.

What this PR does / why we need it:

An upgrade retry must preserve existing catalog data, roll back incomplete DDL together with upgrade progress, and resume persisted work instead of queuing duplicate steps.

  • Extend upgrade-routing tests for an older ready 4.0.8 offset and a pending current-offset upgrade.
  • Cover the reverse partial-catalog state and failures while checking or creating the second catalog table.
  • Add a dedicated embedded-cluster regression using real transactions and persisted upgrade steps. Inject a second-DDL failure and a pre-commit interruption, verify rollback, then restart all services on the same storage with one catalog table still missing. Verify MySQL connectivity, retained user data, completed upgrade steps, and stable catalog-table IDs across another restart.
  • Reuse existing catalog helpers and explicitly release the package's shared fixture before starting the dedicated cluster. Keep assertions outside transaction callbacks so FailNow cannot strand a transaction.

Validation

Local CPU validation on macOS/arm64, Go 1.26.4, using the repository CGo wrapper:

  • pkg/bootstrap and pkg/bootstrap/versions/v4_0_8: full normal package tests passed; v4_0_8 coverage is 100%.
  • pkg/tests/upgrade: full normal and race package tests passed. The new test passed under race in 49.13s.
  • Four focused CN admission tests passed: waiting for catalog commit, propagating upgrade failure, rejecting buffered failure, and bounded waiting without an upgrade owner.
  • Incremental gofmt/vet/golangci-lint passed for the three affected packages; golangci-lint 2.6.2 was built with Go 1.26.4.

The normal upgrade package took 71.989s versus 27.780s with the new test excluded (about 44.2s additional). The private fixture is necessary because it rewrites upgrade progress and restarts services; one user row and two upgrade steps suffice.

Scope and limitations

This is a synthetic catalog-recovery fixture, not an execution of an old 4.2 binary, a mixed-version rolling upgrade, or the original QA reproduction. Rejection of incompatible unfinished version offsets remains unchanged. No production SQL semantics change, so the real MySQL/restart test supplies the public-path evidence rather than adding a duplicate SQL-only BVT.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/test-ci 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