Repository navigation
Description
Is there an existing issue for the same bug?
- I searched MatrixOne issues created during the last week for FULLTEXT, concurrent DDL, cross-CN metadata visibility, and the exact error text. No matching issue was found.
Branch Name
main
Commit ID
845fff8ee9cac962c5002a1007e0b0180efd591b
Other Environment Information
- TKE nightly regression, 3 CN + 1 TN
- Writer and DDL use two different direct CN endpoints.
- Verification uses the cluster SQL service and can be routed to a third CN.
- Workflow run: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/33973784624
- Failed job: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/33973784624/job/101424062603
- Regression driver: https://github.com/matrixorigin/mo-nightly-regression/blob/a1347faff1fd3995fdecfa7fcbb3e2e321bf57b5/script/issue_27487_concurrent_index.py
Actual Behavior
CREATE FULLTEXT INDEX waits for a concurrent writer transaction, completes successfully after that writer rolls back, and the TN successfully creates and populates the hidden FULLTEXT table. A new query started immediately afterwards through another CN intermittently fails with:
ERROR 20105 (HY000): not supported: MATCH() AGAINST() function cannot be replaced by FULLTEXT INDEX and full table scan with fulltext search is not supported yet.
The same run completed the first three fulltext rollback rounds successfully. In round 4, the regular-index commit/rollback cases and the fulltext commit case passed, while the fulltext rollback verification failed:
ISSUE_27487_CASE_PASS run=4 index=regular outcome=commit
ISSUE_27487_CASE_PASS run=4 index=regular outcome=rollback
ISSUE_27487_CASE_PASS run=4 index=fulltext outcome=commit
ISSUE_27487_FAIL: (20105, 'not supported: MATCH() AGAINST() function cannot be replaced by FULLTEXT INDEX and full table scan with fulltext search is not supported yet.')
This failure occurs before the driver can compare the FULLTEXT result with the equivalent base-table LIKE result. No missing index rows, data loss, or persistent index corruption was established by this incident.
Expected Behavior
Once CREATE FULLTEXT INDEX returns successfully, a transaction started afterwards on any CN must resolve the committed FULLTEXT index metadata and plan the top-level MATCH() AGAINST() query through that index. The caller must not need a sleep, synccommit, or same-CN routing after successful DDL.
Steps to Reproduce
1. Start MatrixOne with at least two CNs and one TN.
2. Create a table with 1,000 rows:
CREATE TABLE fulltext_docs_rollback (
id BIGINT PRIMARY KEY,
body TEXT
);
INSERT INTO fulltext_docs_rollback
SELECT result, CONCAT('officialracezebra ', result)
FROM generate_series(1, 1000) g;
3. On writer CN-A, begin a transaction and insert one additional row without committing. Confirm through `mo_locks()` that it holds the `mo_tables` shared metadata lock.
4. On CN-B, start `CREATE FULLTEXT INDEX ft_body ON fulltext_docs_rollback(body)` and confirm that it is waiting on the same metadata lock.
5. Roll back the writer transaction on CN-A and wait for CREATE INDEX on CN-B to return success.
6. Immediately open/use a verifier connection through Proxy or a different CN and run:
SET experimental_fulltext_index = 1;
SELECT COUNT(*) FROM fulltext_docs_rollback
WHERE MATCH(body) AGAINST('officialracezebra');
7. Repeat the commit/rollback matrix. The referenced nightly driver runs regular/FULLTEXT x commit/rollback for ten rounds and reproduced this failure in the fourth FULLTEXT rollback round.Additional information
Confirmed timeline
All timestamps below are UTC on 2026-09-06:
04:53:48.399-04:53:48.408: the verifier CN subscribes the base table (table_id=673355,database_id=673448).- The DDL runs on a different CN.
04:53:49.058596: the TN-side index population statement finishes and reports 3,000 affected posting rows for the hidden__mo_index_secondary_*table.04:53:49.072685: a new verifier transaction begins on another CN and executes the top-levelMATCH() AGAINST()query.04:53:49.090: planning/execution returns error 20105.
The query starts about 14 ms after the hidden-table population finishes and only after the DDL connection has returned success.
Code path
At the incident commit, findMatchFullTextIndex can rewrite MATCH() only when scanNode.TableDef.Indexes contains a matching FULLTEXT definition with TableExist=true. If no usable definition is found, it returns nil and leaves the scalar function unreplaced. The unreplaced function reaches fullTextMatch, which returns error 20105.
The query shape is the same top-level FULLTEXT predicate that passed in the preceding rounds. Combined with the successful TN-side hidden-table creation/population, this proves the immediate verifier plan did not receive a usable committed FULLTEXT definition. The exact internal last hop still needs directed evidence: stale TableDef, TableExist=false, catalog cache publication, or logtail/application watermark.
Related but not duplicate
- [Bug]: CREATE INDEX concurrent with committed INSERTs leaves index results incomplete #27487 reported permanently incomplete index contents when
CREATE INDEXoverlapped committed inserts. - fix: preserve insert metadata lock during index creation #27792 fixed the shared
ObjectRef.NotLockMetamutation so CREATE INDEX correctly waits for the writer metadata lock. - This incident contains that fix, the DDL did wait, and TN completed hidden-table population. The observed failure is post-DDL cross-CN metadata visibility, not missing rows from the old metadata-lock gap.
- [Bug]: fulltext index: MATCH() AGAINST() function cannot be replaced by FULLTEXT INDEX and full table scan with fulltext search is not supported yet. #20687 and recent error-20105 issues concern unsupported JOIN/subquery/expression plan shapes. This query is a supported top-level form and passed repeatedly before the timing-dependent failure.
Impact
- Confirmed: an immediately following query can fail even though CREATE FULLTEXT INDEX returned success.
- Not observed: base-data loss, persistent hidden-index corruption, panic, or service restart.
- Likely recovery is metadata convergence or replanning, but that was not measured because the regression driver stops on the first failure.
Acceptance criteria
- After successful CREATE FULLTEXT INDEX, a new transaction on every CN immediately sees a matching
TableDef.Indexesentry withTableExist=true. - The existing cross-CN regular/FULLTEXT x writer commit/rollback matrix passes repeatedly without sleeps or manual
synccommit. - FULLTEXT verification must assert both plan/index usability and exact equality with the base-table control.
- Add a deterministic delayed-catalog/logtail test that records DDL commit TS, verifier snapshot TS, applied/catalog watermark, table-definition version, and index definitions.
Activity
LeftHandCold commentedon Sep 6, 2026
Root cause is confirmed and fixed by #28289.
Confirmed failure chain
CREATE FULLTEXT INDEXcommits successfully on one CN and the hidden index table is populated.TableDefthat does not contain the new FULLTEXT index.fulltext_matchruntime placeholder in the SELECT plan.mo_tablesmetadata validation only for plans containingNode_LOCK_OP. This MATCH query has no lock node, so it bypasses the catalog-version fence.MATCH() AGAINST() ... cannot be replaced by FULLTEXT INDEX.This explains why the first scenarios pass, why DDL/index population are already complete, and why only a cross-CN immediate verification can fail. It is a transient schema-visibility/plan-validation bug, not missing index data.
Deterministic proof
The regression test uses two CNs and pauses the query only after its stale unresolved FULLTEXT plan has been compiled. The other CN then fully commits
CREATE FULLTEXT INDEX; only afterward is the query released.mo_tableslock validation observes the post-snapshot DDL commit, advances the RC snapshot, returnsErrTxnNeedRetryWithDefChanged, and the rebuilt MATCH plan succeeds.The fix is deliberately limited to SELECT plans that still contain unresolved
fulltext_matchorfulltext_match_score. Rewritten FULLTEXT queries and ordinary SELECTs do not gain an extra metadata lock; a genuine MATCH query without an index retains the original error semantics.fix(fulltext): validate stale cross-CN plans before execution (#28289)
fix(fulltext): validate stale cross-CN plans before execution (matrix…
fix(fulltext): validate stale cross-CN plans before execution (matrix…
fix(fulltext): validate stale cross-CN plans before execution (matrix…