[Bug]: Scoped information_schema.TABLES AUTO_INCREMENT read fails with 1146 when another database drops its same-named table
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
Is there an existing issue for the same bug?
- I have checked the existing issues. #16888 is a related historical symptom, not this scoped read racing a DROP of another base table.
Branch Name
main
Commit ID
df5de1444b222fa9ac53f648715f1b29a0354161 (failing nightly) and afe647f60fbf1393a51d94ce84a1abb676aaaf99 (previous nightly; independently reproduced on both exact images).
Introducing change for this scoped read: #27942 (September 4). Verified by building and exercising its exact first parent and merge, not inferred from the nightly timing.
Actual Behavior
A read of the AUTO_INCREMENT value of a stable table fails with error 1146 naming the physical ID of a different database's concurrently dropped table. No DDL, inserts, subscriptions, failover, or cache misses are required on the target table. Single-node MO and two ordinary SQL connections suffice.
Failed Main MOTR; previous passing run. UTC on 2026-11-26: target DB suffix _7, table t, ID 275061; TN handled DROP of _12.t, ID 275054 at 23:44:51.285350; the CN logged eviction of 275054 at .289373, then returned no such table .275054 at .329207. Client statement ID 01a21a3f-6238-7588-a1ae-813bd50e151a. Error from SQL execution, not a comparison of returned values.
Expected Behavior
Every read returns the target's value (10 in this test). A committed DROP in B should neither invalidate A's observation nor require the caller to retry.
Steps to Reproduce
Use two connections, same account, autocommit. Create databases A and B. In each create t(id BIGINT AUTO_INCREMENT PRIMARY KEY, v INT) AUTO_ID_CACHE=1 AUTO_INCREMENT=10 (use starting value 200 in B). Do not modify A.t.
- Session A:
USE A, repeatedly runSELECT auto_increment FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='t'. - Session B:
USE B, recordSELECT rel_id FROM mo_catalog.mo_tables WHERE reldatabase=DATABASE() AND relname='t'; DROP TABLE t; recreate the same B table; repeat. Run concurrently, allowing ~25 ms before each DROP. - Compare the numeric ID in A's first 1146 with B's recorded IDs. Stop B, verify A's original ID and its result again.
| Isolated exact image | A read successes before first 1146 | A table ID | ID in error | After writer stopped |
|---|---|---|---|---|
| afe647f60f | 4 | 272559 | 272561 (B) | same A ID, value 10 |
| df5de1444b | 5 | 272559 | 272561 (B) | same A ID, value 10 |
Exact historical parent/merge A/B: fresh isolated single-node instances, same host, toolchain, native libs, config and two-session driver. The historical DDL deliberately omits the later AUTO_ID_CACHE option on both builds; A starts at 10 and B at 200. No faults injected.
| Version | Result under concurrent DROP | Shape of EXPLAIN, from input to output |
|---|---|---|
| Parent afc96e9380 | 1,498/1,498 correct A reads, 100 B drop/recreates | schema filter before local projection; no union |
| Merge fa829e5c50 | 12 successful A reads, then 1146 on the first B drop. A ID 272564 remained unchanged; the error named B ID 272566; A returned 10 again | local projection before UNION ALL, then schema filter |
The default cache in this historical A/B also reproduces it: not a new AUTO_ID_CACHE=1 allocator bug. #27942 brought this specific cross-database failure into reach by changing the built-in view shape, not by changing allocator code. This is not a claim about every possible 1146 from metadata enumeration.
Additional information
On both images EXPLAIN puts the table-name predicate on the catalog scan, but the schema predicate TABLE_SCHEMA=DATABASE() above the UNION ALL. The local branch projects internal_auto_increment(reldatabase,relname) before applying the schema filter. It can therefore observe B.t even though B.t cannot contribute a result. Relation lookup uses the query transaction; the function then asks the live committed allocator for that table ID. Once B's DROP commits, this call can report the missing ID and abort the whole read.
Two targeted controls on df5de14, no retry logic: (1) literal schema instead of DATABASE(), 512 correct reads during 100 drops; (2) same DATABASE() but local SELECT arm only, 651 correct reads during 100 drops. The latter changes only the SQL shape under test, not the server binary. #27942 added the UNION ALL for subscribed tables; #27448 previously introduced the volatile set-operation pushdown guard. These are not reasons to revert subscription visibility or broadly relax volatile predicate handling. None of the 16 commits between these two nights first introduced the observed symptom. No evidence of table/data loss or a corrupted allocator.
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 312
- Avg merge
- 22h 59m
- Merged PRs (30d)
- 736
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from matrixorigin/matrixone
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
matrixorigin/matrixone#33363 ·
Maintainers usually reply within 1 day
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
matrixorigin/matrixone#33362 ·
Maintainers usually reply within 1 day
-
SLEEP rejects NULL and negative durations that MySQL acceptsPossibly taken @XuPeng-SH claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
matrixorigin/matrixone#32653 ·
Maintainers usually reply within 1 day
-
[Bug]: TestChangeWatchProxy loses its first tenant connection during PingContext in Ubuntu CIPossibly taken @XuPeng-SH claimed this today. Openkind/bug needs-triage
matrixorigin/matrixone#33371 · 1 assignee ·
Maintainers usually reply within 1 day
-
[Bug]: TestDaemonClaimSQLRoundTrip exhausts its shared deadline during the stale claim update in Ubuntu CIPossibly taken @XuPeng-SH claimed this today. Openkind/bug needs-triage
matrixorigin/matrixone#33370 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in matrixorigin/matrixone
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zalando/postgres-operator#3257 ·
Maintainers usually reply within 2 days
-
[inputs.internal] README lists go_version tag on internal_gather instead of internal_agentPossibly taken @cvas22 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
influxdata/telegraf#20264 ·
Maintainers usually reply within 1 day
-
[Bug] Standalone migration breaks existing Ingress routes using the envoy-http Service port nameOpenaccepted bug wg/enterprise-environment
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/semantic-router#7483 · 1 comment ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
stacklok/toolhive-catalog#2076 ·
Maintainers usually reply within 1 day