Repository navigation
Description
Is there an existing issue for the same bug?
- I searched open and closed MatrixOne issues for the exact test, database/index names, error 1176, regular CREATE INDEX, and cross-CN catalog visibility. No issue covers this exact regular-secondary-index failure.
Branch Name
main
Commit ID
87ec737f6481d20c6b0559c96e1d992dc4804dbe
Other Environment Information
- GitHub Actions PR coverage UT on Ubuntu/x86
- Workflow run: https://github.com/matrixorigin/matrixone/actions/runs/34474253139
- Failed job: https://github.com/matrixorigin/matrixone/actions/runs/34474253139/job/102861793906
- Failing test:
TestIssue27487ConcurrentInsertIsIncludedInNewIndex/regular_secondary_index - The DDL and verifier use different CN connections in the embedded multi-CN fixture.
Actual Behavior
The regular secondary-index branch of TestIssue27487ConcurrentInsertIsIncludedInNewIndex completed its concurrent CREATE INDEX idx_k ON regular_docs(k) successfully on the DDL CN. The verifier CN immediately planned:
EXPLAIN SELECT COUNT(*)
FROM issue_27487_concurrent_index.regular_docs FORCE INDEX(idx_k)
WHERE k = 27487;and failed with:
Error 1176 (42000): Key 'idx_k' doesn't exist in table 'regular_docs'
The job log shows the hidden secondary-index insert finishing at approximately 12:22:48.200Z, the constraint update/DDL commit at approximately 12:22:48.210Z, and the verifier failure at approximately 12:22:48.212Z. The failure is therefore post-DDL metadata visibility on another CN, before result validation.
The failing test source is byte-identical at the workflow base and PR head (sha256 dcd1465c702dfdd5311b89768e7370c1f38327b743feb2ff18016b3c6a753399), and the triggering PR does not modify regular-index creation or catalog/logtail visibility paths.
Expected Behavior
After a regular CREATE INDEX returns success, a new transaction on every CN should resolve the committed index definition immediately. Callers and tests should not require a sleep, manual synccommit, or same-CN routing.
Steps to Reproduce
1. Start the authenticated embedded MatrixOne fixture with at least two CNs.
2. Run `TestIssue27487ConcurrentInsertIsIncludedInNewIndex/regular_secondary_index` under the coverage configuration used by the linked job.
3. Let the test create/seed `regular_docs` on one CN, hold a concurrent writer transaction, and run `CREATE INDEX idx_k ON regular_docs(k)` on another CN.
4. After the writer commits and CREATE INDEX returns success, immediately execute the existing `EXPLAIN ... FORCE INDEX(idx_k)` verification through the other CN.
5. Observe intermittent Error 1176 because that CN has not resolved the committed index definition.Additional information
Attribution evidence
pkg/tests/issues/issue_27487_test.gois unchanged between base87ec737f6481d20c6b0559c96e1d992dc4804dbeand PR head5d21e3d2ae521b5babf248a47a57fccf3bd80b46.- The failure occurs in the existing cross-CN verifier at
issue_27487_test.go:101, reached from the regular-index case around lines 369/173. - The package did not hit its outer budget; this exact subtest failed in about 0.39 seconds.
Related but not duplicate
- [Bug]: CREATE INDEX concurrent with committed INSERTs leaves index results incomplete #27487 concerned index contents missing rows committed concurrently with index creation; fix: preserve insert metadata lock during index creation #27792 fixed its metadata-lock ownership. This failure occurs after CREATE INDEX reports success and cannot resolve the index definition on another CN.
- [Bug]: CREATE FULLTEXT INDEX can be invisible to another CN immediately after successful DDL #28286 concerned the analogous FULLTEXT path; fix(fulltext): validate stale cross-CN plans before execution #28289 added a narrow stale-plan validation/retry for unresolved FULLTEXT expressions. The current failure is the ordinary secondary-index
FORCE INDEXplanning path. - [Bug]: TestIssue26875ReplaceMaintainsIndexedForeignKeyChildren is flaky in coverage UT #27618 tracks a different fixture where CN1 cannot see a table created on CN0 before PREPARE; its merged fixture refactor does not cover post-CREATE-INDEX visibility here.
Acceptance criteria
- Once regular CREATE INDEX returns success, a new transaction on each CN immediately resolves the committed index definition.
- The existing concurrent regular-index commit/rollback cases pass repeatedly under coverage without sleeps, manual
synccommit, or same-CN routing. - Add directed evidence/test coverage around DDL commit TS, verifier snapshot/catalog watermark, table-definition version, and visible constraint/index definitions so the causal visibility boundary is deterministic.
Activity
gouhongshen commentedon Sep 10, 2026
Automated AI triage
This issue requires human involvement and cannot currently be completed independently by the
automated fix loop.
Reason
Human transaction/DDL owners must decide whether successful DDL overrides the configured cross-CN freshness trade-off and define its latency/error contract; then scope the catalog-barrier behavior.
Evidence
The repository documents that
enable-sacrificing-freshnesspermits a CN not to see another CN's latest commit, and defaults it enabled. The reported verifier is a new transaction on a different CN immediately after DDL, precisely the unspecified boundary.Please use this analysis to provide the missing decision, environment, evidence, or ownership
needed before the issue is returned to the AI candidate pool.
gouhongshen commentedon Sep 10, 2026
CI follow-up for PR #28272:
34474253139was attempt 1 when the unrelated coverage failure was classified.gh run rerun 34474253139 --failedwas requested.102880000571after a newer PR head was pushed. No second rerun will be requested.gouhongshen commentedon Sep 10, 2026
Deferred: global DDL visibility needs a transaction/catalog owner decision
Investigated at
7bc20830f018aaef36f61cda035186760e886254.Findings
cnservice.Config.SetDefaultValuedefaultsenable-sacrificing-freshnessto1, andcnservice/server.gotherefore builds each CN transaction client withWithEnableSacrificingFreshness().txnClient.determineTxnSnapshotpreserves the caller's minimum timestamp instead of advancing to the current/global timestamp. The verifier inissue_27487_test.gois a CN0 connection established before the CN1 DDL; it has no CN1 DDL commit timestamp to carry as its next-transaction minimum. A stale CN0 TableDef is therefore permitted by the configured contract.FORCE INDEXvalidates the named index during planning inplan.recordIndexHints -> validateIndexHintNames; an old TableDef returns ER_KEY_DOES_NOT_EXIST beforecompile.LockMetacan acquire its metadata lock and trigger the existing definition-change retry.mo_ctl('cn', 'SYNCCOMMIT', '')is used by cross-CN tests that require it;CmdMethod_SyncCommitcallsTxnClient.SyncLatestCommitTSon the addressed CN. [Bug]: New proxy-routed CN can miss a committed CREATE TABLE #27743 instead establishes a TN-ordered catalog barrier only for a fresh external special-user authentication path. Neither mechanism defines global immediate visibility for arbitrary already-open sessions.Reproduction and test construction
After building the required local CGo artifacts with
make cgo, I ran the exact existing embedded multi-CN regression:The 11 local executions passed. That does not negate the CI failure: the current test controls DDL-vs-writer lock ordering, but does not deterministically hold CN0's catalog/logtail frontier behind the committed DDL timestamp. Its immediate verifier can either arrive before or after CN0 applies the logtail. A deterministic test requires an owner-approved common injection/observable fence at catalog application, not another timing loop.
Required decision
Please have the transaction/catalog owner define the DDL visibility contract:
Implementing a commit-side global fence or changing transaction snapshot selection without those answers changes cluster-wide DDL latency and availability semantics. No safe focused implementation or executable proof can be produced before that decision.
gouhongshen commentedon Sep 10, 2026
PR #28641 is trying to fix this issue.
gouhongshen commentedon Sep 24, 2026
PR #28641 has merged and is awaiting manual validation. The issue remains open.