Repository navigation
fix(storage): degrade topic purge to LIKE when the FULLTEXT index is unusable - #506
Merged
loveRhythm1990 merged 2 commits intoNov 18, 2026
Conversation
…T is unusable (matrixorigin#247) Two FULLTEXT queries still failed the whole request on the recognized unusable-index error (20301 column word does not exist): - find_ids_by_topic, the lookup behind purge(topic): its fast path used map_err(db_err)? so the LIKE scan right below it was unreachable on error. - the branch pick candidate search in git_tools, which matched error text by hand and only knew the empty-pattern case. Route the first through fulltext_rows_or_degraded and export is_degradable_fulltext_error for the second, so both use the single classification in store.rs. Other database errors still propagate.
loveRhythm1990
requested review from
XuPeng-SH,
aptend and
gouhongshen
as code owners
November 17, 2026 12:36
Contributor
|
This pull request is merged. |
…test; drop the pick change Review feedback: the topic lookup test used a simulation hook that the old code never reached, so it passed on the old code too. Replace it with a test that swaps the hidden FULLTEXT index table for one without a word column in an isolated database. MatrixOne then answers 20301 column word does not exist, the unusable state from matrixorigin#247. The old lookup fails this test with that error. The test also checks that an unrelated error (the index table missing entirely) still propagates. Revert the git_tools pick change and its helper. The pick candidate query joins the target table and filters with OR, a shape for which MatrixOne answers 20105 not supported whether the index is healthy or broken. That case was already degraded, so the 20301 branch there is unreachable and had no effect.
gouhongshen
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #247
Where #247 stands on main
Most of the issue is already fixed.
fulltext_rows_or_degradedclassifies the unusable-index error (20301 column word does not exist), and the memory search paths and the graph node search degrade to a scopedLIKEscan. One FULLTEXT query still failed the whole request:find_ids_by_topic, the lookup behindpurge(topic=...). Its fast path ended in.map_err(db_err)?, so theLIKEscan directly below it was only reachable when the query succeeded with zero rows. With a broken index, purge by topic returned a database error.Change
memoria-storage/src/store.rs: run the fast path throughfulltext_rows_or_degraded. An unusable index falls through to the existingLIKEscan, and so does an empty pattern. Other database errors still propagate.Tests
broken_fulltext_index_degrades_topic_lookup_and_other_errors_surfacebreaks the index for real instead of simulating it. In an isolated database it replaces the hidden FULLTEXT index table with one that has nowordcolumn, which makes MatrixOne answer20301 column word does not exist. It then checks:LIKE, and not other owners' rows or inactive rows,On the old code this test fails with
Database("... 20301 ... column word does not exist"). With the change it passes. Skipped withoutDATABASE_URL, like the other database tests.What changed since the first push
The first version also touched the branch pick candidate search in
git_tools.rs. I reverted that part:OR. In a MatrixOne v4.2.8 container that shape answers20105 not supported: MATCH() AGAINST() function cannot be replaced by FULLTEXT INDEX...whether the index is healthy or broken. The existing code already degrades20105, so a20301branch there is unreachable.Verification
cargo test -p memoria-storage --libwith a MatrixOne container: 69 passed, 1 ignored.cargo test -p memoria-storage --test store_crud -- topic: passes.cargo check -p memoria-mcpbuilds.cargo fmt --checkreports nothing in the changed ranges. Existing findings elsewhere are untouched.