Skip to content

[Upgrade CI][3.0-dev] BVT failures due to leaked databases (company/payroll/projects) and snapshot restore FK error #24711

Closed

Description

@aptend

Summary

Upgrade CI (3.0) — Compatibility Test With Release — fails with 25 BVT test errors across 7 test files. Two root causes identified:

  1. Leaked databases (company, payroll, projects) persist in the sys account after upstream (release) tests, contaminating all subsequent HEAD BVT tests that use SHOW DATABASES, information_schema.tables, information_schema.columns, or SHOW ACCOUNTS.
  2. Snapshot restore FK error in snapshot_restore_to_table_fk_2.sql: restore account sys from snapshot snapshot_01 fails with no such table acc_test02.aff01.

Failure Summary

Test File Failures Root Cause
tenant/cache.sql 6 Leaked DBs (show databases 8→11)
snapshot/sys_restore_to_sys_account.sql 8 Leaked DBs (show databases 9→12, 8→11, 11→14)
snapshot/sys_create_snapshot_for_sys_db_table_level.sql 3 Leaked DBs (show databases 9→12)
snapshot/sys_restore_pubsub_to_sys_account.sql 1 Leaked DBs (show databases 9→12)
zz_accesscontrol/inner_object.sql 4 Leaked DBs (duplicate employees/salaries tables in information_schema)
tenant/tenant.test 1 Leaked DBs (show accounts db_count 8→11, tbl_count 107→127)
table/system_table_cases.sql 1 Leaked DBs (table_constraints count 118→136)
snapshot/snapshot_restore_to_table_fk_2.sql 1 FK restore bug (no such table acc_test02.aff01)

Details

Issue 1: Leaked databases

After upstream (release) BVT tests complete and MO is upgraded to HEAD, 3 user databases remain in the sys account:

company
payroll
projects

These are visible in every subsequent SHOW DATABASES query. The source test that creates them without proper DROP DATABASE cleanup could not be identified in the current HEAD test tree — they may originate from the release version's test suite or from snapshot restores that recreate them.

Impact examples:

# tenant/cache.sql row:26 — EXPECT: 8 databases, ACTUAL: 11 (+company, +payroll, +projects)
# sys_restore_to_sys_account.sql row:288 — EXPECT: 11 databases, ACTUAL: 14
# inner_object.sql row:204 — EXPECT: no duplicate table names, ACTUAL: employees(×2), salaries(×2)
# system_table_cases.sql row:89 — EXPECT: table_constraints count=118, ACTUAL: 136 (+18 from leaked DBs)

Issue 2: Snapshot restore FK error

In snapshot_restore_to_table_fk_2.sql:

Line 543: create snapshot snapshot_01 for account;   -- snapshot taken
Line 577: create database acc_test02;                -- created AFTER snapshot
Line 594: create table aff01(...) REFERENCES pri01;  -- FK table created AFTER snapshot
Line 872: restore account sys from snapshot snapshot_01;
          -- EXPECT: success (null)
          -- ACTUAL: "no such table acc_test02.aff01"

The restore fails because acc_test02.aff01 (with a FK to pri01) exists in the current state but not in the snapshot. The restore logic appears to validate FK references against current-state tables that won't exist after the restore.

Environment

Suggested Fix

  1. For leaked databases: Identify the test(s) creating company, payroll, projects and add DROP DATABASE IF EXISTS cleanup in both upstream and head test files. Consider adding a cleanup step between upstream and head test phases in the Upgrade CI workflow.
  2. For snapshot restore: Investigate whether restore account sys should drop FK-dependent tables (acc_test02.aff01) before restoring, or skip FK validation for tables that don't exist in the target snapshot.

Activity

  1. added
    kind/bug
    on May 29, 2026
  2. added theissue type on May 29, 2026
  3. added
    severity/s0
    on May 29, 2026
  4. added this to the MO-202605 milestone on May 29, 2026
  5. gouhongshen commented on Jun 8, 2026

    @gouhongshen
    Contributor

    dup: #23955

    should be fixed

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

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions