Commit Graph

5665 Commits

Author SHA1 Message Date
luofucong
e1ab3be69b refactor: optimize json2 write performance
Signed-off-by: luofucong <luofc@foxmail.com>
2026-07-09 13:38:31 +08:00
jeremyhi
59e4e7efda fix: preserve close-time flush responses (#8443)
* fix: preserve close-time flush responses

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

* test: make close flush race regression deterministic

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

* fix: notify waiters when scheduled flush jobs are dropped

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

* fix: complete pending close after close-time flush

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

* fix: return retryable flush scheduling errors

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

* fix: notify pending bulk writes on flush cleanup

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

* fix: keep writes fenced during close-time flush

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

* fix: queue close after noop wal flush

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

* fix: remove close-specific flush completion path

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

* fix: close region on close-time flush

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

* fix: fail close when follow-up flush cannot start

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

* fix: fence writes during close-time flush

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

* fix: notify listener before follow-up flush

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

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-07-09 04:08:11 +00:00
discord9
81e32eb1b5 test: add auto flush interval compat case (#8448)
Signed-off-by: discord9 <discord9@163.com>
2026-07-09 03:06:14 +00:00
fys
a7d564124d feat(json2): encode json2 variant payloads as jsonb (#8435)
* feat: encode json2 variant payloads as jsonb

* feat: encode json2 variant payloads as jsonb

* minor refactor

* fix: cargo check

* fix: unit test

* fix: cr
2026-07-08 11:27:42 +00:00
discord9
149b687a92 fix: preserve repartitioned file refs during GC (#8445)
* fix: preserve repartitioned file refs during GC

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

* refactor: clarify file refs target region

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-08 08:33:02 +00:00
Lei, HUANG
af51651b64 fix: collect lightweight query-load metrics (#8437)
- Performance: add collect_lightweight_query_load_metrics to walk the
  physical plan and read raw metric values without invoking MetricCollector's
  plan-node formatting on the normal query hot path before EOF.
- Refactor: extract collect_full_metrics and keep full aggregation/formatting
  for verbose analyze output and terminal metrics.
- Test: cover lightweight partial metrics and drop-time query stats reuse.

Files: src/common/recordbatch/src/adapter.rs

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-08 07:07:38 +00:00
jeremyhi
f12a1da3de fix: upgrade datafusion fork (#8438)
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-07-08 06:04:13 +00:00
fys
3bf8b9722d feat(json2): validate append mode for tables with JSON2 columns (#8434)
* feat: validate append mode for JSON2 tables

* fix: cr by codex

* fix: unit test

* fix: validate JSON2 append_mode for all ALTER TABLE operations
2026-07-08 03:33:36 +00:00
sun
ebfe4f6eb2 feat: update dashboard to v0.13.7 (#8431) 2026-07-07 23:39:43 +00:00
Weny Xu
fb1c40e466 chore(ci): stabilize remote wal fuzz tests (#8436)
fix: extend remote wal kafka timeout in fuzz tests

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-07 13:28:00 +00:00
Lei, HUANG
1cc4038880 fix: spawn read operations on query runtime (#8433)
Ensure read requests from `RegionServer` are dispatched to the query
runtime via `common_runtime::spawn_query` instead of executing on the
calling thread. This prevents runtime contention and keeps read
processing on the designated query runtime.

Affected file:
- `src/datanode/src/region_server.rs`

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-07 11:47:05 +00:00
discord9
b6438d3ea2 fix(flow): rebind stale snapshot fence (#8409)
* fix(flow): rebind stale snapshot fence

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

* refactor(flow): avoid repeated stale fence error formatting

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-07 08:36:39 +00:00
discord9
12f83828b1 feat: add Prom remote-write query regression scenario (#8413)
* feat: add Prom remote-write query regression scenario

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

* test: add high-cardinality remote-write query case

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

* feat: chunk remote-write query regression loads

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

* test: use multi-day remote-write regression case

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

* fix: address query regression review comments

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

* ci: allow large query regression comments

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-07 07:58:56 +00:00
sribatsha dash
8f5d681e4b feat: support ALTER TABLE SET auto_flush_interval (#8403)
* feat: support ALTER TABLE SET auto_flush_interval

Closes #8394.

Add a new SetRegionOption::AutoFlushInterval variant so that the
per-table auto flush interval can be changed on existing tables
via 'ALTER TABLE t SET ...', following up the CREATE TABLE path
from #8357.

- region_request.rs: parse 'auto_flush_interval' with humantime and
  map it to the new variant.
- metadata.rs: persist the value (or remove it, if None) in
  TableOptions.extra_options using the same humantime string format
  the engine already expects.
- handle_alter.rs: apply the new interval in
  handle_alter_region_options_fast (no memtable flush needed, same
  pattern as Ttl) and group the variant with Ttl/Twsc in
  new_region_options_on_empty_memtable.

Tests:
- Two unit tests in metadata.rs covering set and unset-to-None.
- A new sqlness case alter_auto_flush_interval.sql covering
  create-then-alter, alter-then-alter, invalid duration, and
  alter on a table that already had auto_flush_interval at create
  time.

Signed-off-by: srivtx <crypticcc101@gmail.com>

* fix: validate auto_flush_interval > 0 in ALTER SET path

Gemini code assist flagged that the request parser accepted a zero
duration, leaving the rejection to the downstream RegionOptions
validation which only fires on next flush. Reject it at parse time
so users get the error immediately at the ALTER TABLE statement.

Also add a '0s' error case to the sqlness test.

Signed-off-by: srivtx <crypticcc101@gmail.com>

* fix: handle SET 'auto_flush_interval' = NULL and add checked-in .result

Address the rest of fengjiachun's review on #8403:

1. Empty value in ALTER SET clears the override (parallels Ttl).
   'ALTER TABLE t SET ... = NULL' comes through as value = ''; we
   now return AutoFlushInterval(None) so the override is removed
   from TableOptions.extra_options, matching the Ttl pattern.

2. Add a unit test in region_request.rs covering the four cases
   (valid, empty-clears, zero-rejected, garbage-rejected).

3. Generate and check in alter_auto_flush_interval.result via
   'cargo sqlness-runner bare -t alter_auto_flush_interval'. Both
   the standalone and distributed sqlness jobs now pass locally,
   and the test extension covers the NULL-clears path end to end.

Signed-off-by: srivtx <crypticcc101@gmail.com>

---------

Signed-off-by: srivtx <crypticcc101@gmail.com>
2026-07-07 07:34:05 +00:00
discord9
9936a83384 feat(query): add runtime provider interface (#8386)
* feat(query): add runtime provider interface

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

* docs(query): document runtime provider interface

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

* feat(query): pass runtime builder to provider

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

* fix(query): make runtime provider fallible

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

* fix(query): propagate runtime provider errors

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-07 07:18:23 +00:00
fys
63cc232339 chore: add sqlness regression for timestamp precision comparison (#8424)
* test: add sqlness regression for timestamp precision comparison

* add result
2026-07-07 06:45:55 +00:00
discord9
c8c7e77cc3 test: add ssts limit compat case (#8427)
Signed-off-by: discord9 <discord9@163.com>
2026-07-07 03:41:22 +00:00
discord9
1d819a3982 test: add comment metadata compat case (#8402)
Signed-off-by: discord9 <discord9@163.com>
2026-07-07 02:27:55 +00:00
discord9
d8f692f4c5 ci: run query regression on self-hosted runners (#8423)
* ci: run query regression on self-hosted runners

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

* ci: use dedicated perf regression runner labels

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

* ci: keep query regression runner scale set minimal

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

* ci: use custom query regression runner image

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

* ci: host query regression runner image in acr

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

* ci: harden query regression runner workflow

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

* ci: avoid runner uid assumptions in values

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

* ci: fix query regression comments for fork prs

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

* ci: address query regression review comments

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-06 13:12:18 +00:00
shuiyisong
90752f5649 feat: persist Prometheus remote write v2 native histograms (#8382)
* chore: add histogram decode

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

* chore: add convert func

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

* feat: implement native histogram persistency

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

* chore: add test

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

* chore: refactor

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

* chore: add README for v2

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

* chore: fix CR issues

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

* fix: cr issue

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

* fix: cr issue

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

* feat: implement metric engine

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

* chore: add comments

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

* chore: fix test

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

* chore: store nh in one struct

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

* chore: fix CR issues

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

* chore: fix CR issues

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

* chore: fix CR issues

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

* chore: fix CR issues

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

* chore: fix test

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

* fix: cr issue

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

* chore: fix CR issues and add feature gate

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

* chore: fix CR issues

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

* fix: add config option

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

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-07-06 11:51:22 +00:00
discord9
ecb26645e7 fix(meta): configure heartbeat message size (#8411)
Signed-off-by: discord9 <discord9@163.com>
2026-07-06 10:29:09 +00:00
jeremyhi
5bcc2e9d6b fix: global limit for distributed inspect streams (#8412)
* fix: global limit for distributed inspect streams

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

* fix: honor tighter filter fetch under global limit

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

* fix: restore distribution after global limit

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

* fix: preserve inherited distribution for global limit

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

* fix: propagate inherited hash partitioning

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

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-07-06 07:02:54 +00:00
discord9
cdf91f5ced chore: pin datafusion to merged branch commit (#8422)
Signed-off-by: discord9 <discord9@163.com>
2026-07-06 04:46:30 +00:00
Ning Sun
434e0c7682 fix: update datafusion-pg-catalog (#8417) 2026-07-06 03:19:39 +00:00
Lei, HUANG
3758911a2e feat: add soft-drop table recovery procedures (#8061)
* feat: add close-first soft-drop table flow
Soft-drop now tombstones table metadata and closes datanode regions instead of
issuing physical drop requests, while preserving hard-drop cleanup semantics and
blocking conflicting drops of recreated table names.
Files:
- `src/common/meta/src/ddl.rs`
- `src/common/meta/src/ddl/drop_table.rs`
- `src/common/meta/src/ddl/drop_table/executor.rs`
- `src/common/meta/src/error.rs`
- `src/common/meta/src/ddl_manager.rs`
- `src/meta-srv/src/metasrv/builder.rs`
- `src/cmd/src/standalone.rs`
- `src/common/meta/src/test_util.rs`
- `src/meta-srv/src/procedure/utils.rs`
- `tests-integration/src/standalone.rs`
- `src/common/meta/src/ddl/tests/drop_table.rs`

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

* feat: add undrop and purge table procedures

Add soft-drop recovery and cleanup procedures, wire their DDL task handling, and update \`greptime-proto\` so the new tasks can round-trip through protobuf.

Files:
- \`Cargo.toml\`
- \`Cargo.lock\`
- \`src/common/meta/src/ddl.rs\`
- \`src/common/meta/src/ddl/undrop_table.rs\`
- \`src/common/meta/src/ddl/purge_dropped_table.rs\`
- \`src/common/meta/src/ddl_manager.rs\`
- \`src/common/meta/src/rpc/ddl.rs\`
- \`src/common/meta/src/key.rs\`
- \`src/common/meta/src/ddl/tests/drop_table.rs\`
- \`src/mito2/src/engine/open_test.rs\`

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

* fix: reopen soft-dropped regions before purge

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

* feat: disable soft-drop operations for metric logical tables

Prevent soft-dropping, undropping, and purging of metric engine logical tables by explicitly returning unsupported errors. This introduces `is_metric_engine_logical_table` to identify metric logical tables and adds corresponding test cases.

Files:
- `src/common/meta/src/ddl/drop_table/metadata.rs`
- `src/common/meta/src/ddl/purge_dropped_table.rs`
- `src/common/meta/src/ddl/tests/drop_table.rs`
- `src/common/meta/src/ddl/undrop_table.rs`
- `src/common/meta/src/ddl/utils.rs`

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

* fix: sync failure detectors during soft-drop lifecycle

Keep region failure detector state aligned as soft-dropped tables close, reopen, and purge regions so stale detectors do not trigger failover for unavailable or deleted regions.

Files:

- \`src/common/meta/src/ddl.rs\`

- \`src/common/meta/src/ddl/drop_table.rs\`

- \`src/common/meta/src/ddl/undrop_table.rs\`

- \`src/common/meta/src/ddl/purge_dropped_table.rs\`

- \`src/common/meta/src/ddl/tests/drop_table.rs\`

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

* refactor: simplify soft-drop table tests

Consolidate redundant soft-drop lifecycle assertions into existing end-to-end tests and share dropped-table metadata setup to keep the branch coverage focused.

Files:

- `src/common/meta/src/ddl/tests/drop_table.rs`

- `src/common/meta/src/key.rs`

- `src/mito2/src/engine/open_test.rs`

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

* fix: reopen follower regions during undrop

Reopen all replicas when restoring dropped physical tables so recovered replicated tables do not leave follower regions closed.

Files:

- `src/common/meta/src/ddl/undrop_table.rs`

- `src/common/meta/src/ddl/tests/drop_table.rs`

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

* feat: use dropped table ddl expr protos

Update greptime-proto and adapt dropped table DDL task conversions to the shared expression wrappers required by the proto API.

Files:

- `Cargo.toml`

- `Cargo.lock`

- `src/api/src/helper.rs`

- `src/common/meta/src/ddl/drop_table/executor.rs`

- `src/common/meta/src/rpc/ddl.rs`

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

* revert: use inline dropped table task protos

Point GreptimeDB at the proto revision that restores direct dropped table task fields and remove wrapper-expression conversion code.

Files:

- `Cargo.toml`

- `Cargo.lock`

- `src/api/src/helper.rs`

- `src/common/meta/src/rpc/ddl.rs`

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

* feat: various soft-drop improvements

- Bump `greptime-proto` dependency revision
  (`Cargo.toml`, `Cargo.lock`)
- Pass `region_wal_options` directly without pre-serialization in undrop flow
  (`src/common/meta/src/ddl/undrop_table.rs`, `src/common/meta/src/key.rs`)
- Remove unused `RegionNumber` import
  (`src/common/meta/src/ddl/utils.rs`)
- Add `reset_failure_detectors` to test mock
  (`src/common/meta/src/ddl/tests/drop_table.rs`)
- Add JSON roundtrip tests for `UndropTableTask` and `PurgeDroppedTableTask`
  (`src/common/meta/src/rpc/ddl.rs`)

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

* feat: validate table name match in undrop procedure

Add a guard in `UndropTableProcedure::on_prepare()` to check that the
dropped table name matches the undrop task name, returning `TableNotFound`
on mismatch.  This prevents undropping a table by a different name when
only the table ID is known.

- `src/common/meta/src/ddl/undrop_table.rs` — add table-name validation
- `src/common/meta/src/ddl/tests/drop_table.rs` — add test for name mismatch

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

* refactor: simplify UndropTableTask to use table_id only

Remove catalog, schema, and table name fields from `UndropTableTask`
since the table name can be derived from the dropped table metadata
in the procedure itself. This eliminates redundant fields and the
associated name-validation test.

Simplify locking in `UndropTableProcedure` to only use `TableLock`.

Update `greptime-proto` dependency revision.

- `Cargo.toml`, `Cargo.lock`
- `src/common/meta/src/rpc/ddl.rs`
- `src/common/meta/src/ddl/undrop_table.rs`
- `src/common/meta/src/ddl/tests/drop_table.rs`

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

* feat: detect table name conflict during tombstone restore in undrop

- Added `require_dest_not_exists` parameter to tombstone `move_values` to check destination key existence during restore

- Added `TombstoneTargetAlreadyExists` error variant

- Map tombstone conflict to `TableAlreadyExists` in undrop procedure

- Added test for undrop failing when live name created after prepare

Files:

- `src/common/meta/src/ddl/tests/drop_table.rs`

- `src/common/meta/src/ddl/undrop_table.rs`

- `src/common/meta/src/error.rs`

- `src/common/meta/src/key/tombstone.rs`

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

* feat: make PurgeDroppedTableTask table_id-only

Streamline the purge-dropped-table flow by requiring a table_id
instead of allowing name-based fallback.

- Refactored `PurgeDroppedTableTask` to hold only `table_id` in `src/common/meta/src/rpc/ddl.rs`
- Simplified purge procedure in `src/common/meta/src/ddl/purge_dropped_table.rs`
- Adapted tests in `src/common/meta/src/ddl/tests/drop_table.rs`
- Bumped `greptime-proto` dependency

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

* fix(tombstone): chunk values by per-key txn ops instead of fixed divisor

Replaced the fixed `max_txn_ops() / 2` chunk size with operation-aware
constants (`MOVE_VALUE_TXN_OPS_PER_KEY=4`, `RESTORE_VALUE_TXN_OPS_PER_KEY=6`)
to correctly account for per-key transaction operations. Added
`TxnOpLimitKvBackend` test helper and two new tests
(`test_restore_chunks_by_total_txn_ops_limit`,
`test_create_chunks_by_total_txn_ops_limit`) verifying chunking under
tight txn op limits.

Affected file:
- `src/common/meta/src/key/tombstone.rs` — chunk size fix,
  `TxnOpLimitKvBackend` helper, two new tests

Signed-off-by: Lei, HUANG &lt;ratuthomm@gmail.com&gt;
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* feat(soft-drop): deregister failure detectors and handle replayed open-regions during purge

- `src/common/meta/src/ddl/drop_table.rs`: deregister failure detectors before
  transitioning to DeleteTombstone state
- `src/common/meta/src/ddl/undrop_table.rs`: refactor `open_regions` into
  `open_regions_inner` with an `ignore_region_not_found` flag; expose
  `open_regions_ignore_region_not_found` for purge replayer
- `src/common/meta/src/ddl/purge_dropped_table.rs`: use
  `open_regions_ignore_region_not_found` in replayed purge procedures
- `src/common/meta/src/ddl/tests/drop_table.rs`: add tests for undrop
  idempotency and purge replay tolerance of dropped regions

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

* chore: fix clippy

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

* fix(soft-drop): open regions before restoring undrop metadata

Restore undropped table metadata only after physical regions have been reopened, keeping the table hidden while regions are still closed. Preserve the live-name conflict check before opening regions and cover the ordering with a regression test.

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

* fix(tombstone): fail fast on invalid txn op budget

Fail before issuing `TombstoneManager` transactions when the configured `max_txn_ops` cannot fit one key. Add coverage for undersized restore budgets in `src/common/meta/src/key/tombstone.rs`.

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

* chore: bump greptime-proto to main branch commit

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

---------

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
Signed-off-by: Lei, HUANG &lt;ratuthomm@gmail.com&gt;
v1.2.0-nightly-20260706
2026-07-05 09:02:48 +00:00
discord9
4f5dccf6bb fix(query): push down PromQL cast filters (#8407)
* fix(query): push down PromQL cast filters

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

* test(query): cover cast preimage pushdown

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

* test(query): expand cast preimage coverage

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

* test(query): compare cast normalization rules

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

* test(query): update cast pushdown sqlness plans

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-03 09:10:00 +00:00
discord9
c44f8da646 feat: add query regression perf harness (#8406)
* feat: add query regression perf harness

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

* feat: extend query regression cases

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

* ci: harden query regression workflows

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

* fix: address query regression review comments

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

* ci: limit query regression PR triggers

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

* ci: run full query regression case set

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

* refactor: model query regression scenarios

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

* fix: avoid unenforced query regression thresholds

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-03 09:09:01 +00:00
discord9
424e400c80 test: add flow scheduled now compat case (#8400)
Signed-off-by: discord9 <discord9@163.com>
2026-07-03 06:31:40 +00:00
Weny Xu
2dc6addb66 feat: report region query stats in heartbeat (#8401)
* feat: report region read load in heartbeat

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

* feat: expose region query stats in information schema

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

* chore: update sqlness result

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

* fix: record region query stats on stream drop

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

* fix: keep region query cpu stats in nanoseconds

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

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-03 06:11:57 +00:00
discord9
33902eef3e fix(mito): honor unknown file lingering time (#8365)
* fix(mito): honor unknown file lingering time

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

* fix(mito): allow gc test helper arguments

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

* test(mito): cover unknown file ttl boundaries

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

* test: update unknown file ttl config snapshot

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

* chore: fix typo in logical table alter

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

* refactor(mito): make gc delete helper sync

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

* refactor(mito): call gc delete helper directly

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

* refactor(mito): minimize unknown file ttl changes

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-03 04:31:35 +00:00
jeremyhi
fc7a9bf56d fix: handle PromQL time binary aggregation (#8398)
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-07-02 11:18:58 +00:00
discord9
ba073045e2 perf(mito): skip manifest-pruned file ranges (#8366)
* perf(mito): skip manifest-pruned file ranges

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

* test(mito): allow empty prune benchmark output

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

* fix(mito): avoid caching stale pruned builders

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

* chore(mito): address pruner clippy

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

* fix(mito): account worker pruner builder metrics

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

* test(mito): keep empty prune benchmark local

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

* refactor(mito): share manifest-pruned range skip

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

* chore(mito): shorten prune cache comment

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

* fix(mito): keep manifest prune state in pruner

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

* test(mito): cover manifest prune fast skip edge cases

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

* chore: fix typo in logical table alter

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

* chore(mito): address pruner review comments

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-02 06:25:16 +00:00
discord9
55852a05b8 feat: stream explain analyze metrics over http (#8380)
* feat: stream explain analyze metrics over http

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

* fix: address analyze stream review comments

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

* test: document analyze stream protocol

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

* test: update config api expectation

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

* fix: track slow queries for analyze stream

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-02 06:24:53 +00:00
discord9
6b587eb0a5 test: add recent sqlness compat cases (#8395)
* test: add recent sqlness compat cases

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

* test: add more sqlness compat cases

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-02 03:13:53 +00:00
discord9
5f6b88b782 fix(flow): bind scheduled now in dist plan (#8389)
Signed-off-by: discord9 <discord9@163.com>
2026-07-01 10:56:30 +00:00
Weny Xu
3aa82567c4 fix: invalidate comment DDL cache and lock by object ID (#8390)
* fix: invalidate comment ddl cache locally

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

* fix: fix typos

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

* chore: apply suggestions

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

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-01 10:02:57 +00:00
Lei, HUANG
8a11ee9462 fix: record catalog and schema in slow queries (#8387)
* fix: record catalog and schema in slow queries

Add catalog and schema context to slow query records while appending the new columns after existing fields to preserve column order.

- `src/common/frontend/src/slow_query_event.rs`: extend `SlowQueryEvent` schema and rows with `catalog_name` and `schema_name`, and cover append-only ordering.
- `src/catalog/src/process_manager.rs`: carry catalog and schema through `SlowQueryTimer`.
- `src/frontend/src/instance.rs`: capture context for SQL, plan, and PromQL slow query timers.
- `tests-integration/tests/sql.rs`: assert MySQL and PostgreSQL slow query records include catalog and schema.

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

* fix: address slow query review comment

Use `String::clone` when writing slow query catalog and schema values.

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

* fix: keep slow query schema only

Remove the slow query `catalog_name` column and keep `schema_name` as a non-null tag dimension.

- `src/common/frontend/src/slow_query_event.rs`: expose only `schema_name` in `SlowQueryEvent` rows and mark it as a tag.

- `src/catalog/src/process_manager.rs`: stop carrying catalog context in `SlowQueryTimer`.

- `src/frontend/src/instance.rs`: pass only schema context to slow query timers.

- `tests-integration/tests/sql.rs`: assert slow query records include `schema_name` without `catalog_name`.

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

* fix: schema name semantic should be field

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

* fix: typo

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

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-01 09:05:51 +00:00
discord9
d8bf4f813a fix: respect gc mailbox timeout for admin gc (#8363)
Signed-off-by: discord9 <discord9@163.com>
2026-07-01 07:39:49 +00:00
discord9
88d20d8c93 test: choose compat runner cli args by version (#8376)
* test: use legacy rpc args in compat runner

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

* test: detect compat runner grpc cli args

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

* ci: run compat on ready pr open

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

* test: choose compat cli args by version

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

* test: address compat arg test review

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

* test: fix compat runner comment typo

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-01 07:29:32 +00:00
fys
1fea548c17 feat(json2): reject non-object JSON values on write (#8381)
* feat: disable non object json write

* remove unused code

* fix: sqlness test

* simply code

* add comment

* remove unused unit test

* fix: cargo fmt

* fix: unit test

* fix: unit test
2026-07-01 03:12:09 +00:00
Ning Sun
f684479d9c refactor: extract region hook function for extension (#8375)
* refactor: extract region hook function for extension

* refactor: add a warning for unmatched vector size

* feat: reconstruct sst_info from file_meta

* chore: update comments about the hook
2026-07-01 03:04:23 +00:00
shuiyisong
5a7a9c9f07 chore: use ENV for building dashboard (#8384)
Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-06-30 12:43:28 +00:00
Weny Xu
2efe9884b1 feat: support structured instruction reply errors (#8335)
* feat: add structured instruction errors

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

* refactor: use structured instruction reply errors

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

* fix: respect instruction error retry hints

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

* chore: remove unused code

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-06-30 09:41:37 +00:00
raphaelroshan
4c28afd16f feat: support table-level auto_flush_interval (#8357)
Make auto_flush_interval configurable per table (region) in addition to
the global Mito engine config, mirroring how ttl supports a global default
with a per-table override.

- Add auto_flush_interval to RegionOptions, parsed from the table option
  with the same humantime format as the global config; reject a
  non-positive value.
- The periodic flush logic resolves the effective interval per region,
  falling back to the global config when unset, using a saturating
  conversion to avoid overflow on extreme values.
- Accept the option key in is_mito_engine_option_key so it can be set at
  CREATE TABLE via WITH ('auto_flush_interval' = '5m').

Ref #8340

Signed-off-by: raphaelroshan <raphaelroshan@gmail.com>
2026-06-30 07:40:54 +00:00
fys
aa563628fb feat(json2): type hint (#8247)
* feat(json2): type hint

* test(datatypes): add JsonSettings serde round-trip test

* minor refactor

This reverts commit 7ff5a5249a09be5396536284fe822b5761ef4e6a.

* fix: code review
2026-06-30 07:37:31 +00:00
discord9
d3cc1b1888 feat(flow): stabilize eval interval scheduling (#8360)
* feat(flow): stabilize eval interval scheduling

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

* fix(flow): satisfy eval schedule clippy

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

* test(flow): trim eval schedule coverage

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

* test(flow): cover stable eval scheduling

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

* fix(flow): reserve scheduled runtime hint

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

* test(flow): trim sqlness result eof

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

* fix(flow): harden eval schedule edges

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

* fix(flow): address scheduled flow review

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

* fix(flow): clean scheduled config handling

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

* test(flow): add eval interval compat case

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

* test(flow): cover show create flow in compat

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

* fix(flow): drop scheduled time from flow context

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

* test(flow): assert scheduled now binding

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-06-29 09:55:27 +00:00
discord9
16b60fe847 ci: add sqlness compat smoke (#8370)
* ci: add sqlness compat smoke

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

* ci: limit compat smoke pull request trigger

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

* ci: run compat smoke in merge queue

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

* ci: configure compat version window

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

* ci: move compat smoke logic into script

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

* ci: expand compat version window

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

* ci: rename compat job for recent releases

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

* ci: report compat test failures

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-06-29 08:18:28 +00:00
Yvan Wang
7c1009c00f feat: accept x-greptime-pipeline-name header on /events/logs (#8371)
* feat: accept x-greptime-pipeline-name header on /events/logs

The /events/logs (and /logs/ingest) endpoint previously only read the
pipeline name from the `pipeline_name` query parameter, while the
OTLP/Elasticsearch/Splunk log ingestion endpoints already accept it via
the `x-greptime-pipeline-name` header. This inconsistency is unfriendly
to users.

Make `log_ingester` resolve the pipeline name from the
`x-greptime-pipeline-name` header (and the deprecated
`x-greptime-log-pipeline-name`), falling back to the query parameter.
The header takes precedence, consistent with how other pipeline options
(e.g. `x-greptime-pipeline-params`) outrank their query-parameter
counterparts.

Closes #6095

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: BootstrapperSBL <yvanwww01@gmail.com>

* address review: prefer non-deprecated pipeline-name header

When both pipeline-name headers are present, resolve the non-deprecated
`x-greptime-pipeline-name` before the deprecated
`x-greptime-log-pipeline-name`, and cover the precedence with a test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: BootstrapperSBL <yvanwww01@gmail.com>

---------

Signed-off-by: BootstrapperSBL <yvanwww01@gmail.com>
Co-authored-by: BootstrapperSBL <yvanwww01@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 07:08:44 +00:00
Ning Sun
4327358e2d ci: add cargo.lock changeset size check (#8348)
* ci: add cargo.lock changeset size check

* ci: fix cargo lock check
2026-06-29 06:40:33 +00:00
shuiyisong
59d40c39b1 feat: prw_v2 initial commit with sample ingestion (#8361)
* chore: add v2 entrance

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

* chore: decode request

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

* chore: implement remote write v2 for samples

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

* chore: add tests

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

* chore: remove hand-written proto

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

* chore: refactor

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

* fix: CR issue

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

* fix: CR issue

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

* fix: merge tests

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

* chore: add source version field

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

* chore: fix CR issues

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

* fix: test

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

* fix: sqlness

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

* chore: update proto

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

* chore: update proto

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

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-06-29 03:15:41 +00:00