bug: Ngram refresh retry can skip unpublished block metadata
Maintainers usually reply within 1 day
@b41sh is already working on this.
Since Nov 25, 2026.
Assessment
This issue has not been assessed yet.
Description
Search before asking
- Searched existing issues. #20943 covers stale cache reads after an in-place rewrite, and #20957 proposes immutable paths. This report tracks a separate failure: retry skips metadata publication after a rejected commit, even without a stale cache read.
Version
Inspected at 77137bc2adc99e32893bb00a4ba81ad38c485b9a, before #21088. This is a storage-side failure path; it does not require the post-write hook.
What's Wrong?
Ngram refresh writes the new filter to the existing Bloom file path before committing the snapshot that contains the updated BlockMeta. If a concurrent table change rejects that commit, the filter can remain on disk while the published BlockMeta still has the old index sizes. A retry sees the filter in the file and can return as a no-op, leaving fuse_block(...).ngram_index_size stale.
Expected: retry should publish the missing block metadata, or rebuild and publish the index. File presence alone should not mark the refresh complete.
How to Reproduce?
The following is a proposed deterministic check from code inspection, not a completed end-to-end reproduction:
- Insert a string row into a Fuse table, then create an
ASYNC NGRAM INDEXon that column. Confirm the existing block'sngram_index_sizeisNULLinfuse_block. - Prepare its refresh pipeline, then change the same table's metadata without rewriting blocks (for example, create another async index) before executing the pipeline. The baseline test
test_refresh_batch_conflict_does_not_publish_snapshotalready sets up this conflict and checks that the stale snapshot is not published. - Retry
REFRESH NGRAM INDEXusing the current table definition. Check that the retry publishes the missing size rather than leaving itNULL.
The relevant paths are the in-place write and the filter-presence check.
Are you willing to submit PR?
- Yes
- Dominant language
- Rust
- Stars
- 9.5k
- Forks
- 903
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 204
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databendlabs/databend
-
bug: segment pruning skips rows when only some blocks have statistics of an added columnPossibly taken @zhyass claimed this today. OpenC-bug
databendlabs/databend#21244 · 1 assignee ·
Maintainers usually reply within 1 day
-
bug: ORDER BY ... NULLS LAST LIMIT returns wrong rows when an inverted index answers the filter and the sort column has NULLsPossibly taken @b41sh claimed this today. OpenC-bug
databendlabs/databend#21243 · 1 assignee ·
Maintainers usually reply within 1 day
-
Feature: Reduce role-graph work for explicit secondary rolesPossibly taken @TCeason claimed this 1 day ago. OpenC-feature
databendlabs/databend#21226 · 1 assignee ·
Maintainers usually reply within 1 day
-
Feature: Key role-dependent query results by authorization contextPossibly taken @TCeason claimed this 1 day ago. OpenC-feature
databendlabs/databend#21225 · 1 assignee ·
Maintainers usually reply within 1 day
-
bug: filters folded to false on block statistics drop matching rows: cast-eliminated equality under NOT, float arithmetic over NaN and infinities, variant IS DISTINCT FROMPossibly taken @forsaken628 claimed this 1 day ago. OpenC-bug
databendlabs/databend#21216 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in databendlabs/databend
Similar issues
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
eliasstravik/herdr-projects#1605 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
jlcodes99/cockpit-tools#3332 ·
Maintainers usually reply within 3 days
-
Cognito: the email MFA code (EMAIL_OTP challenge after a password flow) has 8 digits; AWS delivers 6Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aws/aws-emulator#692 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 82/100
pamburus/hl#1779 · 1 comment ·
Maintainers usually reply within 1 day