Add an opt-out for ingestion Parquet and Puffin preloading, enabled by default. Preserve import and staging behavior and cover publication with cache warming enabled and disabled.
Signed-off-by: WenyXu <wenymedia@gmail.com>
Carry additive sampling counters through region RPC and validate unique payload accounting with overlapping proposal and validation samples. Document directory-only probes separately from the payload file limit and allow directory-proven empty buckets in a census.
Update the generated Cargo lockfile for the proto revision; the resolver also reselects existing dependency edges without changing package versions.
Signed-off-by: WenyXu <wenymedia@gmail.com>
Add bounded progressive split requests and validated outcomes, with engine and metric-engine forwarding and a dedicated client RPC. Keep ordinary sketch queries unchanged and validate controls before acquiring region snapshots.
Signed-off-by: WenyXu <wenymedia@gmail.com>
Reject query planning during repartition handoff and keep new targets pending until all manifests have been applied. Carry planned partition versions to datanodes and validate the pinned scan snapshot, including retiring merge sources. Preserve retryable read errors and cover cached routes, transport, metric mapping, and scope changes.
Signed-off-by: WenyXu <wenymedia@gmail.com>
Add optional file-sampling requests and unscaled sample diagnostics, validate limits, and preserve the fields through region RPC conversion. Pin the published proto revision in the standalone OSS workspace; retain Cargo-generated lockfile dependency-edge normalization.
Signed-off-by: WenyXu <wenymedia@gmail.com>
* perf(table): compile a regex predicate once per scan instead of once per batch
Signed-off-by: discord9 <discord9@163.com>
* perf(recordbatch): borrow a regex cache once per array instead of per row
Signed-off-by: discord9 <discord9@163.com>
* perf(recordbatch): borrow a regex cache from a pool and defer its compilation
Signed-off-by: discord9 <discord9@163.com>
* perf(table): keep the regex rewrite off the pruning path
`prune_with_stats` folds a predicate into column statistics and never evaluates
it, so the precompiled-regex rewrite bought nothing there: the pruning
predicate builder replaces nodes it does not recognize with `true`, and the
rewrite ran per file (manifest pruning) and per batch (bulk memtable pruning).
Split the two conversions: `to_physical_expr` stays the evaluating entry point
and keeps `PrecompiledRegexExpr`; the new `to_pruning_physical_exprs` builds
what `create_physical_expr` builds, with the `DFSchema` built once per call
instead of once per expression.
Also pin the pool's concurrency property without a clock: eight cache guards
held and used at once, asserting eight acquisitions over one compilation.
Signed-off-by: discord9 <discord9@163.com>
---------
Signed-off-by: discord9 <discord9@163.com>
* feat(meta-srv): check pending WAL tails of source regions before a repartition starts
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test(common-meta): freeze the region statistic encodings before the pending tails flag
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(meta-srv): clarify the repartition pending tails errors and pin the flag encoding
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(meta-srv): retry repartitions over pending WAL tails and pass sources without a report
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* docs(meta-srv): note the retained leader report in the repartition pre-check
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(meta-srv): report pending repartition tails as region not ready and share is_false
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* style(meta-srv): order the repartition pre-check test imports
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
---------
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
Windows SystemTime and 32-bit time_t targets cannot represent the 5e18 ms statement start, so checked_add returns None before the planner sees the query. Skip the high-level shape there; the platform-independent native_tree_supported_declines_the_instants_that_overflow test still covers the admission predicate.
Signed-off-by: discord9 <discord9@163.com>
* fix(meta-srv): retry only unready regions and recheck routes in region migration
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(meta-srv): check the whole batch before aborting a recovered migration
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test(meta-srv): cover the invalidation of a retried route switch
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test(meta-srv): share the moved-leader fixture and cover replies with errors
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(meta-srv): recover migrations without parsing the persisted state
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(meta-srv): keep promoting a target that holds a follower replica
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(meta-srv): broadcast the routes a migration rollback clears
The rollback that clears the Downgrading marks of a batch now broadcasts
the table cache invalidation, so clients that cached the marked routes
refresh them. Also call the infallible broadcast directly at the start
check, bind the pending regions before borrowing them, and document why
the upgrade failure test repeats its attempt.
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(meta-srv): broadcast cleared marks when a later table of a rollback fails
The rollback broadcasts the table cache invalidation whenever it cleared
a Downgrading mark, also when a later table of the batch then fails: a
retry finds those marks gone and would broadcast nothing.
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
---------
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* perf(query): let a TopK over a filtered scan publish its dynamic filter early
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(query): share the global TopK conditions and flush filters per batch
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test(query): pin unsplit filter output at batch size 1
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(query): balance rows when assigning ranges in time order
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(query): leave TopK on other sort keys unchanged
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(query): spread ranges of unknown size and test the scan wiring
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test(query): share TopK test helpers and merge assignment cases
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(query): leave fetch-limited filters alone under a TopK
A FilterExec with a fetch keeps the first rows that pass, so changing
when the TopK threshold arrives or the order ranges are read changes
which rows it keeps. Both rules now stop at such a filter.
Also use replace_children instead of the deprecated with_new_children,
and document the coalescer behavior that batch size 1 relies on.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(query): rewrite only TopKs bounded by a SortPreservingMergeExec
A partitioned TopK keeps up to fetch rows per partition, which equals
the global result only because the merge above it takes the first rows
of all partitions. Match from that merge, through projections, and
require the TopK's fetch to cover the merge's, so a TopK whose
per-partition rows are part of the result is never rewritten.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* docs(query): state what the global TopK fetch cap does and does not bound
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(query): keep per-partition TopK heaps when no range can be skipped
With no more ranges than partitions each partition reads at most one
range, so the TopK threshold leaves no later range to skip and one heap
only adds a single consumer. filtered_scan_below_topk now requires more
ranges than partitions; both callers pass the partition count they plan
for.
The small sqlness tables in order_by and windowed_sort fall under the
guard, so a new windowed_sort case with six files covers the rewrite
end to end.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test(perf): add a query regression case for time-index TopK over a selective filter
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test(sqlness): say what the one-heap windowed_sort case pins
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* feat: add an admin function that discards a datanode's pending WAL tails
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix: refuse a tail discard over an unconfirmed manifest update and address review
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test: drop the integration test that repeats the admin function's region form
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix: refuse a tail discard while a tail replay's update is uncertain
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* build: pin greptime-proto to the branch that adds the pending tails truncate kind
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test: record the region id case of the discard_pending_tails sqlness test
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix: track the uncertain replay update only without conditional publication and pin the truncate wire format
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test: simplify the truncate wire test
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test: cover the discard requests sent to regions and the metric data region
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test(mito2): pin the WAL history a discard relies on after a crash
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test(common-function): describe the mock pending tails discard
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(operator): report discard failures per region and clarify pending tails docs
Log each failed region of a by-table pending tails discard with its region id
and the tails the other regions discarded, derive the unsupported message from
the truncate kind, drop the unused feature parameter, document that a discard
raises the flushed entry id to the tail bound, and test discarding a kept tail
after a replay commit with an uncertain result.
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(operator): warn with the partial discard count and state the WAL history check precisely
Format request.rs, log the tails discarded by the regions that succeeded at
warn level when another region fails, state in the docs that an open checks WAL
history through the flushed entry id where the log store checks history and
that whoever adds a tail ensures it for every node that may lead the region,
and rename two tests after the outcomes they assert.
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* docs(mito2): note that accepting missing WAL history opens a region past a discarded bound
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* docs(mito2): rewrap the pending tails discard handler doc
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* refactor(store-api): discard pending WAL tails with a dedicated region request
Carry the discard as RegionRequest::DiscardPendingTails, decoded from the
DiscardPendingTailsRequest body, instead of a truncate kind. Mito handles it as
a worker control request, so the truncate path no longer special-cases it;
the Metric Engine forwards it to a physical region's data region; the
frontend builds it for a region or for every region of a table, sharing the
table lookup with the discard of unflushed data. The wire fixture now pins the
new request body.
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* refactor(metric-engine): give the pending tails discard its own error context
Report a failed discard as a pending tails discard rather than a truncate in
the Metric Engine, pin that Mito handles the discard as a worker control
request, state that physical_region_ids returns a logical table's physical
regions, and drop leftovers from the truncate kind in the tests.
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* build: pin greptime-proto to the dedicated pending tails discard request
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* build: pin greptime-proto to the merged pending tails discard request
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
---------
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(operator): apply metric ingest TTL to physical tables
Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
* fix(operator): preserve instant TTL on logical tables and add remote write TTL hint integration test
Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
* fix(operator): preserve instant TTL on logical tables and add remote write TTL hint integration test
Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
* test(sqlness): regenerate logical table TTL expectation
Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
* refactor(operator): centralize metric logical table TTL checks
Share retention-vs-instant TTL helpers between DDL validation, auto-create
option filling, and ingest rejection messages so batch and SQL paths stay aligned.
Signed-off-by: Tyagiquamar <Tyagiquamar@users.noreply.github.com>
* fix(operator): borrow physical table name for TTL hint error
Signed-off-by: Tyagiquamar <Tyagiquamar@users.noreply.github.com>
* test(sqlness): expect InvalidArguments for logical retention TTL
Align table_semantics with alter_table retention rejection and rustfmt
the TTL hint error helper call.
Signed-off-by: Tyagiquamar <Tyagiquamar@users.noreply.github.com>
* feat(operator): apply retention ttl hint only on physical table creation and ignore on subsequent writes
Signed-off-by: Mohd Quamar Tyagi <104281681+Tyagiquamar@users.noreply.github.com>
* fix(operator): legacy logical TTL on create and restore ddl.rs LF
Strip retention ttl from metric logical CREATE options with a warning so
import_v2 can replay older snapshots. Narrow alter TTL checks, reduce
helper visibility, and convert ddl.rs back to LF line endings.
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
* fix(cli): clippy in import_v2 legacy ttl test
Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
* docs(operator): clarify logical metric ttl alter handling
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
* test(sqlness): add server-side coverage for legacy logical-table TTL
Replace the mock import_v2 unit test with sqlness cases verifying:
- SHOW CREATE TABLE omits database retention TTL on logical tables.
- Legacy logical CREATE TABLE with retention TTL strips the retention option from create_options.
- Explicit instant TTL remains preserved on logical tables.
Group TTL_KEY import in ddl.rs and verify create_options in HTTP test.
Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
* refactor(operator): strip logical retention ttl in one place
Every logical-table create path ends in StatementExecutor::create_logical_tables,
so strip retention ttl there instead of in fill_table_options_for_create and
validate_logical_create. validate_logical_create no longer mutates its input.
Classify ttl by parsing it once: only a valid non-instant ttl counts as
retention. Invalid values now fail normal option validation instead of being
silently stripped on create or reported as retention on ALTER.
Drop unit tests covered by the sqlness and HTTP integration cases.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
---------
Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
Signed-off-by: Tyagiquamar <Tyagiquamar@users.noreply.github.com>
Signed-off-by: Mohd Quamar Tyagi <104281681+Tyagiquamar@users.noreply.github.com>
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Co-authored-by: Tyagiquamar <Tyagiquamar@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Dennis Zhuang <killme2008@gmail.com>
* perf: prune by time range for filters on date_bin of the time index
A filter on a view's date_bin(...) bucket column reaches the region scan
as date_bin(stride, ts) <op> literal. The time range extractor only
understood ts <op> literal, so such scans read every file.
date_bin floors to the bucket start, so date_bin(ts) <= ts <
date_bin(ts) + stride for any fixed-width stride and origin. Derive a
conservative time range from that for >, >=, <, <=, = and BETWEEN.
Signed-off-by: Floris Smit <florissmit10@gmail.com>
* fix(table): keep rows that date_bin truncates on coarse time indexes
DataFusion computes the date_bin bucket start in nanoseconds and truncates
it to the column unit, so on a TIMESTAMP(0|3|6) column the returned bucket
can be up to one unit below the true start. Widen the derived upper bound
by one unit on such columns.
Keep date_bin filters unsupported in extract_time_range_strict: a range
derived from them is up to a bucket wider than the filter, so timestamps
synthesized at its bounds may not satisfy it.
Signed-off-by: Floris Smit <florissmit10@gmail.com>
---------
Signed-off-by: Floris Smit <florissmit10@gmail.com>