[Bug]: DROP ACCOUNT can return 20105 merging a shared mo_tables lock at the minimum row-lock limit

Open
#33,325 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@matrix-meow is already working on this.

Since Nov 26, 2026.

Assessment

This issue has not been assessed yet.

Description

kind/bug needs-triage
Is there an existing issue for the same bug?
  • I have checked the existing issues.

#32986 concerns an unrelated account being blocked by a publication on mo_account. This occurrence returned error 20105 while taking a shared range on mo_tables.

Branch Name

4.2-dev

Commit ID

CI tested 2d6b095780b48436bb41e98ba0acba3c9fa70e38 in PR #33295. Its target at that time was bf72bfbc376186521e5e20f74ddfa8bf99b2c404.

Other Environment Information

Ubuntu x86-64, Go 1.26.4, race-enabled unit tests. Failing UT job, second attempt. The first attempt on the same SHA passed the isolated issues package.

Actual Behavior

TestDropAccountWithMinimumRowLockCount created direct_drop, then DROP ACCOUNT direct_drop returned Error 20105 (HY000): not supported: merge range lock not support with shared lock. The failure occurred during the direct DROP, before the restore subscenario.

The local lock service reported table ID 2 (mo_catalog.mo_tables), row count 2 and options Shared-Range-Wait. The inner transaction rolled back and the outer DROP returned the error. The trace does not identify the other holder.

On the clean target commit, the unmodified SQL test passed in isolation. Replaying the same DROP while a second transaction held shared catalog rows reproduced the exact MySQL error 20105.

Expected Behavior

The DROP completes with MaxLockRowCount=1, including when catalog metadata is shared with another transaction. The account is absent afterwards.

Steps to Reproduce
  1. Run TestDropAccountWithMinimumRowLockCount in ./pkg/tests/issues/isolated under the CI unit-test workload. Failure is intermittent.
  2. To reproduce the lock condition independently on the clean target commit, use the existing local lock-service test harness. Let transactions A and B both acquire a shared row lock on key 2 of table 2. Have A acquire a shared range on keys 1 through 3. It returns ErrMergeRangeLockNotSupport.
  3. Release B and repeat A's range request. The request succeeds.
  4. For an end-to-end control on the same clean target, use the existing one-CN test fixture with the same row limit and create the same account. After creation, install a test observer on successful locks for table 2. For each shared point held by the original transaction, have one additional transaction acquire the same point in shared mode through the normal local lock service. Hold the additional transaction across the DROP. Seven shared metadata points were joined in this run. The original SQL returned error 20105 on a shared range for table 2. The observer did not inject a lock result or SQL error.
Additional information

The SQL and lock-service controls used the repository CGo test wrapper with Go 1.26.4 on macOS arm64. The controlled SQL reproduction establishes that concurrent catalog readers suffice to trigger this failure in the target branch. The identity of the second holder in the original CI trace is still unknown.

Dominant language
Go
Stars
1.9k
Forks
312
Avg merge
22h 59m
Merged PRs (30d)
736

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from matrixorigin/matrixone

All issues in matrixorigin/matrixone

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.