Commit Graph

5287 Commits

Author SHA1 Message Date
Yingwen
dde1edcdb4 fix: incorrect prefilter check (#7886)
Signed-off-by: evenyag <realevenyag@gmail.com>
2026-03-31 02:45:07 +00:00
Yao Noel Achi
fb2dd862d5 fix: avoid cloning serialized view plans on resolve (#7882)
fix: avoid cloning serialized view plan on resolve

- Change `ViewInfoValue.view_info` from `Vec<u8>` to
`common_base::bytes::Bytes` so resolving a view no longer clones
the full serialized plan buffer on every decode.
- To keep the change narrow, the metadata write boundary still
accepts `Vec<u8>` and converts once when constructing/updating
`ViewInfoValue`. The hot read path  now uses a cheap clone of the
stored bytes.
- The benches introduced revealed up to 82% resolution time
improvment.

Signed-off-by: Yao ACHI <achi.noel@hotmail.com>
2026-03-31 01:51:09 +00:00
Ning Sun
e14404c677 chore: update rust toolchain to 2026-03-21 (#7849)
* chore: update rust toolchain to 2026-03-21

* chore: new format

* fix: lint

* chore: resolve lint issues

* chore: remove as_millis_f64

* chore: deps up
2026-03-30 12:13:14 +00:00
shuiyisong
a8fe6b5e44 fix: allow auto type upscale conversion in trace ingestion (#7870)
* fix: allow auto type upscale conversion in trace ingestion

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: immediate return when parse fails

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: typos

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* test: add integration test and fix

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* feat: add Int/Float/Bool to String conversion

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* refactor: coerce rows together

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* refactor: extract coerce

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* refactor: save clone

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* chore: add comments

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* refactor: unify in- and cross-batch check

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* chore: add comments

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
v1.0.0-rc.2-a8fe6b5e4-20260330-1774862317
2026-03-30 08:30:32 +00:00
Ning Sun
6bd14aaf9f fix: correct app-name for dashboard (#7884) 2026-03-30 08:22:37 +00:00
Yingwen
92e2d71f48 feat: implement prefilter framework and primary key prefilter (#7862)
* feat: prefilter basic framework

Signed-off-by: evenyag <realevenyag@gmail.com>

* refactor: move arguments to RowGroupBuildContext

Signed-off-by: evenyag <realevenyag@gmail.com>

* refactor: skip prefiltered exprs in FlatPruneReader

Signed-off-by: evenyag <realevenyag@gmail.com>

* refactor: remove unused functions

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: update comment

Signed-off-by: evenyag <realevenyag@gmail.com>

* feat: handle partition columns in prefilter

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: fix clippy

Signed-off-by: evenyag <realevenyag@gmail.com>

* fix: apply prefiltered selection by and_then

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: fix clippy

Signed-off-by: evenyag <realevenyag@gmail.com>

* fix: handle last row cache

Signed-off-by: evenyag <realevenyag@gmail.com>

* fix: don't ignore error in PrimaryKeyFilter

Signed-off-by: evenyag <realevenyag@gmail.com>

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-03-30 04:24:20 +00:00
jeremyhi
3904df5397 chore: refine track memory metrics semantics (#7874)
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-03-30 03:32:49 +00:00
cui
8e7e4a91d2 fix(datatypes): correct ConstantVector rhs comparison in vector equality (#7866)
* fix(datatypes): compare ConstantVector rhs inner in vector equality

When either operand is a ConstantVector, the recursive equal() call must
compare lhs.inner() against rhs.inner(). The second argument incorrectly
used lhs twice, breaking equality when only the rhs was constant.

Signed-off-by: Weixie Cui <cuiweixie@gmail.com>

* fix: review

Signed-off-by: Weixie Cui <cuiweixie@gmail.com>

---------

Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
2026-03-30 03:22:04 +00:00
Ruihang Xia
fe45ae446c perf: optimize promql range functions (#7878)
* bench(promql): add range-function benchmark suite

* perf(promql): use flat buffers in range function hot loops

* perf(promql): reuse quantile scratch buffers
v1.0.0-rc.2-nightly-20260330
2026-03-27 23:36:13 +00:00
Weny Xu
6f2ec12059 feat(partition): add expression split utility (#7822)
* feat(partition): add expression split utility

Implement MVP split logic with checker-safe degrade paths and move module under utils/split with aligned split naming and tests.

Signed-off-by: WenyXu <wenymedia@gmail.com>

* refactor: minor

Signed-off-by: WenyXu <wenymedia@gmail.com>

* chore: header

Signed-off-by: WenyXu <wenymedia@gmail.com>

* chore: styling

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(partition): degrade split when branch becomes unsatisfiable

Detect empty conjunction branches after split and return EmptyBranch instead of silently succeeding. This keeps split behavior aligned with expected partition semantics and adds regression tests for contradictory cuts.

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(partition): tighten empty-branch split detection

Handle Eq/NotEq contradictions and discrete-gap unsatisfiable ranges in split empty-branch checks. Add regression tests for equality conflicts and impossible int/date intervals.

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(partition): degrade singleton and uint impossible split branches

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(partition): enforce finite float bounds in split degradation

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(partition): drop date and timestamp support from expr split

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(partition): reject nan and infinity in expr split

Signed-off-by: WenyXu <wenymedia@gmail.com>

* refactor(partition): reuse conjunction bound collection in expr split

Signed-off-by: WenyXu <wenymedia@gmail.com>

* chore: fmt

Signed-off-by: WenyXu <wenymedia@gmail.com>

* chore: add comments

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(partition): respect null-first semantics in empty branch checks

Signed-off-by: WenyXu <wenymedia@gmail.com>

* refactor(partition): restrict expr split to range-only shapes

Signed-off-by: WenyXu <wenymedia@gmail.com>

* docs(partition): clarify split helper scope and test names

Signed-off-by: WenyXu <wenymedia@gmail.com>

* chore: add comments

Signed-off-by: WenyXu <wenymedia@gmail.com>

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-03-27 07:22:02 +00:00
Lei, HUANG
b57dfc18dc feat: pending rows batching for metrics (#7831)
* feat: metric batch 2s PoC

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: max_concurrent_flushes

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: work channel size

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* feat(servers): add metrics and logs for pending rows batch flush

Add the `FLUSH_ELAPSED` histogram metric to track the duration of pending
rows batch flushes in the Prometheus store protocol handler. This provides
better observability into the performance and latency of the batcher.

Also update telemetry by:
- Recording elapsed time for both successful and failed flush operations.
- Adding an informational log upon successful flush including row count and duration.
- Including elapsed time in error logs when a flush fails.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat(servers): implement columnar batching for pending rows

Refactor PendingRowsBatcher to use columnar batching for the metrics
store. Incoming RowInsertRequests are now converted to RecordBatches,
partitioned, and flushed via BulkInsert requests to datanodes.

- Enhance MultiDimPartitionRule to handle scalar boolean predicates.
- Add metrics for tracking flush failures and dropped rows.
- Update dependencies to support columnar batching in servers.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat(servers): add backpressure for pending rows

Implement backpressure in PendingRowsBatcher by limiting in-flight
requests with a semaphore and making the submission wait for the flush
result. This ensures Prometheus write requests are throttled and only
return once the data has been successfully flushed to datanodes.

- Add max_inflight_requests to PromStoreOptions.
- Use oneshot channels to notify submitters of flush completion.
- Limit concurrent requests using a new inflight_semaphore.
- Update PendingRowsBatcher::submit to wait for the flush outcome.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat: add stage-level metrics for bulk ingestion

Introduce histograms to track the elapsed time of various stages in the
metric engine bulk insert path and the server's pending rows batcher.
This provides better observability into the performance bottlenecks
of the ingestion pipeline.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* - `src/metric-engine/src/engine/bulk_insert.rs`: Removed the fallback mechanism that converted record batches to rows when bulk inserts were unsupported, along with related helper functions and unused imports.
- `src/operator/src/insert.rs`: Removed an unused import (`common_time::TimeToLive::Instant`).

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat(servers): columnar Prom remote write

Optimize the Prometheus remote write path by allowing direct conversion
from decoded Prometheus samples to Arrow RecordBatches. This bypasses
intermediate row-based representations when `PendingRowsBatcher` is
active and no pipeline is used, improving ingestion efficiency.

- Implement `as_record_batch_groups` in `TablesBuilder` and `PromWriteRequest`.
- Add `submit_prom_record_batch_groups` to `PendingRowsBatcher`.
- Introduce `DecodedPromWriteRequest` in `prom_store`.
- Implement row-to-RecordBatch conversion logic in `prom_row_builder`.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* Revert "feat(servers): columnar Prom remote write"

This reverts commit efbb63c12a3e7fcec03858ea0351efd94fec8242.

* refactor(servers): improve row to RecordBatch conversion

- Use `snafu::ensure` for row validation in `rows_to_record_batch`.
- Add explicit type hint for `MutableVector` to improve clarity.
- Reorganize and clean up imports in `pending_rows_batcher.rs`.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* perf(servers): use arrow builders for row conversion

This commit optimizes the conversion from `api::v1::Rows` to `RecordBatch`
by using Arrow builders directly. This avoids the overhead of
`MutableVector` and `common_recordbatch`, leading to better performance
in the `pending_rows_batcher`.

Additionally, the `#[allow(dead_code)]` attribute is removed from
`modify_batch_sparse` in the metric engine as it is now utilized.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* perf(metric-engine): optimize batch modification

Optimize `modify_batch_sparse` by reusing buffers, using Arrow
builders, and employing fast-path encoding methods. This reduces
allocations and avoids redundant downcasting and serializer overhead.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/metric-engine-support-bulk:
 **Add Environment Variable for Batch Sync Control**

 - `pending_rows_batcher.rs`: Introduced an environment variable `PENDING_ROWS_BATCH_SYNC` to control the synchronization behavior of batch processing. If set to true, the function will wait for the flush result; otherwise, it will return immediatel
 with the total rows count.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* wip

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* chore: update and fix clippy

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* fix: failing test

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* picking-pending-rows-batcher:
 ### Commit Message

 Remove Unused Code and Simplify Error Handling

 - **`src/error.rs`**: Removed the `BatcherQueueFull` error variant and its associated logic, simplifying the error handling by removing unused code.
 - **`src/http/prom_store.rs`**: Eliminated the `try_decompress` function, streamlining the decompression logic by directly using `snappy_decompress` in `decode_remote_read_request`.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* chore: parse PENDING_ROWS_BATCH_SYNC once

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* chore: revert unrelated changes

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* **Refactor Prometheus Write Handling**

 - **`prom_store.rs`**: Introduced `pre_write` method in `PromStoreProtocolHandler` to handle pre-write checks for Prometheus remote write requests. Updated `write` method to utilize `pre_write`.
 - **`server.rs`**: Modified `PendingRowsBatcher` initialization to conditionally create a batcher based on `with_metric_engine` flag.
 - **`http/prom_store.rs`**: Integrated `pre_write` checks before submitting requests to `PendingRowsBatcher`.
 - **`query_handler.rs`**: Added `pre_write` method to `PromStoreProtocolHandler` trait for pre-write operations.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* picking-pending-rows-batcher:
 - **Fix Label Typo**: Corrected a typo in the label value from `"flush_wn ite_region"` to `"flush_write_region"` in `pending_rows_batcher.rs`.
 - **Refactor Array Building Logic**: Introduced a macro `build_array!` to streamline the construction of `ArrayRef` for different data types, reducing code duplication in `pending_rows_batcher.rs`.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* format toml

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* picking-pending-rows-batcher:
 ### Update PromStore and PendingRowsBatcher Configuration

 - **`prom_store.rs`**: Set `pending_rows_flush_interval` to `Duration::ZERO` to disable automatic flushing.
 - **`pending_rows_batcher.rs`**: Enhance validation to disable the batcher when `flush_interval` is zero or configuration values like `max_batch_rows`, `max_concurrent_flushes`, `worker_channel_capacity`, or `max_inflight_requests` are zero, preventing potential panics or deadlocks.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* picking-pending-rows-batcher:
 ### Update `pending_rows_flush_interval` to Zero

 - **Files Modified**:
   - `src/frontend/src/service_config/prom_store.rs`
   - `tests-integration/tests/http.rs`

 - **Key Changes**:
   - Updated `pending_rows_flush_interval` from `Duration::from_secs(2)` to `Duration::ZERO` in `prom_store.rs`.
   - Changed `pending_rows_flush_interval` configuration from `"2s"` to `"0s"` in `http.rs`.

 These changes set the flush interval to zero, potentially affecting how frequently pending rows are flushed.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* picking-pending-rows-batcher:
 **Add Worker Management Enhancements**

 - **`metrics.rs`**: Introduced `PENDING_WORKERS` gauge to track active pending rows batch workers.
 - **`pending_rows_batcher.rs`**:
   - Added worker idle timeout logic with `WORKER_IDLE_TIMEOUT_MULTIPLIER`.
   - Implemented worker management functions: `spawn_worker`, `remove_worker_if_same_channel`, and `should_close_worker_on_idle_timeout`.
   - Enhanced worker lifecycle management to handle idle workers and ensure proper cleanup.
 - **Tests**: Added unit tests for worker removal and idle timeout logic.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* fix: clippy

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
Co-authored-by: jeremyhi <fengjiachun@gmail.com>
2026-03-27 02:19:00 +00:00
Yingwen
d3c8df70f5 fix: fix SeriesScan verbose mode mising metrics (#7872)
Signed-off-by: evenyag <realevenyag@gmail.com>
2026-03-26 17:52:18 +00:00
Ning Sun
08ded45c7a feat: add common_version customization (#7869)
* feat: add product name customization

* chore: update tests
2026-03-26 10:18:06 +00:00
Ruihang Xia
1118fe243f test: filter on region_peers table (#7864)
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2026-03-26 07:01:47 +00:00
discord9
d7bc5ad16b feat: add incremental read context and scan boundaries (#7848)
* feat: add incremental read context and scan boundaries

Signed-off-by: discord9 <discord9@163.com>

* chore: per review

Signed-off-by: discord9 <discord9@163.com>

* docs: explain field

Signed-off-by: discord9 <discord9@163.com>

---------

Signed-off-by: discord9 <discord9@163.com>
2026-03-26 07:00:22 +00:00
jeremyhi
8058ce7cf2 refactor: simplify scan memory tracking (#7827)
* refactor: simplify scan memory tracking

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: make confg-docs

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: by codex review comment

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* feat: track_with_policy

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: minor change

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: mem granularity mb to kb

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: by review comment

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: by scan_memory_on_exhausted comment

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix: by review comment

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: typo

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-03-26 03:25:50 +00:00
fys
8d40b129f1 chore: remove unused rexpect dev-dependency (#7865)
* chore: remove unused rexpect dev-dependency

* fix: taplo fmt
2026-03-26 03:14:59 +00:00
Ning Sun
73b48b14c1 feat: update postgres ParameterDescription size limit (#7861)
* feat: update postgres ParameterDescription size limit

* chore: don't log io error
2026-03-26 03:10:39 +00:00
Ruihang Xia
59dd418629 feat: simplify nested aggr inside count query (#7859)
* as optimizer rule

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* dump changes

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* perf: tighten count-count optimizer rewrite

* extend inner op set

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* simplify and more coverage

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* remove prom-non-null

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* preserve value column through pruning

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* more sqlness cases

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* rename

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* enforce is not null before inner aggr

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* finalize

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update sqlness result

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2026-03-26 00:08:38 +00:00
Boudewijn van Groos
ec9d57cecc fix: nested views not working (#7857)
Signed-off-by: Boudewijn van Groos <boudewijn.vangroos@foundationzero.org>
2026-03-25 17:58:45 +00:00
Lei, HUANG
35c5a4adb7 fix(mito2): accept post-truncate flush for skip-wal tables (#7858)
Allow flush edits with equal entry ids when flushed sequence advances, so close-time flush after truncate still succeeds for skip-wal regions while stale pre-truncate flushes are rejected. Add a regression test for create->truncate->write->close timing.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
2026-03-25 12:26:27 +00:00
Yingwen
04aa84af62 feat: use ArrowReaderBuilder instead of the RowGroups API (#7853)
* feat: use ArrowReaderBuilder instead of the RowGroups API

Signed-off-by: evenyag <realevenyag@gmail.com>

* refactor: make row_group_idx required

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: remove unsed variant

Signed-off-by: evenyag <realevenyag@gmail.com>

* fix: collect total_fetch_elapsed metrics

Signed-off-by: evenyag <realevenyag@gmail.com>

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
v1.0.0-rc.2-13cdfa9b5-20260325-1774407105
2026-03-25 03:10:19 +00:00
Ning Sun
13cdfa9b59 fix: update 8-bit int to smallint in postgres (#7854) 2026-03-24 12:16:38 +00:00
shuiyisong
c8c2e09eed refactor: move election trait and implementations to the common-meta crate (#7820)
* refactor: move election impl to common-meta

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

* fix: adding back comment

Signed-off-by: shuiyisong <xixing.sys@gmail.com>

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-03-24 10:21:31 +00:00
Yingwen
0e22d6a72b feat: implement partition range cache stream (#7842)
* feat: add cache stream helpers, key construction, config wiring, and metrics for partition range cache

Add range result cache size config field and wire it through cache builder
chains. Implement cache key building (build_range_cache_key), stream
replay/store helpers (cached_flat_range_stream, cache_flat_range_stream),
dictionary compaction (compact_pk_dictionary), and partition range row group
collection. Add range cache metrics (size, hit, miss) to ScanMetricsSet
and PartitionMetrics. Move fingerprint tests from scan_region to
range_cache module. These functions are not yet wired into scan execution.

Signed-off-by: evenyag <realevenyag@gmail.com>

* feat: add benchmark for cache stream

Signed-off-by: evenyag <realevenyag@gmail.com>

* refactor: move bench_util to test_util

Signed-off-by: evenyag <realevenyag@gmail.com>

* feat: share dict

Signed-off-by: evenyag <realevenyag@gmail.com>

* test: test ptr_eq

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: fmt code

Signed-off-by: evenyag <realevenyag@gmail.com>

* refactor: simplify value array handling

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: add todo for estimate size

Signed-off-by: evenyag <realevenyag@gmail.com>

* feat: simplify size calculation

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: remove one test

Signed-off-by: evenyag <realevenyag@gmail.com>

* test: update config test

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: address review comment

Only ignore exprs that can extract time ranges

Signed-off-by: evenyag <realevenyag@gmail.com>

* test: fix tests

Signed-off-by: evenyag <realevenyag@gmail.com>

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-03-24 10:01:13 +00:00
liyang
187b8d3798 ci: remove redundant directory level when uploading artifacts to S3 (#7852)
Signed-off-by: liyang <daviderli614@gmail.com>
2026-03-24 09:19:18 +00:00
discord9
30e895abbe fix: prom cast to f64 (#7840)
* fix: cast to f64

Signed-off-by: discord9 <discord9@163.com>

* test: div case

Signed-off-by: discord9 <discord9@163.com>

* test: int test

Signed-off-by: discord9 <discord9@163.com>

* chore: sqlness update

Signed-off-by: discord9 <discord9@163.com>

* chore: test

Signed-off-by: discord9 <discord9@163.com>

* chore: update test

Signed-off-by: discord9 <discord9@163.com>

---------

Signed-off-by: discord9 <discord9@163.com>
2026-03-24 06:24:52 +00:00
Weny Xu
9bd983ea40 fix: prevent stale in-flight cache refill after invalidation in CacheContainer (#7825)
* fix: prevent stale cache refill after invalidate

Signed-off-by: WenyXu <wenymedia@gmail.com>

* chore: apply suggestions from CR

Signed-off-by: WenyXu <wenymedia@gmail.com>

* feat: introduce `get_latest`

Signed-off-by: WenyXu <wenymedia@gmail.com>

* chore: styling

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix: enforce construction-time cache init strategy

Make cache initialization behavior explicit via InitStrategy selected at construction and document dirty-vs-checked semantics. Keep latest-read call compatibility while partition manager uses strategy-driven get paths.

Signed-off-by: WenyXu <wenymedia@gmail.com>

* test: rename get_by_ref freshness test

Signed-off-by: WenyXu <wenymedia@gmail.com>

* feat: use `InitStrategy::VersionChecked` for table route cache

Signed-off-by: WenyXu <wenymedia@gmail.com>

* chore: apply suggestions

Signed-off-by: WenyXu <wenymedia@gmail.com>

* chore: apply suggestions from CR

Signed-off-by: WenyXu <wenymedia@gmail.com>

* chore: apply suggestions from CR

Signed-off-by: WenyXu <wenymedia@gmail.com>

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-03-24 04:24:15 +00:00
Yingwen
5231ee40c8 feat: add parquet pk prefilter helpers (#7850)
* feat: extract parquet pk prefilter helpers

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: fmt code

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: fix warnings

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: update todo

Signed-off-by: evenyag <realevenyag@gmail.com>

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-03-24 03:57:18 +00:00
dependabot[bot]
6bebf93caf chore(deps): bump tar from 0.4.44 to 0.4.45 (#7846)
Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.44 to 0.4.45.
- [Commits](https://github.com/alexcrichton/tar-rs/compare/0.4.44...0.4.45)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 0.4.45
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-24 02:15:27 +00:00
dependabot[bot]
7afe16ddf7 chore(deps): bump rustls-webpki from 0.103.3 to 0.103.10 (#7847)
Bumps [rustls-webpki](https://github.com/rustls/webpki) from 0.103.3 to 0.103.10.
- [Release notes](https://github.com/rustls/webpki/releases)
- [Commits](https://github.com/rustls/webpki/compare/v/0.103.3...v/0.103.10)

---
updated-dependencies:
- dependency-name: rustls-webpki
  dependency-version: 0.103.10
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-24 02:15:06 +00:00
dennis zhuang
223f6cfdf7 feat: supports sst_format for x-greptime-hints and database options (#7843)
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-03-24 02:05:16 +00:00
Ruihang Xia
f999d5e70e feat: avoid some vector-array conversions on flat projection (#7804)
* perf(mito2): optimize flat projection conversion

* shrink the diff size

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* apply gemini's sugg

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* nit

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2026-03-24 00:11:37 +00:00
Lei, HUANG
7874282089 feat(mito): flat scan for time series memtable (#7814)
* feat/flat-for-time-series:
 ### Commit Message

 Enhance `TimeSeriesMemtable` with Record Batch Support

 - **`time_series.rs`**:
   - Introduced `BatchToRecordBatchContext` to facilitate conversion of batch iterators to record batch iterators.
   - Added `build_record_batch` method in `TimeSeriesIterBuilder` to support record batch creation.
   - Implemented multiple test cases to validate the functionality of record batch creation, including tests for projections,
 deduplication, sequence filtering, and data correctness.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/flat-for-time-series:
 Refactor `TimeSeriesMemtable` and `TimeSeriesIterBuilder`

 - Renamed `adapter_context` to `batch_to_record_batch` in `TimeSeriesMemtable` for clarity.
 - Simplified `MemtableRangeContext` initialization by removing the `batch_to_record_batch` parameter.
 - Added `is_record_batch` method to `TimeSeriesIterBuilder` to indicate record batch status.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/flat-for-time-series:
 ### Add Time Range Filtering and Predicate Group Enhancements

 - **`memtable.rs`**: Updated `IterBuilder` to include `time_range` parameter in `build_record_batch` method, enhancing record batch iteration with time range filtering.
 - **`time_series.rs`**: Modified `TimeSeriesIterBuilder` to use `PredicateGroup` instead of `Predicate`, and integrated `PruneTimeIterator` for time-based filtering.
 - **`memtable_util.rs`**: Removed unused `Predicate` import, reflecting changes in predicate handling.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

---------

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
2026-03-23 19:39:57 +00:00
Lei, HUANG
72f289df50 chore: remove GrpcQueryHandler::put_record_batch (#7844)
chore: remove GrpcQueryHandler::put_record_batch, we should use GrpcQueryHandler::handle_put_record_batch_stream instead

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
2026-03-23 07:12:39 +00:00
jeremyhi
805536aed1 fix: windows file path (#7839)
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
v1.0.0-rc.2-nightly-20260323
2026-03-20 08:19:41 +00:00
Ning Sun
d14817bfa6 fix: resolve optimization issue for extended query (#7824)
* fix: resolve optimization issue for extended query

* fix: type cast from subquery

* chore: update error information in sqlness

* chore: switch to released pgwire

* refactor: remove optimize function completely

* chore: add more tests

* test: attempt to fix the fuzz issue

* fix: try to resolve the test issue
2026-03-20 03:58:39 +00:00
Ruihang Xia
f034255fe6 perf: support group accumulators for state wrapper (#7826)
* perf: support group accumulators for state wrapper

* new tests and avoid clone

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2026-03-19 22:40:52 +00:00
jeremyhi
16fcbb2729 feat: export import v2 pr1 (#7785)
* feat: v2 schema handling

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* feat: impl m1.5 ddl export/import and schema tests

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: git ignore update

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: add license header

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: make fmt-check happy

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix: Run imported DDL against the intended schema

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix: Canonicalize schema names after case-insensitive check

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix: escape sql funcs

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix: Fixed by carrying explicit execution_schema in DdlStatement instead of parsing schema from SQL

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix: Fixed by encoding schema names as safe path segments in shared DDL path helpers

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* refactor(cli): make export/import v2 schema recovery DDL-only

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: by clippy

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: follow our styling

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix(cli): reject remote snapshot URIs with empty root

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix(cli): dedupe schema filters after canonicalization

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix(cli): schema-scoped detection to cover external tables

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-03-19 21:26:41 +00:00
Ruihang Xia
2af3951944 feat: cache decoded region metadata alone with parquet metadata (#7813)
* cache decoded region metadata

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix: account for decoded sst metadata cache weight

* take optional pre-exist metadata

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2026-03-19 03:09:47 +00:00
discord9
f2bccbd96a docs: flow inc query rfc (#7816)
* docs: flow inc query rfc

Signed-off-by: discord9 <discord9@163.com>

* chore: typo

Signed-off-by: discord9 <discord9@163.com>

* chore

Signed-off-by: discord9 <discord9@163.com>

* docs: clarify flow incremental stale recovery

Clarify that flush-boundary invalidation is part of IncrementalQueryStale, and document the in-memory checkpoint plus cold-start full snapshot recovery model.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: discord9 <discord9@163.com>

---------

Signed-off-by: discord9 <discord9@163.com>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-19 00:37:40 +00:00
ZonaHe
cc441b5642 feat: update dashboard to v0.12.0 (#7823)
Co-authored-by: sunchanglong <sunchanglong@users.noreply.github.com>
2026-03-17 18:25:14 +00:00
Lei, HUANG
dc98e0215b feat(metric-engine): support bulk inserts with put fallback (#7792)
* feat(metric-engine): support bulk inserts

Implement `RegionRequest::BulkInserts` to support efficient columnar data
ingestion in the metric engine.

Key changes:
- Implement `bulk_insert_region` to handle logical-to-physical region mapping
  and dispatch writes.
- Add `batch_modifier` for `RecordBatch` transformations, specifically for
  `__tsid` generation and sparse primary key encoding.
- Integrate `BulkInserts` into the `MetricEngine` request handling logic.
- Provide a row-based fallback mechanism if the underlying storage doesn't
  support bulk writes.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/metric-engine-bulk-insert:
 ### Update `bulk_insert.rs` to Support Partition Expression Version

 - **Enhancements**:
   - Added support for `partition_expr_version` in `RegionBulkInsertsRequest` and `RegionPutRequest`.
   - Modified the handling of `partition_expr_version` to be dynamically set from the `request` object.

 Files affected:
 - `src/metric-engine/src/engine/bulk_insert.rs`

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* fix: cargo lock revert

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* add doc for conversions

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* chore: simplify test

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/metric-engine-bulk-insert:
 ### Refactor `bulk_insert.rs` in `metric-engine`

 - **Refactor Functionality**:
   - Replaced `resolve_tag_columns` with `resolve_tag_columns_from_metadata` to streamline tag column resolution.
   - Moved logic for resolving tag columns directly into `resolve_tag_columns_from_metadata`, removing the need for an external function call.
 - **Enhancements**:
   - Improved error handling and context provision for missing physical regions and columns.
   - Optimized tag column sorting and index management within the batch processing logic.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/metric-engine-bulk-insert:
 ### Refactor `record_batch_to_rows` Function in `bulk_insert.rs`

 - Simplified the `record_batch_to_rows` function by removing the `logical_metadata` parameter and directly validating column types within the function.
 - Enhanced error handling for timestamp, value, and tag columns by checking their data types and providing detailed error messages.
 - Replaced the use of `Helper::try_into_vector` with direct downcasting to `TimestampMillisecondArray`, `Float64Array`, and `StringArray` for improved type safety and clarity.
 - Updated the construction of `api::v1::Rows` to directly handle null values and construct `api::v1::Value` objects accordingly.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/metric-engine-bulk-insert:
 ## Commit Message

 Refactor `bulk_insert.rs` to optimize state access

 - Moved the state read operation inside a new block to limit its scope and improve code clarity.
 - Adjusted logic for processing `tag_columns` and `non_tag_indices` to work within the new block structure.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/metric-engine-bulk-insert:
 ### Refactor `compute_tsid_array` Function

 - **Refactored `compute_tsid_array` function**: Modified the function signature to accept `tag_arrays` as a parameter instead of building it internally. This change affects the following files:
   - `src/metric-engine/src/batch_modifier.rs`

 - **Updated test cases**: Adjusted test cases to accommodate the new `compute_tsid_array` function signature by passing `tag_arrays` explicitly.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* docs: add doc for bulk_insert_region

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/metric-engine-bulk-insert:
 ### Commit Message

 Refactor `bulk_insert.rs` in `metric-engine`:

 - Removed error handling for unsupported status codes in `write_data` method.
 - Eliminated `record_batch_to_rows` function, simplifying the data insertion process.
 - Streamlined the `write_data` method by removing fallback logic for unsupported operations.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/metric-engine-bulk-insert:
 - **Optimize Primary Key Construction**: Refactored `modify_batch_sparse` in `batch_modifier.rs` to use `BinaryBuilder` for more efficient primary key construction.
 - **Add Fallback for Unsupported Bulk Inserts**: Updated `bulk_insert.rs` to handle unsupported bulk inserts by converting record batches to rows and using `RegionPutRequest`.
 - **Implement Record Batch to Rows Conversion**: Added `record_batch_to_rows` function in `bulk_insert.rs` to convert `RecordBatch` to `api::v1::Rows` for fallback operations.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/metric-engine-bulk-insert:
 Add test for handling null values in `record_batch_to_rows`

 - Added a new test `test_record_batch_to_rows_with_null_values` in `bulk_insert.rs` to verify the handling of null values in the `record_batch_to_rows` function.
 - The test checks the conversion of a `RecordBatch` with null values in various fields to ensure correct row creation and schema handling.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* feat/metric-engine-bulk-insert:
 Add fallback path for unsupported status and improve error context handling

 - **`bulk_insert.rs`**:
   - Added a fallback path for `PartitionTreeMemtable` in case of unsupported status code.
   - Enhanced error handling by using `with_context` for better error messages when timestamp and value columns are not found in `RecordBatch`.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

---------

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
2026-03-17 11:28:06 +00:00
Yingwen
e0aadffb91 feat: add flat last row reader to the final stream (#7818)
Signed-off-by: evenyag <realevenyag@gmail.com>
2026-03-17 07:55:48 +00:00
Yingwen
5a37e58b4f feat(mito2): add partition range cache infrastructure (#7798)
* feat: add partition range cache infra

Signed-off-by: evenyag <realevenyag@gmail.com>

* refactor: optimize scan request fingerprint cloning

Signed-off-by: evenyag <realevenyag@gmail.com>

* refactor: merge loops

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: more docs

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: update estimated size method and comment

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: fix clippy

Signed-off-by: evenyag <realevenyag@gmail.com>

* feat: only cache when we scan files

Signed-off-by: evenyag <realevenyag@gmail.com>

* fix: address PR review comments for partition range cache

- Remove TimeSeriesDistribution from fingerprint as it only affects yield order
- Disable range cache when dyn filters are present since they change at runtime

Signed-off-by: evenyag <realevenyag@gmail.com>

* chore: fmt code

Signed-off-by: evenyag <realevenyag@gmail.com>

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-03-17 03:53:20 +00:00
Ning Sun
dd82fcac00 chore: update visibility of BatchToRecordBatchAdapter::new (#7817) 2026-03-16 09:56:34 +00:00
Lei, HUANG
be4a7a6d37 refactor: remove Memtable::iter (#7809)
* refactor: remove Memtable::iter

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* fix: review comments

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

---------

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
2026-03-16 07:49:31 +00:00
maximk777
b007f85986 feat(http): improve error logging with client IP (#7503)
* feat(http): improve error logging with client IP

- Add logging to ErrorResponse::from_error_message()
- Add middleware to log HTTP errors with client IP

Closes #7328

Signed-off-by: maximk777 <maximkirienkov777@gmail.com>

* fix(http): address review comments for error logging

Restore rich Debug logging in from_error(), add URI/method/matched path
to client IP middleware, and only log when client address is available.

Signed-off-by: evenyag <realevenyag@gmail.com>

---------

Signed-off-by: maximk777 <maximkirienkov777@gmail.com>
Signed-off-by: evenyag <realevenyag@gmail.com>
Co-authored-by: evenyag <realevenyag@gmail.com>
2026-03-16 07:10:33 +00:00
jeremyhi
c6f1ef8aec feat: track unlimited usage in memory manager (#7811)
* feat: track unlimited usage in memory manager

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: by gemini comment

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* chore: remove unused import

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-03-16 03:52:27 +00:00
Ning Sun
306e8398cf fix: correct unicode representation for jsonb_to_string (#7810)
* fix: correct unicode representation for jsonb_to_string

* refactor: correct function name and behavior

* fix: fix json_to_string and provide tests
2026-03-16 03:01:02 +00:00