Skip to content

[Fix] DropDatabase: refresh snapshot after exclusive lock to prevent orphan records from concurrent CLONE#23767

Merged
heni02 merged 2 commits intomatrixorigin:3.0-devfrom
LeftHandCold:fix_clone+drop
Feb 25, 2026
Merged

[Fix] DropDatabase: refresh snapshot after exclusive lock to prevent orphan records from concurrent CLONE#23767
heni02 merged 2 commits intomatrixorigin:3.0-devfrom
LeftHandCold:fix_clone+drop

Conversation

@LeftHandCold
Copy link
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 #23766

What this PR does / why we need it:

When CLONE (CREATE TABLE) and DROP DATABASE execute concurrently, the lock service does not advance DROP's snapshot because CLONE only modifies mo_tables, not mo_database. This causes DROP to miss newly created tables, leaving orphan records in mo_tables that trigger OkExpectedEOB panic during checkpoint replay.

Fix: after acquiring the exclusive lock in DropDatabase, explicitly advance the snapshot to the latest commit timestamp via GetLatestCommitTS + WaitLogTailAppliedAt + UpdateSnapshot, ensuring Relations() sees all tables committed before the lock was granted.

…orphan records from concurrent CLONE

When CLONE (CREATE TABLE) and DROP DATABASE execute concurrently, the lock
service does not advance DROP's snapshot because CLONE only modifies mo_tables,
not mo_database. This causes DROP to miss newly created tables, leaving orphan
records in mo_tables that trigger OkExpectedEOB panic during checkpoint replay.

Fix: after acquiring the exclusive lock in DropDatabase, explicitly advance the
snapshot to the latest commit timestamp via GetLatestCommitTS +
WaitLogTailAppliedAt + UpdateSnapshot, ensuring Relations() sees all tables
committed before the lock was granted.
@heni02 heni02 merged commit 6d57944 into matrixorigin:3.0-dev Feb 25, 2026
21 of 22 checks passed
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.

5 participants