Skip to content

pkg/ddl, pkg/sessionctx: pass fulltext sysvars to TiCI | tidb-test=a9bf2dca824dc746361234cd4d763178e0eedd13 tiflash=feature-fts#65967

Merged
ti-chi-bot[bot] merged 6 commits intopingcap:feature/ftsfrom
wjhuang2016:fts-ddl-sysvars
Feb 9, 2026
Merged

Conversation

@wjhuang2016
Copy link
Member

@wjhuang2016 wjhuang2016 commented Feb 2, 2026

What problem does this PR solve?

Issue Number: ref #63937

Problem Summary:

  • Support FULLTEXT INDEX creation system variables: innodb_ft_max_token_size, innodb_ft_min_token_size, ngram_token_size, innodb_ft_enable_stopword, innodb_ft_server_stopword_table, innodb_ft_user_stopword_table.
  • Read stopwords from the configured stopword table and pass them to TiCI at index creation time (including CREATE TABLE ... FULLTEXT INDEX ...).

What changed and how does it work?

  • Add the above sysvars with validation and cluster persistence.
  • Capture sysvar values into the relevant DDL jobs (ADD FULLTEXT INDEX and CREATE TABLE with FULLTEXT indexes), so each new FULLTEXT index creation uses a stable snapshot of the sysvars (existing indexes are not affected).
  • Extend TiDB internal TiCI proto (pkg/tici/tici.proto) to carry CreateIndexRequest.parser_info and ParserInfo.stop_words.
  • During FULLTEXT index creation, TiDB builds parser_info.parser_params from job sysvars and (for standard parser + stopwords enabled + stopword table configured) reads stopwords from the table (single VARCHAR column value) and sends the de-duplicated list via parser_info.stop_words.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 2, 2026
@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 49.57447% with 237 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.4720%. Comparing base (2d2bd57) to head (66554a9).
⚠️ Report is 52 commits behind head on feature/fts.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           feature/fts     #65967        +/-   ##
===================================================
+ Coverage      72.3094%   72.4720%   +0.1626%     
===================================================
  Files             1895       1922        +27     
  Lines           533272     535482      +2210     
===================================================
+ Hits            385606     388075      +2469     
+ Misses          123717     123272       -445     
- Partials         23949      24135       +186     
Flag Coverage Δ
integration 46.2513% <2.3404%> (-0.0280%) ⬇️
unit 70.0566% <49.5744%> (+0.1726%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 63.2627% <ø> (+0.2240%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wjhuang2016
Copy link
Member Author

/retest

1 similar comment
@wjhuang2016
Copy link
Member Author

/retest

@wjhuang2016 wjhuang2016 changed the title pkg/ddl, pkg/sessionctx: pass fulltext sysvars to TiCI pkg/ddl, pkg/sessionctx: pass fulltext sysvars to TiCI | tidb-test=a9bf2dca824dc746361234cd4d763178e0eedd13 tiflash=feature-fts Feb 4, 2026
@wjhuang2016
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Feb 4, 2026
@wjhuang2016
Copy link
Member Author

/retest

1 similar comment
@wjhuang2016
Copy link
Member Author

/retest

}

func (e *executor) captureFullTextIndexSysvarsToJob(sctx sessionctx.Context, job *model.Job, indexOption *ast.IndexOption) error {
parser := model.FullTextParserTypeStandardV1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are to use the original parser type from the old full-text index, addtional checks and changes might be needed to check the parser type itself, as the old full-text has a wilder scope of support compared to the one we are implementing at the moment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads-up. I did not change the parser-type compatibility logic in this PR; will follow up separately if/when we need to support carrying over legacy FULLTEXT parser settings.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 5, 2026
@wjhuang2016
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 5, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 6, 2026

@JinheLin: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 6, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 6, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JinheLin, OliverS929, winoros
Once this PR has been reviewed and has the lgtm label, please assign benjamin2037, yudongusa for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 6, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-02-05 09:12:23.392361783 +0000 UTC m=+344614.493760496: ☑️ agreed by OliverS929.
  • 2026-02-06 12:04:01.834087979 +0000 UTC m=+9485.801264843: ☑️ agreed by winoros.

@wjhuang2016
Copy link
Member Author

/retest

2 similar comments
@wjhuang2016
Copy link
Member Author

/retest

@JaySon-Huang
Copy link
Contributor

/retest

@ti-chi-bot ti-chi-bot bot merged commit 24eed5e into pingcap:feature/fts Feb 9, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants