Commit Graph
6758 Commits
Author SHA1 Message Date
discord9 4f08eeca82 feat(query): place a fused node region-side, and ask for per-series scans
A `FusedSeries` node is built for one metric's series, and a region holds a subset
of those series with none split across regions, so the node commutes with the
region split when what it reads is per-series. It says so now, and the analyzer
may place it inside the merge scan.

Three conditions, each drawn from the conversion that has to succeed there:

- The node's input is exactly the table scan. The region builds the node from the
  scan's own raw-series entrypoint and cannot look through a filter, a projection
  or a sort in between, so a node over anything else has nothing to read where it
  would be placed.
- The node binds a metric name, because the region resolves the series of one
  named metric.
- No node of its tree folds across series. A region holds part of a metric's
  series, so an aggregate or a binary operation evaluated there would consume a
  partial input and return a wrong answer without saying so. Every operation the
  compiler emits today - input, instant, window, map - reads one series at a
  time, so this refuses nothing buildable; it is the conservative answer for a
  tree built some other way.

A scan below such a node also asks for the per-series distribution now. That is
what makes a region prepare its series scan, and only that path packs a series'
chunks into the frame the node reads.

Both are inert without a `FusedSeries` node, so an ordinary query keeps its plan
and its scan request.

Not yet reached: the analyzer asks whether a plan encodes before it asks whether
a node commutes, and this node has no Substrait serializer, so the plan is
expanded at the node and the region still receives the bare scan. A test pins
that boundary so it fails the day the node can cross it.

Signed-off-by: discord9 <discord9@163.com>
2026-10-24 21:30:49 +08:00
discord9 9469ac146b feat(query): offer a PromQL statement to the native fused-series route
Nothing called `native_compile::compile` or built a `FusedSeries`, so the native
tree and its node were library code with tests and no query behind them. This
adds the route, behind a per-query flag.

The statement is offered to the compiler at the root, where the expression the
reader wrote still exists. A shape the compiler refuses - `NotImplemented` - is
this route declining the query, and planning continues exactly as it would with
the flag off. Anything else is a real error.

The physical half is an arm in `PromExtensionPlanner`. Its children are already
built by then, so a metric scan arrives as the region scan, and the node asks that
scan for its named raw-series binding: `try_to_named_series_scan` resolves the
label source and ordering from the scanner itself, which is the only thing that
can name them, and returns the leaf the node reads. A scanner that cannot serve a
raw frame is reported, not silently re-planned.

Two things this needed that the route does not get for free:

- The region scan has to be prepared as one partition. `resolve_named_series_binding`
  refuses a scan whose partition count is not one, and a fresh scan has not set
  its partitions at all: `ParallelizeScan` runs after extension planning and would
  spread it, so the node would run one evaluator per partition and split a logical
  series. Preparing the ranges as one partition is what keeps `FusedSeriesExec`
  over one series stream, and it is why this route does not scan in parallel yet.
- The scan needs the per-series distribution hint. That is what makes a region
  prepare its series scan, and only that path packs a series' chunks into the frame
  this node reads. The existing planner asks for it through a sort that
  `ScanHintRule` turns into the hint; this node has no such sort below it, so the
  hint is attached to the scan directly.

A query the route cannot bind faithfully keeps the existing plan rather than a
wrong one: more than one selector, a label matcher that would survive
preprocessing, an `__field__` matcher, a native histogram field, a missing table,
or a shape whose grid the compiler's statement cannot express.

Signed-off-by: discord9 <discord9@163.com>
2026-10-24 21:30:49 +08:00
discord9 4ad743f0b8 test(promql): register binary metrics before execution
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 21:12:34 +08:00
discord9 65e93320ed refactor(promql): keep runtime trees owned by their executions
Register each execution's node metric handles once in the physical plan's metrics set. Reading metrics no longer retains or locks runtime topology. Keep historical counters alive after execution drop and cover repeated reads and executions.

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 21:09:22 +08:00
discord9 1374f70f1d test(promql): feed the newly added native tests through input slots
The histogram-function and range-modifier tests that landed on the branch use
the execution entry points as they were before the runtime took an input
position, so they name the leaf they push at.

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:55:40 +08:00
discord9 fb9165c29a test(promql): feed the label-rewrite tests through an explicit input slot
The runtime takes an input position now, so the tests that a label rewrite
brought in name the leaf they push at, and the map import no longer carries the
operation type the runtime reads through `MapOp`.

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:52:06 +08:00
discord9 dd537832b6 test(promql): re-export retained roots after rebuilding
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:52:06 +08:00
discord9 e1c31500d3 test(promql): verify recursive metrics and rebuilt plan isolation
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:52:06 +08:00
discord9 8c62255059 fix(promql): drop terminal input schemas with their slots
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:52:06 +08:00
discord9 475b2d5aef test(promql): verify retained-root cancellation returns every byte
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:52:06 +08:00
discord9 aed40ffa6d test(promql): preserve input routing and partition metric ownership
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:52:06 +08:00
discord9 1bc32e3ee2 test(promql): pass explicit input slots to fused collision fixture
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:52:06 +08:00
discord9 d8058bbd65 style(promql): format recursive aggregate imports
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:52:06 +08:00
discord9 1cfaaab89f refactor(promql): validate fused input trees without node paths
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:52:06 +08:00
discord9 df2ea44bd9 refactor(promql): drive and release the recursive runtime tree
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:52:06 +08:00
discord9 7fb5ac36da test(promql): inspect recursive runtime ownership and release
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-24 18:52:06 +08:00
discord9 da9c63dc0e refactor(promql): remove NodePath and own the runtime tree recursively
A node was identified by the path that reached it, so every execution and
every metric export walked that path again, and a node's own state lived in
tables keyed by it. This replaces that with one recursive runtime tree: each
node owns its children, its operator state, its metrics and, once settled,
nothing it no longer needs.

An `InputId` is assigned only to the leaves that actually receive a feed, by a
depth-first walk of the built tree, so a scalar leaf takes no id and no node is
addressed by position. Pulling, settling, flushing after a subtree closes,
EOF, errors and drop all recurse through the same tree.


Signed-off-by: discord9 <discord9@163.com>
2026-10-24 18:52:05 +08:00
dennis zhuang e285a3f207 feat(promql): evaluate the anchored and smoothed range modifiers (#9888)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

Native operator kernels, NEW-EVAL-MOD (#27).

## What's changed and what's your intention?

Prometheus v3.15.0 adds two experimental range selector modifiers behind
`EnableExtendedRangeSelectors`: `anchored` and `smoothed`. This adds
them to the range evaluator as `RangeWindow.modifier:
Option<RangeModifier>`.

- **What they read.** `anchored` also reads the statement's lookback
before the window start. `smoothed` reads the lookback before the start
and after the end. The evaluator keeps samples that much longer and
widens a smoothed window's end.
- **Kernels** follow `extendedRate`, `pickOrInterpolate*`,
`interpolate`, `correctForCounterResets` and `pickFirstSampleIndices`:
- `rate`, `increase` and `delta` take the start value from the last
sample at or before the start. For `smoothed` they interpolate both
ends, a counter that reset between the two samples restarts from zero,
and nothing is extrapolated.
- `resets` and `changes` (anchored only) count from that anchor sample.
- **Allowed functions.** These match `AnchoredSafeFunctions` /
`SmoothedSafeFunctions`; any other function is rejected with Prometheus'
message. Evaluated input (subqueries) is refused; the parser does not
allow modifiers there either.
- **When a smoothed point is decided.** A smoothed end needs the first
sample at or after the point. A point is therefore decided once every
field holds such a sample, or once the lookback past it has arrived. The
chunk's last row alone is not enough: a stale last row is dropped, and a
field can be empty in it.
- **Not here:**
- Native histogram samples under a modifier are refused with
`NotImplemented`. Prometheus runs `extendedHistogramRate` there, and
returns nothing with a warning for mixed windows.
- No compiler wiring: promql-parser 0.10 lexes the keywords but has no
grammar or AST for them.
- A scan feeding a modified window has to read the extra lookback; the
`RangeWindow` doc says so.
- **Display:** `rate [5m] smoothed lookback 300000ms ...`.

### Tests

- Golden `range_eval/modifier_cases.txt` (43 KB, 100 cases) from
`promql-compat/cmd/narthex-golden-rangemod`. It has 50 random cases and
50 cases with whole-second times that put samples exactly on the window
and lookback bounds. Each case is pushed as one chunk and as one chunk
per sample, and the cases for unsupported functions expect the
rejection.
- A smoothed `delta` whose first chunk ends on a stale row must wait for
the next sample to interpolate the end. This case fails when readiness
comes from the chunk's last row.
- Display of a modified window.

## PR Checklist
Please convert it to a draft if some of the following conditions are not
met.

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-24 00:03:16 +08:00
Dennis Zhuang 9de4dcb075 chore: merge narthex into feat/narthex-range-modifiers
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

# Conflicts:
#	src/promql/src/native/display/tests.rs
2026-10-23 23:13:17 +08:00
dennis zhuang 9cf49b2007 feat(promql): compile and run native histogram functions as map operations (#9849)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

Native tree operator wiring, native histogram functions (#25). Follows
#9845 → #9846 → #9848 (all merged).

## What's changed and what's your intention?

`histogram_count`, `histogram_sum`, `histogram_avg`, `histogram_stddev`
and `histogram_stdvar` now compile into the native tree and run in the
existing `Map` node.

- **Plan.** `MapOp::Histogram(NativeHistogramFunction)`. These are
pointwise per series like math (Prometheus `simpleHistogramFunc`), so no
new node or output type is needed.
- **Runtime.** `map_chunk` calls the existing `map_native_histogram`
kernel: only histogram positions produce a value, float positions become
holes, and only `__name__` is dropped (`__type__`/`__unit__` stay,
unlike math). When the op empties a closing chunk, the closing series is
named the same way. `map_chunk` now takes `&Arc<SeriesSchema>` to call
the kernel.
- **Kernel.** `map_native_histogram` checks its input against the schema
with `validate_grid_series`, as `map_math` does. It used to check only
that the axis is a grid, and a series with more or fewer fields than the
schema indexed out of bounds.
- **Compiler.** `histogram_function` lists the five names; one vector
argument. `histogram_quantile` / `histogram_fraction` also read classic
bucket series across series, so they are not maps and are not wired
here.
- **Display.** The PromQL name.

Shared files touched: `native/plan.rs` (`MapOp`), `native/execute.rs`
(`map_chunk`), `native/display.rs`, `native_compile.rs`.

### Tests

- Runtime: a chunk holding histogram, float, histogram maps to values at
the two histogram positions with the name dropped; a closing float chunk
is emptied and keeps `__type__`.
- Kernel: a series that does not fit the schema is refused instead of
panicking.
- Compiler: the five names bind their kernel into a map.

## PR Checklist
Please convert it to a draft if some of the following conditions are not
met.

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-23 21:34:47 +08:00
Dennis Zhuang 8870d4279b chore: merge narthex into feat/narthex-histogram-node 2026-10-23 18:41:42 +08:00
dennis zhuang 8497382673 feat(promql): compile and run label_replace and label_join as map operations (#9848)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

Native tree operator wiring, label category (#25). Builds on #9846 (date
wiring, merged).

## What's changed and what's your intention?

`label_replace` and `label_join` now compile into the native tree and
run in the existing `Map` node.

- **Plan.** `BoundMap.ops` becomes `Arc<[MapOp]>`, with
`MapOp::Math(MathOp)` and `MapOp::Label(Arc<LabelRewrite>)`. A label
change is pointwise per series like math, so it needs no new node,
collector or output type.
- **Kernel.** `LabelRewrite` (in `map_label.rs`) is the checked,
compiled change: `replace` anchors the regex and checks the destination,
`join` checks source and destination names, `apply` rewrites one
`MetricName`. The whole-vector `label_replace` / `label_join` now go
through it and still merge same-labelset series afterwards, so the
Prometheus golden keeps covering the same code. Fields are private, so
only the two constructors build one.
- **Runtime.** `map_chunk` applies label ops to the series metric and
math ops through `map_math`. When a math op empties a closing chunk, the
labels of the closing series come from applying the remaining ops in
order (label ops rewrite, math ops drop the name). Series a label change
folds into one label set go through the `Emitted` ledger the map already
keeps: disjoint values merge, a shared point is refused.
- **Compiler.** `label_rewrite` reads the string-literal arguments.
Arguments Prometheus rejects at evaluation (invalid regex, empty label
name) fail the statement with `Plan`, as Prometheus fails the query;
everything unsupported stays `NotImplemented`.
- **Display.** `label_replace "dst" "repl" "src" "regex"` / `label_join
"dst" "sep" ["a", "b"]`.

Shared files touched: `native/plan.rs` (`MapOp`), `native/execute.rs`
(`map_chunk`, `no_row_series` now takes the metric),
`native/display.rs`, `native_compile.rs`. Test constructors move from
`MathOp` to `MapOp::Math`.

Known difference, not introduced here but now reachable: Prometheus
checks same-labelset duplicates separately for floats and histograms,
while the native ledger counts both as a value at a position. A
`label_replace` that folds a float series and a histogram series onto
one label set at the same step is refused natively.

### Tests

- Runtime: a relabel that folds two series refuses the shared point; a
closing chunk emptied mid-chain carries labels from label ops on both
sides of the emptying op; a label-only map hands histogram samples and
holes through unchanged.
- Compiler: both functions bind their change into a map; an invalid
regex fails the statement with `Plan`.
- `map_label` Prometheus golden (existing) now runs through
`LabelRewrite`.

## PR Checklist
Please convert it to a draft if some of the following conditions are not
met.

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-23 18:07:51 +08:00
dennis zhuang 3674b33db8 fix(promql): keep fill_left and fill_right on their written sides under group_right (#9899)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

prometheus/prometheus#19939

## What's changed and what's your intention?

The native binary kernel applied `fill_left` / `fill_right` after
swapping the operands of `group_right`, so under `group_right`
`fill_left` filled a missing right-hand sample and `fill_right` a
missing left-hand one. That is the Prometheus behavior before
prometheus/prometheus#19939, which was merged into Prometheus main on
2026-10-13: the fill values now swap together with the operands, so they
always refer to the side written in the query.

For example, `node_meta - on(instance) group_right fill_left(5)
fill_right(7) cpu_info`: a missing `node_meta` must give `5 - cpu_info`
and a missing `cpu_info` must give `node_meta - 7`.

- `binary_field` swaps `fill.lhs` / `fill.rhs` when the one side is the
left, matching `VectorBinop` after #19939. The `FillValues` doc now
states the as-written meaning.
- `fill_cases.txt` is regenerated by promql-compat
`narthex-golden-vector -experimental fill` built against Prometheus at
the #19939 merge commit (same seed and case count). Only the 24
`group_right` cases whose fill fires on an asymmetric pair change.

No released Prometheus contains #19939 yet (v3.15.1 still has the old
behavior), so until the next release native results differ from released
Prometheus for asymmetric fills under `group_right`. The compiler does
not bind vector-vector fill modifiers yet, so this is not reachable from
a query today; it has to land before that wiring does.

## PR Checklist
Please convert it to a draft if some of the following conditions are not
met.

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-23 16:44:07 +08:00
dennis zhuang 1c63b06265 feat(promql): compile topk, bottomk, limitk, limit_ratio and count_values into the vector node (#9890)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

Native tree operator wiring, Select / aggregate categories (#25).
Follows #9850 → #9851 → #9852 → #9853 → #9854 (all merged) and #9833.

## What's changed and what's your intention?

`topk`, `bottomk`, `limitk`, `limit_ratio` and `count_values` now
compile. #9833 left them out of `AggregateKind` because they do not fold
a group into one value per point. They now bind as a `Vector` node
through `vector_aggregate`:

- `topk` / `bottomk` / `limitk`: `k` is folded to a constant as
`quantile`'s parameter is, and the `by` / `without` grouping is kept. A
`k` only known at run time is refused with `NotImplemented`. NaN,
negative and out-of-range `k` are left to the kernel, which fails or
answers at evaluation as Prometheus does.
- `limit_ratio`: the ratio is folded the same way. The grouping is
dropped, since Prometheus keeps or drops each series by its label hash
alone.
- `count_values`: the label is a string literal. Label validation stays
in the kernel, an execution error as in Prometheus.

The module doc, the grammar and the `SUPPORTED` text name the new
shapes.

### Tests

- Compiler: each aggregator binds its operation with the folded
parameter and grouping. A run-time `k` is refused, and the rejection
quotes every aggregator this compiler takes.

## PR Checklist
Please convert it to a draft if some of the following conditions are not
met.

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-23 16:21:20 +08:00
Dennis Zhuang 804d050c2b fix(promql): refuse a histogram in a modified window when it is ingested
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-23 16:09:32 +08:00
Dennis Zhuang 1f88b11698 chore: merge feat/narthex-label-node into feat/narthex-histogram-node 2026-10-23 15:13:51 +08:00
Dennis Zhuang 13f4fb9cdb chore: merge narthex into feat/narthex-label-node
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

# Conflicts:
#	src/promql/src/native/execute/tests.rs
2026-10-23 15:13:42 +08:00
Yingwen ce4fc4529e feat(mito): read columnar series through prepared sources (#9892)
* feat(mito): read columnar series through prepared sources

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

* fix(mito): rebuild schema-incompatible columnar sidecars

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

* docs(mito): regenerate series format configuration

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

* fix(mito): batch prepared series reads and preflight inputs

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

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-10-23 15:11:29 +08:00
Dennis Zhuang 4ca04d2790 chore: merge narthex into fix/narthex-group-right-fill 2026-10-23 15:05:43 +08:00
Dennis Zhuang 871350dfd8 test(promql): give the fused series windows no range modifier
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-23 15:04:52 +08:00
Dennis Zhuang e6add3f888 chore: merge narthex into feat/narthex-range-modifiers 2026-10-23 14:56:31 +08:00
Dennis Zhuang 968f5a4525 chore: merge narthex into feat/narthex-vector-agg-compile 2026-10-23 14:51:16 +08:00
Dennis Zhuang 5e621d481b chore: merge narthex into feat/narthex-vector-agg-compile 2026-10-23 14:50:20 +08:00
dennis zhuang 0356a1607a ci: bring the narthex branch's CI workflows up to main (#9912)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

Unblocks the CI checks of #9868 and the rest of the `narthex` stack.

## What's changed and what's your intention?

`narthex` is a long-lived feature branch that has fallen behind `main`,
so its
CI still runs the older workflows. Three checks fail for reasons that
have
nothing to do with the branch's code:

- **Prepare Fuzz Targets** — the setup step installs `libfuzzer-14-dev`,
which
  is no longer available on the current runner image.
- **Run Multi-language SDK Tests** — the job asks for Python 3.8, which
the
  current runners no longer provide.
- **Clippy** — the failure is inside `cargo clippy`, not in the setup
steps, so
  it is not addressed here; see the note at the end.

This PR cherry-picks the CI commits that landed on `main` but not on
`narthex`,
so the branch's workflows match `main` again. It changes **no Rust
code** — all
33 changed files are workflow definitions, composite actions, `Makefile`
targets, `.github/scripts/`, and one how-to doc.

The commits are applied with `-x` so each carries the upstream SHA, and
they
apply without conflicts.

### What is picked

| Commit | Why |
| --- | --- |
| `97e3bfd547b` | manual S3 metric snapshot benchmark |
| `f1fb5e4e7a5` | `RUST_MIN_STACK=8MB` for the merge_group coverage job
|
| `813b132221f` | compare release validation against the previous stable
version |
| `b2b606115b7` | crash/restart/multi-region/drop cells for the S3 WAL
benchmark |
| `db61aecadbc` | do not run these actions on a fork |
| `a0a7ec02b5d` | compare several images in one object store WAL S3 run
|
| `fdb8ceeb542` | increase release integration test stack size |
| `f855355ed04` | independent Linux release architecture selection |
| `630cca33956` | align nightly Windows and macOS artifact test stack
sizes |
| `99d907cf1d2` | **fixes the two failing jobs above**: drops
`libfuzzer-14-dev`, moves the SDK tests to Python 3.13, installs protoc
via `taiki-e/install-action` |
| `6e40daed98e` | move `monitoring.datanodeStorage` out of the
standalone `base` |
| `de0fea673eb` | specify the Kind storage class for datanodes |

### Limitations

The Clippy failure is **not** fixed by this PR. Its setup steps
(checkout,
protoc, toolchain, cache) all succeeded and the failure is in the `cargo
clippy`
step itself, so it needs its own diagnosis — a lint in the branch's code
or a
toolchain difference. I could not retrieve that job's log to say which.

`kafka-wal-helper.yaml` is a pre-existing multi-document YAML file; it
is not
touched here and not affected by these picks.

## PR Checklist
Please convert it to a draft if some of the following conditions are not
met.

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-23 14:49:48 +08:00
Weny Xu de0fea673e fix(ci): specify Kind storage class for datanodes (#9908)
Signed-off-by: WenyXu <wenymedia@gmail.com>
(cherry picked from commit 567849908e)
2026-10-23 14:43:12 +08:00
liyang 6e40daed98 fix(ci): move monitoring datanodeStorage out of standalone base (#9902)
The `datanodeStorage` field belongs directly under `monitoring.standalone`
(GreptimeDBStandaloneSpec), not under `monitoring.standalone.base`
(PodTemplateSpec). Nesting it under `base` renders an invalid
GreptimeDBCluster resource and the CRD schema rejects it during
server-side apply:

  .spec.monitoring.standalone.base.datanodeStorage: field not declared in schema

(cherry picked from commit 3483f4a284)
2026-10-23 14:43:12 +08:00
dennis zhuang 99d907cf1d ci: fix CI setup steps that fail on Ubuntu 26.04 runners (#9901)
* ci: install protoc with taiki-e/install-action

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

* ci: run multi-language SDK tests on Python 3.13

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

* ci: drop the unused libfuzzer-14-dev package from fuzz builds

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

* ci: build fuzz targets with the bundled libFuzzer

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

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
(cherry picked from commit 00ab09012d)
2026-10-23 14:43:12 +08:00
Yingwen 630cca3395 fix(ci): align nightly Windows and macOS artifact test stack sizes (#9860)
* fix(ci): increase Windows nightly test stack size

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

* fix(ci): align optional macOS artifact test stack size

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

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
(cherry picked from commit 8b1d68369b)
2026-10-23 14:43:12 +08:00
Weny Xu f855355ed0 ci: allow independent Linux release architecture selection (#9865)
* ci: allow independent Linux release architecture selection

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

* ci: use Linux architecture checkboxes and preserve release defaults

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

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
(cherry picked from commit f595e9bbf0)
2026-10-23 14:43:12 +08:00
Yingwen fdb8ceeb54 fix(ci): increase release integration test stack size (#9817)
Signed-off-by: evenyag <realevenyag@gmail.com>
(cherry picked from commit e6fa1a0b21)
2026-10-23 14:43:12 +08:00
jeremyhi a0a7ec02b5 ci: compare several images in one object store WAL S3 benchmark run (#9691)
* ci: compare several images in one object store WAL S3 benchmark run

A new `images` input takes a JSON list of 2..4 {label, image}. Every
cell then runs once per image, back to back, and the image order
reverses with the configuration order every other round. The cell id
gains the label. The single-image inputs keep their meaning and cell ids.

The validate job pulls every image before an instance is allocated. It
pins each image to its digest and records the version and commit that
the image reports. Each cell starts the image of its label. An optional
`warmup` runs the first load cell once per image as round 0, and no
statistic uses it.

The plan step estimates the benchmark job's minutes on c6id.2xlarge
from the cell times of earlier runs. It refuses a plan that does not
fit the job timeout.

The summary keeps the Raft Engine ratios within each image. With
several images it also reports, per group, concurrency and config:

- every round's rows/s and client p50/p99;
- each image's ratio to the first, with the geometric mean, minimum
  and maximum over the rounds.

Every cell records the host load averages at its start and end.

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

* ci: scale the S3 benchmark time estimate with the batch size

The per-cell rates were measured with 1000-row batches. A smaller batch
keeps about the request rate, not the row rate, so the estimate now
shrinks rows/s with the batch. A one-row durable plan is refused instead
of passing a timeout it cannot fit.

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

* ci: pin the S3 benchmark runtime image without pulling it in validate

An anonymous pull from ECR Public on a hosted runner can exceed the
registry's data limit, and it failed the validate job of several
dispatches with "toomanyrequests: Data limit exceeded". Validate now
reads only the registry manifest to pin the runtime image's digest. A
reference that names a digest must be served under that digest.

The check that the image holds the loader and the generator moves to
the benchmark host. It runs right after the runtime pull and before any
GreptimeDB image is pulled or any cell starts.

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

* test: run the S3 benchmark runtime content check against both files

The fake docker now runs the pull step's own check in a directory that stands in for the runtime image. It covers both files present, the loader missing and the generator missing, so dropping either file check fails the test.

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

* ci: pin a digest-named S3 benchmark runtime image without the registry

ECR Public's anonymous data limit now refuses hosted runners even the
manifest read, and validate failed in "Pin the runtime image digest".
A runtime reference that names its sha256 digest, like the default one,
is already pinned, so validate takes that digest with no network call.
The format checks stay. Only a tag-only reference is resolved through
the registry. The content check on the benchmark host is unchanged.

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

* ci: check the full S3 benchmark runtime reference before pinning it offline

A named digest no longer reaches the registry, so nothing parsed the rest of the reference. Validate now checks the whole reference against Docker's reference grammar first. It refuses an empty repository, a doubled '@' or a bad tag before any pin is emitted or any instance is allocated.

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

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
(cherry picked from commit a436213bf3)
2026-10-23 14:43:10 +08:00
yihong db61aecadb ci: do not run these actions on fork (#9721)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
(cherry picked from commit 4684b95f72)
2026-10-23 14:43:10 +08:00
jeremyhi b2b606115b ci: add crash, restart, multi-region and drop cells to the S3 WAL benchmark (#9632)
* ci: add crash, restart, multi-region and drop cells to the S3 WAL benchmark

Extend the object store WAL S3 benchmark beyond one load per configuration:

- Inputs for a full image reference, the configurations to run (R0 adds Raft
  Engine with the standalone default sync_write = false), extra environment
  for every server container, a restart after each load, and a JSON list of
  named cell groups that override those inputs.
- Restart cells SIGKILL the loaded server, restart it on the same prefix and
  data home, and time /health, the first correct count and the log store
  recovery; min_objects fails a cell that left too few objects indexed.
- Crash groups write striped 1000-row batches from several writers, kill the
  server at a random point, restart it and check every acknowledged batch
  against the table (durable: present exactly once; enqueued: no duplicate,
  no partial batch, losses counted). A pinned variant keeps one row of a
  second table unflushed and samples the indexed objects while it runs.
- Idle windows scrape the server before and after a quiet period.
- A load group may split the loaded table into equal event_time ranges, so
  every batch writes to every region, and checks that each region took rows.
- Drop groups write a table, drop it, kill and restart the server, then
  write and flush another table and wait for the dropped table's objects to
  be collected.
- The summary adds WAL traffic, objects per second, mean object size,
  entries and appends per object, S3 requests per operation, server and host
  CPU, the loader's own request latency, rows per region, crash cycles, and
  each restart's replay per region from the server log.

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

* ci: report the object sequences a replay spans instead of objects replayed

The width of a region's replayed entry range counts every object sequence in it, including objects that hold no entry of the region and are skipped, so the summary labels it as a span.

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

* ci: fail a crash cycle that loses a batch an earlier restart recovered

The oracle accepted every missing acknowledged batch in the enqueued mode,
so a batch that one restart recovered and a later restart no longer found
passed. Every cycle keeps what its restart found, and a cycle now fails in
either mode unless every batch an earlier restart recovered is still
present, so only the current cycle's backlog that was not durable at its
kill may be missing.

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

* ci: keep the pinned WAL pinned and label OpenDAL operations as such

The pin table inherited the engine's 10-minute auto flush, so a longer
pinned cycle could flush its row and release the WAL before the kill. It now
sets its own auto_flush_interval of one day, longer than any crash group can
run, and a pinned cycle fails unless its indexed objects never fall while
it runs.

The summary's request counts come from opendal_operation_duration_seconds,
which counts OpenDAL calls rather than HTTP requests (a paginated list or a
multipart write is one operation), so the fields and columns now say S3
operations.

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

* ci: check a pinned cycle's retention by the collected-object counter

Net growth of the indexed objects can hide collection, and short cycles take no periodic sample, so a pinned cycle now fails unless deleted_objects_total is the same in the scrape before its writers start and in the one before the kill, both of the same server process. The operation columns name OpenDAL.

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

* ci: let a pinned cell collect only the objects below its pin

The first write after a start lets the store collect the empty start object asynchronously, so a deletion after a cycle's baseline does not mean the pin let go. A pinned cell now scrapes the server before it writes the pin row and fails only once its servers together have collected more objects than were indexed then, counting the first server from that scrape and every restarted one from its start.

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

* ci: test that a pinned cell's allowance spans its server restarts

Two servers that each collect fewer objects than lie below the pin but more together now fail the cell in the second cycle.

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

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
(cherry picked from commit 0e82b29b23)
2026-10-23 14:43:10 +08:00
localhost 813b132221 fix(ci): compare release validation against the previous stable version (#9636)
Ancestry-based tag selection skips stable tags that live only on older release branches.

Signed-off-by: paomian <xpaomian@gmail.com>
(cherry picked from commit 3de8610e2e)
2026-10-23 14:43:10 +08:00
discord9 f1fb5e4e7a ci(coverage): set RUST_MIN_STACK=8MB in merge_group coverage job (#9615)
The merge_group coverage job did not set RUST_MIN_STACK, so test threads
ran with the default 2MiB stack while the regular test job (and the
production runtime in debug) use 8MiB. The deeper PromQL planning chain
from #9494 overflows 2MiB under llvm-cov instrumentation, aborting
tests::promql_test::anon_promql_ratio_repro::case_1_test_with_standalone
with SIGABRT (12/12 failures across three merge-queue candidates).
Align the coverage job with the existing 8MiB test policy.

Signed-off-by: discord9 <discord9@163.com>
(cherry picked from commit 60097a0628)
2026-10-23 14:43:10 +08:00
jeremyhi 97e3bfd547 test: add manual S3 metric snapshot benchmark (#9573)
* test: add repeatable metric snapshot S3 benchmark

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

* test: use only existing CI S3 permissions in the metric snapshot benchmark

The CI S3 user is not allowed GetBucketLocation or ListBucketMultipartUploads,
so the bucket probe and the prefix cleanup failed with AccessDenied. Use only
list, put, get and delete under the run prefix, as the object store WAL
benchmark does, and probe S3 before allocating the EC2 runner.

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

* test: scope metric snapshot inventory to the current round

The full round's S3 inventory listed the whole run prefix, so it also counted
the smoke snapshot. List only the round's snapshot prefix while cleanup still
covers the run, and assert that the teardown's S3 cleanup step runs always()
with the validated run prefix.

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

* docs: record the AWS validation run of the metric snapshot benchmark

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

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
(cherry picked from commit 7df99f946e)
2026-10-23 14:43:10 +08:00
dennis zhuang 069b942518 feat(promql): run count_values in the native vector node (#9854)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

Native tree operator wiring, aggregate category (`count_values`, #25).
Stacked on #9853 → #9852 → #9851 → #9850; its own change is the last
commit. Draft until those merge.

## What's changed and what's your intention?

`count_values(label, v)` runs natively as `BoundSelect::CountValues {
label, group }` through `aggregate::count_values`.

- **Why this node.** `count_values` writes one label set per distinct
value, which #9833 leaves out of `AggregateKind` as a different shape.
It reads the whole vector at a point, which is what the select node
does.
- **Output.** Groups are keyed by their final label set, so each result
label set is one series and the node does not mark its output as holding
pieces. Input pieces of one label set hold disjoint points, so their
counts add.
- **Memory.** The estimate charges a group per row, since a gauge with
distinct values makes about one group per sample: the group's label set
twice with the value label, its counts and its result series.

Not here: compiling `count_values`, which is an aggregate expression and
goes through #9833. Before it is compiled, it needs a decision on native
histogram input. Prometheus counts histograms by their string form; the
kernel refuses them with `NotImplemented`. Until the kernel covers them,
the compiler has to refuse such input.

### Tests

- Runtime: values shared across series are counted per point, including
a series delivered in two chunks.
- Display: the `count_values` line.

## PR Checklist
Please convert it to a draft if some of the following conditions are not
met.

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-23 09:33:20 +08:00
discord9 85c5dc0d69 test(promql): pin the refusal to a kind the runtime still refuses (#9900)
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-23 08:35:30 +08:00
Dennis Zhuang fcefda611d chore: merge feat/narthex-label-node into feat/narthex-histogram-node 2026-10-23 08:27:17 +08:00
Dennis Zhuang b71676e72d chore: merge narthex into feat/narthex-label-node
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

# Conflicts:
#	src/promql/src/native/execute/tests.rs
#	src/query/src/promql/native_compile/tests.rs
2026-10-23 08:27:11 +08:00