Commit Graph

5853 Commits

Author SHA1 Message Date
discord9 556fe09fc4 test: restore sqlness result terminators
Signed-off-by: discord9 <discord9@163.com>
2026-08-21 11:51:11 +08:00
discord9 c96b21ef31 test: remove trailing blank lines from flow sqlness results
Signed-off-by: discord9 <discord9@163.com>
(cherry picked from commit 5497d5c15e2adf48b18dc390c9bf7f6f09ec859b)
2026-08-21 11:51:11 +08:00
discord9 73b54382b4 chore: restore beta2 lock metadata and flow contract docs
Signed-off-by: discord9 <discord9@163.com>
(cherry picked from commit aef820b0edb51ec28c1f6653f2a6ea4a6c9cea9d)
2026-08-21 11:51:11 +08:00
sun 1d1ebdcfaf feat: update dashboard to v0.13.13 (#8898)
(cherry picked from commit aa1f8202d40fdc4fb4224191d9654f951e25440e)
2026-08-21 11:51:11 +08:00
Ning Sun 507dda2d88 feat: update to pgwire 0.40.7 (#8860)
(cherry picked from commit ae9795567690e946a44e10934ba4b18993a36d42)
2026-08-21 11:51:11 +08:00
Gaurav Shokeen 5f6ae43ac6 fix(prometheus): custom column remote reads (#8659)
* fix(prometheus): custom column remote reads

Resolve timestamp and value column names from the table schema and carry
them through query planning and result conversion. Add a remote-read
regression test covering custom_ts and custom_value.

Signed-off-by: grezzko <me@gauravshokeen.com>

* fix: resolve remote-read value columns safely

Prefer the sole field for custom schemas and greptime_value for
multi-field tables. Reject ambiguous schemas and add regression tests.

Signed-off-by: grezzko <me@gauravshokeen.com>

---------

Signed-off-by: grezzko <me@gauravshokeen.com>
Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
Co-authored-by: Lei, HUANG <mrsatangel@gmail.com>
(cherry picked from commit 3d7d7e916c5c8643d57d61616c180396193f8911)
2026-08-21 11:51:11 +08:00
discord9 be0985cc39 fix(frontend): remove gRPC DDL panics for DropView and non-timestamp time index (#8739)
* fix(frontend): remove gRPC DDL panics for DropView and non-timestamp time index

Direct gRPC DDL bypasses the SQL parser, so two client-controlled DDL
payloads could panic a request handler:

- QX-152: DdlExpr::DropView hit todo!() (instance/grpc.rs:247-248).
  Wire it to the real drop-view implementation (drop_view was
  pub(crate); widened to pub) so a DropView DDL returns a structured
  error (e.g. TableNotFound) instead of panicking.
- QX-153: a CreateTableExpr whose time_index column is not a timestamp
  reached Schema::new's unwrap (ddl.rs:2346 -> schema.rs:114-119).
  create_table_info now uses Schema::try_new with ConvertSchemaSnafu
  context (InvalidArguments), and the direct gRPC CreateTable arm
  validates the request via validate_create_expr (which now also checks
  the time-index column type is a timestamp) before any catalog work.

SQL/HTTP paths were already protected by the parser; unchanged.
Tests: qx_152_drop_view_via_grpc_ddl_returns_error_not_panic,
qx_153_create_table_with_non_timestamp_time_index_via_grpc_returns_error
(asserts InvalidArguments), test_create_table_info_rejects_non_timestamp_time_index.

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

* test(frontend): add gRPC DDL happy-path coverage for DropView and CreateTable

Per review: the initial tests only asserted error paths. Add:
- drop_if_exists=true on a missing view succeeds (no error)
- dropping an existing view via gRPC DDL succeeds end-to-end
- a valid CreateTableExpr with a timestamp time index still succeeds
  (guards validate_create_expr against rejecting good requests)
- qx_152 test now asserts the TableNotFound status instead of is_err()

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

---------

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
(cherry picked from commit 11e785ed5680dbb07b7cf88ec1b9642cde5ba1e1)
2026-08-21 11:51:11 +08:00
discord9 be9106be72 fix(flow): retain release heartbeat state compatibility
Signed-off-by: discord9 <discord9@163.com>
(cherry picked from commit 96af8e274919eeebb8fff616f2cbd759ae76f376)
2026-08-21 11:51:11 +08:00
discord9 c4baa56b23 fix(flow): fix flow stats aggregation and df_plan_to_sql quoting (#8729)
* fix(flow): fix flow stats aggregation and df_plan_to_sql quoting

1. Distributed-mode flow stats last-writer-wins overwrite:
   Each flownode heartbeat put its local flow state map into the single
   global __flow/state key, so reports from different nodes overwrote
   each other. Store per-flownode reports under
   __flow/state/node/{node_id} in the in-memory KV and aggregate on each
   heartbeat (last_exec_time_map/state_size/start_time_map take the max
   across nodes) into the global key. FlowStateHandler derives node
   identity from header.member_id (fallback peer.id) and ignores
   identity-less reports. Per-node keys clear automatically on leader
   change KV reset. Adapts to FlowStateValue.start_time_map added in
   #8392.

2. df_plan_to_sql unquoted special characters break flush/scheduled
   execution: ForceQuoteIdentifiers only quoted uppercase identifiers,
   so Prometheus-style table names with ':' (e.g. cpu_cores:sum) were
   left unquoted, producing invalid SQL ('keyword: :'). Quote any
   identifier with non-[a-z0-9_] chars using double quotes
   (dialect-neutral).

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

* fix(flow): address review comments on quoting and logging

- df_plan_to_sql: also quote digit-leading identifiers (e.g. 123metrics)
  which would produce invalid SQL when re-parsed. SQL keywords are
  intentionally not checked (ALL_KEYWORDS would over-quote common column
  names like number; the unparse failure path has an InsertIntoPlan
  fallback).
- flow_state_handler: downgrade identity-less report log from warn! to
  debug! to avoid an anomalous sender spamming warn every heartbeat.

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

---------

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
(cherry picked from commit 375dd569482235914ef09ef5c21e15cc79fcd052)
2026-08-21 11:51:11 +08:00
discord9 f9135380b5 feat(flow): add flow statistics and SHOW FLOW STATUS (release slice)
Signed-off-by: discord9 <discord9@163.com>
(cherry picked from commit 523c60c53bdc21fd1b1fa43b857e78de710f0d58)
2026-08-21 11:51:11 +08:00
Yingwen 6618427fc6 feat: add admin function to discard unflushed data (#8768)
* feat: add admin function to discard unflushed data

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

* test: cover discarding unflushed data by table

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

* chore: fix license header

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

* fix: reject discarding logical metric table data

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

* refactor: defer table name formatting in error paths

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

* chore(deps): update greptime-proto revision

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

* refactor: rename discard unflushed admin function

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

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
(cherry picked from commit 68605aa64d25a24e14b3bbf0b62e453d97179947)
2026-08-21 11:51:11 +08:00
Yingwen 9c683fccfc feat(mito2): discard unflushed region data safely (#8600)
* feat: support discarding unflushed region data

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

* fix(mito2): wake stalled writers after discard

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

* refactor(mito2): drop redundant manifest check for discarding unflushed data

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

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
(cherry picked from commit 62d2c43b54c6bc45de5d49305073e396d6daf434)
2026-08-21 11:51:11 +08:00
jeremyhi 424e53d841 feat: make frontend heartbeat extensible and lifecycle-safe (#8726)
* feat: make frontend heartbeat extensible and lifecycle-safe

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

* fix: isolate heartbeat extension response handlers

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

* fix: cancel in-flight heartbeat response handling

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

* test: cover heartbeat wire compatibility

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

* fix: clean up failed heartbeat startup

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

* fix: address frontend heartbeat review feedback

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

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
(cherry picked from commit 6ffa27bc8e78b5e11b2db3d2a898438446b298be)
2026-08-21 11:51:11 +08:00
shuiyisong 2f5e97850e fix: clear pooled Prometheus Remote Write decoder state (#8921)
fix: clear prw parse cache

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-08-21 10:53:44 +08:00
Lei, HUANG 8eeff8b441 fix(mito2): limit compaction picker threads (#8704)
* fix(mito2): limit compaction picker threads

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

* refactor(mito2): extract TWCS input picking

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

* refactor(mito2): make compaction picker async

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

* refactor(mito2): remove redundant build_output test helper

After making the compaction picker async and extracting TWCS input
picking, the test-only build_output helper is just a thin wrapper around
build_output_with_time_range. Drop it and call the full method directly
from tests.

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

* docs: correct compact runtime config wording

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

* test(runtime): harden compact blocking limit check

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

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-08-13 17:07:34 +08:00
discord9 39aa8ab974 chore(deps): bump datafusion to 452cb4b (support Dictionary literals in substrait) [v1.2 backport] (#8842)
* chore(deps): bump datafusion to 452cb4b (support Dictionary literals in substrait)

Backport of #8839 to release/v1.2.

Bump the GreptimeTeam/datafusion fork rev from 6d6ae9a to 452cb4b,
which includes fix(substrait): support Dictionary literals in producer.
This fixes flow queries against dictionary-encoded PK string columns
(metric tables) failing with 'NotImplemented("Unsupported literal:
Dictionary(UInt32, Utf8(...))")'.

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

* fix(mito): make do_region_gc pub(crate) to fix private_interfaces warning

clippy runs with -D warnings and this private_interfaces warning fails the
backport CI on release/v1.2.

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

---------

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-08-13 11:26:06 +08:00
Yingwen 407f83e15e fix: backport Prometheus and skip_wal fixes to v1.2 (#8838)
* fix: support Utf8View labels in Prometheus response

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

* fix(meta): validate leaders before enabling skip_wal

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

* fix(meta): adapt skip_wal test to v1.2

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

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
Co-authored-by: jeremyhi <fengjiachun@gmail.com>
2026-08-11 14:17:47 +08:00
Yingwen a08d3b7e63 feat: support enabling skip_wal with ALTER TABLE (#8817)
* feat: support enabling skip_wal with ALTER TABLE (#8730)

* feat: support enabling skip_wal with alter table

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

* test: cover skip wal on metric physical region

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

* fix: retry skip wal alter on route changes

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

* fix: address skip wal review feedback

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

* fix: preserve skip wal create options

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

* fix: prefer typed skip wal option

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

* fix: address skip wal review comments

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

* fix: canonicalize legacy skip wal option

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

* fix: keep typed skip wal canonical

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

* fix: simplify skip wal option tracking

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

---------

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

* test(object-store): fix racy SecureFs abort test (#8720)

test_writer_abort_is_unsupported_without_atomic_write asserted the file
content immediately after abort() returned Unsupported. SecureFsWriter
writes through tokio::fs::File, whose write_all() only enqueues a blocking
write task (tokio's poll_write returns Ready before the write completes),
so the data may not be visible yet when the test reads the file. Drop the
race-prone content assertion and only verify the Unsupported contract.

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

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
Signed-off-by: evenyag <realevenyag@gmail.com>
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
Co-authored-by: jeremyhi <jiachun_feng@proton.me>
Co-authored-by: Lei, HUANG <6406592+v0y4g3r@users.noreply.github.com>
2026-08-10 15:45:41 +08:00
Lei, HUANG 7a2479496f chore!: gate soft-drop table behind the enterprise feature (#8747)
* chore: gate soft-drop table behind the enterprise feature

Soft-drop table becomes an enterprise-only feature:

- metasrv rejects gc.experimental_soft_drop.enable=true at startup in
  non-enterprise builds, and ddl_soft_drop_enabled is hard-disabled
  without the enterprise feature as a second line of defense
- the UNDROP TABLE parser/AST/statement variant, ADMIN purge_table()
  registration, and information_schema.recycle_bin registration are
  compiled out unless the enterprise feature is enabled
- common-meta procedures, tombstone keys, and DdlTask serde stay
  unconditional for persisted-procedure recovery and wire compatibility
- the [gc.experimental_soft_drop] section is removed from the OSS
  example config and generated docs (moving to the enterprise repo)
- the soft-drop sqlness cases and their CI job are removed from OSS
  (moving to the enterprise repo); affected information_schema .result
  files are regenerated

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

* refactor: limit unused_variables allow to non-enterprise builds

Addresses review comment: apply the allow via cfg_attr so enterprise
builds still catch accidental unused variables in register_admin_only.

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

* refactor: include the config key in the soft-drop enterprise gate error

Addresses review comment: name gc.experimental_soft_drop.enable in the
startup validation error so users can locate the setting quickly when
it is set via env vars or layered config.

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

* test: limit unused_mut allow to non-enterprise builds

Addresses review comment: apply the allow via cfg_attr so enterprise
builds still catch unused mut in the table_ddl_event test setup.

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

* feat: reject soft-drop DDL submissions in non-enterprise builds

Addresses review comment: clients could bypass the SQL-level gates by
submitting DdlTask::UndropTable or DdlTask::PurgeDroppedTable directly
to the procedure service. Reject fresh submissions at the DdlManager
boundary in non-enterprise builds while keeping the procedure loaders
registered for crash recovery and wire compatibility.

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

* test: stop --enable-gc from enabling soft drop in the sqlness template

Addresses review comment: the metasrv test template rendered
[gc.experimental_soft_drop] enable = true under the generic --enable-gc
flag, which non-enterprise metasrv now rejects at startup, making the
documented --enable-gc mode unusable in OSS. Keep the flag scoped to
plain GC; enterprise soft-drop coverage moves to the enterprise repo.

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

* fix: gate fresh soft-drop procedures

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

* test: gate soft-drop fallback coverage

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

* fix: gate soft-drop procedure implementation

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

* refactor: gate drop table soft-drop behavior

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

* refactor: gate expired soft-drop gc behavior

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

* ci: test enterprise table ddl lifecycle

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

* chore: mark purge_table as enterprise licensed

The purge_table module is compiled only with the enterprise feature, so
apply the Enterprise License header and register it with both license
header configurations.

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

* chore: mark recycle_bin as enterprise licensed

The recycle_bin module is compiled only with the enterprise feature, so
apply the Enterprise License header and register it with both license
header configurations.

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

* chore: mark soft-drop procedure sources as enterprise licensed

The purge and undrop procedure implementations plus the recycle-bin test
module compile only with the enterprise feature. Apply the Enterprise
License header and register them with both license configurations.

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

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-08-06 15:10:54 +08:00
Ning Sun 38dd51a9f9 fix: add public constructor for compactor (#8724) 2026-08-03 18:31:23 +08:00
discord9 9b86ff6994 chore: bump release version to 1.2.0-beta.1
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
v1.2.0-beta.1
2026-07-31 22:37:57 +08:00
Weny Xu ad2c1bfc59 fix(meta): preserve legacy WAL options compatibility (#8707)
* fix: preserve legacy region WAL options format

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

* test: add downgrade compatibility coverage

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

* refactor: deduplicate compat restart

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

* test: harden downgrade compatibility check

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

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-31 13:40:27 +00:00
jeremyhi 448f973593 fix: sandbox SQL local filesystem access (#8708)
* fix: sandbox SQL local filesystem access

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

* fix: address local file sandbox review findings

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

* fix: support Windows local copy paths

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

* fix: improve sandbox path errors

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

* refactor: simplify local path error context

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

* perf: stream secure filesystem listings

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

* style: derive local file access default

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

* fix: improve local file access errors

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

* fix: address local file access review findings

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

* test: simplify local file access coverage

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

* fix: harden sandboxed local file backends

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

* fix: reject directory copy targets before creation

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

* fix: avoid implicit string clone in file table listing

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

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-07-31 13:23:15 +00:00
Weny Xu 1aa35716cb refactor(event): store procedure trigger as JSONB (#8700)
* refactor(event): store procedure trigger as JSONB

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

* test(event): fix JSONB procedure trigger assertions

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

* refactor(event): remove procedure trigger display

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

* test(event): update batch GC trigger assertions

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

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-31 13:22:26 +00:00
LFC 4e04f92591 fix: make select whole json2 column worked (#8683)
* fix: make select whole json2 column worked

Signed-off-by: luofucong <luofc@foxmail.com>

* resolve PR comments

Signed-off-by: luofucong <luofc@foxmail.com>

* x

Signed-off-by: luofucong <luofc@foxmail.com>

---------

Signed-off-by: luofucong <luofc@foxmail.com>
2026-07-31 13:14:33 +00:00
Yingwen 25090b9f54 feat(mito2): support cancelling flush jobs (#8685)
* feat(mito2): support cancelling flush jobs

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

* refactor(mito2): refine flush cancellation handling

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

* fix(mito2): handle ambiguous manifest update errors

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

* test(mito2): reduce cancellation test duplication

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

* fix(mito2): fail pending writes after flush failure

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

* refactor(mito2): remove redundant cancellation check

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

* fix(mito2): validate drop before cancelling flush

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

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-07-31 12:02:28 +00:00
discord9 c52db42b61 test: stabilize remote dynamic filter left join e2e (#8711)
test: stabilize remote dynamic filter left join

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-07-31 10:56:52 +00:00
dennis zhuang 81a0dd77c7 fix(mito2): fence async index builds by schema generation (#8697)
* fix(mito2): fence async index builds by schema generation

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito2): retry stale index builds after schema changes

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-07-31 09:29:06 +00:00
shuiyisong 88606f0dff fix(metric-engine): prevent stale metadata cache fills (#8699)
* fix: metric engine cache

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

* fix: cr issue

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

* fix: leak cache

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

* chore: add comment

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

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-07-31 07:40:51 +00:00
Weny Xu 8f11629e34 feat(metasrv): add batch GC lifecycle events (#8673)
* feat(metasrv): add batch GC lifecycle events

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

* fix(metasrv): reduce batch GC event fanout

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

* fix(metasrv): fix batch GC event import

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

* fix(metasrv): refine batch GC events

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

* fix(metasrv): preserve batch GC reports on failure

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

* fix(metasrv): retain batch GC reports on retry

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

* fix(metasrv): harden batch GC report merging

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

* test: scope repartition SST assertions to target table

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

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-31 07:13:56 +00:00
shuiyisong c3d8c976a2 feat(query): add native histogram result plumbing (#8693)
* feat(query): add native histogram result plumbing

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

* fix: cr issue

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

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-07-31 03:14:48 +00:00
Lei, HUANG eb8ae171cc refactor(mito2): split compaction scheduler modules (#8698)
* refactor(mito2): split compaction module into scheduler/reader submodules

Extract the compaction scheduler lifecycle (scheduler, status, phases,
execution, SST reservations, pending requests) and its tests out of
compaction.rs into compaction/scheduler.rs and compaction/scheduler_test.rs.

Split the remaining helpers by responsibility:
- estimate_compaction_bytes/refresh_picker_output move to scheduler.rs,
  the only call site
- get_expired_ssts moves to picker.rs, shared by the TWCS and window
  pickers
- CompactionSstReaderBuilder/time_range_to_predicate/ts_to_lit move to
  the new compaction/reader.rs

The root compaction.rs keeps the shared output types and
find_dynamic_options, and re-exports the moved types so existing call
paths stay unchanged. Pure code motion, no behavior change.

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

* refactor(mito2): separate compaction scheduling from execution details

Turn compaction/scheduler.rs into a directory module to make the
scheduling flow easier to review:

- scheduler.rs keeps the pure scheduling core: the CompactionScheduler
  state machine, scheduling entry points, termination chaining, DDL
  coordination and region lifecycle events
- scheduler/planning.rs holds the execution-facing parts: background
  planning dispatch, picker invocation, plan acceptance, remote/local
  submission and memory estimation
- scheduler/state.rs holds the per-region lifecycle types:
  CompactionStatus, ActiveCompaction, CompactionPhase, CompactingFiles,
  LocalCompactionState, CompactionExecution and PendingCompaction

Child modules keep access to the scheduler's private methods, so the
split is pure code motion with minimal visibility changes (pub(super)
only where the parent module or tests reach into child items).
No behavior change.

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

* refactor(mito2): use absolute scheduler imports

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

* docs(mito2): document compaction scheduler modules

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

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-31 02:46:05 +00:00
shuiyisong 00f0dcc663 refactor: replace endpoint permission variants with named actions (#8692)
* refactor: perm enum

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

* refactor: use typed actions

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

* fix: pub structs

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

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-07-30 10:19:48 +00:00
Weny Xu 979a22b38a feat(metasrv): record WAL prune procedure events (#8677)
* feat(metasrv): record WAL prune procedure events

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

* feat(metasrv): expand WAL prune procedure events

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

* fix: fix toml fmt

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

* fix(metasrv): clarify WAL prune event semantics

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

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-30 09:09:27 +00:00
Ning Sun 0f4a4bcdb7 chore: update flake to use zlib (#8691)
* chore: update flake to use zlib

* chore: minor housekeeping
2026-07-30 08:52:51 +00:00
dennis zhuang f817690b82 fix(mito2): make async index publication conditional (#8676)
* fix(mito2): make async index publication conditional

Check the captured SST generation and commit index metadata under the same manifest write lock. Revalidate the committed metadata before applying it to the in-memory version, and clean exact-version artifacts when either publication stage becomes stale.

Add deterministic compaction and overlapping-index tests covering reopen consistency, duplicate rows, cache cleanup, and both file purgers.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor(mito2): centralize manifest update finalization

Share the locked update, lock release, follower check, and hook firing path between regular manifest updates and conditional index publication.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito2): retain index build leases across reopen

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito2): avoid retiring scheduler on index failure

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito2): handle cross-region index publication

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito2): use physical region for index paths

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(cmd): update noop index builder

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito2): avoid reusing published index versions

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* chore(mito2): log untracked index build stops

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito2): set compaction time range in index test

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-07-30 08:50:01 +00:00
Ning Sun bf187291c1 feat: expose MitoRegion::all_manifest_files for metadata rebuild (#8680)
* feat: expose MitoRegion::all_manifest_files for metadata rebuild

Adds a public read-only accessor that returns all live SST file metas
and the current manifest version from the region manifest. Used by the
downstream project admin path to enumerate the authoritative live file
set without going through the worker loop.

* fix(mito2): merge staging manifest files in all_manifest_files

The original implementation only read the normal manifest
(manifest_ctx.manifest()) and skipped staging_manifest(). While the
region is in staging mode (e.g. region copy/migration), the authoritative
live file set lives in the staging manifest, so callers would silently
miss those files.

Now matches the semantics of manifest_sst_entries() (~L771), which
explicitly merges manifest().files with staging_manifest().files via a
HashMap collect (dedup by FileId). The returned manifest version is the
staging version when a staging manifest is present, otherwise the normal
manifest version.

Also removed downstream-specific references from the rustdoc comments.
2026-07-30 08:10:52 +00:00
discord9 e66d56d1f9 fix(query): handle empty operands in PromQL or (#8502)
* fix(query): handle empty operands in PromQL or

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

* fix(query): preserve schema for empty histograms

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

* fix(query): preserve set operation context

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

* refactor(query): simplify zero-column error

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-30 07:58:37 +00:00
Yingwen 2c9c695a4d refactor(mito2): add prerequisites for range-based series reads (#8679)
refactor(mito2): prepare range-based series reader

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-07-30 07:30:41 +00:00
Weny Xu 6de01f17da ci: limit fuzz test parallelism (#8690)
Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-30 07:13:04 +00:00
discord9 5ed7128f06 perf(query): prune RangeSelect input projections (#8570)
* perf(query): prune RangeSelect input projections

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

* test(query): stabilize RangeSelect projection snapshot

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

* test(query): update RangeSelect nested plan snapshot

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

* fix(query): handle nested RangeSelect aliases

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-30 07:09:49 +00:00
discord9 32be67c024 fix(query): use physical partition types for metric route pruning (#8590)
* fix(query): prune logical metric regions after repartition

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

* fix(query): centralize conservative region pruning

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

* refactor(query): extract pruning metadata helper

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

* docs(query): explain pruning metadata helper

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

* docs(query): clarify pruning metadata mismatch

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-30 07:05:38 +00:00
discord9 9776d88dc8 fix: preserve dictionary regex filter semantics (#8688)
* fix: preserve dictionary regex filter semantics

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

* test(query): update dictionary regex plan results

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-30 06:20:57 +00:00
fys 3a904f332f fix(json2): standardize widening and projection cast semantics (#8661)
* fix(json2): standardize widening and projection cast semantics

Signed-off-by: fys <fengys1996@gmail.com>

* fix: cargo clippy

Signed-off-by: fys <fengys1996@gmail.com>

* fix: typos

Signed-off-by: fys <fengys1996@gmail.com>

* fix: unit test

Signed-off-by: fys <fengys1996@gmail.com>

* feat: add fast-path

Signed-off-by: fys <fengys1996@gmail.com>

* remove unsed code

Signed-off-by: fys <fengys1996@gmail.com>

* refactor(json2): project nested json_get paths with JsonArray

Signed-off-by: fys <fengys1996@gmail.com>

* fix(query): reject projecting whole JSON2 columns

Signed-off-by: fys <fengys1996@gmail.com>

* fix(query): reject whole-column JSON2 reads

Signed-off-by: fys <fengys1996@gmail.com>

* test(json2): organize limitation sqlness cases

Signed-off-by: fys <fengys1996@gmail.com>

* fix: sqlness test

Signed-off-by: fys <fengys1996@gmail.com>

---------

Signed-off-by: fys <fengys1996@gmail.com>
2026-07-30 04:08:53 +00:00
Weny Xu 47ca5c362e feat: add table DDL procedure events (#8627)
* feat(meta): emit table DDL procedure events

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

* fix(meta): honor table DDL event filters

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

* test(meta): cover table DDL event filters

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

* refactor(meta): align table DDL event conventions

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

* refactor(meta): bound table DDL event payloads

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

* test(meta): consolidate table DDL event tests

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

* style(meta): use crate visibility in event tests

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

* test: stabilize table DDL event assertions

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

* fix(meta): exclude repartition from alter table events

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

* fix(meta): resolve table event rebase conflicts

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

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-30 03:24:47 +00:00
discord9 64c66f0a6b chore(deps): pin timestamp widening preimage fix (#8686)
Signed-off-by: discord9 <discord9@163.com>
2026-07-30 02:29:35 +00:00
sun 2ed3c3c43f feat: update dashboard to v0.13.10 (#8687) 2026-07-29 14:44:10 +00:00
Ning Sun 8098009532 chore: update nix flake to 26.05 (#8681) 2026-07-29 13:44:58 +00:00
Lei, HUANG f524a0b5b4 feat: support time range in manual compaction (#8669)
* feat: support time range in manual compaction

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

* fix: reject overflowing compaction range alignment

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

* fix: preserve range across compaction continuations

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

* perf: use graph traversal for compaction windows

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

* chore: bump proto to commit on main

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

* docs: explain compaction window dependency closure

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

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-29 13:33:10 +00:00
Weny Xu 31f9a9a6fd feat(metasrv): add repartition lifecycle events (#8665)
* feat(metasrv): add repartition lifecycle events

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

* refactor(metasrv): simplify event module names

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

* fix(procedure): emit submitted events for child procedures

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

* refactor(metasrv): flatten repartition event payload

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

* refactor(metasrv): defer repartition topology rows

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

* fix(procedure): avoid events on failed child spawn

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

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-29 13:15:43 +00:00