Skip to content

[4.2-dev] [Bug] Avoid fulltext2 posting materialization for live DF - #32850

Merged
XuPeng-SH merged 4 commits into
matrixorigin:4.2-devfrom
VioletQwQ-0:codex/issue-28846-live-df
Nov 27, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:4.2-devfrom
VioletQwQ-0:codex/issue-28846-live-df

Conversation

@VioletQwQ-0

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #28846

What this PR does / why we need it:

globalStats.df currently expands each loaded term's compressed posting list into a full docID slice before applying segment liveness. This change returns the raw posting DF for fully-live segments and counts live docIDs block by block with fixed-size scratch space for dirty segments. It preserves the live-document DF, query-level cache, and search results while avoiding full-list materialization.

Non-goals:

  • No query semantics, corpus, or workload changes.

Validation:

  • Focused UT: TestLiveTermDF* and TestGlobalStatsDF* via mo-cgo-test — PASS at a44c418aa644c4a77c5e6d06187ce973f18e07ce.
  • Owning package: ./pkg/fulltext2/... — PASS at the same head.
  • Static checks: go vet ./pkg/fulltext2/... with repository CGo include/link flags — PASS.
  • Synthetic microbenchmark: loaded, fully-live DF=200,000, 8 terms — streaming helper 18.66 ns/op, 0 B/op; materialized oracle 5.48 ms/op, 12.85 MB/op. This is a helper microbenchmark, not issue-level performance acceptance.
  • BVT: test/distributed/cases/fulltext/fulltext_plugin_smoke.sql now exercises a multi-term BOOLEAN SHOULD query through the production SQL path. Local BVT execution was unavailable (mo-tester/service is not installed); exact-head CI result is pending.
  • Base source at e8fd84b331f168eafd0ec28149b043eaebc7e39d still materializes postings in globalStats.df; no new runtime base measurement was made here.
  • Issue performance validation: NOT_RUN. Required before QA acceptance: the existing distributed Fulltext Vector long-running workload, mixed qvec,nqft at 8 workers each, three consecutive independent 300-second NQFT windows, success/total, p50/p95/p99, QPS, and zero restart/OOM, with a matched main control on the same data/config. A stable, non-interfering execution window is still pending.
  • QA required: yes — the issue's acceptance is a sustained distributed latency comparison, which the package tests and SQL BVT cannot establish.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify

mergify Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH

XuPeng-SH commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: a44c418aa644c4a77c5e6d06187ce973f18e07ce

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mo-bot review · mo-bot-local · review

Commit: a44c418aa644c4a77c5e6d06187ce973f18e07ce

Assessment: approve

Live-DF counting preserves existing liveness and query-cache semantics, reusing raw counts and block decoding without new shared state. The scoped allocation benefit is validated; no blocking correctness or design defects remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Isolation preflight passed. Go 1.26.4 and reused native artifacts were verified against current inputs.

  • Ten focused test roots passed. The fulltext2 package tree passed across seven packages: 307 roots, 359 tests/subtests, zero skips.

  • Package listing, build and vet passed.

  • 32 benchmark variants × three repetitions completed. Loaded dirty DF=200,000/eight terms: median 4.92ms versus 6.36ms, and 0 versus 12,845,056 B/op against the prior-algorithm oracle.

  • Receipts and logs reconciled in validation-summary.json; all three discussion keys assessed; source unchanged.

Limitations:

  • The added SQL smoke uses classic FULLTEXT and does not exercise this FULLTEXT2 helper. Existing FULLTEXT2 fixtures were reviewed, and loaded-index scoring oracles passed.

  • Distributed SQL BVT and issue #28846 sustained NQFT latency acceptance were not run. Helper benchmarks do not establish an end-to-end latency fix.

@XuPeng-SH XuPeng-SH changed the title [Bug] Avoid fulltext2 posting materialization for live DF [4.2-dev] [Bug] Avoid fulltext2 posting materialization for live DF Nov 17, 2026

This branch was successfully deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants