* feat(mito2): add lossless multi-region compaction executor
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* refactor(mito2): use bounded workers for multi-region compaction
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* fix(mito2): materialize compaction routing fragments on demand
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* fix(index): clean up Tantivy resources on cancellation
Keep temporary directories alive through initialization and in-flight writer finalization. Release writers and remove directories on the shared blocking runtime, and retain the finishing task so abort can join it safely.
Cover creator lifecycle cleanup and multi-region cancellation and sibling failure after Tantivy initialization.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* refactor(mito2): stream single-window multi-region compaction
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* test(mito2): read published multi-region outputs with real metadata
Multi-region output metadata was only inspected field by field; every
successful read cleared the sequence bound and forced the preserve marker,
so partition filtering and sequence override were never exercised with the
metadata a caller publishes.
Read each output again with the returned FileMeta and the target metadata,
and require the same row count and the same reader-visible sequences.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* test(mito2): cover multi-region routing mask rejection
The exclusive-routing guards were unreachable: every fixture used a
partition rule whose masks happened to be disjoint and correctly sized.
An unchecked caller-supplied rule can still violate both invariants, and a
violation would route one physical row to several target regions.
Cover both guards: overlapping predicates from a real rule with
check_exprs=false, and an over-short mask from a minimal rule
implementation. Both must fail before any output is protected.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* test(mito2): cover JSON2 rewrite through multi-region compaction
The multi-region executor wires the shared JSON2 rewrite plan by column
id and target layout, but no fixture carried a JSON2 column, so neither the
per-target mapping nor the materialized values were exercised.
Write a source SST with a narrower JSON2 layout (one key stays in the
remainder), compact it into a wider target layout, and read the output back:
require the target physical layout and the original key values.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* test(mito2): cover every validate_plan rejection
Plan validation is the boundary that keeps malformed inputs away from the
routing and writer stages, but only the happy path was exercised. Mutate a
valid plan for each rejection (budgets, control state, empty targets, window
alignment/overflow, source ownership, duplicates, missing inputs, mismatched
schemas) and require the specific reason under a timeout, with no protected
outputs.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* test(mito2): assert multi-region output bytes and retained groups
output_bytes had no positive assertion, and the peak check was an upper
bound that also holds when the peak is never recorded. Require the reported
bytes to equal the sum of the produced files and the peak equal-key group
storage to be non-zero.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* test(index): cover retained Tantivy finalization on abort and drop
Cancellation was only exercised after finish_writer returned, so the
retained finalization handle and the directory lease it holds were never
tested. Simulate a commit that is still running, then require abort to join
it before removing the directory and creator drop to clean up after the
lease is released.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* refactor(mito2): share sequence provenance helpers on FileMeta
The multi-region writer duplicated the trust predicate and maximum-bound
fold that read paths and DefaultSstMerger already rely on, so the two could
disagree about whether a file's row sequences are trustworthy.
Move both rules onto FileMeta, delegate from FileHandle, and reuse them from
the multi-region writer and the compactor.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* docs(mito2): document the guarded SST write path
write_sst_with_guard is the enterprise seam whose behaviour is not visible
from its signature, and the comment above the non-cache arm still claimed
the cache was unconditionally disabled. Describe the bypass, the single
upload stream and the pre-create guard, and correct the stale comment.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* docs(mito2): document multi-region plan budget fields
The public plan left max_output_file_size and window_seconds without units or
semantics, and memory_limit without the multipart-minimum floor implied by
admission. State all three so callers cannot budget against the wrong unit.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* docs(mito2): explain the multi-region row-group cap
Capping output row groups at 1024 rows diverged from ordinary compaction
without saying why. Record that the cap bounds the encoder working set that
each resident target admits, and keep the behaviour unchanged.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* style(mito2): separate new error variants consistently
Every other variant in the enum is separated by a blank line; the new
enterprise variants were glued to their neighbours.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* docs(mito2): quote the new module identifier in the module map
Every other row of the module map starts with a backticked identifier; the
multi-region row did not.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* test(mito2): prefix multi-region tests with test_
Every other test under compaction/ is named test_*, so name-filtered runs
and IDE grouping silently skipped this module. Rename only the test
functions; assertions are unchanged.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* style(mito2): wrap the multi-region scan stream bodies
rustfmt does not reflow async_stream macro bodies, so the shared scan kept
statements far past the column limit. Split them into one statement per
line; behaviour is unchanged.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* test(mito2): make the table-stage folding cases independent
Both parametrized cases used identical options and differed only by
merge_mode, which the table stage never reads, so the second case re-ran
the first. Keep the ignored-merge-mode case and spend the second on
preserve_row_sequence, asserting the per-file marker as well as the row
count.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* test(mito2): fix partition mask test name
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* style(mito2): wrap multi-region worker macro bodies
Wrap receive and accounting expressions and expand the scan completion arm without changing worker behavior.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* docs(mito2): document multi-region output levels
Document that returned files default to L1 and callers must adjust metadata before publication when another level is intended. Distinguish this convention from changing existing persisted levels.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* fix(mito2): identify invalid multi-region plan fields
Report each invalid source or execution limit separately while preserving validation order and thresholds. Update rejection cases and cover negative window widths.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* test(mito2): consolidate multi-region compaction regressions
Share SST fixtures and complete-row oracles while preserving non-append, JSON2, sequence, and cancellation coverage. Drive Tantivy finalization tests through the real finish path.
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
---------
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
* fix: align fulltext bloom tokens with matches_term and use them for LIKE
The bloom fulltext index stored tokens that did not follow
matches_term's word boundaries (`_`, ASCII next to Han, Han substrings),
so pruning dropped rows matches_term accepts.
Tokens and query probes now share the character classes of
matches_term, Han runs are indexed as bigrams, and LIKE patterns use the
same probes. The bloom blob is written under a new key; blobs from older
versions are no longer probed. Tantivy no longer serves matches_term.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* chore: drop unused lazy_static from index and avoid typo-flagged test tokens
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* docs: link like_probes to tokenize instead of the downstream ScriptTokenizer
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* refactor: name probe extraction with verbs and document CharClass
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* feat: rebuild legacy fulltext bloom indexes and probe lower(col)
The manifest records the fulltext bloom version per column, so ADMIN
BUILD_INDEX now rebuilds SSTs whose bloom index predates the current
tokens, and ssts_index_meta shows the version.
Case-insensitive bloom indexes also store the tokens of the whole
lowercased text for rows where it can differ (U+0130, U+212A, sigma),
so matches_term(lower(col), ..) and lower(col) LIKE .. use the index.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test: cover legacy bloom index rewrite by compaction in the compat case
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* chore: log outdated fulltext bloom indexes in the consistency check
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* docs: explain the unrecorded fulltext bloom version
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(index): build bloom filters from element hashes without per-token allocation
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(index): speed up inverted index building with hashed buffers and sync pushes
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* chore(index): use BuildHasher::hash_one for element hashes
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* chore(index): require callers to act on spill requests
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(index): insert bloom hashes one by one to keep segment set capacity bounded
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test(index): add index build and bloom search benchmarks
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test(index): keep applier setup out of the bloom search benchmark
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(index): skip empty spills and keep the old inverted sort memory estimate
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(index): stream fulltext token hashes and test spill dispatch
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* docs(index): note non-ASCII tokens still allocate in analyze_text_hashes
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* docs(index): narrow the allocation note to case-insensitive non-ASCII tokens
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(mito2): load missing index pages of all ranges in one read
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* refactor(mito2): drop unused IndexCacheMetrics::merge
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(mito2): share cached bloom filter metadata instead of cloning it
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(mito2): only merge adjacent ranges when batch reading index pages
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(mito2): skip empty ranges when batch loading index pages
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(mito2): fetch index ranges concurrently
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test(index): return Arc<BloomFilterMeta> from RecordingReader
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(index): search bloom filters of all row groups in one read
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(index): bound the filter bytes of each batched bloom search
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(index): count batch filter bytes exactly as the search reads them
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* chore(index): allow single-range groups in the budget test
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test(index): cover filters shared across segments in the budget test
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* chore(toolchain): switch to stable Rust 1.96.1 and remove all nightly feature gates
Move the workspace from the pinned nightly-2026-03-21 to stable
1.96.1 and drop all 23 '#![feature]' gates across 13 crates,
rewriting the still-unstable API usages with stable equivalents:
- try_blocks: closures / an async block (table, query, common-function, servers)
- duration_constructors: Duration::from_secs(n * 86400) / (n * 60)
- iterator_try_collect: collect::<Result<Vec<_>, _>>()
- box_patterns: as_deref() + matches! chains (sql)
- error_iter: error_chain_root() source-chain walker (common-error);
sources() includes the error itself, so the walker never panics
- int_roundings: div_floor -> div_euclid (equal for positive divisors)
- iter_partition_in_place: stable sort_by_key partition helper (index)
- hash_set_entry: HashSet::insert bool / contains+insert
- trait_alias: lifetime-parameterized dyn FnOnce type aliases (puffin)
- string_from_utf8_lossy_owned: from_utf8_lossy(&v).into_owned()
- never_type: Infallible (common-recordbatch)
- debug_closure_helpers: closure-backed DebugFmt newtype (mito2)
- binary_heap_pop_if: peek().is_some_and() + pop()
- exclusive_wrapper: drop Exclusive; C: Send + Unpin already in bounds
- stmt_expr_attributes: stale gate, no usages
Also fix release-dev-builder-images.yaml, which parsed
rust-toolchain.toml with a date-only regex and would produce empty
image versions with a stable channel; it now extracts the full
channel token. Dev-builder images verified against stable 1.96.1
(image build, default-toolchain behavior, binstall/nextest, riscv64
and android targets, in-image cargo check).
Validated on 1.96.1: cargo check --workspace --all-targets, clippy
--workspace --all-targets --all-features -D warnings, cargo fmt
--check, and nextest on all 13 affected crates (4586 passed).
Part of #9289. Depends on #9298 (fuzz nightly quarantine) merging
first.
Signed-off-by: Ning Sun <sunning@greptime.com>
* chore: update flake checksum
* chore: use wild for linker in flake
---------
Signed-off-by: Ning Sun <sunning@greptime.com>
* fix(index): intersect bitmaps before early exit in predicates applier
The loop skipped intersecting when the next bitmap was empty, which left
the accumulator unchanged instead of zeroing it. Intersect first, then
break when the result is empty.
Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
* per gemini
* style(index): format predicates applier loop
* fix(index): remove unused mut in predicates applier
---------
Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Co-authored-by: discord9 <55937128+discord9@users.noreply.github.com>
Co-authored-by: discord9 <discord9@163.com>
perf: move Tantivy fulltext search to blocking thread pool
Wrap the synchronous Tantivy search (query parsing, posting list
traversal, stored field reads) in spawn_blocking_global to avoid
starving the tokio async runtime with CPU-bound work.
Signed-off-by: lyang24 <lanqingy93@gmail.com>
* feat: adds the foundational types and SQL parsing support for vector index
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* refactor: by suggestions
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix: ensure index option values must be greater than zero
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* chore: validate connectivity strictly
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix: compile error
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* feat: disable SIMD for ci
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf: cached reader do not get page concurrently
Otherwise they will all fetch the same pages in parallel
Signed-off-by: evenyag <realevenyag@gmail.com>
* perf: always disable zstd for bloom
Signed-off-by: evenyag <realevenyag@gmail.com>
---------
Signed-off-by: evenyag <realevenyag@gmail.com>