fix: tokenize non-null fulltext columns independently - #26609
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review complete. The shared tokenizer now skips NULL content columns independently while preserving participating-column order, delimiter and position behavior, JSON offsets, all-NULL zero-output semantics, and malformed non-NULL error propagation. Create-index, synchronous/post-DML, and async ISCP paths all converge on this boundary; existing-index rebuild and mixed-version rollout caveats are documented. Focused regressions passed under race at count 50, the full table_function package passed under race, fulltext/indexplugin/ISCP packages passed, build and vet passed, diff check passed, and current CI is green.
What type of PR is this?
Which issue(s) this PR fixes:
issue #26557
What this PR does / why we need it:
fulltext_index_tokenizecurrently returns before tokenization when any indexed content column isNULL. In a multi-column FULLTEXT index this silently omits the entire document, even when another indexed column contains searchable content.This PR makes the smallest behavior change at the shared tokenizer boundary:
NULLcontent column independently;NULL;The shared boundary covers index creation and synchronous/post-DML/asynchronous maintenance without planner, catalog, or index-plugin restructuring.
Coverage
(NULL, value) <-> (value, NULL)UPDATE, all-NULL removal, revival, DELETE, and async INSERT.Exact-head local evidence for
5d4b02ac64a9895df2a284fe978e77098225eaf5:TestFullTextTokenizeSkipsNullContentColumns -race -count=69: PASSTestFullTextTokenizeSkipsConstNullContentColumn -race -count=100: PASS./pkg/sql/colexec/table_function -race -count=1: PASSmake build: PASSfulltext,fulltext_bm25,fulltext_update_consistency,gojieba: 715/715 statements PASSgit diff --check: PASSPASS review=PASS, exact diff hashcb8b05c355a583a8b9b15fd407a6354f20964a3db7ac4f9987e61d233cbccfe4Existing-index governance
This code fix is forward-maintenance only; it intentionally does not scan or mutate existing hidden FULLTEXT index tables. A multi-column index populated before the fix may already lack documents whose indexed row had a partial NULL and must be rebuilt after every CN and async-index consumer is on the fixed version.
Inventory candidate multi-column FULLTEXT indexes before rollout:
For each affected index, capture
SHOW CREATE TABLEso the index name, ordered columns, parser, and async option are preserved. In a maintenance window, use supported DDL to drop and recreate the FULLTEXT index; do not editmo_catalogor hidden index tables directly. There is no automatic migration in this PR.Rollback caveat: rolling back the binary does not repair or revert index contents. Old writers can again omit partial-NULL documents, so pause affected FULLTEXT DML during rollback and rebuild after returning to the fixed version.
QA handoff
Validate on a Proxy + at least 2 CN deployment after all writers use the fixed build:
BVT: YES
QA required: YES. Keep issue #26557 open until the tested version/environment, rebuild evidence, and terminal PASS are recorded.