Skip to content

[Bug]: TKE SET case leaks SI isolation into snapshot foreign-key BVT #29410

Closed

Description

@aunjgr

Is there an existing issue for the same bug?

  • I checked the open issues for this ADD FOREIGN KEY stale-snapshot conflict and the TKE case.

Branch Name

fix/28012-restart-sql-context; the same failure occurs on unrelated fix/28079-account-lifecycle-shared.

Commit ID

66e89ff6c1ece72ce39969fcedb13153c87d9fd8 (first linked TKE run).

Other Environment Information

MatrixOne “MO Checkin Regression On TKE / MO CHECKIN BVT TEST” GitHub Actions job on 2026-09-27.

Actual Behavior

The first failure in test/distributed/cases/snapshot/sys_restore_to_sys_account.sql is at lines 437–438:

alter table ti1 add constraint fi1 foreign key (b) references ti2(a);
alter table tm1 add constraint fm1 foreign key (b) references tm2(a);

Both return w-w conflict: tableID: ..., table snapshot is stale. Because those constraints were never added, later historical/restored SHOW CREATE TABLE checks at lines 442, 444, 454, 456, 481, and 482 omit the expected fi1/fm1 definitions. These are cascading mismatches, not evidence that SHOW CREATE itself dropped valid foreign-key metadata. The script reports 10 failed statements.

Expected Behavior

The two sequential ADD FOREIGN KEY statements succeed on their current tables, and snapshot/restored SHOW CREATE TABLE retains the constraints.

Steps to Reproduce

  1. Run the TKE checkin BVT including test/distributed/cases/snapshot/sys_restore_to_sys_account.sql.
  2. Inspect the first errors at lines 437–438 before the downstream SHOW CREATE mismatches.

Additional information

Diagnosis and focused validation

The TKE log runs test/distributed/cases/set/set_transaction_rejection.sql before the snapshot case. That SET case changed the primary session to REPEATABLE-READ but restored only sql_mode, leaking fixed SI isolation to later files. The foreign-key table-lock guard then reports the stale SI snapshot at the first ADD FOREIGN KEY; later SHOW CREATE mismatches cascade from those rejected ALTERs. This is the working cause pending TKE-topology confirmation, not a reason to weaken the SI guard.

The fix saves and restores isolation, read-only, and SQL mode in the SET case. A normal-comparison local run of the SET and snapshot cases together passed 587/587 statements twice on the same standalone instance; exact TKE CI remains the final topology check.

Activity

  1. added
    kind/bug
    on Sep 27, 2026
  2. changed the title [-][Bug]: TKE snapshot SHOW CREATE omits foreign keys[/-] [+][Bug]: ADD FOREIGN KEY hits stale-snapshot write conflict in TKE BVT[/+] on Sep 27, 2026
  3. changed the title [-][Bug]: ADD FOREIGN KEY hits stale-snapshot write conflict in TKE BVT[/-] [+][Bug]: TKE SET case leaks SI isolation into snapshot foreign-key BVT[/+] on Sep 27, 2026
  4. added
    severity/s0
    and removed on Sep 27, 2026
  5. added a commit that references this issue on Sep 27, 2026
    5a96035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions