Skip to content

revert(fulltext2): keep cached indexes read-only - #28017

Merged
mergify[bot] merged 7 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/issue-28005-fulltext2-readonly-cache
Sep 3, 2026
Merged

mergify[bot] merged 7 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/issue-28005-fulltext2-readonly-cache

Conversation

@VioletQwQ-0

@VioletQwQ-0 VioletQwQ-0 commented Sep 2, 2026 •

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 #28005

What this PR does / why we need it:

This change restores the intended FULLTEXT2 cache contract: a cached search index is immutable and read-only for its entire cache-entry lifetime.

It:

  • reverts the FULLTEXT2 cold-load observability and cross-generation base/tail reuse introduced by perf(fulltext2): add cold-load observability #27461 and perf(fulltext2): reuse immutable bases across cache generations #27462;
  • removes the older CDC-triggered Cache.Remove, so a successful incremental flush does not evict or refresh the warm search index;
  • accepts delayed CDC visibility until the existing stale/TTL replacement boundary;
  • preserves current-main generic vector-cache lifecycle and concurrency fixes used by other index algorithms;
  • keeps nil-safe failed-load destruction and partial tail-load cleanup as independent correctness safeguards.

It does not change SQL, DDL, the FULLTEXT2 index format, ranking, CDC wire protocol, or the generic vector-cache implementation.

Validation

The branch was normally merged with the current upstream/main before publication.

  • exact base: d37cc0f7b14c3dbd5bc810fc85950cf4da1e9a9b
  • exact head: edb9d42df152ddd1f8977bf50cb1b11594327878
  • exact diff hash: 8ad6d4b8ea414c95c23a3ef304a3a3fab1471526506aaebdad3855fe432f8747
  • GOWORK=off go list -mod=readonly ./pkg/fulltext2 ./pkg/fulltext2/plugin/compile: PASS
  • fixed the exact-head compile error in storage_mock_test.go by passing int32(types.T_int64) to the existing FrameDeletes(int32, ...) helper; this is test-only and has no runtime semantic change
  • git diff --check: PASS
  • schema-v6 semantic preflight bound to the exact head and diff hash: PASS
  • final exact-head self-review covering source/lifecycle/test scope: PASS
  • repository CGo wrapper and direct fulltext2 tests/build/vet: BLOCKED before compilation by the local environment's missing cgo/libmo.dylib/third-party prerequisites and docfilter native CGo symbols (mo_cbitmap_*/mo_croaring_*); no test binary was produced

The prior CI run 33711420432 was for the superseded head f07aff43; its UT, SCA, and coverage jobs were red, while the two available BVT jobs passed. Job logs were unavailable through the API (404), so no blind rerun was performed. Fresh exact-head CI for edb9d42d is the authoritative gate and must finish before merge.

BVT and QA

BVT: N/A for this PR. The changed contract is process-local cache lifetime and accepted delayed visibility after CDC; a deterministic package/race regression and production-path source invariant are the appropriate pre-merge checks.

QA is required before closing #28005. Deployment validation should cover CDC with concurrent warm searches, stale/TTL replacement, MERGE/REBUILD, restart, cancellation, and resource cleanup.

The PR is Ready for review. No CI, merge, or QA closure is claimed here.

Revert matrixorigin#27462 and its prerequisite matrixorigin#27461, and stop evicting the warm FULLTEXT2 cache after each local CDC flush. Cached indexes remain immutable until the existing stale or TTL lifecycle replaces them.

Refs matrixorigin#28005.
@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 →

@VioletQwQ-0

Copy link
Copy Markdown
Collaborator Author

Updated and pushed the exact-head mainline sync at e3f4616b60ef73cb942e747d3974941d88e9c0e3.

  • The branch was normally merged with current upstream/main before this CI cycle; semantic preflight and final self-review remain PASS with diff_hash=76fdae26ee515792b823e741cb5ba3bc9d7ae5de8147d9a95da6a604e459b82c.
  • The prior failures in run 33711420432 belonged to superseded head f07aff43; its UT, SCA, and coverage logs were unavailable through the API (404), so no blind rerun was used.
  • Fulltext2 CGo tests/build/vet remain locally BLOCKED before compilation by missing native docfilter symbols and CGo prerequisites.
  • Fresh CI for this head is now the authoritative gate and is pending. QA remains required for [Performance]: keep FULLTEXT2 cache read-only across CDC updates #28005; no merge or QA closure is claimed.

@VioletQwQ-0

Copy link
Copy Markdown
Collaborator Author

Exact-head CI compile repair

Updated and pushed commit edb9d42df152ddd1f8977bf50cb1b11594327878.

  • The SCA and UT Coverage jobs for superseded head e3f4616b reported the same source error: typed types.T_int64 could not be passed to FrameDeletes(int32, ...).
  • pkg/fulltext2/storage_mock_test.go now passes int32(types.T_int64). This is a test-only compile repair and does not change FULLTEXT2 runtime behavior or the test oracle.
  • The branch is synchronized with upstream/main at d37cc0f7b14c3dbd5bc810fc85950cf4da1e9a9b; current clean semantic preflight and self-review are bound to diff hash 8ad6d4b8ea414c95c23a3ef304a3a3fab1471526506aaebdad3855fe432f8747.
  • Local fulltext2 CGo tests/build/vet remain blocked before compilation by missing native prerequisites; fresh CI for edb9d42d is pending.

No CI, merge, or QA closure is claimed. The existing reviewer requests remain in place.

@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.

Deep review completed on exact HEAD edb9d42df152ddd1f8977bf50cb1b11594327878: APPROVE.

No blocking correctness, performance, liveness, or resource-lifecycle issue found.

What I checked:

  • Contract against #28005 and the revert boundary of #27461/#27462: a warm FULLTEXT2 cache entry is no longer evicted or incrementally mutated by committed CDC flushes.
  • Counterexamples around concurrent search + CDC, stale/TTL eviction, MERGE/REBUILD, shutdown, failed/cancelled load, partial mmap/tail decode failure, and old-reader/new-generation overlap.
  • Ownership/cleanup: every mapped base segment and decoded tail segment is released on partial failures; Destroy is nil-safe; generic exact-entry deletion and waiter/retry behavior remain intact.
  • Performance: warm-query hot path is unchanged, CDC no longer forces repeated cold loads or waits, and there is no new logging path. The deliberate tradeoff is that the next stale/TTL replacement performs a full base+tail reload; this is bounded by the existing load budget and occurs on the accepted eventual-freshness boundary.
  • Generic vector-cache fixes are preserved; the revert is scoped to the FULLTEXT2 pooling/invalidation mechanism.

Local validation:

  • go test -mod=readonly -count=1 ./pkg/fulltext2 ./pkg/fulltext2/plugin/compile ./pkg/vectorindex/cache
  • focused FULLTEXT2 cleanup/error-path tests under -race -count=20
  • focused vector-cache concurrent search/delete, TTL, retry/waiter tests under -race -count=20
  • go test -mod=readonly -race -count=1 ./pkg/iscp
  • git diff --check

All passed. Exact-head Linux UT, SCA, coverage, standalone BVT, and multi-CN BVT are also green.

Accepted behavior: hot entries may expose CDC changes only after the existing stale/TTL cycle (roughly 10–12.5 minutes), as specified by #28005.

Non-blocking follow-ups:

  1. Add a durable production-path regression that proves a successful non-empty CDC flush does not evict a warm cache entry and does not block concurrent search.
  2. Update stale comments that still describe CDC-triggered Cache.Remove.

@mergify mergify Bot added the queued label Sep 3, 2026
@mergify

mergify Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-03 06:30 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-09-03 06:30 UTC · at 1092ab739c120052fff0b8d1ff27854663cd098f · squash

This pull request spent 23 seconds in the queue, including 1 second running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)

@mergify
mergify Bot merged commit 1092ab7 into matrixorigin:main Sep 3, 2026
26 of 27 checks passed
@mergify mergify Bot removed the queued label Sep 3, 2026
VioletQwQ-0 added a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
This change restores the intended FULLTEXT2 cache contract: a cached search index is immutable and read-only for its entire cache-entry lifetime.

It:

- reverts the FULLTEXT2 cold-load observability and cross-generation base/tail reuse introduced by matrixorigin#27461 and matrixorigin#27462;
- removes the older CDC-triggered `Cache.Remove`, so a successful incremental flush does not evict or refresh the warm search index;
- accepts delayed CDC visibility until the existing stale/TTL replacement boundary;
- preserves current-main generic vector-cache lifecycle and concurrency fixes used by other index algorithms;
- keeps nil-safe failed-load destruction and partial tail-load cleanup as independent correctness safeguards.

It does not change SQL, DDL, the FULLTEXT2 index format, ranking, CDC wire protocol, or the generic vector-cache implementation.

### Validation

The branch was normally merged with the current `upstream/main` before publication.

- exact base: `d37cc0f7b14c3dbd5bc810fc85950cf4da1e9a9b`
- exact head: `edb9d42df152ddd1f8977bf50cb1b11594327878`
- exact diff hash: `8ad6d4b8ea414c95c23a3ef304a3a3fab1471526506aaebdad3855fe432f8747`
- `GOWORK=off go list -mod=readonly ./pkg/fulltext2 ./pkg/fulltext2/plugin/compile`: PASS
- fixed the exact-head compile error in storage_mock_test.go by passing int32(types.T_int64) to the existing FrameDeletes(int32, ...) helper; this is test-only and has no runtime semantic change
- `git diff --check`: PASS
- schema-v6 semantic preflight bound to the exact head and diff hash: PASS
- final exact-head self-review covering source/lifecycle/test scope: PASS
- repository CGo wrapper and direct fulltext2 tests/build/vet: BLOCKED before compilation by the local environment's missing `cgo/libmo.dylib`/third-party prerequisites and `docfilter` native CGo symbols (`mo_cbitmap_*`/`mo_croaring_*`); no test binary was produced

The prior CI run `33711420432` was for the superseded head `f07aff43`; its UT, SCA, and coverage jobs were red, while the two available BVT jobs passed. Job logs were unavailable through the API (404), so no blind rerun was performed. Fresh exact-head CI for `edb9d42d` is the authoritative gate and must finish before merge.

### BVT and QA

BVT: N/A for this PR. The changed contract is process-local cache lifetime and accepted delayed visibility after CDC; a deterministic package/race regression and production-path source invariant are the appropriate pre-merge checks.

QA is required before closing matrixorigin#28005. Deployment validation should cover CDC with concurrent warm searches, stale/TTL replacement, MERGE/REBUILD, restart, cancellation, and resource cleanup.

The PR is Ready for review. No CI, merge, or QA closure is claimed here.

Approved by: @XuPeng-SH
VioletQwQ-0 added a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
This change restores the intended FULLTEXT2 cache contract: a cached search index is immutable and read-only for its entire cache-entry lifetime.

It:

- reverts the FULLTEXT2 cold-load observability and cross-generation base/tail reuse introduced by matrixorigin#27461 and matrixorigin#27462;
- removes the older CDC-triggered `Cache.Remove`, so a successful incremental flush does not evict or refresh the warm search index;
- accepts delayed CDC visibility until the existing stale/TTL replacement boundary;
- preserves current-main generic vector-cache lifecycle and concurrency fixes used by other index algorithms;
- keeps nil-safe failed-load destruction and partial tail-load cleanup as independent correctness safeguards.

It does not change SQL, DDL, the FULLTEXT2 index format, ranking, CDC wire protocol, or the generic vector-cache implementation.

### Validation

The branch was normally merged with the current `upstream/main` before publication.

- exact base: `d37cc0f7b14c3dbd5bc810fc85950cf4da1e9a9b`
- exact head: `edb9d42df152ddd1f8977bf50cb1b11594327878`
- exact diff hash: `8ad6d4b8ea414c95c23a3ef304a3a3fab1471526506aaebdad3855fe432f8747`
- `GOWORK=off go list -mod=readonly ./pkg/fulltext2 ./pkg/fulltext2/plugin/compile`: PASS
- fixed the exact-head compile error in storage_mock_test.go by passing int32(types.T_int64) to the existing FrameDeletes(int32, ...) helper; this is test-only and has no runtime semantic change
- `git diff --check`: PASS
- schema-v6 semantic preflight bound to the exact head and diff hash: PASS
- final exact-head self-review covering source/lifecycle/test scope: PASS
- repository CGo wrapper and direct fulltext2 tests/build/vet: BLOCKED before compilation by the local environment's missing `cgo/libmo.dylib`/third-party prerequisites and `docfilter` native CGo symbols (`mo_cbitmap_*`/`mo_croaring_*`); no test binary was produced

The prior CI run `33711420432` was for the superseded head `f07aff43`; its UT, SCA, and coverage jobs were red, while the two available BVT jobs passed. Job logs were unavailable through the API (404), so no blind rerun was performed. Fresh exact-head CI for `edb9d42d` is the authoritative gate and must finish before merge.

### BVT and QA

BVT: N/A for this PR. The changed contract is process-local cache lifetime and accepted delayed visibility after CDC; a deterministic package/race regression and production-path source invariant are the appropriate pre-merge checks.

QA is required before closing matrixorigin#28005. Deployment validation should cover CDC with concurrent warm searches, stale/TTL replacement, MERGE/REBUILD, restart, cancellation, and resource cleanup.

The PR is Ready for review. No CI, merge, or QA closure is claimed here.

Approved by: @XuPeng-SH
VioletQwQ-0 added a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
This change restores the intended FULLTEXT2 cache contract: a cached search index is immutable and read-only for its entire cache-entry lifetime.

It:

- reverts the FULLTEXT2 cold-load observability and cross-generation base/tail reuse introduced by matrixorigin#27461 and matrixorigin#27462;
- removes the older CDC-triggered `Cache.Remove`, so a successful incremental flush does not evict or refresh the warm search index;
- accepts delayed CDC visibility until the existing stale/TTL replacement boundary;
- preserves current-main generic vector-cache lifecycle and concurrency fixes used by other index algorithms;
- keeps nil-safe failed-load destruction and partial tail-load cleanup as independent correctness safeguards.

It does not change SQL, DDL, the FULLTEXT2 index format, ranking, CDC wire protocol, or the generic vector-cache implementation.

### Validation

The branch was normally merged with the current `upstream/main` before publication.

- exact base: `d37cc0f7b14c3dbd5bc810fc85950cf4da1e9a9b`
- exact head: `edb9d42df152ddd1f8977bf50cb1b11594327878`
- exact diff hash: `8ad6d4b8ea414c95c23a3ef304a3a3fab1471526506aaebdad3855fe432f8747`
- `GOWORK=off go list -mod=readonly ./pkg/fulltext2 ./pkg/fulltext2/plugin/compile`: PASS
- fixed the exact-head compile error in storage_mock_test.go by passing int32(types.T_int64) to the existing FrameDeletes(int32, ...) helper; this is test-only and has no runtime semantic change
- `git diff --check`: PASS
- schema-v6 semantic preflight bound to the exact head and diff hash: PASS
- final exact-head self-review covering source/lifecycle/test scope: PASS
- repository CGo wrapper and direct fulltext2 tests/build/vet: BLOCKED before compilation by the local environment's missing `cgo/libmo.dylib`/third-party prerequisites and `docfilter` native CGo symbols (`mo_cbitmap_*`/`mo_croaring_*`); no test binary was produced

The prior CI run `33711420432` was for the superseded head `f07aff43`; its UT, SCA, and coverage jobs were red, while the two available BVT jobs passed. Job logs were unavailable through the API (404), so no blind rerun was performed. Fresh exact-head CI for `edb9d42d` is the authoritative gate and must finish before merge.

### BVT and QA

BVT: N/A for this PR. The changed contract is process-local cache lifetime and accepted delayed visibility after CDC; a deterministic package/race regression and production-path source invariant are the appropriate pre-merge checks.

QA is required before closing matrixorigin#28005. Deployment validation should cover CDC with concurrent warm searches, stale/TTL replacement, MERGE/REBUILD, restart, cancellation, and resource cleanup.

The PR is Ready for review. No CI, merge, or QA closure is claimed here.

Approved by: @XuPeng-SH
@VioletQwQ-0
VioletQwQ-0 deleted the codex/issue-28005-fulltext2-readonly-cache branch December 1, 2026 03:47

This branch was previously deployed

1 inactive deployment
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/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants