Skip to content

fix: recreate missing character sets table during upgrade - #27369

Merged
mergify[bot] merged 3 commits into
matrixorigin:mainfrom
aptend:fix/character-sets-missing-table
Aug 20, 2026
Merged

mergify[bot] merged 3 commits into
matrixorigin:mainfrom
aptend:fix/character-sets-missing-table

Conversation

@aptend

@aptend aptend commented Aug 20, 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 #27287

What this PR does / why we need it:

The v4.0.6 tenant upgrade populates information_schema.CHARACTER_SETS, but a legacy tenant can be missing that table entirely. The population check then fails before the upgrade SQL can run.

This PR adds an idempotent table-creation entry before the population entry:

  • recreate a missing CHARACTER_SETS table from the canonical DDL;
  • leave an existing table unchanged;
  • advance the v4.0.6 VersionOffset so same-version deployments execute the repair.

Validation:

  • complete pkg/bootstrap/versions/v4_0_6 package tests;
  • focused creation, population, entry-order, and metadata tests;
  • same-version VersionOffset tenant-upgrade regression in pkg/bootstrap;
  • go build, go vet, and git diff --check.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep-reviewed exact head ff3407f810e9416f724b6921dacaa4b4ef53fd2b. No P0/P1/P2 blocker found.

The repair is correctly ordered: the idempotent CHARACTER_SETS existence/create entry precedes population. The lowercase lookup matches the canonical catalog identity: both the current internal executor and the historical bootstrap parser normalize these system DDLs with lower_case_table_names=1; the object has always been a base table. Existing tables are left untouched, while a missing table is recreated from the same DDL used for fresh tenants.

The VersionOffset advances and the equal-version path deliberately reruns the current v4.0.6 handler, so tenants already reporting 4.0.6 receive this repair. Creation, population, subsequent upgrade entries, tenant version, and task progress remain in one transaction; failure rolls back atomically and retries are idempotent. Tenant rows serialize competing workers, and the error drain returns to the outer timer rather than hot-looping. Q1-Q3 found no new ownership, wait-graph, or unbounded-resource issue.

Validation passed: full pkg/bootstrap/versions/v4_0_6 and pkg/bootstrap race suites, repeated same-version/offset and idempotence tests, and git diff --check.

@mergify mergify Bot added the queued label Aug 20, 2026
@mergify

mergify Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-20 05:11 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-08-20 06:23 UTC · at a1bc8aa34f5633c821092664616a0a252ac44a87 · squash

This pull request spent 1 hour 12 minutes in the queue, including 52 minutes 21 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)

@mergify
mergify Bot merged commit 2a38e2a into matrixorigin:main Aug 20, 2026
26 of 27 checks passed
@mergify mergify Bot removed the queued label Aug 20, 2026
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…in#27369)

The v4.0.6 tenant upgrade populates `information_schema.CHARACTER_SETS`, but a legacy tenant can be missing that table entirely. The population check then fails before the upgrade SQL can run.

This PR adds an idempotent table-creation entry before the population entry:

- recreate a missing `CHARACTER_SETS` table from the canonical DDL;
- leave an existing table unchanged;
- advance the v4.0.6 `VersionOffset` so same-version deployments execute the repair.

Validation:

- complete `pkg/bootstrap/versions/v4_0_6` package tests;
- focused creation, population, entry-order, and metadata tests;
- same-version `VersionOffset` tenant-upgrade regression in `pkg/bootstrap`;
- `go build`, `go vet`, and `git diff --check`.

Approved by: @XuPeng-SH
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…in#27369)

The v4.0.6 tenant upgrade populates `information_schema.CHARACTER_SETS`, but a legacy tenant can be missing that table entirely. The population check then fails before the upgrade SQL can run.

This PR adds an idempotent table-creation entry before the population entry:

- recreate a missing `CHARACTER_SETS` table from the canonical DDL;
- leave an existing table unchanged;
- advance the v4.0.6 `VersionOffset` so same-version deployments execute the repair.

Validation:

- complete `pkg/bootstrap/versions/v4_0_6` package tests;
- focused creation, population, entry-order, and metadata tests;
- same-version `VersionOffset` tenant-upgrade regression in `pkg/bootstrap`;
- `go build`, `go vet`, and `git diff --check`.

Approved by: @XuPeng-SH
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…in#27369)

The v4.0.6 tenant upgrade populates `information_schema.CHARACTER_SETS`, but a legacy tenant can be missing that table entirely. The population check then fails before the upgrade SQL can run.

This PR adds an idempotent table-creation entry before the population entry:

- recreate a missing `CHARACTER_SETS` table from the canonical DDL;
- leave an existing table unchanged;
- advance the v4.0.6 `VersionOffset` so same-version deployments execute the repair.

Validation:

- complete `pkg/bootstrap/versions/v4_0_6` package tests;
- focused creation, population, entry-order, and metadata tests;
- same-version `VersionOffset` tenant-upgrade regression in `pkg/bootstrap`;
- `go build`, `go vet`, and `git diff --check`.

Approved by: @XuPeng-SH

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/bug Something isn't working size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants