Commit Graph

5760 Commits

Author SHA1 Message Date
luofucong 2164d53d60 add more metrics
Signed-off-by: luofucong <luofc@foxmail.com>
2026-07-23 17:11:57 +08:00
discord9 45fc51ebd2 fix: demote expected remote dynamic filter misses (#8574)
Signed-off-by: discord9 <discord9@163.com>
2026-07-23 04:39:56 +00:00
Yingwen 9b579c7618 feat: make parquet row group size configurable (#8446)
* feat: make parquet row group size configurable via max_row_group_row_count region option

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

* feat: split inverted index segments across row group boundaries

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

* test: verify max_row_group_row_count region option

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

* test: update row group size sqlness result

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

* fix(mito2): use parquet row group size for index rebuild

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

* fix: update query perf fixture indexer builder

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

* fix(mito2): clamp index selection to parquet rows

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

* feat: support altering parquet row group size

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

* fix(mito2): handle idempotent append mode in mixed alters

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

* fix(mito2): stage mixed region option alters atomically

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

* fix(mito2): ignore inverted indexes with mismatched row counts

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

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-07-23 03:56:10 +00:00
shuiyisong d9122ece3c perf: optimize OTLP trace ingestion (#8604)
perf: optimize trace ingestion

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-07-22 13:16:19 +00:00
Lei, HUANG c8f65c7b99 feat: update flow windows after metric batch flush (#8544)
* feat: update flow windows after metric batch flush

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

* refactor: move batch rows into flow notifier

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

* fix: preserve timestamp index in metric batches

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

* fix: avoid blocking flow notification lookups

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

* fix: add context to timestamp extraction logs

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

* fix: include peer in flow notification errors

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

* feat: compact flow notifications with time ranges

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

* fix: bound pending flow notification queue

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

* refactor: send raw timestamps in flow notifications

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

* test: update config API snapshot

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

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-22 13:09:30 +00:00
LFC eddedff769 fix(json2): treat empty object as null when insert (#8602)
* fix(json2): treat empty object as null when insert

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

* fix ci

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

---------

Signed-off-by: luofucong <luofc@foxmail.com>
2026-07-22 13:09:02 +00:00
discord9 25217100b0 chore: pin DataFusion cardinality effect (#8562)
Signed-off-by: discord9 <discord9@163.com>
2026-07-22 12:37:09 +00:00
discord9 f107f92688 fix(query): harden range time conversion (#8515)
* fix(query): harden range time conversion

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

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: discord9 <discord9@163.com>
Co-authored-by: dennis zhuang <killme2008@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-22 11:57:04 +00:00
discord9 3155d49f84 fix: convert literals in joins and subqueries (#8501)
* fix: convert literals in joins and subqueries

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

* fix: preserve semi joins with duplicate fields

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

* test: update limit error after subquery conversion

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-22 10:48:26 +00:00
discord9 f65e83fe39 fix(pipeline)!: check integer narrowing (#8589)
fix(pipeline): check integer narrowing

Signed-off-by: discord9 <discord9@163.com>
2026-07-22 10:43:38 +00:00
discord9 8b47fd53bd fix: qualify scalar-subquery tables in persisted views (#8581)
fix(query): traverse scalar subqueries in views

Signed-off-by: discord9 <discord9@163.com>
2026-07-22 10:43:24 +00:00
discord9 4c5be47400 fix(flow): downgrade disabled incremental checkpoint log (#8572)
Signed-off-by: discord9 <discord9@163.com>
2026-07-22 10:41:09 +00:00
discord9 0564269426 fix: bind Prom remote read schema per query (#8591)
Signed-off-by: discord9 <discord9@163.com>
Co-authored-by: Lei, HUANG <6406592+v0y4g3r@users.noreply.github.com>
2026-07-22 10:14:39 +00:00
fys 4d61471cc8 feat(json2): support JSON2 nested path fallback reads (#8540)
* feat: add nested read strategy for variant parent fallback

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

* refactor: drop nested fallback metadata from projection plan

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

* refactor: simplify nested parquet fallback planning

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

* add docs

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

* add Json2FallbackPlan

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

* add Json2FallbackDecoder

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

* test: add json2 nested fallback sqlness coverage

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

* add more sqlness test about json2 nested read

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

* refactor: split parquet reader nested stream helpers

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

* cache somethins in hot path

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

* chore: refine code

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

* minor change

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

* feat(mito2): align nested JSON2 parquet schemas

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

* refactor(mito2): default nested JSON reads to fallback

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

* chore: revert some unnecessary changes

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

* disallow JSON2 root fallback in parquet projection

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

* document JSON2 fallback root guard

* fix(json2): support variant-to-struct schema alignment

* refactor: simplify nested JSON schema alignment

* fix: cr

* fix: cr

* chore: add comment for null_on_json_type_mismatch

---------

Signed-off-by: fys <fengys1996@gmail.com>
2026-07-22 09:42:26 +00:00
discord9 a636dcf6b2 ci: gate releases on compat and query regression (#8469)
Signed-off-by: discord9 <discord9@163.com>
2026-07-22 09:19:16 +00:00
Lei, HUANG 036db3d1ec fix: ignore dropping marker during GC (#8588)
Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
2026-07-22 09:17:26 +00:00
discord9 9f5a11e82a fix(flow): lower routine batching messages to debug (#8592)
fix(flow): reduce expected batching log noise

Signed-off-by: discord9 <discord9@163.com>
2026-07-22 08:46:42 +00:00
Lei, HUANG d8f9bb4e3d test: stabilize ttl instant sqlness case (#8595)
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-22 07:21:59 +00:00
discord9 8843dc9104 fix: stabilize remote analyze stage ordering (#8584)
* fix: stabilize remote analyze stage ordering

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

* Update src/query/src/dist_plan/merge_scan.rs

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Signed-off-by: discord9 <discord9@163.com>
Co-authored-by: Lei, HUANG <6406592+v0y4g3r@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-07-22 15:57:19 +08:00
discord9 4a0dd8f9bc fix(query): preserve bare plan names in analyze json (#8519)
Signed-off-by: discord9 <discord9@163.com>
2026-07-22 03:33:19 +00:00
Ning Sun d9b58edbb0 feat: add a region hook for gc cleanup (#8547)
* feat: add a region hook for gc cleanup

* chore: more tests and review fix

* fix: address review comments

* fix: address review comments
2026-07-22 03:27:04 +00:00
fys 598a412fbb feat: add mysql object store backend (#8560)
* feat: add mysql object store backend

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

* fix: code review

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

* add feature guard

---------

Signed-off-by: fys <fengys1996@gmail.com>
2026-07-21 13:53:27 +00:00
Lei, HUANG ed8a4990fe feat(flow): handle time_ranges in DirtyWindowRequest (#8582)
* feat(flow): handle time_ranges in DirtyWindowRequest

Bump greptime-proto to include the new `time_ranges` field on
DirtyWindowRequest (GreptimeTeam/greptime-proto#330) and mark the
corresponding aligned time windows as dirty in the batching engine,
in addition to the existing per-timestamp dirty marking.

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

* style(flow): fix doc comment spacing in align_time_window

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

* test(flow): cover time_ranges in handle_mark_dirty_time_window

Verify a valid [start_inclusive, end_exclusive) range is aligned to
time window boundaries and stored with an explicit end, and that empty
or reversed ranges are skipped.

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

* fix(flow): union merged dirty windows with the larger end

Merging a bounded dirty range with a window contained in it (e.g.
[0s, 15s) with nested [5s, 10s), or an unbounded dirty window inside a
bounded range) previously assigned the contained window's upper bound,
shrinking the merged window and permanently dropping the tail range
from re-computation. Keep max(prev_upper, cur_upper) instead.

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

* fix(flow): clip bounded dirty ranges at the expire bound

merge_dirty_time_windows dropped every window whose start is before
expire_lower_bound, so a bounded dirty range crossing the bound (e.g.
[0s, 15s) with expire 10s) lost its still-live suffix [10s, 15s). Now
bounded ranges are dropped only when their end is at/before the expire
bound, and crossing ranges are clipped to the bound (which the caller
aligns to the time window boundary). Unbounded windows keep the
existing start-based behavior.

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

* fix(flow): fall back to full dirty on dirty-window alignment failure

An eval/alignment error previously aborted the per-task dirty-marking
closure, losing every dirty timestamp and range accumulated for that
task, while the RPC still returned Ok so the producer would not retry.
On alignment failure now log a warning and mark the whole task dirty
(set_dirty) instead, so the affected data is conservatively
recomputed.

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

* style(flow): apply rustfmt to new dirty-window merge tests

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

* test(flow): cover time index units in dirty window marking

Document that DirtyWindowRequest timestamps/time_ranges are bare i64s
interpreted in the source table's time index native unit, and add a
test expressing the same [3s, 11s) range in second/millisecond/
microsecond/nanosecond units across four tables, asserting all align
to the same dirty window [0s, 15s).

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

* chore: bump greptime-proto to 8127f179

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

* fix(flow): return dirty-window alignment errors to callers

Do not acknowledge a DirtyWindowRequest when a time-windowed task cannot
align a timestamp or range. The previous conservative fallback used
set_dirty(), but that marker only represents a single epoch-start window
for time-windowed flows, so it could still lose the affected dirty
range. Propagate task errors through the join loop instead so producers
can retry.

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

* chore: update proto to commits on main

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

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-21 12:56:01 +00:00
shuiyisong d4d9e199e7 fix: enforce table-aware permissions across query and ingest protocols (#8552)
* feat: extend permission req check

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: preserve Prometheus query and write semantics

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: cr issue

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>

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-07-21 12:15:53 +00:00
shuiyisong 5065dfcf2f feat: grant creators access to newly created databases (#8566)
* feat: implement auto database acl after create database

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

* chore: add comments

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

* fix: timeout conversion:

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

* chore: remove register loaders parameter in ddl_manager initialization

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

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-07-21 11:29:49 +00:00
Yingwen 50bf494578 feat(mito2): expose adaptive batch APIs (#8578)
* chore: change tag check method

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

* feat(mito2): expose adaptive batch APIs

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

* fix(mito2): guard zero merge batch size

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

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-07-21 08:53:17 +00:00
Weny Xu e7c5767d52 fix: preserve leader cache configuration and record cache hits (#8576)
Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-21 08:52:38 +00:00
discord9 56addd0623 fix: stream remote analyze metrics while pending (#8405)
* fix: stream remote analyze metrics while pending

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

* test: verify flight metrics preserve pending batch

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

* fix: preserve direct SST perf queries in plans

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

* fix: bind flight metrics capability to query

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-21 04:17:50 +00:00
Ning Sun e3d2864947 test: gate pluginoption test for oss repo only (#8569) v1.2.0-d1e61a4ad-20260720-1784560249 2026-07-20 15:27:05 +00:00
Weny Xu d1e61a4ad2 fix(mito): chunk manifest object writes (#8567)
Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-20 14:19:48 +00:00
dependabot[bot] 6f13af8647 chore(deps): bump serde_with from 3.1.0 to 3.21.0 (#8565)
Bumps [serde_with](https://github.com/jonasbb/serde_with) from 3.1.0 to 3.21.0.
- [Release notes](https://github.com/jonasbb/serde_with/releases)
- [Commits](https://github.com/jonasbb/serde_with/compare/v3.1.0...v3.21.0)

---
updated-dependencies:
- dependency-name: serde_with
  dependency-version: 3.21.0
  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-07-20 12:59:28 +00:00
Ning Sun 5b69770dbc refactor: add field id and extension type to histogram (#8528)
* refactor: add field id and extension type to histogram

* chore: revert histogram check

* chore: lint

* test: add test coverage for maybe_update_schema

* feat: calculate sub field id from parent column id

* refactor(mito2): guard histogram sub-field ids and cover parquet footer

Address review on #8528:

- native_histogram: derive sub-field ids with checked arithmetic. The SST
  writer now surfaces a new InvalidNativeHistogramSubfield error when a
  sub-field id cannot be resolved (unknown name or i32 overflow) instead of
  silently dropping the id or wrapping. maybe_wrap_schema is now fallible.
- sst: add parquet writer/footer round-trip tests asserting the
  greptime.histogram extension and nested PARQUET:field_id (incl. list
  elements) survive on disk, and a non-canonical struct is left untouched.
- sst: fix a broken rustdoc link to stamp_native_histogram_subfield_ids.

Signed-off-by: Ning Sun <sunning@greptime.com>

* fix: return error when fail to get i32 column id

---------

Signed-off-by: Ning Sun <sunning@greptime.com>
2026-07-20 12:18:34 +00:00
Weny Xu d386aeb98b ci: split export import v2 e2e test (#8564)
Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-07-20 11:26:37 +00:00
Ning Sun 63e63078b2 feat: allow unknown PluginOptions with a warning message (#8550)
* feat: allow unknown PluginOptions with a warning message

* refactor(plugins): deserialize plugin option from borrowed Value

Address review feedback on #8550: in filter_known_plugin_options,
deserialize each entry from a borrowed serde_json::Value reference
instead of cloning it. This removes the per-entry Value clone on the
happy path while keeping the original value available for the warning
log when an entry is unrecognized.

Signed-off-by: Ning Sun <sunning@greptime.com>

* chore: address review comments

* fix: verify against downstream project

---------

Signed-off-by: Ning Sun <sunning@greptime.com>
2026-07-20 11:16:20 +00:00
Lei, HUANG 25909bd1aa fix(mito): notify bulk writes on WAL error (#8563)
* fix(mito): notify bulk writes on WAL error

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

* fix(mito): move write ctx tests after items

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

* docs: mention PR template in agent guide

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

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-20 08:59:08 +00:00
Yingwen 5b1b12d041 fix(mito2): adapt batch size for wide rows (#8543)
* fix(mito2): adapt batch size for wide rows

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

* chore: address review comments

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

* refactor(mito2): simplify bulk memtable merging

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

* chore: fix batch size license header

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

* fix(mito2): size encoded batches from row groups

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

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-07-20 08:46:45 +00:00
Lei, HUANG 6a53bb053c feat: enable soft-drop table lifecycle (#8554)
* feat: add purge_table admin function

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

* fix: restrict purge_table to admin

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

* fix: keep purge tombstone lookup consistent

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

* test: verify soft-drop table lifecycle

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

* ci: run soft-drop lifecycle sqlness

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

* fix: read purge tombstones authoritatively

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

* fix(meta): invalidate soft-drop marker caches

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

* feat(meta): enable configurable table soft drop

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

* fix(ci): configure gc for soft-drop sqlness

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

* fix(meta): close regions before soft-drop metadata

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

* fix(meta): avoid rollback after soft-drop tombstone

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

* fix(function): validate admin single-row calls

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

* fix(meta): log purge dropped table target

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

* fix(meta): mark soft-drop config experimental

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

* fix: sqlness test base

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

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-20 08:28:35 +00:00
Yingwen b1580c98f6 fix: display codes in metasrv client errors (#8558)
* fix: display codes in metasrv client errors

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

* fix: normalize meta client errors in sqlness

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

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-07-20 06:48:49 +00:00
shuiyisong abcbd4f934 chore: ignore mysql connection reset error (#8556)
* chore: ignore mysql connection reset error

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

* fix: cr issue and add broken pipe

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

---------

Signed-off-by: shuiyisong <xixing.sys@gmail.com>
2026-07-20 06:05:13 +00:00
Ruihang Xia 0479c05092 perf: preserve dictionary-encoded query labels (#8541)
* perf: preserve dictionary-encoded query labels

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

* fix(client): skip dictionary Flight batches

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

* fix(servers): decode dictionary labels in HTTP output

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

* test(mito2): support dictionary tags in series scans

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

* fix(servers): preserve dictionary child nulls in SQL

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

* fix(promql): compare dictionary tags by logical nulls

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

* fix(query): keep dictionary tags within query paths

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

* refactor(query): scope PK dictionary encoding to reads

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

* fix(query): preserve pushdown for dictionary labels

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

* fix(query): handle dictionary labels in query operators

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

* fix(query): complete label type matching

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

* fix(query): align dictionary query schemas

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

* fix(query): decode incompatible OR labels

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

* fix(query): preserve dictionary partition pruning

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

* fix: handle dictionary query edge cases

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

* fix: import dictionary downcast macro

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

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2026-07-17 13:57:10 +00:00
Yash Agrawal 026cfbd122 feat: support splunk HEC raw endpoint (#8491)
* feat: add /raw handler + unit tests

Signed-off-by: yash <yasha4658@gmail.com>

* feat: add integration test for splunk /raw handler

Signed-off-by: yash <yasha4658@gmail.com>

* fix: added logs and captured payload unit test for splunk /raw endpoint

Signed-off-by: yash <yasha4658@gmail.com>

* fix: apply cargo fmt and optimize raw_line_to_map

Signed-off-by: yash <yasha4658@gmail.com>

* fix: preserve entire body as a event with opt-in linebreaker query param

Signed-off-by: yash <yasha4658@gmail.com>

---------

Signed-off-by: yash <yasha4658@gmail.com>
2026-07-17 13:01:39 +00:00
Lei, HUANG bbf989ac36 feat: support soft-drop recycle bin and UNDROP TABLE (#8546)
* feat: support full WAL retirement

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

* fix: complete close request migration

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

* refactor: guard Kafka provider setup behind index collector check

Move Kafka provider initialization and `get_or_insert` inside the
existing `if let Some(collector)` block so these operations are
skipped when no global index collector is configured.

Affected file:
- `src/log-store/src/kafka/log_store.rs`

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

* chore: avoid to_vec

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

* feat: clean up soft-dropped regions offline

Use an explicit RegionCleanUp request for purge-table cleanup so tombstoned regions can be removed without reopening them.

Route cleanup through datanode, Mito, and metric-engine offline paths, including WAL obsoletion and region directory removal.

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

* fix(meta): reject file-engine soft drop

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

* chore: preserve soft-drop cleanup split state

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

* refactor: remove obsolete CleanUp match arm from RegionRequest

The `CleanUp` variant in the `region_request::Body` match is now handled
exclusively by `RegionServer` via a separate path. This arm would have
returned an unexpected error, so removing it eliminates dead code.

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

* fix(meta): clean every soft-dropped region replica

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

* fix(meta): order soft-drop replica cleanup

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

* Revert "fix(meta): order soft-drop replica cleanup"

This reverts commit e77162d3e5ebcf2817e2845a6a5177c328fb2c60.

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

* Revert "fix(meta): clean every soft-dropped region replica"

This reverts commit 2378e00cc258ca1b6a85a1aafbd68c79c666f43c.

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

* feat(catalog): expose soft drops in recycle bin

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

* feat(sql): add UNDROP TABLE

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

* test(sql): cover UNDROP TABLE execution

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

* fix(sql): keep successful UNDROP result

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

* fix: reject stale undrop by name-based lookup after tombstone consumed

When a table is dropped, recreated under the same name (consuming the name
tombstone), and then the recreated table is dropped, an undrop procedure
that was built before the first drop and holds a stale original table name
should fail with TableNotFound instead of silently matching a different
table.

Changed `UndropTableProcedure::on_prepare` to perform a name-based lookup
when `table_name` is available and filter by table ID, ensuring that a
dropped table can only be recovered when its name tombstone still maps to
the expected ID.

- `src/common/meta/src/ddl/undrop_table.rs`: name-first lookup in on_prepare
- `src/common/meta/src/ddl/tests/drop_table.rs`: test for the stale-id
  rejection case

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

* fix(log-store): keep Kafka obsolete_all as no-op

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

* fix(catalog): hide purging tables from recycle bin

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

* fix(catalog): scope recycle bin scans by catalog

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

* test(sqlness): update recycle bin expectations

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

* refactor: avoid redundant recycle bin allocations

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

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-17 08:15:21 +00:00
discord9 f713d241e6 fix(ci): summarize query regression in one table (#8536)
* fix(ci): summarize query regression in one table

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

* test(ci): cover query regression comment renderer

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

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-17 07:23:46 +00:00
Div 1acdec9334 fix: timestamp display precision should respect column schema (#8227) (#8238)
* fix: timestamp display precision should respect column schema (#8227)

Previously, the MySQL writer converted timestamps to NaiveDateTime via
to_chrono_datetime_with_timezone(), then passed the NaiveDateTime to
write_col(). NaiveDateTime::Display uses a fixed 6-digit fractional-
second format, causing:
  - TIMESTAMP(3) to show '.195000' instead of '.195'
  - TIMESTAMP(9) to show '.195123' instead of '.195123456'

Fix: use Timestamp::to_timezone_aware_string() directly, which formats
with chrono's '%.f' specifier — it strips trailing zeros and preserves
full nanosecond fidelity based on the actual stored unit.

Also add comprehensive unit tests in mysql_writer_test.rs covering:
  - All concrete data type → MySQL column type mappings
  - UNSIGNED_FLAG propagation for unsigned integer types
  - Timestamp precision for all four units (0/3/6/9 decimal places)
  - Edge cases: zero subseconds, trailing-zero stripping, Unix epoch,
    negative timestamps, and timezone offset shifts
  - Column-def ordering, empty schema, and decimal variants

Signed-off-by: Divyansh <anshmcs@gmail.com>

* perf: reuse format buffer for timestamp serialization to avoid per-row heap allocation

Signed-off-by: Divyansh <anshmcs@gmail.com>

* refactor: rename test variable and update visibility of create_mysql_column function

Signed-off-by: Divyansh <anshmcs@gmail.com>

* test: fix timestamp test constants and add sqlness case for display precision

- Correct the base epoch constant: 1_748_836_200 is 2025-06-02, not
  2026-06-02; use 1_780_372_200 to match the documented instant.
- Fix subsecond expectations: chrono's %.f renders fractional digits in
  groups of 3 (.100 / .010), it does not strip to .1 / .01.
- Add sqlness case timestamp_precision_display reproducing issue #8227
  over the MySQL protocol (TIMESTAMP(0/3/6/9) rendering).
- cargo fmt reflow of create_mysql_column signature.

Signed-off-by: Divyansh <anshmcs@gmail.com>

* fix: support binary protocol for timestamp column

Signed-off-by: Divyansh <anshmcs@gmail.com>

* test: update sqlness results for new timestamp display precision

Signed-off-by: Divyansh <anshmcs@gmail.com>

---------

Signed-off-by: Divyansh <anshmcs@gmail.com>
2026-07-17 07:22:17 +00:00
Ruihang Xia c969fb0a5e perf: reduce parquet metadata cache footprint (#8527)
* perf(mito2): reuse parquet metadata size accounting

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

* perf(mito2): skip unused parquet column indexes

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

* perf(mito2): cache compact parquet metadata

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

* fix(mito2): tolerate metadata cache encoding failures

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

* fix(mito2): skip disabled metadata cache encoding

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

* refactor(mito2): avoid nested metadata cache task

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

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2026-07-16 11:20:13 +00:00
shuiyisong 3ae8d7d46a refactor: reconcile OTLP trace schemas request-wide (#8485)
* refactor: global trace schema

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: cr issue

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: cr issue

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

* fix: fmt

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

* refactor: split files

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

* chore: add comments and doc

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: cr issue

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-16 10:56:27 +00:00
Lei, HUANG 4873fc4f18 feat(meta): add retention GC for soft-dropped tables (#8526)
* feat(meta): persist soft-drop retention metadata

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

* fix(meta): complete soft-drop retention coverage

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

* fix(meta): finalize soft-drop metadata after prepare

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

* feat(meta): purge expired soft-dropped tables

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

* fix(meta): keep soft-drop GC responsive

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

* fix(meta): deduplicate soft-drop purge tasks

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

* fix(meta): release purge reservations safely

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

* refactor(meta): simplify soft-drop GC wiring

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

* feat(meta): persist soft-drop retention deadlines

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

* fix(meta): retain soft-drop config for recovery

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

* fix: complete standalone DDL test context

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

* fix(meta): recheck retention before automatic purge

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

* fix(meta): keep experimental soft drop disabled

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

* fix(meta): rotate soft-drop purge candidates

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

* fix(meta): address soft-drop retention review

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

* fix(meta): protect retained table tombstones

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

* fix(meta): preserve post-cleanup purge state

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

* fix(meta): fence purge by drop generation

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

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-07-16 08:47:03 +00:00
dennis zhuang a585b83bfc fix: count Postgres SCRAM auth failures and correct auth config docs (#8538)
* fix: count Postgres SCRAM auth failures in the auth failure metric

The SCRAM SASL paths returned `Failed` without touching
`METRIC_AUTH_FAILURE`, so once SCRAM is enabled wrong-password and
unknown-user attempts disappeared from `greptime_servers_auth_failure_count`.

Funnel every SCRAM rejection through `record_scram_failure`, which records
one failure with a uniform `UserPasswordMismatch` label so the counter stays
useful without revealing whether the user exists.

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

* docs: correct per-protocol auth notes in config examples

The user_provider note no longer matched the implementation: pbkdf2_sha256
is excluded from Postgres SCRAM (so its iteration count is never exposed in a
SCRAM handshake), and the warning that hash-only verifiers cannot use MySQL's
native password handshake had been dropped.

State the actual per-protocol fallbacks and incompatibilities, scope the
iteration/salt enumeration caveat to pg_scram_sha256, and regenerate
config.md.

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

* fix: avoid double-counting Postgres SCRAM authorization failures

authorize() already increments METRIC_AUTH_FAILURE with its own status
code, so routing the authorization-rejection path through
record_scram_failure counted it twice, mislabeling the second increment
as UserPasswordMismatch. Return early to bypass the recorder.

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

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-07-16 07:59:35 +00:00
discord9 c7bcddacc5 fix: preserve nulls in timestamp arrays (#8508)
Signed-off-by: discord9 <discord9@163.com>
2026-07-16 06:40:42 +00:00
discord9 a3816c889e fix(ci): harden query regression runner (#8534)
Signed-off-by: discord9 <discord9@163.com>
2026-07-16 03:31:24 +00:00