diff --git a/.agents/README.md b/.agents/README.md
index d55aac50f06..8d21de0f1a2 100644
--- a/.agents/README.md
+++ b/.agents/README.md
@@ -11,16 +11,23 @@ Shared agent skills live in `.agents/skills`.
- Add or update shared skills under `.agents/skills//SKILL.md`.
- If a new skill does not appear, restart the agent or start a new thread.
-## Per-crate guides
+## Per-directory guides
-Hot crates carry an `AGENTS.md` next to their code as a navigation aid (module
-map, read/write paths, change-coupling points, test commands, gotchas):
+Read every `AGENTS.md` from the repository root down to the path being changed.
+The root guide applies everywhere; nested guides add rules and navigation for
+their subtree.
+- [`src/common/meta/AGENTS.md`](../src/common/meta/AGENTS.md) — metadata keys, KV backends, DDL procedures, and caches
+- [`src/query/AGENTS.md`](../src/query/AGENTS.md) — query planning, optimization, and distributed execution
+- [`src/servers/AGENTS.md`](../src/servers/AGENTS.md) — wire protocols and network servers
+- [`src/operator/AGENTS.md`](../src/operator/AGENTS.md) — statement, DDL/DML, and write orchestration
- [`src/mito2/AGENTS.md`](../src/mito2/AGENTS.md) — primary time-series storage engine
- [`src/metric-engine/AGENTS.md`](../src/metric-engine/AGENTS.md) — metrics engine (logical/physical regions)
- [`src/flow/AGENTS.md`](../src/flow/AGENTS.md) — stream processing / continuous aggregation
- [`src/frontend/AGENTS.md`](../src/frontend/AGENTS.md) — request entry point and orchestration
- [`src/meta-srv/AGENTS.md`](../src/meta-srv/AGENTS.md) — metadata and cluster coordination
+- [`tests/compatibility/AGENTS.md`](../tests/compatibility/AGENTS.md) — persisted/wire compatibility cases
+- [`tests/perf/AGENTS.md`](../tests/perf/AGENTS.md) — query regression harness and case DSL
## Architecture invariants
diff --git a/.agents/architecture-invariants.md b/.agents/architecture-invariants.md
index b7ce954c972..f290e1ce386 100644
--- a/.agents/architecture-invariants.md
+++ b/.agents/architecture-invariants.md
@@ -20,15 +20,18 @@ metadata KV values (`common-meta` keys, metric-engine metadata), and gRPC
messages. A node running an old version may read data written by a new one and
vice versa.
-- Add fields, don't repurpose or reorder them. For serde types use
- `#[serde(default)]` / `#[serde(alias)]`; never change the meaning of an existing
- field or the discriminant of an existing enum variant.
-- Monotonic version counters (e.g. the mito2 manifest version) only ever move
- forward — never reset or skip.
+- Preserve the contract of the actual encoding: Protobuf field numbers/types,
+ serde field and variant names, positional field order, and explicitly encoded
+ enum discriminants. Do not treat Rust declaration order as a wire contract
+ for name-based formats such as JSON.
+- Use `#[serde(default)]` for newly optional data and `#[serde(alias)]` for a
+ compatible rename. Do not reset or reuse versions within one persisted
+ history.
- When a change touches a persisted or wire format, add a case to the
- compatibility test suite. See `docs/rfcs/2025-07-04-compatibility-test-framework.md`
- — compatibility has been broken on releases before (v0.14.1, v0.15.1) precisely
- because this step was skipped.
+ compatibility test suite. Follow [`tests/compatibility/README.md`](../tests/compatibility/README.md)
+ and [`tests/compatibility/AGENTS.md`](../tests/compatibility/AGENTS.md). The
+ original compatibility RFC describes a superseded case format and is not the
+ current runbook.
- Wire types are generated from the external `greptime-proto` crate; change the
format there first, then bump the dependency (see invariant 6's pattern).
@@ -43,8 +46,8 @@ The workspace is layered; dependencies point downward only.
`file-engine`) implement it; `datanode` drives engines **through the trait**,
not through engine internals.
- `frontend` reaches storage through `operator` / `query` / `catalog`, not by
- depending on `datanode` internals. Standalone mode is the one bridge, via a
- `RegionServer` wrapper (`src/frontend/src/instance/standalone.rs`).
+ depending on `datanode` internals. Standalone mode is the one bridge, via the
+ `RegionServer` adapter in `src/standalone/src/datanode_manager.rs`.
- Do not introduce circular dependencies. New deps go through
`[workspace.dependencies]` in the root `Cargo.toml`, not per-crate version
literals.
@@ -54,9 +57,9 @@ The workspace is layered; dependencies point downward only.
Runtimes are partitioned by workload so one workload can't starve another. They
live in `common-runtime` (`src/common/runtime/`).
-- Use the categorized spawns — `spawn_global`, `spawn_query`, `spawn_ingest`,
- `spawn_compact`, `spawn_hb` — instead of constructing your own tokio runtime,
- and pick the category that matches the work.
+- Runtime construction belongs in process bootstrap or test/benchmark harnesses.
+ Product components use `spawn_global`, `spawn_query`, `spawn_ingest`,
+ `spawn_compact`, or `spawn_hb` instead of a component-local Tokio runtime.
- Run CPU-bound or synchronous-blocking work via `spawn_blocking_*`; never do
heavy CPU or blocking syscalls directly inside an async task.
- Never call `block_on*` from inside an async context or an engine worker — it
@@ -85,23 +88,19 @@ unfinished work merge without freezing it into the stable config surface.
When you stabilize such a feature, drop the prefix and document the migration.
-## 6. DataFusion is a pinned fork — two sections, two forms
+## 6. DataFusion is a pinned fork — workspace dependencies plus patches
GreptimeDB uses a fork at `GreptimeTeam/datafusion`, wired up in the root
-`Cargo.toml` through **two sections that hold different things**:
+`Cargo.toml` through two sections:
-- `[workspace.dependencies]` pins each DataFusion sub-crate to an **exact
- crates.io version** (e.g. `datafusion = "=53.1.0"`).
-- `[patch.crates-io]` redirects those same crates to the **fork at a git rev**
- (e.g. `datafusion = { git = ".../GreptimeTeam/datafusion.git", rev = "..." }`).
+- `[workspace.dependencies]` pins directly referenced sub-crates to an exact
+ crates.io version.
+- `[patch.crates-io]` redirects resolution to the fork. It may also contain
+ transitive-only sub-crates with no workspace dependency.
-So:
-
-- Adding a new DataFusion sub-crate dependency means adding it to **both**
- sections — the `=` entry under `[workspace.dependencies]` and the
- matching git-rev patch under `[patch.crates-io]`.
-- Upgrading DataFusion means bumping the version in `[workspace.dependencies]`
- **and** the rev in `[patch.crates-io]` together, for all of them.
+Add a direct dependency to `[workspace.dependencies]` and patch it if needed; a
+transitive-only override needs only the patch. Upgrade all exact pins and fork
+revisions together.
## 7. Enterprise-gated code is licensed differently from the rest
diff --git a/.agents/generated-files.md b/.agents/generated-files.md
index 1a16fcb28cf..23f7e81daf3 100644
--- a/.agents/generated-files.md
+++ b/.agents/generated-files.md
@@ -35,7 +35,14 @@ Edit the example TOMLs and/or the template, then regenerate. Do not edit
## Grafana dashboards
-Generated artifacts; regenerate rather than editing by hand.
+For the metrics dashboards, edit
+`grafana/dashboards/metrics/cluster/dashboard.json`. The generator derives the
+standalone `dashboard.json` by removing instance filters, then produces
+`dashboard.yaml` and `dashboard.md` for both cluster and standalone variants.
+Do not hand-edit those five derived files.
+
+`grafana/dashboards/events/dashboard.json` and
+`grafana/dashboards/logs/dashboard.json` are not outputs of this generator.
```bash
make dashboards
@@ -56,5 +63,6 @@ dependency.
## License headers
-Managed by the license-header tooling and the pre-commit hooks; let the tooling
-add/fix them rather than editing headers by hand.
+License headers are checked by `korandoru/hawkeye@v5` in
+`.github/workflows/checks.yml`. For enterprise-gated files, also update both
+license lists and run `make check-enterprise-license`.
diff --git a/.agents/skills/greptimedb-release-note/SKILL.md b/.agents/skills/greptimedb-release-note/SKILL.md
index a5cb47e9b02..893b99445ce 100644
--- a/.agents/skills/greptimedb-release-note/SKILL.md
+++ b/.agents/skills/greptimedb-release-note/SKILL.md
@@ -167,9 +167,10 @@ The release note is also published as a blog post in **`GreptimeTeam/docs`**.
git -C fetch origin main
git -C worktree add -b chore/X.Y.Z-release-note /tmp/docs-release-note origin/main
```
-- **The PR body must follow the docs repo's template** (`.github/pull_request_template.md` —
- "What's Changed in this PR" + a Checklist). Fill in the description; leave checklist boxes
- for the reviewer.
+- **Read and follow the current docs repo PR template**
+ (`.github/pull_request_template.md`) from the checkout used for the release.
+ Fill in every required section and leave reviewer-owned checklist boxes unchecked;
+ do not rely on hard-coded section names from an older template.
- Commit with sign-off, push, open a **draft** PR, then remove the worktree:
```
git -C /tmp/docs-release-note add blog/release-X-Y-Z.md
diff --git a/.cargo/config.toml b/.cargo/config.toml
index 53dcb05f335..9ffc1961b09 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -1,6 +1,9 @@
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
+[target.riscv64gc-unknown-linux-gnu]
+linker = "riscv64-linux-gnu-gcc"
+
[alias]
sqlness = "run --bin sqlness-runner --target-dir target/sqlness --"
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 549d6300ea1..e9e4d6ea561 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -6,8 +6,8 @@
## [Module] Database Engine
/src/index @evenyag @discord9 @WenyXu
-/src/mito2 @evenyag @v0y4g3r @waynexia
-/src/query @evenyag @waynexia @discord9
+/src/mito2 @evenyag @v0y4g3r
+/src/query @evenyag @discord9
## [Module] Distributed
/src/common/meta @MichaelScofield @WenyXu
@@ -20,8 +20,8 @@
/src/store-api @v0y4g3r @evenyag
## [Module] Metrics Engine
-/src/metric-engine @waynexia @WenyXu
-/src/promql @waynexia @evenyag @discord9
+/src/metric-engine @WenyXu @v0y4g3r
+/src/promql @evenyag @discord9
## [Module] Flow
-/src/flow @discord9 @waynexia
+/src/flow @discord9 @WenyXu
diff --git a/.github/actions/build-dev-builder-images/action.yml b/.github/actions/build-dev-builder-images/action.yml
index 41f69193969..1ca37101302 100644
--- a/.github/actions/build-dev-builder-images/action.yml
+++ b/.github/actions/build-dev-builder-images/action.yml
@@ -31,6 +31,10 @@ inputs:
description: Build dev-builder-android image
required: false
default: "true"
+ build-dev-builder-riscv64:
+ description: Build dev-builder-riscv64 image
+ required: false
+ default: "true"
runs:
using: composite
steps:
@@ -70,6 +74,21 @@ runs:
IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \
DEV_BUILDER_IMAGE_TAG=${{ inputs.version }}
+ - name: Build and push dev-builder-riscv64 image # Only build image for amd64 platform (it cross-compiles riscv64 binaries).
+ shell: bash
+ if: ${{ inputs.build-dev-builder-riscv64 == 'true' }}
+ run: |
+ make dev-builder-riscv64 \
+ IMAGE_REGISTRY=${{ inputs.dockerhub-image-registry }} \
+ IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \
+ DEV_BUILDER_RISCV64_IMAGE_TAG=${{ inputs.version }}
+ docker push ${{ inputs.dockerhub-image-registry }}/${{ inputs.dockerhub-image-namespace }}/dev-builder-riscv64:${{ inputs.version }}
+ if [[ "${{ github.event_name }}" == "push" ]]; then
+ docker tag ${{ inputs.dockerhub-image-registry }}/${{ inputs.dockerhub-image-namespace }}/dev-builder-riscv64:${{ inputs.version }} \
+ ${{ inputs.dockerhub-image-registry }}/${{ inputs.dockerhub-image-namespace }}/dev-builder-riscv64:latest
+ docker push ${{ inputs.dockerhub-image-registry }}/${{ inputs.dockerhub-image-namespace }}/dev-builder-riscv64:latest
+ fi
+
- name: Build and push dev-builder-android image # Only build image for amd64 platform.
shell: bash
if: ${{ inputs.build-dev-builder-android == 'true' }}
diff --git a/.github/runner-scale-sets/query-regression/README.md b/.github/runner-scale-sets/query-regression/README.md
index a1d58de7166..ce447dbdd0a 100644
--- a/.github/runner-scale-sets/query-regression/README.md
+++ b/.github/runner-scale-sets/query-regression/README.md
@@ -1,321 +1,184 @@
# Query regression self-hosted runners
-The `Query Regression` workflow uses the dedicated ARC runner scale set
-`perf-regression-8-cores`. ARC runner Pods run in the target Kubernetes cluster
-and connect outbound to GitHub. The live scale set is currently **paused**:
-`minRunners=0`, `maxRunners=0`, and no runner Pods. Do not resume it without
-explicit approval.
+The `Query Regression` workflow runs on **Aliyun ECS ephemeral runners**
+(`aliyun-ecs`, the default and only automated path): a `provision` job on
+`ubuntu-latest` creates one pay-as-you-go ECS instance per run, and the
+instance registers itself as an ephemeral GitHub runner with a per-run
+label. A `teardown` job (`if: always()`) deletes the instance;
+`query-regression-janitor.yml` sweeps tagged leftovers older than 4 hours
+daily.
-## Prerequisites and trust admission
+Build caches live on the instance's system disk, so **every run compiles
+cold**; only the within-run reuse (base build warms the candidate build
+through the shared target dir and sccache) applies. There is no retained
+data disk.
-Install the ARC scale set controller if it is not already installed:
+Dispatching with any other `runner` value uses it as a literal self-hosted
+runner label, which is how a manually prepared host (see
+`ecs-image/bootstrap-runner-host.sh`) runs the workflow. For PR labels, set
+the repository variable `QUERY_REGRESSION_PR_RUNNER` to such a label to
+redirect PR runs away from ECS.
+
+The office ARC scale set `perf-regression-8-cores` that previously ran this
+workflow is retired; see git history for its values files and pause/deploy
+procedures. Tearing down the office cluster (helm release, runner namespace,
+and the `query-regression-build-cache` PVC) is a manual operator action
+outside this repository. This directory keeps its historical
+`runner-scale-sets` name for path stability.
+
+## Nightly vs previous nightly
+
+`query-regression-nightly.yml` runs after a successful `GreptimeDB Nightly
+Build` (`workflow_run`). It resolves that run's `head_sha` as the candidate
+and the previous successful nightly (same branch, typically Friday when
+Monday's nightly fires) as the base, then calls `query-regression.yml` with
+those immutable SHAs. Both binaries are still compiled on the ECS runner;
+this is not an artifact-download path. `workflow_dispatch` can pass explicit
+`base_ref` / `candidate_ref` or a nightly run id. If there is no previous
+nightly, or both nightlies built the same commit, the comparison is skipped.
+
+## Aliyun ECS path
+
+Configuration lives in repository variables/secrets:
+
+| Kind | Name | Purpose |
+| --- | --- | --- |
+| secret | `ALICLOUD_ECS_ACCESS_KEY_ID` / `ALICLOUD_ECS_ACCESS_KEY_SECRET` | RAM user scoped to ECS RunInstances/DeleteInstances/Describe*/CreateImage/RunCommand. Used only by provision/teardown jobs on `ubuntu-latest`; never reaches the ECS instance. |
+| secret | `GH_PERSONAL_ACCESS_TOKEN` | Creates the short-lived runner registration token (shared with the jsonbench EC2 path). |
+| vars | `ALIYUN_ECS_REGION_ID` / `ALIYUN_ECS_VSWITCH_ID` / `ALIYUN_ECS_SECURITY_GROUP_ID` | Network placement. The security group should allow egress only; no inbound rules are needed. The vSwitch pins the zone. |
+| vars | `ALIYUN_ECS_INSTANCE_TYPE` | Dedicated (non-burstable, non-shared) instance family. Prefer 32 GiB (e.g. `ecs.g8i.2xlarge`); `ecs.c9i.2xlarge` is 8c16g and nightly thin-LTO of greptime peaks above that. Both base and candidate clusters run on the same machine, so noisy neighbors break thresholds. |
+| vars | `QUERY_REGRESSION_ECS_IMAGE_ID` | Custom image built by `ecs-image/build-ecs-image.py`. |
+
+The system disk is 40 GiB, which covers the image, a 16 GiB swapfile, the
+checkout, and cold build caches (target dir, cargo registry, sccache). ENOSPC
+stops the runner itself from writing logs, which GitHub reports as `The
+operation was canceled` with no telemetry, indistinguishable from a
+platform-side cancellation.
+cloud-init masks `systemd-oomd`, disables `unattended-upgrades` /
+`apt-daily-upgrade`, creates `/swapfile`, and sets `OOMPolicy=continue`
+on the runner unit. Ubuntu 24.04 defaults to `DefaultOOMPolicy=stop`,
+which SIGTERM-s the whole unit when rustc is OOM-killed and GitHub
+reports `The operation was canceled` with no telemetry. Unattended
+upgrades can do the same via `systemctl restart` of the runner after a
+library update; GitHub then records `UserCancelled` even though the job
+was still valid. Swap is a safety net for 16 GiB types, not a substitute
+for 32 GiB; linking on swap is slow.
+
+When a run dies with an unexplained `The operation was canceled` (no
+"Canceled by" banner, healthy machine), re-dispatch with `keep_instance`
+checked: the teardown job is skipped and the instance survives for
+post-mortem inspection. The security group is egress-only, so inspect via
+Cloud Assistant (`RunCommand`) or VNC: the runner's `_diag` logs under the
+runner home record reconnects and worker crashes, `journalctl -u
+ephemeral-github-runner.service` mirrors the console stream, `dmesg -T`
+shows kernel OOM kills, and `machine-telemetry.log` in the job workspace
+has the 30 s sampler history. The janitor sweep still deletes the instance
+after its TTL, so finish the inspection within that window.
+
+Trust model on the ECS path: the instance receives only the one-hour runner
+registration token via user data and holds no cloud credentials; the Aliyun
+AK/SK exist only in the control-plane jobs. Instance tags
+(`managed-by=query-regression-ci`, `query-regression-run-id`) feed the janitor
+sweep.
+
+### Building and updating the ECS image
+
+The runner `Dockerfile` in the parent directory stays the single source of the
+tool contract. Build a new ECS image from it:
```bash
-helm upgrade --install arc \
- oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller \
- --namespace arc-systems \
- --create-namespace \
- --version 0.14.2
+ALIBABA_CLOUD_ACCESS_KEY_ID=... ALIBABA_CLOUD_ACCESS_KEY_SECRET=... \
+uv run .github/runner-scale-sets/query-regression/ecs-image/build-ecs-image.py \
+ --region-id --vswitch-id --security-group-id \
+ --base-image-id
```
-Create the GitHub App secret in the runner namespace. Prefer an App limited to
-`GreptimeTeam/greptimedb`:
+The script boots a temporary builder instance, `docker build`s the runner
+image, materializes `/opt/rustup`, `/opt/cargo`, `/usr/local/bin` tools, and
+`/home/runner` (actions-runner) onto the host, installs the ephemeral-runner
+systemd unit from `ecs-image/`, and snapshots a custom image. It prints the
+image id; set it as `QUERY_REGRESSION_ECS_IMAGE_ID`, and bump
+`RUNNER_IMAGE_EPOCH` in `query-regression.yml` at the same time so the target
+cache invalidates. Builder sentinel polling requires the Cloud Assistant
+agent, which Aliyun public Ubuntu images include.
-```bash
-kubectl -n arc-runners create secret generic greptimedb-arc-github-app \
- --from-literal=github_app_id= \
- --from-literal=github_app_installation_id= \
- --from-file=github_app_private_key=
-```
-
-The values files here reference that secret by name.
+## Trust admission for PR runs
A maintainer applying the `query-regression` or `heavy-regression` label is
-**trust admission for that exact PR revision**. `query-regression` runs the six
-routine default cases; `heavy-regression` runs only the high-cardinality
-`prom_remote_write_7913` remote-write case. The admitted job may use this scale
-set's dedicated, writable persistent cache. `pull_request: labeled` is the only
-PR trigger: the label event snapshots its merge, head, and base SHAs. A queued
-job fetches that immutable event merge SHA directly, verifies it is a two-parent
-merge whose parents include the snapshotted head exactly once, and uses its
-other parent as the actual base build revision. The snapshotted event base is
-retained for audit only, so a difference from the merge's non-head parent is
-not a failure. The job never follows a newer mutable PR merge ref. An
-unavailable event merge, or one that does not contain exactly one snapshotted
-head parent, fails closed. A later PR head change does not retarget an already
-queued run: it may execute only its previously trusted event revision if that
-revision remains fetchable. To run the new revision, the maintainer must review
-it, remove the label, and re-add the desired regression label; cancel the old
-run if it is no longer wanted. An existing label does not automatically rerun
-the benchmark.
+**trust admission for that exact PR revision**. `query-regression` runs the
+six routine default cases; `heavy-regression` runs only the high-cardinality
+`prom_remote_write_7913` remote-write case. `pull_request: labeled` is the only PR
+trigger: the label event snapshots its merge, head, and base SHAs. A queued
+job fetches that immutable event merge SHA directly, verifies it is a
+two-parent merge whose parents include the snapshotted head exactly once, and
+uses its other parent as the actual base build revision. The snapshotted
+event base is retained for audit only, so a difference from the merge's
+non-head parent is not a failure. The job never follows a newer mutable PR
+merge ref. An unavailable event merge, or one that does not contain exactly
+one snapshotted head parent, fails closed. A later PR head change does not
+retarget an already queued run: it may execute only its previously trusted
+event revision if that revision remains fetchable. To run the new revision,
+the maintainer must review it, remove the label, and re-add the desired
+regression label; cancel the old run if it is no longer wanted. An existing
+label does not automatically rerun the benchmark.
-Admission does not relax runner hardening or GitHub permissions. Keep
-service-account token mounting disabled; do not mount host paths, the Docker
-socket, kubeconfig, or long-lived credentials. The runner and cache initializer
-use UID/GID 1001, disallow privilege escalation, drop all capabilities, and use
-the RuntimeDefault seccomp profile. Keep GitHub tokens least-privilege and
-review workflow changes before admission. Where the CNI supports it, restrict
-egress to required GitHub Actions, artifact/cache, Rust/crate/toolchain, DNS,
-and image-registry endpoints; block unrelated cluster services, private ranges,
-and metadata endpoints unless a case requires them.
-
-### Network routing prerequisite
-
-Required split routing is an **external environment-specific prerequisite**. The
-responsible network operator must route GitHub Actions, GitHub content,
-artifact/cache, crates.io, Rust toolchain, and image-registry traffic through
-the approved path rather than the VPN where applicable. Neither this repository
-nor Kubernetes configures that route. Verify it with the responsible network
-operator before any canary.
+Admission does not relax runner hardening or GitHub permissions. Keep the ECS
+instance free of cloud credentials and long-lived tokens, keep the security
+group egress-only, keep GitHub tokens least-privilege, and review workflow
+changes before admission.
## Runner image and workflow tools
-Build and push the derived runner image; it preserves the official
-`/home/runner/run.sh` entrypoint and supplies CI tools needed at runtime. The
-image builds `otelgen` from
+The runner `Dockerfile` builds `otelgen` from
[`WenyXu/otelgen`](https://github.com/WenyXu/otelgen) commit
[`863a3f395d062c7322cc1de08a38774b7fdaa6c8`](https://github.com/WenyXu/otelgen/commit/863a3f395d062c7322cc1de08a38774b7fdaa6c8)
-so trace cases do not download or compile tools during a benchmark run:
+so trace cases do not download or compile tools during a benchmark run. It is
+built only as a toolchain factory: `build-ecs-image.py` and
+`bootstrap-runner-host.sh` both materialize its contents onto a host, and the
+benchmark itself runs host-native.
-```bash
-docker build \
- --platform linux/amd64 \
- -f .github/runner-scale-sets/query-regression/Dockerfile \
- -t greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-query-regression-runner:latest \
- .github/runner-scale-sets/query-regression
-
-docker push greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-query-regression-runner:latest
-```
-
-Deploy by digest, not mutable tag, by updating both image references in
-`values-8-cores.yaml` after a rebuild. Update `RUNNER_IMAGE_DIGEST` and bump
-`RUNNER_IMAGE_EPOCH` in `query-regression.yml` at the same time. If the registry
-is private, use a dedicated read-only pull secret only as `imagePullSecrets`;
-never expose registry credentials to runner containers.
-Both digest-pinned init and runner containers use `IfNotPresent`: the immutable
-digest makes a cached image safe and avoids adding a registry dependency to every
-runner startup.
-
-The runner optionally imports only the non-sensitive `HTTP_PROXY`,
-`HTTPS_PROXY`, and `NO_PROXY` variables from the
-`query-regression-runner-local-env` ConfigMap. Manage that ConfigMap locally in
-the target namespace; private endpoint configuration must not be committed, and
-credentials or secrets must never be placed in a ConfigMap.
-
-Before builds, the workflow asserts UID/GID 1001 and exact image tool versions:
-`libprotoc 3.21.12`, `uv 0.11.26`, `mold 2.30.0`, `Python 3.12.3`, `sccache
-0.16.0`, `otelgen` commit `863a3f395d062c7322cc1de08a38774b7fdaa6c8`,
-root-owned `rustup 1.29.0`, and the image-baked
-`nightly-2026-03-21` Rust toolchain. Rustup, Cargo, and Rustc must resolve from
-`/opt/cargo/bin`; the runner cannot write `/opt/rustup` or `/opt/cargo/bin`.
-Protobuf well-known includes, including `google/protobuf/any.proto` and
-`google/protobuf/empty.proto`, are an image contract and must compile with
-`protoc`.
+Before builds, the workflow asserts the runner UID/GID (1001 in the ECS image;
+overridable via `QUERY_REGRESSION_RUNNER_UID`/`QUERY_REGRESSION_RUNNER_GID`)
+and exact tool versions: `libprotoc 3.21.12`, `uv 0.11.26`, `mold 2.40.4`,
+`Python 3.14.4`, `sccache 0.16.0`, `otelgen` commit
+`863a3f395d062c7322cc1de08a38774b7fdaa6c8`, root-owned `rustup 1.29.0`, and
+the image-baked `nightly-2026-03-21` Rust toolchain. `mold` and `python3`
+come from apt at image-build time (not Ubuntu 24.04's default 3.12); bump
+the Verify pins together with `QUERY_REGRESSION_ECS_IMAGE_ID` when the
+image is rebuilt. Rustup, Cargo, and Rustc
+must resolve from `/opt/cargo/bin`; the runner cannot write `/opt/rustup` or
+`/opt/cargo/bin`. Protobuf well-known includes, including
+`google/protobuf/any.proto` and `google/protobuf/empty.proto`, are an image
+contract and must compile with `protoc`.
`actions-rust-lang/setup-rust-toolchain@v1` is intentionally removed. The
-workflow sets its warning-denying mold `RUSTFLAGS` directly, disables automatic
-Rustup installation, and performs no runtime toolchain downloads.
+workflow sets its warning-denying mold `RUSTFLAGS` directly, disables
+automatic Rustup installation, and performs no runtime toolchain downloads.
-The workflow no longer uses GitHub `rust-cache`, `setup-protoc`, `setup-uv`, or
-runtime Rust setup: the image establishes immutable executable state and the PVC
-supplies only reusable Cargo data. Do not reintroduce those actions unless the
-corresponding cache or image contract changes.
+The workflow no longer uses GitHub `rust-cache`, `setup-protoc`, `setup-uv`,
+or runtime Rust setup: the image establishes immutable executable state and
+each instance's system disk holds only that run's Cargo data. Do not
+reintroduce those actions unless the image contract changes.
-## Capacity and persistent cache
+## Capacity
-`values-8-cores.yaml` is normal operation: `minRunners=0`, `maxRunners=1`.
-`values-paused.yaml` is the mandatory pause overlay: `minRunners=0`,
-`maxRunners=0`. The job uses group `query-regression-persistent-cache-v1`,
-`queue: max`, and `cancel-in-progress: false`; admitted jobs queue rather than
-replacing older pending jobs. During maintenance, cancel admitted queued runs as
-well as pausing ARC. Runner Pods have `activeDeadlineSeconds=12600`.
-The runner requests 6 CPU and limits at 8 CPU to preserve `minipc-3`
-allocatable-capacity scheduling headroom; do not reset the request to 8 CPU
-without revalidating scheduling capacity.
+Each run provisions its own ECS instance, so overlapping dispatches proceed
+in parallel. There is no workflow `concurrency` group. All Cargo state
+(`CARGO_HOME` including registry/git, `CARGO_TARGET_DIR`, sccache, cache
+metadata) lives on the 40 GiB system disk and is discarded with the VM.
+`RUSTUP_HOME=/opt/rustup` and `/opt/cargo/bin` are image-owned. The runner
+sets `RUSTC_WRAPPER=/usr/local/bin/sccache`,
+`SCCACHE_DIR=/home/runner/.cache/sccache`, `SCCACHE_CACHE_SIZE=10G`, and
+`CARGO_INCREMENTAL=0`. sccache uses its local disk backend and self-evicts
+at 10G. Base and candidate builds share the target on that disk; Cargo
+fingerprints invalidate source and dependency changes.
-The cache claim `query-regression-build-cache` is a nominal 600Gi `local-path`
-PVC in `arc-runners`. It is `ReadWriteOnce`; `local-path` uses
-WaitForFirstConsumer binding and Delete reclaim behavior, produces a
-node-affine local PV, is non-expandable, and the 600Gi request is not a hard
-storage quota. The runner's `minipc-3` selector is its only consumer candidate.
-
-The initializer mounts the PVC root at `/cache`, creates and write-tests these
-versioned subpaths as non-root UID/GID 1001, and the runner mounts them as:
-
-| Persistent state | PVC subpath | Runner mount |
-| --- | --- | --- |
-| Ephemeral Cargo home | `emptyDir` | `/home/runner/.cargo` |
-| Cargo registry data | `cargo-registry-v1` | `/home/runner/.cargo/registry` |
-| Cargo Git data | `cargo-git-v1` | `/home/runner/.cargo/git` |
-| Cargo target | `query-regression-target-v1` | `/home/runner/query-regression-target` |
-| Cache metadata | `meta-v1` | `/home/runner/query-regression-cache-meta` |
-| sccache local disk cache | `sccache-v1` | `/home/runner/.cache/sccache` |
-| Immutable Rust toolchain | image-owned | `/opt/rustup`, `/opt/cargo/bin` |
-
-The Pod security context uses UID/GID and `fsGroup` 1001 with
-`fsGroupChangePolicy: OnRootMismatch`; no privileged `chown` or raw `hostPath`
-is used. `CARGO_HOME` is a per-Pod `emptyDir`; only its nested `registry` and
-`git` mounts are persistent. `RUSTUP_HOME=/opt/rustup` and `/opt/cargo/bin` are
-image-owned immutable paths, while `CARGO_TARGET_DIR`, cache metadata, and
-`SCCACHE_DIR` are persistent absolute paths. The runner sets
-`RUSTC_WRAPPER=/usr/local/bin/sccache`,
-`SCCACHE_DIR=/home/runner/.cache/sccache`, `SCCACHE_CACHE_SIZE=40G`, and
-`CARGO_INCREMENTAL=0`. sccache uses its local PVC disk backend and self-evicts
-at 40G; do not add runtime downloads, object storage, or a shared backend.
-
-The repository's `.cargo/config.toml` remains a trusted per-revision build input.
-In contrast, `$CARGO_HOME/config*`, credentials, installed bins, and Cargo
-metadata outside the persistent `registry` and `git` data mounts are ephemeral
-and cannot survive to another Pod.
-
-The local disk backend has a one-server constraint. `maxRunners=1` and the
-unchanged `query-regression-persistent-cache-v1` workflow concurrency group
-serialize runs; do not increase runner capacity or relax that serialization
-while this backend is in use. Base and candidate builds share the target; Cargo
-fingerprints invalidate source and dependency changes. The workflow records the
-sccache version and relevant environment in the target ABI marker, starts and
-zeros sccache after cache and toolchain checks, shows initial/base/candidate
-statistics, and resets statistics between base and candidate builds.
-
-### Disk preflight and cleanup contract
-
-Before applying or unpausing, verify the backing filesystem on `minipc-3` has
-at least 900GiB free. The current local-path provisioner source is
-`/opt/local-path-provisioner`; measure the filesystem containing it:
-
-```bash
-df -PB1G /opt/local-path-provisioner
-```
-
-The workflow reports `du`, `df -P`, human-readable free space, and inode
-availability before builds and in an always-run report. Its cleanup is narrow
-and non-destructive:
-
-- warn at target size 400GiB; at 450GiB clear only the complete target root;
-- warn at Cargo registry-plus-Git data size 60GiB; at 80GiB remove only
- `registry/src` and `git/checkouts`, then abort if that persistent data remains
- at least 80GiB;
-- below 300GiB backing free space, clear the complete target root first,
- remeasure, then remove only those Cargo extracted trees and checkouts; abort
- if free space is still below 300GiB;
-- never automatically remove Cargo registry cache/index, Git database, the
- image-owned Cargo bin or Rustup toolchain, cache metadata, the self-evicting
- sccache directory, or the PVC.
-
-The target clear uses fixed absolute roots and removes all entries, including
-dotfiles. After migration validation, remove obsolete `cargo-home-v1` and
-`rustup-home-v1` only in explicit maintenance while ARC is 0/0 and no runner Pod
-exists; they are not mounted by the current configuration.
-
-## Deploy and pause safely
-
-First verify the configured external network route and the disk preflight. Apply the PVC; while
-the scale set is paused, it is expected to remain `Pending` because
-WaitForFirstConsumer has no scheduled runner:
-
-```bash
-kubectl apply --dry-run=server \
- -f .github/runner-scale-sets/query-regression/cache-pvc.yaml
-kubectl apply -f .github/runner-scale-sets/query-regression/cache-pvc.yaml
-```
-
-Render normal and paused configurations. Normal values are always first; the
-pause overlay is always last:
-
-```bash
-helm template perf-regression-8-cores \
- oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set \
- --namespace arc-runners --version 0.14.2 \
- --set controllerServiceAccount.name=arc-gha-rs-controller \
- --set controllerServiceAccount.namespace=arc-systems \
- -f .github/runner-scale-sets/query-regression/values-8-cores.yaml
-
-helm template perf-regression-8-cores \
- oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set \
- --namespace arc-runners --version 0.14.2 \
- --set controllerServiceAccount.name=arc-gha-rs-controller \
- --set controllerServiceAccount.namespace=arc-systems \
- -f .github/runner-scale-sets/query-regression/values-8-cores.yaml \
- -f .github/runner-scale-sets/query-regression/values-paused.yaml
-```
-
-The **first post-merge Helm deployment must reconcile the release in paused
-mode**. Keep the pause overlay last:
-
-```bash
-# First post-merge deployment and every return to paused mode: 0/0.
-helm upgrade --install perf-regression-8-cores \
- oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set \
- --namespace arc-runners --create-namespace --version 0.14.2 \
- --reset-values --wait \
- -f .github/runner-scale-sets/query-regression/values-8-cores.yaml \
- -f .github/runner-scale-sets/query-regression/values-paused.yaml
-
-# Expect 0/0 and no runner resources before considering normal mode.
-kubectl -n arc-runners get autoscalingrunnerset perf-regression-8-cores \
- -o jsonpath='{.spec.minRunners}{"/"}{.spec.maxRunners}{"\n"}'
-kubectl -n arc-runners get ephemeralrunners,pods \
- -l actions.github.com/scale-set-name=perf-regression-8-cores
-```
-
-Only after that verification and separate explicit approval, apply normal 0/1
-operation without the pause overlay:
-
-```bash
-helm upgrade --install perf-regression-8-cores \
- oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set \
- --namespace arc-runners --create-namespace --version 0.14.2 \
- --reset-values --wait \
- -f .github/runner-scale-sets/query-regression/values-8-cores.yaml
-```
-
-Do not use bare `helm rollback`, `--atomic`, or `--reuse-values`: a stored
-revision can restore nonzero runner capacity. Inspect rendered manifests for
-capacity, the `minipc-3` selector, cache claim and mounts, initializer,
-security context, and resources. After approved normal mode receives its first
-canary, the PVC binds to `minipc-3`.
-
-For local-PV node loss, cache recovery is intentionally disposable: return to
-0/0, recreate the PVC on a healthy node, cold-fill it, and run a new canary.
-
-## Canary and rollback
-
-With explicit approval, run two identical `workflow_dispatch` canaries on
-`perf-regression-8-cores`, using immutable full base and candidate commit SHAs
-and `cargo_profile=nightly`. The first is the cold fill; the second verifies warm
-reuse. Record the workflow's base/candidate build elapsed logs and cache
-ABI-marker output, initial/base/candidate sccache statistics, and cache report.
-Confirm the image tool contract (root-owned Rustup/Cargo paths, baked nightly,
-and non-writable `/opt` roots) and that the ephemeral Cargo home contains only
-the mounted registry/Git data before Cargo creates per-Pod state.
-Obtain dependency and tool network byte counters from the configured
-environment counter source, filtered to `minipc-3` and the dependency/tool
-destinations.
-
-Accept the canary only when all of the following hold:
-
-- exactly one runner Pod runs on `minipc-3`, and both jobs use the same bound PV;
-- UID/GID 1001 cache mounts are writable; the warm run does not invalidate the
- target or bulk-redownload crates or toolchains; sccache reports separate base
- and candidate build statistics without server or cache-path errors; immutable
- Rustup/Cargo roots remain non-writable and only registry/Git data persists;
-- warm base build time is at most 50% of cold base build time;
-- warm dependency/tool network bytes are at most 10% of cold fill bytes;
-- cache sizes remain below soft watermarks, node free space remains at least
- 300GiB, and the benchmark is correct without TLS EOFs or timeouts;
-- the configured environment counter source confirms this traffic is outside VPN
- accounting.
-
-Immediately return to 0/0 after either canary unless ongoing normal operation
-has been explicitly approved; return immediately on any traffic, cache, disk,
-TLS, or correctness failure. To roll back, use the paused Helm upgrade above,
-or another explicit `helm upgrade --install` with known-good values followed by
-`values-paused.yaml`, `--reset-values`, and `--wait`. Do not delete the PVC
-automatically; preserve it for diagnosis unless intentionally discarding cache.
+The workflow reports `du` / `df` in telemetry. It does not try to reclaim
+space across runs: a cold 40 GiB disk that fills up fails the build.
## Future optional phases
-The current phase uses a digest-pinned image with sccache 0.16.0 and no shared
-cache service. Optional follow-ups are an image additionally seeded with the
-exact Rust toolchain and `cargo fetch --locked`; or an internal read/write
-sccache backend or Cargo/Git mirror. Evaluate them only if persistent PVC reuse
-is insufficient.
+The current phase uses a materialized runner toolchain with sccache 0.16.0 and
+no shared cache service. Optional follow-ups are an image additionally seeded
+with `cargo fetch --locked` results, or an internal read/write sccache
+backend or Cargo/Git mirror. Evaluate them only if cold compile time on the
+system disk becomes the bottleneck.
diff --git a/.github/runner-scale-sets/query-regression/cache-pvc.yaml b/.github/runner-scale-sets/query-regression/cache-pvc.yaml
deleted file mode 100644
index 692f3a2d6e2..00000000000
--- a/.github/runner-scale-sets/query-regression/cache-pvc.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-apiVersion: v1
-kind: PersistentVolumeClaim
-metadata:
- name: query-regression-build-cache
- namespace: arc-runners
- labels:
- app.kubernetes.io/part-of: perf-regression-8-cores
-spec:
- volumeMode: Filesystem
- accessModes:
- - ReadWriteOnce
- storageClassName: local-path
- resources:
- requests:
- storage: 600Gi
diff --git a/.github/runner-scale-sets/query-regression/ecs-image/bootstrap-runner-host.sh b/.github/runner-scale-sets/query-regression/ecs-image/bootstrap-runner-host.sh
new file mode 100644
index 00000000000..883bbede092
--- /dev/null
+++ b/.github/runner-scale-sets/query-regression/ecs-image/bootstrap-runner-host.sh
@@ -0,0 +1,195 @@
+#!/usr/bin/env bash
+# Copyright 2023 Greptime Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Bootstrap an Ubuntu 24.04 host as a query-regression self-hosted runner.
+#
+# This is the host-native equivalent of the ECS image contract: it
+# installs docker-ce from Docker's official repository, builds the runner
+# image from the sibling Dockerfile (the single source of the tool contract),
+# materializes the toolchain onto the host, and optionally registers the
+# runner and installs its systemd service.
+#
+# Large state lives under --data-root (a data disk): docker's data-root, the
+# runner home, and the rustup/cargo toolchain roots, symlinked back to the
+# hard-coded contract paths (/home/runner, /opt/rustup, /opt/cargo).
+#
+# The script is idempotent: re-running refreshes the toolchain in place, and
+# the runner registration (.runner/.credentials) and _work survive. A live
+# runner service is stopped first and restarted at the end.
+#
+# Usage:
+# sudo bash bootstrap-runner-host.sh --repo-dir /path/to/greptimedb
+# sudo RUNNER_TOKEN= bash bootstrap-runner-host.sh --repo-dir . \
+# --register --repo-url https://github.com//
+#
+# Options:
+# --repo-dir PATH greptimedb checkout containing the runner Dockerfile (required)
+# --data-root PATH data disk mount point (default: /data)
+# --uid / --gid N runner user id (default: 3141; the ECS image contract is 1001)
+# --register also register the runner and install the systemd service
+# --repo-url URL repository URL for registration (required with --register)
+# --runner-name N runner name (default: qreg-host)
+# --labels L runner labels (default: perf-regression-8-cores)
+#
+# With --register, provide a fresh registration token via RUNNER_TOKEN.
+
+set -euo pipefail
+
+REPO_DIR=""
+DATA_ROOT="/data"
+RUNNER_UID="3141"
+RUNNER_GID="3141"
+REGISTER="false"
+REPO_URL=""
+RUNNER_NAME="qreg-host"
+RUNNER_LABELS="perf-regression-8-cores"
+IMAGE_TAG="qreg-runner:manual"
+
+while [[ $# -gt 0 ]]; do
+ case "$1" in
+ --repo-dir) REPO_DIR="$2"; shift 2 ;;
+ --data-root) DATA_ROOT="$2"; shift 2 ;;
+ --uid) RUNNER_UID="$2"; shift 2 ;;
+ --gid) RUNNER_GID="$2"; shift 2 ;;
+ --register) REGISTER="true"; shift ;;
+ --repo-url) REPO_URL="$2"; shift 2 ;;
+ --runner-name) RUNNER_NAME="$2"; shift 2 ;;
+ --labels) RUNNER_LABELS="$2"; shift 2 ;;
+ -h | --help) sed -n '17,40p' "$0"; exit 0 ;;
+ *) echo "Unknown argument: $1" >&2; exit 2 ;;
+ esac
+done
+
+[[ $EUID -eq 0 ]] || { echo "Run as root, e.g. sudo bash $0 ..." >&2; exit 1; }
+[[ -n "${REPO_DIR}" ]] || { echo "--repo-dir is required" >&2; exit 2; }
+DOCKERFILE="${REPO_DIR}/.github/runner-scale-sets/query-regression/Dockerfile"
+[[ -f "${DOCKERFILE}" ]] || { echo "Dockerfile not found at ${DOCKERFILE}" >&2; exit 1; }
+if [[ "${REGISTER}" == "true" ]]; then
+ [[ -n "${REPO_URL}" ]] || { echo "--repo-url is required with --register" >&2; exit 2; }
+ [[ -n "${RUNNER_TOKEN:-}" ]] || { echo "RUNNER_TOKEN env is required with --register" >&2; exit 2; }
+fi
+
+step() { printf '\n==> %s\n' "$*"; }
+
+# A re-run refreshes files under the (possibly live) runner service, so stop
+# it first and restart it at the end (unless --register re-creates it).
+RUNNER_SERVICE="$(systemctl list-units --type=service --all --no-legend 'actions.runner.*' 2>/dev/null | awk '{print $1}' | head -n 1 || true)"
+RUNNER_WAS_ACTIVE="false"
+if [[ -n "${RUNNER_SERVICE}" ]] && systemctl is-active --quiet "${RUNNER_SERVICE}"; then
+ step "Stop running runner service ${RUNNER_SERVICE}"
+ systemctl stop "${RUNNER_SERVICE}"
+ RUNNER_WAS_ACTIVE="true"
+fi
+
+step "Install docker-ce from Docker's official repository"
+for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do
+ apt-get remove -y "${pkg}" 2>/dev/null || true
+done
+apt-get update
+apt-get install -y ca-certificates curl
+install -m 0755 -d /etc/apt/keyrings
+curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
+chmod a+r /etc/apt/keyrings/docker.asc
+# shellcheck disable=SC1091
+. /etc/os-release
+tee /etc/apt/sources.list.d/docker.sources > /dev/null <&2
+ exit 1
+fi
+echo "{ \"data-root\": \"${DATA_ROOT}/docker\" }" > /etc/docker/daemon.json
+# containerd keeps its own content store (where build-time image data lands);
+# move it off the system disk too.
+mkdir -p /etc/containerd
+containerd config default | sed "s|root = \"/var/lib/containerd\"|root = \"${DATA_ROOT}/containerd\"|" > /etc/containerd/config.toml
+systemctl start containerd docker
+docker info | grep "Docker Root Dir"
+
+step "Build the runner image"
+docker build --platform linux/amd64 -f "${DOCKERFILE}" -t "${IMAGE_TAG}" "${REPO_DIR}"
+
+step "Materialize the toolchain onto the host"
+mkdir -p "${DATA_ROOT}/opt" "${DATA_ROOT}/runner" /opt /home
+container="$(docker create "${IMAGE_TAG}")"
+trap 'docker rm -f "${container}" >/dev/null 2>&1 || true' EXIT
+# The `/.` suffix copies directory *contents*, so re-running over an existing
+# materialization refreshes it in place instead of nesting runner/runner.
+# Files absent from the image (runner registration, _work) are preserved.
+docker cp "${container}:/home/runner/." "${DATA_ROOT}/runner"
+docker cp "${container}:/opt/rustup/." "${DATA_ROOT}/opt/rustup"
+docker cp "${container}:/opt/cargo/." "${DATA_ROOT}/opt/cargo"
+for tool in uv uvx otelgen sccache; do
+ docker cp "${container}:/usr/local/bin/${tool}" "/usr/local/bin/${tool}"
+done
+docker rm "${container}" > /dev/null
+trap - EXIT
+ln -sfn "${DATA_ROOT}/runner" /home/runner
+ln -sfn "${DATA_ROOT}/opt/rustup" /opt/rustup
+ln -sfn "${DATA_ROOT}/opt/cargo" /opt/cargo
+docker image rm "${IMAGE_TAG}" > /dev/null
+
+step "Install system packages"
+apt-get install -y --no-install-recommends \
+ build-essential clang cmake git gzip jq libprotobuf-dev libssl-dev mold \
+ openssh-client pkg-config protobuf-compiler python3 sudo tar unzip wget xz-utils zip zstd
+
+step "Create runner user (${RUNNER_UID}:${RUNNER_GID}) and environment"
+getent group "${RUNNER_GID}" > /dev/null || groupadd -g "${RUNNER_GID}" runner
+id -u runner > /dev/null 2>&1 || useradd -u "${RUNNER_UID}" -g "${RUNNER_GID}" -d /home/runner -s /bin/bash runner
+chown -R "${RUNNER_UID}:${RUNNER_GID}" "${DATA_ROOT}/runner"
+echo 'PATH=/opt/cargo/bin:/usr/local/bin:/usr/bin:/bin' > "${DATA_ROOT}/runner/.env"
+chown "${RUNNER_UID}:${RUNNER_GID}" "${DATA_ROOT}/runner/.env"
+
+if [[ "${REGISTER}" == "true" ]]; then
+ step "Register runner ${RUNNER_NAME} (labels: ${RUNNER_LABELS})"
+ if [[ -n "${RUNNER_SERVICE}" ]]; then
+ (cd /home/runner && ./svc.sh uninstall) || true
+ fi
+ runuser -u runner -- bash -c "cd /home/runner && HOME=/home/runner ./config.sh \
+ --url '${REPO_URL}' --token '${RUNNER_TOKEN}' --name '${RUNNER_NAME}' \
+ --labels '${RUNNER_LABELS}' --unattended --replace --disableupdate"
+
+ step "Install and start the runner service"
+ cd /home/runner
+ ./svc.sh install runner
+ ./svc.sh start
+ ./svc.sh status
+else
+ step "Skipping registration (pass --register --repo-url ... with RUNNER_TOKEN to enable)"
+ if [[ "${RUNNER_WAS_ACTIVE}" == "true" ]]; then
+ step "Restart runner service ${RUNNER_SERVICE}"
+ systemctl start "${RUNNER_SERVICE}"
+ systemctl --no-pager status "${RUNNER_SERVICE}" || true
+ fi
+fi
+
+step "Done"
+echo "Runner home: /home/runner -> ${DATA_ROOT}/runner"
+echo "Before each workflow run on this persistent host, clean transient cargo state:"
+echo " sudo rm -f /home/runner/.cargo/.package-cache"
+echo " sudo rm -rf /home/runner/.cargo/.global-cache"
diff --git a/.github/runner-scale-sets/query-regression/ecs-image/build-ecs-image.py b/.github/runner-scale-sets/query-regression/ecs-image/build-ecs-image.py
new file mode 100644
index 00000000000..7031917f910
--- /dev/null
+++ b/.github/runner-scale-sets/query-regression/ecs-image/build-ecs-image.py
@@ -0,0 +1,392 @@
+#!/usr/bin/env python3
+# Copyright 2023 Greptime Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# PEP 723 inline metadata (see .github/scripts/aliyun-ecs-runner-provision.py
+# for the convention).
+# /// script
+# requires-python = ">=3.10"
+# dependencies = [
+# "alibabacloud_ecs20140526>=4.1.0,<6",
+# "alibabacloud_tea_openapi>=0.3.12,<1",
+# ]
+# ///
+
+"""Build the query-regression ECS custom image (manual ops tool).
+
+Boots a temporary pay-as-you-go ECS instance from a public Ubuntu 24.04 image,
+builds the existing runner container image (the Dockerfile in the parent
+directory remains the single source of the tool contract), materializes the
+tool directories onto the host filesystem so the workflow's "Verify runner
+image tools" step holds unchanged, installs the ephemeral-runner systemd unit,
+and snapshots the result as a custom image. The temporary instance is deleted
+afterwards.
+
+Sentinel polling reads the instance's serial console output
+(GetInstanceConsoleOutput) and looks for marker lines the user data writes to
+/dev/console. This has no in-guest agent dependency.
+
+Usage:
+ uv run .github/runner-scale-sets/query-regression/ecs-image/build-ecs-image.py \
+ --region-id cn-hangzhou --vswitch-id vsw-... --security-group-id sg-... \
+ --base-image-id ubuntu_24_04_x64_20G_alibase_*.vhd
+"""
+
+from __future__ import annotations
+
+import argparse
+import base64
+import os
+import time
+from pathlib import Path
+
+ASSETS_DIR = Path(__file__).resolve().parent
+DONE_MARKER = "QREG_IMAGE_BUILD_DONE"
+FAILED_MARKER = "QREG_IMAGE_BUILD_FAILED"
+POLL_INTERVAL_SECONDS = 15
+CONSOLE_POLL_INTERVAL_SECONDS = 30
+BUILD_TIMEOUT_SECONDS = 60 * 60
+
+# Same apt package contract as the runner Dockerfile; the base
+# actions-runner image is Ubuntu 24.04, so an Ubuntu 24.04 host resolves the
+# same tool versions (protoc 3.21.12, mold 2.40.4, Python 3.14.4).
+# Docker itself comes from Docker's official repository (docker-ce), not the
+# distribution-packaged docker.io.
+APT_PACKAGES = [
+ "build-essential",
+ "ca-certificates",
+ "clang",
+ "cmake",
+ "curl",
+ "git",
+ "gpg",
+ "gzip",
+ "jq",
+ "libprotobuf-dev",
+ "libssl-dev",
+ "mold",
+ "openssh-client",
+ "pkg-config",
+ "protobuf-compiler",
+ "python3",
+ "sudo",
+ "tar",
+ "unzip",
+ "wget",
+ "xz-utils",
+ "zip",
+ "zstd",
+]
+
+DOCKER_CE_PACKAGES = "docker-ce docker-ce-cli containerd.io docker-buildx-plugin"
+
+
+def render_user_data(dockerfile: str, start_runner: str, unit: str) -> str:
+ dockerfile_b64 = base64.b64encode(dockerfile.encode()).decode()
+ start_runner_b64 = base64.b64encode(start_runner.encode()).decode()
+ unit_b64 = base64.b64encode(unit.encode()).decode()
+ packages = " ".join(APT_PACKAGES)
+ return f"""#!/bin/bash
+set -euo pipefail
+trap 'echo "{FAILED_MARKER} at line $LINENO" > /dev/console' ERR
+# Stream the full build log to the serial console so the poller (and anyone
+# watching GetInstanceConsoleOutput) sees real progress, not a silent login
+# prompt for the whole build.
+exec > >(tee -a /dev/console) 2>&1
+
+apt-get update
+DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends {packages}
+
+# Docker from the official repository, not the distribution-packaged docker.io.
+install -m 0755 -d /etc/apt/keyrings
+curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
+chmod a+r /etc/apt/keyrings/docker.gpg
+. /etc/os-release
+echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu ${{VERSION_CODENAME}} stable" \
+ > /etc/apt/sources.list.d/docker.list
+apt-get update
+DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends {DOCKER_CE_PACKAGES}
+
+base64 -d > /tmp/Dockerfile <<'EOF'
+{dockerfile_b64}
+EOF
+mkdir -p /tmp/image-context
+docker build --platform linux/amd64 -f /tmp/Dockerfile -t qreg-runner:local /tmp/image-context
+
+# Materialize the tool contract onto the host filesystem.
+container="$(docker create qreg-runner:local)"
+trap 'docker rm -f "${{container}}" >/dev/null 2>&1 || true' EXIT
+docker cp "${{container}}:/opt/rustup" /opt/rustup
+docker cp "${{container}}:/opt/cargo" /opt/cargo
+for tool in uv uvx otelgen sccache; do
+ docker cp "${{container}}:/usr/local/bin/${{tool}}" "/usr/local/bin/${{tool}}"
+done
+docker cp "${{container}}:/home/runner" /home/runner
+
+# Runner identity mirrors the container image (UID/GID 1001).
+groupadd --gid 1001 runner 2>/dev/null || true
+useradd --uid 1001 --gid 1001 --home-dir /home/runner --shell /bin/bash runner 2>/dev/null || true
+chown -R 1001:1001 /home/runner
+
+mkdir -p /opt/ephemeral-github-runner
+base64 -d > /opt/ephemeral-github-runner/start-runner.sh <<'EOF'
+{start_runner_b64}
+EOF
+chmod 0755 /opt/ephemeral-github-runner/start-runner.sh
+base64 -d > /etc/systemd/system/ephemeral-github-runner.service <<'EOF'
+{unit_b64}
+EOF
+systemctl daemon-reload
+systemctl enable ephemeral-github-runner.service
+
+# Keep the image free of the build-time docker state (also shrinks the
+# snapshot: buildkit cache is several GB).
+docker rm -f "${{container}}" >/dev/null
+docker system prune -af >/dev/null
+trap - EXIT
+
+echo "{DONE_MARKER}" > /dev/console
+"""
+
+
+def make_ecs_client(region_id: str):
+ from alibabacloud_ecs20140526.client import Client as EcsClient
+ from alibabacloud_tea_openapi.models import Config as OpenApiConfig
+
+ return EcsClient(
+ OpenApiConfig(
+ access_key_id=os.environ["ALIBABA_CLOUD_ACCESS_KEY_ID"],
+ access_key_secret=os.environ["ALIBABA_CLOUD_ACCESS_KEY_SECRET"],
+ region_id=region_id,
+ endpoint=f"ecs.{region_id}.aliyuncs.com",
+ )
+ )
+
+
+def wait_for_instance_status(client, region_id: str, instance_id: str, wanted: str, deadline: float) -> None:
+ from alibabacloud_ecs20140526 import models as ecs_models
+
+ import json
+
+ while time.monotonic() < deadline:
+ response = call_api_with_retry(
+ lambda: client.describe_instances(
+ ecs_models.DescribeInstancesRequest(
+ region_id=region_id, instance_ids=json.dumps([instance_id])
+ )
+ ),
+ "DescribeInstances",
+ )
+ instances = response.body.instances.instance
+ if instances and instances[0].status == wanted:
+ return
+ time.sleep(POLL_INTERVAL_SECONDS)
+ raise TimeoutError(f"Instance {instance_id} did not reach status {wanted} in time")
+
+
+# Aliyun error codes worth retrying: throttling and server-side faults. Client
+# errors (4xx: permissions, bad parameters) are configuration problems and must
+# fail fast instead of being retried.
+TRANSIENT_ERROR_CODES = {"Throttling", "Throttling.User", "InternalError", "ServiceUnavailable"}
+
+
+def is_transient(error: Exception) -> bool:
+ # UnretryableException comes from the darabonba network layer: connection
+ # reset, read timeout, DNS blip.
+ if type(error).__name__ == "UnretryableException":
+ return True
+ code = getattr(error, "code", "") or ""
+ status = getattr(error, "statusCode", None)
+ return code in TRANSIENT_ERROR_CODES or (isinstance(status, int) and status >= 500)
+
+
+def call_api_with_retry(fn, description: str, attempts: int = 5):
+ """Retry transient API/network failures; the build is too long to die on a blip.
+
+ Only call this with idempotent or safely-repeatable requests (reads,
+ StopInstance, CreateImage). Never with RunInstances: if the request
+ succeeded but the response was lost, a retry double-creates instances.
+ """
+ for attempt in range(1, attempts + 1):
+ try:
+ return fn()
+ except Exception as error: # noqa: BLE001
+ if attempt == attempts or not is_transient(error):
+ raise
+ print(f"{description} failed (attempt {attempt}/{attempts}): {error}", flush=True)
+ time.sleep(POLL_INTERVAL_SECONDS)
+ raise RuntimeError("unreachable: retry loop exited without returning")
+
+
+def read_console_output(client, region_id: str, instance_id: str) -> str:
+ """Fetch the instance's serial console output; no in-guest agent needed."""
+ from alibabacloud_ecs20140526 import models as ecs_models
+
+ response = call_api_with_retry(
+ lambda: client.get_instance_console_output(
+ ecs_models.GetInstanceConsoleOutputRequest(region_id=region_id, instance_id=instance_id)
+ ),
+ "GetInstanceConsoleOutput",
+ )
+ return base64.b64decode(response.body.console_output or "").decode("utf-8", "replace")
+
+
+def main() -> int:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--region-id", default=os.environ.get("ALIYUN_ECS_REGION_ID"))
+ parser.add_argument("--vswitch-id", default=os.environ.get("ALIYUN_ECS_VSWITCH_ID"))
+ parser.add_argument("--security-group-id", default=os.environ.get("ALIYUN_ECS_SECURITY_GROUP_ID"))
+ parser.add_argument("--base-image-id", default=os.environ.get("ALIYUN_ECS_BASE_IMAGE_ID"))
+ parser.add_argument("--resource-group-id", default=os.environ.get("ALIYUN_ECS_RESOURCE_GROUP_ID"))
+ parser.add_argument("--instance-type", default="ecs.g7.xlarge")
+ parser.add_argument("--image-name", default=None, help="Defaults to a timestamped name.")
+ args = parser.parse_args()
+
+ for name in ("region_id", "vswitch_id", "security_group_id", "base_image_id"):
+ if not getattr(args, name):
+ raise SystemExit(f"Missing required configuration: --{name.replace('_', '-')}")
+
+ from alibabacloud_ecs20140526 import models as ecs_models
+
+ client = make_ecs_client(args.region_id)
+ image_name = args.image_name or time.strftime(
+ "greptimedb-query-regression-runner-%Y%m%d%H%M%S", time.gmtime()
+ )
+
+ user_data = base64.b64encode(
+ render_user_data(
+ (ASSETS_DIR.parent / "Dockerfile").read_text(),
+ (ASSETS_DIR / "start-runner.sh").read_text(),
+ (ASSETS_DIR / "ephemeral-github-runner.service").read_text(),
+ ).encode()
+ ).decode()
+
+ instance_id = None
+ try:
+ response = client.run_instances(
+ ecs_models.RunInstancesRequest(
+ region_id=args.region_id,
+ image_id=args.base_image_id,
+ resource_group_id=args.resource_group_id,
+ instance_type=args.instance_type,
+ v_switch_id=args.vswitch_id,
+ security_group_id=args.security_group_id,
+ instance_name=f"build-{image_name}",
+ description="Temporary builder for the query-regression ECS image",
+ amount=1,
+ instance_charge_type="PostPaid",
+ spot_strategy="NoSpot",
+ internet_charge_type="PayByTraffic",
+ internet_max_bandwidth_out=100,
+ # Peak usage is ~18G (OS+apt, docker image, and the materialized
+ # toolchain coexist briefly): deliberately tight, and a smaller
+ # disk makes the image snapshot faster. Instances created from
+ # the image get a larger system disk from the provision side.
+ system_disk=ecs_models.RunInstancesRequestSystemDisk(
+ category="cloud_essd", size="20"
+ ),
+ user_data=user_data,
+ tag=[
+ ecs_models.RunInstancesRequestTag(key="managed-by", value="query-regression-ci"),
+ ecs_models.RunInstancesRequestTag(key="role", value="image-builder"),
+ ],
+ )
+ )
+ instance_id = response.body.instance_id_sets.instance_id_set[0]
+ print(f"Builder instance: {instance_id}", flush=True)
+ wait_for_instance_status(client, args.region_id, instance_id, "Running", time.monotonic() + 10 * 60)
+
+ deadline = time.monotonic() + BUILD_TIMEOUT_SECONDS
+ while time.monotonic() < deadline:
+ console = read_console_output(client, args.region_id, instance_id)
+ if DONE_MARKER in console:
+ break
+ if FAILED_MARKER in console:
+ tail = "\n".join(console.splitlines()[-20:])
+ raise RuntimeError(f"Image build failed on the builder; console tail:\n{tail}")
+ lines = console.splitlines()
+ print(f"Build in progress; last console line: {lines[-1] if lines else '(none yet)'}", flush=True)
+ time.sleep(CONSOLE_POLL_INTERVAL_SECONDS)
+ else:
+ raise TimeoutError("Image build did not finish in time")
+
+ print("Stopping builder before image creation", flush=True)
+ try:
+ call_api_with_retry(
+ lambda: client.stop_instance(
+ ecs_models.StopInstanceRequest(
+ instance_id=instance_id,
+ # The instance is deleted right after the snapshot, but
+ # there is no reason to keep billing vCPU during the stop.
+ stopped_mode="StopCharging",
+ )
+ ),
+ "StopInstance",
+ )
+ except Exception as error: # noqa: BLE001
+ # Instance families with local disks do not support StopCharging.
+ print(f"StopCharging unavailable ({error}); stopping with default mode", flush=True)
+ call_api_with_retry(
+ lambda: client.stop_instance(ecs_models.StopInstanceRequest(instance_id=instance_id)),
+ "StopInstance",
+ )
+ wait_for_instance_status(client, args.region_id, instance_id, "Stopped", time.monotonic() + 10 * 60)
+
+ image = call_api_with_retry(
+ lambda: client.create_image(
+ ecs_models.CreateImageRequest(
+ region_id=args.region_id, instance_id=instance_id, image_name=image_name
+ )
+ ),
+ "CreateImage",
+ )
+ image_id = image.body.image_id
+ deadline = time.monotonic() + 60 * 60
+ while time.monotonic() < deadline:
+ description = call_api_with_retry(
+ lambda: client.describe_images(
+ ecs_models.DescribeImagesRequest(region_id=args.region_id, image_id=image_id)
+ ),
+ "DescribeImages",
+ )
+ images = description.body.images.image
+ if images:
+ status = images[0].status
+ print(f"Image {image_id} status: {status} (progress {images[0].progress})", flush=True)
+ if status == "Available":
+ break
+ time.sleep(POLL_INTERVAL_SECONDS)
+ else:
+ raise TimeoutError(
+ f"Image {image_id} did not become Available in time. The snapshot "
+ f"continues server-side: check its status in the console and reuse it "
+ f"once Available instead of rebuilding."
+ )
+
+ print(f"Custom image ready: {image_id} ({image_name})", flush=True)
+ print(f"Set the repo variable QUERY_REGRESSION_ECS_IMAGE_ID={image_id}", flush=True)
+ return 0
+ finally:
+ if instance_id:
+ try:
+ client.delete_instance(
+ ecs_models.DeleteInstanceRequest(instance_id=instance_id, force=True)
+ )
+ print(f"Deleted builder instance {instance_id}", flush=True)
+ except Exception as error: # noqa: BLE001
+ print(f"Failed to delete builder instance {instance_id}: {error}", flush=True)
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/.github/runner-scale-sets/query-regression/ecs-image/ephemeral-github-runner.service b/.github/runner-scale-sets/query-regression/ecs-image/ephemeral-github-runner.service
new file mode 100644
index 00000000000..a1cbe6a4503
--- /dev/null
+++ b/.github/runner-scale-sets/query-regression/ecs-image/ephemeral-github-runner.service
@@ -0,0 +1,45 @@
+# Copyright 2023 Greptime Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+[Unit]
+Description=Ephemeral GitHub Actions runner
+After=network-online.target
+Wants=network-online.target
+# cloud-final runs the provision user data, which writes
+# /etc/ephemeral-github-runner.env and the drop-ins below. Ordering after it
+# makes the runner come up configured on first boot, no restart needed.
+# (cloud-init's `systemctl restart` in user data remains as the bridge for
+# images built before this ordering existed.)
+After=cloud-final.service
+
+[Service]
+Type=simple
+# The toolchain lives in the image at /opt/cargo/bin (the Dockerfile's ENV
+# PATH does not survive materialization onto the host). Publish it here so
+# every runner job inherits it. /etc/ephemeral-github-runner.env currently
+# carries the same PATH line as a bridge for images built before this
+# directive existed; EnvironmentFile is applied after Environment=, and the
+# two values are kept identical, so there is no conflict.
+Environment=PATH=/opt/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+EnvironmentFile=/etc/ephemeral-github-runner.env
+ExecStart=/opt/ephemeral-github-runner/start-runner.sh
+Restart=no
+# If the kernel OOM killer kills a job child (rustc/cargo), keep the runner
+# service alive so the job is reported as a normal failure with logs instead
+# of the runner vanishing and GitHub reporting a cancellation. cloud-init's
+# oom.conf drop-in carries the same directive for images built before this.
+OOMPolicy=continue
+
+[Install]
+WantedBy=multi-user.target
diff --git a/.github/runner-scale-sets/query-regression/ecs-image/start-runner.sh b/.github/runner-scale-sets/query-regression/ecs-image/start-runner.sh
new file mode 100644
index 00000000000..a6aff87ca22
--- /dev/null
+++ b/.github/runner-scale-sets/query-regression/ecs-image/start-runner.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# Copyright 2023 Greptime Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Configure and start the ephemeral GitHub Actions runner on an ECS instance.
+# Baked into the custom image at /opt/ephemeral-github-runner/ by
+# build-ecs-image.py; the per-run environment is written by cloud-init to
+# /etc/ephemeral-github-runner.env.
+set -euo pipefail
+
+# shellcheck disable=SC1091
+source /etc/ephemeral-github-runner.env
+
+export HOME=/home/runner
+cd /home/runner
+
+if [[ ! -f /home/runner/.runner ]]; then
+ runuser -u runner -- ./config.sh \
+ --url "${REPO_URL}" \
+ --token "${RUNNER_TOKEN}" \
+ --name "${RUNNER_NAME}" \
+ --labels "${RUNNER_LABELS}" \
+ --ephemeral --unattended --replace --disableupdate
+fi
+
+exec runuser -u runner -- ./run.sh
diff --git a/.github/runner-scale-sets/query-regression/values-8-cores.yaml b/.github/runner-scale-sets/query-regression/values-8-cores.yaml
deleted file mode 100644
index cff1322680b..00000000000
--- a/.github/runner-scale-sets/query-regression/values-8-cores.yaml
+++ /dev/null
@@ -1,146 +0,0 @@
-githubConfigUrl: "https://github.com/GreptimeTeam/greptimedb"
-githubConfigSecret: greptimedb-arc-github-app
-
-runnerScaleSetName: "perf-regression-8-cores"
-minRunners: 0
-maxRunners: 1
-
-template:
- spec:
- automountServiceAccountToken: false
- activeDeadlineSeconds: 12600
- nodeSelector:
- kubernetes.io/hostname: minipc-3
- securityContext:
- runAsNonRoot: true
- runAsUser: 1001
- runAsGroup: 1001
- fsGroup: 1001
- fsGroupChangePolicy: OnRootMismatch
- seccompProfile:
- type: RuntimeDefault
- volumes:
- - name: cargo-home
- emptyDir: {}
- - name: build-cache
- persistentVolumeClaim:
- claimName: query-regression-build-cache
- initContainers:
- - name: initialize-build-cache
- image: greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-query-regression-runner@sha256:e713b294e23b7e15184e558866c90025e59930033e72c97650dbc7f1ca022d11
- imagePullPolicy: IfNotPresent
- command:
- - /bin/sh
- - -ec
- - |
- umask 0002
- for directory in cargo-registry-v1 cargo-git-v1 query-regression-target-v1 meta-v1 sccache-v1; do
- cache_directory="/cache/${directory}"
- mkdir -p "${cache_directory}"
- test -w "${cache_directory}"
- probe_file="${cache_directory}/.write-probe"
- : > "${probe_file}"
- test -f "${probe_file}"
- rm "${probe_file}"
- done
- securityContext:
- runAsNonRoot: true
- runAsUser: 1001
- runAsGroup: 1001
- allowPrivilegeEscalation: false
- capabilities:
- drop:
- - ALL
- resources:
- requests:
- cpu: 100m
- memory: 128Mi
- ephemeral-storage: 1Gi
- limits:
- cpu: 500m
- memory: 512Mi
- ephemeral-storage: 1Gi
- volumeMounts:
- - name: build-cache
- mountPath: /cache
- containers:
- - name: runner
- image: greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/greptimedb-query-regression-runner@sha256:e713b294e23b7e15184e558866c90025e59930033e72c97650dbc7f1ca022d11
- imagePullPolicy: IfNotPresent
- command: ["/home/runner/run.sh"]
- env:
- - name: CARGO_HOME
- value: /home/runner/.cargo
- - name: HTTP_PROXY
- valueFrom:
- configMapKeyRef:
- name: query-regression-runner-local-env
- key: HTTP_PROXY
- optional: true
- - name: HTTPS_PROXY
- valueFrom:
- configMapKeyRef:
- name: query-regression-runner-local-env
- key: HTTPS_PROXY
- optional: true
- - name: NO_PROXY
- valueFrom:
- configMapKeyRef:
- name: query-regression-runner-local-env
- key: NO_PROXY
- optional: true
- - name: UV_CACHE_DIR
- value: /home/runner/.cargo/uv-cache
- - name: RUSTUP_HOME
- value: /opt/rustup
- - name: RUSTUP_TOOLCHAIN
- value: nightly-2026-03-21
- - name: RUSTUP_AUTO_INSTALL
- value: "0"
- - name: CARGO_TARGET_DIR
- value: /home/runner/query-regression-target
- - name: QUERY_REGRESSION_CACHE_META
- value: /home/runner/query-regression-cache-meta
- - name: RUSTC_WRAPPER
- value: /usr/local/bin/sccache
- - name: SCCACHE_DIR
- value: /home/runner/.cache/sccache
- - name: SCCACHE_CACHE_SIZE
- value: 40G
- - name: CARGO_INCREMENTAL
- value: "0"
- securityContext:
- runAsNonRoot: true
- runAsUser: 1001
- runAsGroup: 1001
- allowPrivilegeEscalation: false
- capabilities:
- drop:
- - ALL
- resources:
- requests:
- cpu: "6"
- memory: 24Gi
- ephemeral-storage: 80Gi
- limits:
- cpu: "8"
- memory: 24Gi
- ephemeral-storage: 80Gi
- volumeMounts:
- - name: cargo-home
- mountPath: /home/runner/.cargo
- - name: build-cache
- mountPath: /home/runner/.cargo/registry
- subPath: cargo-registry-v1
- - name: build-cache
- mountPath: /home/runner/.cargo/git
- subPath: cargo-git-v1
- - name: build-cache
- mountPath: /home/runner/query-regression-target
- subPath: query-regression-target-v1
- - name: build-cache
- mountPath: /home/runner/query-regression-cache-meta
- subPath: meta-v1
- - name: build-cache
- mountPath: /home/runner/.cache/sccache
- subPath: sccache-v1
diff --git a/.github/runner-scale-sets/query-regression/values-paused.yaml b/.github/runner-scale-sets/query-regression/values-paused.yaml
deleted file mode 100644
index fe734ef7615..00000000000
--- a/.github/runner-scale-sets/query-regression/values-paused.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-minRunners: 0
-maxRunners: 0
diff --git a/.github/scripts/aliyun-ecs-runner-provision.py b/.github/scripts/aliyun-ecs-runner-provision.py
new file mode 100644
index 00000000000..74a69681f3d
--- /dev/null
+++ b/.github/scripts/aliyun-ecs-runner-provision.py
@@ -0,0 +1,485 @@
+#!/usr/bin/env python3
+# Copyright 2023 Greptime Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This is the first `.github/scripts/` user of PEP 723 inline script metadata:
+# `uv run` installs the pinned Aliyun SDK before executing. The SDK import stays
+# lazy (inside `make_ecs_client`) so unit tests can import this module with a
+# plain stdlib interpreter.
+# /// script
+# requires-python = ">=3.10"
+# dependencies = [
+# # Pin exactly after the first live run against the Aliyun API.
+# "alibabacloud_ecs20140526>=4.1.0,<6",
+# "alibabacloud_tea_openapi>=0.3.12,<1",
+# ]
+# ///
+
+"""Provision an ephemeral Aliyun ECS query-regression runner.
+
+Creates one pay-as-you-go ECS instance from the query-regression custom image
+and waits until the instance registers itself as an ephemeral GitHub Actions
+runner with a per-run label. Build caches live on the instance system disk
+and disappear with the VM. The instance id is written to job outputs as soon
+as the VM exists so the teardown job is the single DeleteInstance caller (a
+timeout here used to delete and then teardown deleted again). On runner
+online timeout the console is dumped and the job fails; teardown releases
+the instance.
+
+The Aliyun credentials are used only in this control-plane job (ubuntu-latest)
+and are never passed to the ECS instance; the instance receives only a
+short-lived GitHub runner registration token via user data.
+"""
+
+from __future__ import annotations
+
+import argparse
+import base64
+import json
+import os
+import time
+import urllib.error
+import urllib.request
+from dataclasses import dataclass
+
+RUNNER_NAME_PREFIX = "qreg-ecs"
+RUNNER_LABEL_PREFIX = "query-regression-ecs"
+MANAGED_BY_TAG_KEY = "managed-by"
+MANAGED_BY_TAG_VALUE = "query-regression-ci"
+RUN_TAG_KEY = "query-regression-run-id"
+
+# Runner cache paths on the instance system disk. They are created empty
+# every provision and deleted with the VM.
+CACHE_PATHS = (
+ "/home/runner/.cargo/registry",
+ "/home/runner/.cargo/git",
+ "/home/runner/query-regression-target",
+ "/home/runner/query-regression-cache-meta",
+ "/home/runner/.cache/sccache",
+)
+
+RUNNER_ONLINE_TIMEOUT_SECONDS = 10 * 60
+POLL_INTERVAL_SECONDS = 5
+
+# Nightly thin-LTO of greptime peaks above ecs.c9i.2xlarge's 16 GiB. A swap
+# file plus masking systemd-oomd lets the kernel reclaim rustc pages instead
+# of SIGTERM-ing the runner service cgroup (GitHub then reports the step as
+# "The operation was canceled"). Sized to match that 16 GiB instance; a
+# 32 GiB type still benefits as a safety net. Lives on the system disk next
+# to the cold build caches.
+SWAP_FILE = "/swapfile"
+SWAP_SIZE_GIB = 16
+
+
+@dataclass(frozen=True)
+class ProvisionConfig:
+ region_id: str
+ vswitch_id: str
+ security_group_id: str
+ image_id: str
+ instance_type: str
+ repo: str
+ run_id: str
+ github_token: str
+ # Optional resource group; required when the RAM grant is scoped to one.
+ resource_group_id: str | None = None
+ # Runner identity inside the image; the workflow asserts the same values.
+ runner_uid: str = "1001"
+ runner_gid: str = "1001"
+
+
+def runner_name_for_run(run_id: str) -> str:
+ return f"{RUNNER_NAME_PREFIX}-{run_id}"
+
+
+def runner_label_for_run(run_id: str) -> str:
+ return f"{RUNNER_LABEL_PREFIX}-{run_id}"
+
+
+def render_user_data(
+ runner_name: str,
+ runner_label: str,
+ runner_token: str,
+ repo: str,
+ runner_uid: str = "1001",
+ runner_gid: str = "1001",
+) -> str:
+ """Render the cloud-init shell script for the runner instance."""
+ destinations = " ".join(f'"{dst}"' for dst in CACHE_PATHS)
+ cache_setup = f"""# Caches live on the system disk, are deleted with the instance, and every
+# run compiles cold. Within-run reuse (base warming candidate via the shared
+# target dir and sccache) still applies.
+mkdir -p {destinations}
+chown -R {runner_uid}:{runner_gid} /home/runner"""
+ swap_setup = f"""# Mask systemd-oomd before enabling swap: Ubuntu 24.04 kills the whole
+# service cgroup on PSI pressure, and swap thrashing looks like pressure.
+systemctl disable --now systemd-oomd.socket systemd-oomd.service || true
+systemctl mask systemd-oomd.socket systemd-oomd.service || true
+# apt-daily-upgrade / unattended-upgrades can `systemctl restart` services
+# whose libraries were updated. That SIGTERM-s the runner mid-job; GitHub
+# records UserCancelled (job still valid, child exit 143). These VMs live
+# ~1h; security updates belong in the image, not at job time.
+systemctl disable --now unattended-upgrades.service apt-daily.timer apt-daily-upgrade.timer apt-daily.service apt-daily-upgrade.service || true
+systemctl mask unattended-upgrades.service apt-daily.timer apt-daily-upgrade.timer apt-daily.service apt-daily-upgrade.service || true
+systemctl stop unattended-upgrades.service || true
+killall -9 unattended-upgr || true
+cat > /etc/apt/apt.conf.d/99disable-auto-updates <<'APTEOF'
+APT::Periodic::Update-Package-Lists "0";
+APT::Periodic::Unattended-Upgrade "0";
+APT::Periodic::Download-Upgradeable-Packages "0";
+APTEOF
+if [[ ! -f "{SWAP_FILE}" ]]; then
+ fallocate --length {SWAP_SIZE_GIB}G "{SWAP_FILE}"
+ chmod 600 "{SWAP_FILE}"
+ mkswap "{SWAP_FILE}"
+fi
+swapon "{SWAP_FILE}"
+sysctl --write vm.swappiness=10
+swapon --show
+free --human"""
+ return f"""#!/bin/bash
+set -euo pipefail
+
+{cache_setup}
+
+{swap_setup}
+
+cat > /etc/ephemeral-github-runner.env <<'ENVEOF'
+RUNNER_NAME={runner_name}
+RUNNER_LABELS={runner_label}
+RUNNER_TOKEN={runner_token}
+REPO_URL=https://github.com/{repo}
+# The container image baked /opt/cargo/bin into PATH via Dockerfile ENV; on
+# the host nothing inherits that, so publish it through the unit's
+# EnvironmentFile: runner job processes inherit the runner's environment.
+PATH=/opt/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ENVEOF
+
+# Stream the runner service's own logs (config output, job lifecycle, crash
+# messages) to the serial console, next to the kernel's OOM-killer records.
+# Teardown dumps the console tail before deleting the instance, so the
+# witness of what killed the runner survives the machine.
+mkdir -p /etc/systemd/system/ephemeral-github-runner.service.d
+cat > /etc/systemd/system/ephemeral-github-runner.service.d/console.conf <<'CONFEOF'
+[Service]
+StandardOutput=journal+console
+StandardError=journal+console
+CONFEOF
+# systemd's DefaultOOMPolicy=stop SIGTERM-s the whole unit when *any*
+# process in the cgroup is OOM-killed (typically rustc during thin LTO).
+# That is the "Session terminated, killing shell..." / job Canceled path:
+# runuser dies, GitHub deletes the ephemeral registration, always() steps
+# never run. continue keeps the runner up so cargo can report signal 9.
+cat > /etc/systemd/system/ephemeral-github-runner.service.d/oom.conf <<'CONFEOF'
+[Service]
+OOMPolicy=continue
+CONFEOF
+systemctl daemon-reload
+# restart (not start): the image enables this unit, so it may already
+# have come up without the drop-ins if it raced cloud-init. restart
+# applies OOMPolicy=continue to the running cgroup. --no-block matters:
+# newer image units carry After=cloud-final.service, and this script IS
+# cloud-final — a blocking restart would deadlock until TimeoutStartSec.
+systemctl restart --no-block ephemeral-github-runner.service
+"""
+
+
+def encode_user_data(script: str) -> str:
+ return base64.b64encode(script.encode("utf-8")).decode("ascii")
+
+
+def github_api(token: str, method: str, path: str, body: dict | None = None) -> dict:
+ data = json.dumps(body).encode("utf-8") if body is not None else None
+ request = urllib.request.Request(
+ f"https://api.github.com{path}",
+ data=data,
+ method=method,
+ headers={
+ "Accept": "application/vnd.github+json",
+ "Authorization": f"Bearer {token}",
+ "X-GitHub-Api-Version": "2022-11-28",
+ },
+ )
+ try:
+ with urllib.request.urlopen(request, timeout=30) as response:
+ return json.loads(response.read().decode("utf-8"))
+ except urllib.error.HTTPError as error:
+ # GitHub's error body says exactly why (e.g. "Must have admin rights to
+ # Repository" for a PAT without the required scope); surface it instead
+ # of a bare "HTTP Error 403".
+ body = error.read().decode("utf-8", "replace")
+ raise SystemExit(
+ f"GitHub API {method} {path} failed: HTTP {error.code}: {body}\n"
+ "The token comes from the GH_PERSONAL_ACCESS_TOKEN secret; it needs "
+ "'repo' scope (classic PAT) or 'Administration: write' on the "
+ "repository (fine-grained PAT)."
+ ) from error
+
+
+def create_registration_token(github_token: str, repo: str) -> str:
+ response = github_api(
+ github_token,
+ "POST",
+ f"/repos/{repo}/actions/runners/registration-token",
+ body={},
+ )
+ return response["token"]
+
+
+def find_runner_by_name(github_token: str, repo: str, name: str) -> dict | None:
+ page = 1
+ while True:
+ response = github_api(
+ github_token,
+ "GET",
+ f"/repos/{repo}/actions/runners?per_page=100&page={page}",
+ )
+ runners = response.get("runners", [])
+ for runner in runners:
+ if runner.get("name") == name:
+ return runner
+ if len(runners) < 100:
+ return None
+ page += 1
+
+
+def make_ecs_client(config: ProvisionConfig):
+ from alibabacloud_ecs20140526.client import Client as EcsClient
+ from alibabacloud_tea_openapi.models import Config as OpenApiConfig
+
+ access_key_id = os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_ID", "")
+ access_key_secret = os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_SECRET", "")
+ if not access_key_id or not access_key_secret:
+ raise SystemExit(
+ "ALIBABA_CLOUD_ACCESS_KEY_ID/SECRET are empty; in CI they come from the "
+ "ALICLOUD_ECS_ACCESS_KEY_ID/SECRET repository secrets (a missing or "
+ "misnamed secret expands to an empty string)."
+ )
+ return EcsClient(
+ OpenApiConfig(
+ access_key_id=access_key_id,
+ access_key_secret=access_key_secret,
+ region_id=config.region_id,
+ endpoint=f"ecs.{config.region_id}.aliyuncs.com",
+ )
+ )
+
+
+def wait_for_instance_status(client, region_id: str, instance_id: str, wanted: str, deadline: float) -> None:
+ from alibabacloud_ecs20140526 import models as ecs_models
+
+ while time.monotonic() < deadline:
+ response = client.describe_instances(
+ ecs_models.DescribeInstancesRequest(
+ region_id=region_id, instance_ids=json.dumps([instance_id])
+ )
+ )
+ instances = response.body.instances.instance
+ if instances and instances[0].status == wanted:
+ return
+ time.sleep(POLL_INTERVAL_SECONDS)
+ raise TimeoutError(f"Instance {instance_id} did not reach status {wanted} in time")
+
+
+def fetch_console_output(client, region_id: str, instance_id: str) -> str:
+ from alibabacloud_ecs20140526 import models as ecs_models
+
+ response = client.get_instance_console_output(
+ ecs_models.GetInstanceConsoleOutputRequest(region_id=region_id, instance_id=instance_id)
+ )
+ return base64.b64decode(response.body.console_output or "").decode("utf-8", "replace")
+
+
+class ConsoleTailer:
+ """Incrementally prints new serial-console lines so cloud-init progress is
+ visible in the CI log while waiting, not only after a failure dump."""
+
+ def __init__(self, client, region_id: str, instance_id: str) -> None:
+ self.client = client
+ self.region_id = region_id
+ self.instance_id = instance_id
+ self.printed_lines = 0
+
+ def poll(self) -> None:
+ try:
+ lines = fetch_console_output(self.client, self.region_id, self.instance_id).splitlines()
+ except Exception as error: # noqa: BLE001
+ print(f"[console] unable to fetch console output: {error}", flush=True)
+ return
+ # The API returns a bounded tail; if it ever shrinks, restart from the
+ # beginning of the new buffer rather than skipping lines.
+ if len(lines) < self.printed_lines:
+ self.printed_lines = 0
+ for line in lines[self.printed_lines :]:
+ print(f"[console] {line}", flush=True)
+ self.printed_lines = len(lines)
+
+
+def dump_console_output(client, region_id: str, instance_id: str) -> None:
+ try:
+ output = fetch_console_output(client, region_id, instance_id)
+ except Exception as error: # noqa: BLE001
+ print(f"Unable to fetch console output for {instance_id}: {error}", flush=True)
+ return
+ tail = "\n".join(output.splitlines()[-80:])
+ print(f"::group::Console output tail for {instance_id}\n{tail}\n::endgroup::", flush=True)
+ summary_path = os.environ.get("GITHUB_STEP_SUMMARY")
+ if summary_path:
+ with open(summary_path, "a", encoding="utf-8") as summary:
+ summary.write(f"ECS console output ({instance_id})\n\n```\n")
+ summary.write(tail)
+ summary.write("\n```\n\n")
+
+
+def append_github_output(name: str, value: str) -> None:
+ output_path = os.environ.get("GITHUB_OUTPUT")
+ if output_path:
+ with open(output_path, "a", encoding="utf-8") as output:
+ output.write(f"{name}={value}\n")
+
+
+def run_instance(client, config: ProvisionConfig, user_data: str) -> str:
+ from alibabacloud_ecs20140526 import models as ecs_models
+
+ request = ecs_models.RunInstancesRequest(
+ region_id=config.region_id,
+ image_id=config.image_id,
+ resource_group_id=config.resource_group_id,
+ instance_type=config.instance_type,
+ v_switch_id=config.vswitch_id,
+ security_group_id=config.security_group_id,
+ instance_name=runner_name_for_run(config.run_id),
+ host_name=runner_name_for_run(config.run_id),
+ description=f"Ephemeral query-regression runner for run {config.run_id}",
+ amount=1,
+ instance_charge_type="PostPaid",
+ spot_strategy="NoSpot",
+ internet_charge_type="PayByTraffic",
+ internet_max_bandwidth_out=100,
+ # Holds the image (~12G), the 16G swapfile, the source checkout, the
+ # base+candidate cluster data homes, and cold build caches. Deleted
+ # with the instance.
+ system_disk=ecs_models.RunInstancesRequestSystemDisk(category="cloud_essd", size="40"),
+ user_data=user_data,
+ tag=[
+ ecs_models.RunInstancesRequestTag(key=MANAGED_BY_TAG_KEY, value=MANAGED_BY_TAG_VALUE),
+ ecs_models.RunInstancesRequestTag(key=RUN_TAG_KEY, value=config.run_id),
+ ],
+ )
+ response = client.run_instances(request)
+ instance_id = response.body.instance_id_sets.instance_id_set[0]
+ return instance_id
+
+
+def provision(config: ProvisionConfig) -> int:
+ client = make_ecs_client(config)
+ runner_name = runner_name_for_run(config.run_id)
+ runner_label = runner_label_for_run(config.run_id)
+
+ registration_token = create_registration_token(config.github_token, config.repo)
+ user_data = encode_user_data(
+ render_user_data(
+ runner_name,
+ runner_label,
+ registration_token,
+ config.repo,
+ config.runner_uid,
+ config.runner_gid,
+ )
+ )
+
+ print(f"::group::Run instance {runner_name}", flush=True)
+ instance_id = run_instance(client, config, user_data)
+ print(f"Instance id: {instance_id}", flush=True)
+ # Teardown is the only DeleteInstance caller. Write outputs immediately
+ # so a later status/online failure still releases this VM.
+ append_github_output("label", runner_label)
+ append_github_output("instance_id", instance_id)
+ append_github_output("runner_name", runner_name)
+ wait_for_instance_status(client, config.region_id, instance_id, "Running", time.monotonic() + 5 * 60)
+ print("::endgroup::", flush=True)
+
+ print("::group::Wait for runner online", flush=True)
+ deadline = time.monotonic() + RUNNER_ONLINE_TIMEOUT_SECONDS
+ tailer = ConsoleTailer(client, config.region_id, instance_id)
+ last_console_poll = 0.0
+ while time.monotonic() < deadline:
+ runner = find_runner_by_name(config.github_token, config.repo, runner_name)
+ if runner is not None:
+ status = runner.get("status")
+ print(f"Runner {runner_name} status: {status}", flush=True)
+ if status == "online":
+ print("::endgroup::", flush=True)
+ print(f"Runner {runner_name} is online with label {runner_label}", flush=True)
+ return 0
+ # The serial console lags the guest by a minute or so; 30s polling is
+ # enough to follow cloud-init without tripping API throttling.
+ if time.monotonic() - last_console_poll >= 30:
+ tailer.poll()
+ last_console_poll = time.monotonic()
+ time.sleep(POLL_INTERVAL_SECONDS)
+
+ print("::endgroup::", flush=True)
+ print(
+ f"Runner {runner_name} did not come online in time; "
+ "leaving instance for the teardown job to delete",
+ flush=True,
+ )
+ dump_console_output(client, config.region_id, instance_id)
+ return 1
+
+
+def main() -> int:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--region-id", default=os.environ.get("ALIYUN_ECS_REGION_ID"))
+ parser.add_argument("--vswitch-id", default=os.environ.get("ALIYUN_ECS_VSWITCH_ID"))
+ parser.add_argument("--security-group-id", default=os.environ.get("ALIYUN_ECS_SECURITY_GROUP_ID"))
+ parser.add_argument("--image-id", default=os.environ.get("QUERY_REGRESSION_ECS_IMAGE_ID"))
+ parser.add_argument("--instance-type", default=os.environ.get("ALIYUN_ECS_INSTANCE_TYPE"))
+ parser.add_argument("--repo", default=os.environ.get("GITHUB_REPOSITORY"))
+ parser.add_argument("--run-id", default=os.environ.get("GITHUB_RUN_ID"))
+ parser.add_argument("--github-token", default=os.environ.get("GH_PERSONAL_ACCESS_TOKEN"))
+ parser.add_argument("--runner-uid", default=os.environ.get("QUERY_REGRESSION_RUNNER_UID", "1001"))
+ parser.add_argument("--runner-gid", default=os.environ.get("QUERY_REGRESSION_RUNNER_GID", "1001"))
+ parser.add_argument("--resource-group-id", default=os.environ.get("ALIYUN_ECS_RESOURCE_GROUP_ID"))
+ args = parser.parse_args()
+
+ missing = [
+ name
+ for name, value in vars(args).items()
+ if name not in ("resource_group_id",)
+ and (value is None or (isinstance(value, str) and not value))
+ ]
+ if missing:
+ flags = ", ".join(f"--{name.replace('_', '-')}" for name in missing)
+ raise SystemExit(f"Missing required configuration: {flags} (or their env defaults)")
+
+ config = ProvisionConfig(
+ region_id=args.region_id,
+ vswitch_id=args.vswitch_id,
+ security_group_id=args.security_group_id,
+ image_id=args.image_id,
+ instance_type=args.instance_type,
+ repo=args.repo,
+ run_id=args.run_id,
+ github_token=args.github_token,
+ resource_group_id=args.resource_group_id or None,
+ runner_uid=args.runner_uid,
+ runner_gid=args.runner_gid,
+ )
+ return provision(config)
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/.github/scripts/aliyun-ecs-runner-teardown.py b/.github/scripts/aliyun-ecs-runner-teardown.py
new file mode 100644
index 00000000000..36c80253b95
--- /dev/null
+++ b/.github/scripts/aliyun-ecs-runner-teardown.py
@@ -0,0 +1,237 @@
+#!/usr/bin/env python3
+# Copyright 2023 Greptime Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# PEP 723 inline metadata (see aliyun-ecs-runner-provision.py for the
+# convention). The SDK import stays lazy so unit tests run on a plain
+# stdlib interpreter.
+# /// script
+# requires-python = ">=3.10"
+# dependencies = [
+# "alibabacloud_ecs20140526>=4.1.0,<6",
+# "alibabacloud_tea_openapi>=0.3.12,<1",
+# ]
+# ///
+
+"""Tear down ephemeral Aliyun ECS query-regression runners.
+
+Two modes:
+
+- Targeted (per workflow run): delete one instance by id and deregister its
+ runner by name. Both steps are idempotent and best-effort; a missing
+ instance or runner is not an error.
+- Sweep (scheduled janitor): delete every instance tagged as managed by
+ query-regression CI whose creation time is older than the given TTL, and
+ deregister the matching runners. This is the safety net for runs whose
+ teardown job never executed.
+"""
+
+from __future__ import annotations
+
+import argparse
+import importlib.util
+import os
+import sys
+from datetime import datetime, timedelta, timezone
+from pathlib import Path
+
+# Reuse the GitHub API client, runner lookup, and tag constants from the
+# provision script.
+_PROVISION_SPEC = importlib.util.spec_from_file_location(
+ "aliyun_ecs_runner_provision",
+ Path(__file__).resolve().parent / "aliyun-ecs-runner-provision.py",
+)
+assert _PROVISION_SPEC is not None and _PROVISION_SPEC.loader is not None
+provision = importlib.util.module_from_spec(_PROVISION_SPEC)
+sys.modules[_PROVISION_SPEC.name] = provision
+_PROVISION_SPEC.loader.exec_module(provision)
+
+SWEEP_TTL = timedelta(hours=4)
+# ECS DescribeInstances creation_time is ISO8601 UTC, e.g. "2026-08-17T02:13Z".
+CREATION_TIME_FORMATS = ("%Y-%m-%dT%H:%M:%SZ", "%Y-%m-%dT%H:%MZ")
+
+
+def parse_creation_time(value: str) -> datetime:
+ for fmt in CREATION_TIME_FORMATS:
+ try:
+ return datetime.strptime(value, fmt).replace(tzinfo=timezone.utc)
+ except ValueError:
+ continue
+ raise ValueError(f"Unparsable ECS creation time: {value}")
+
+
+def expired_instance_names(
+ instances: list[tuple[str, str, str]], now: datetime, ttl: timedelta
+) -> list[tuple[str, str]]:
+ """Pick (instance_id, instance_name) pairs whose creation is older than ttl.
+
+ `instances` items are (instance_id, instance_name, creation_time).
+ """
+ expired = []
+ for instance_id, instance_name, creation_time in instances:
+ age = now - parse_creation_time(creation_time)
+ if age >= ttl:
+ expired.append((instance_id, instance_name))
+ return expired
+
+
+def make_ecs_client(region_id: str):
+ from alibabacloud_ecs20140526.client import Client as EcsClient
+ from alibabacloud_tea_openapi.models import Config as OpenApiConfig
+
+ access_key_id = os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_ID", "")
+ access_key_secret = os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_SECRET", "")
+ if not access_key_id or not access_key_secret:
+ raise SystemExit(
+ "ALIBABA_CLOUD_ACCESS_KEY_ID/SECRET are empty; in CI they come from the "
+ "ALICLOUD_ECS_ACCESS_KEY_ID/SECRET repository secrets (a missing or "
+ "misnamed secret expands to an empty string)."
+ )
+ return EcsClient(
+ OpenApiConfig(
+ access_key_id=access_key_id,
+ access_key_secret=access_key_secret,
+ region_id=region_id,
+ endpoint=f"ecs.{region_id}.aliyuncs.com",
+ )
+ )
+
+
+def delete_instance(client, instance_id: str, region_id: str | None = None) -> bool:
+ import time
+
+ from alibabacloud_ecs20140526 import models as ecs_models
+
+ # Export the serial console before destroying the evidence: a cancelled
+ # run still runs this teardown job, and the console tail (cloud-init,
+ # runner service logs, kernel OOM records) is the only witness of what
+ # happened on the machine.
+ if region_id is not None:
+ provision.dump_console_output(client, region_id, instance_id)
+
+ # DeleteInstance rejects instances that are still Initializing (or in
+ # another transitional status). Teardown runs right after a cancelled
+ # run, when the instance may be only seconds old, so retry the transient
+ # status errors for a few minutes instead of leaking the instance.
+ deadline = time.monotonic() + 5 * 60
+ while True:
+ try:
+ client.delete_instance(ecs_models.DeleteInstanceRequest(instance_id=instance_id, force=True))
+ print(f"Deleted instance {instance_id}", flush=True)
+ return True
+ except Exception as error: # noqa: BLE001
+ message = str(error)
+ if "InvalidInstanceId.NotFound" in message:
+ print(f"Instance {instance_id} already gone", flush=True)
+ return True
+ if "IncorrectInstanceStatus" in message and time.monotonic() < deadline:
+ print(f"Instance {instance_id} is in a transitional status; retrying delete", flush=True)
+ time.sleep(15)
+ continue
+ print(f"Failed to delete instance {instance_id}: {error}", flush=True)
+ return False
+
+
+def deregister_runner(token: str, repo: str, runner_name: str) -> bool:
+ runner = provision.find_runner_by_name(token, repo, runner_name)
+ if runner is None:
+ print(f"Runner {runner_name} is not registered", flush=True)
+ return True
+ try:
+ provision.github_api(token, "DELETE", f"/repos/{repo}/actions/runners/{runner['id']}")
+ print(f"Deregistered runner {runner_name} (id {runner['id']})", flush=True)
+ return True
+ except Exception as error: # noqa: BLE001
+ print(f"Failed to deregister runner {runner_name}: {error}", flush=True)
+ return False
+
+
+def list_managed_instances(client, region_id: str) -> list[tuple[str, str, str]]:
+ from alibabacloud_ecs20140526 import models as ecs_models
+
+ result: list[tuple[str, str, str]] = []
+ next_token = None
+ while True:
+ request = ecs_models.DescribeInstancesRequest(
+ region_id=region_id,
+ tag=[
+ ecs_models.DescribeInstancesRequestTag(
+ key=provision.MANAGED_BY_TAG_KEY, value=provision.MANAGED_BY_TAG_VALUE
+ )
+ ],
+ max_results=100,
+ next_token=next_token,
+ )
+ response = client.describe_instances(request)
+ for instance in response.body.instances.instance:
+ result.append((instance.instance_id, instance.instance_name, instance.creation_time))
+ next_token = response.body.next_token
+ if not next_token:
+ return result
+
+
+def sweep(client, region_id: str, repo: str, github_token: str, ttl: timedelta) -> int:
+ instances = list_managed_instances(client, region_id)
+ print(f"Found {len(instances)} managed instance(s) in {region_id}", flush=True)
+ expired = expired_instance_names(instances, datetime.now(timezone.utc), ttl)
+ ok = True
+ for instance_id, instance_name in expired:
+ print(f"Instance {instance_id} ({instance_name}) exceeds TTL {ttl}; deleting", flush=True)
+ # Runner names mirror instance names by construction in the provision
+ # script (both are qreg-ecs-).
+ ok &= delete_instance(client, instance_id, region_id)
+ ok &= deregister_runner(github_token, repo, instance_name)
+ return 0 if ok else 1
+
+
+def main() -> int:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--region-id", default=os.environ.get("ALIYUN_ECS_REGION_ID"))
+ parser.add_argument("--repo", default=os.environ.get("GITHUB_REPOSITORY"))
+ parser.add_argument("--github-token", default=os.environ.get("GH_PERSONAL_ACCESS_TOKEN"))
+ parser.add_argument("--instance-id", default=os.environ.get("QUERY_REGRESSION_ECS_INSTANCE_ID"))
+ parser.add_argument("--runner-name", default=os.environ.get("QUERY_REGRESSION_ECS_RUNNER_NAME"))
+ parser.add_argument(
+ "--sweep",
+ action="store_true",
+ help="Janitor mode: delete all managed instances older than --sweep-ttl-hours.",
+ )
+ parser.add_argument("--sweep-ttl-hours", type=float, default=SWEEP_TTL.total_seconds() / 3600)
+ args = parser.parse_args()
+
+ for name in ("region_id", "repo", "github_token"):
+ if not getattr(args, name):
+ raise SystemExit(f"Missing required configuration: --{name.replace('_', '-')}")
+
+ client = make_ecs_client(args.region_id)
+
+ if args.sweep:
+ return sweep(
+ client, args.region_id, args.repo, args.github_token, timedelta(hours=args.sweep_ttl_hours)
+ )
+
+ ok = True
+ if args.instance_id:
+ ok &= delete_instance(client, args.instance_id, args.region_id)
+ else:
+ print("No instance id given; skipping instance deletion", flush=True)
+ if args.runner_name:
+ ok &= deregister_runner(args.github_token, args.repo, args.runner_name)
+ else:
+ print("No runner name given; skipping runner deregistration", flush=True)
+ return 0 if ok else 1
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/.github/scripts/pr-open-limit.js b/.github/scripts/pr-open-limit.js
new file mode 100644
index 00000000000..46f770074f3
--- /dev/null
+++ b/.github/scripts/pr-open-limit.js
@@ -0,0 +1,144 @@
+// Warns when a repository member has too many open pull requests.
+//
+// Review capacity is the bottleneck, so authors are expected to land or close
+// existing work before opening more. Drafts are not counted and never warned
+// about: they are not asking for review yet.
+// This is advisory only — it never closes a pull request or fails the job.
+
+import { appendFileSync } from "node:fs";
+
+const MARKER = "";
+// GITHUB_TOKEN can only edit comments authored by the Actions bot itself.
+const COMMENT_AUTHOR = "github-actions[bot]";
+// Repository permissions that mark someone as part of the team.
+const TEAM_PERMISSIONS = ["admin", "maintain", "write"];
+// Keep the comment readable for authors who are far over the limit.
+const MAX_LISTED_PRS = 10;
+
+function summary(text) {
+ if (process.env.GITHUB_STEP_SUMMARY) {
+ appendFileSync(process.env.GITHUB_STEP_SUMMARY, `${text}\n`);
+ }
+ console.log(text);
+}
+
+// `author_association` cannot be used here: it is computed from what the caller
+// is allowed to see, so GITHUB_TOKEN reports a private organization member as
+// CONTRIBUTOR. Repository permission is viewer-independent.
+//
+// On error this returns true rather than false. A token that cannot read
+// permissions would otherwise make the whole check silently pass everyone.
+async function isTeamMember(octokit, owner, repo, username) {
+ try {
+ const { data } = await octokit.repos.getCollaboratorPermissionLevel({
+ owner,
+ repo,
+ username,
+ });
+ // Never log the level itself: job logs are public.
+ return TEAM_PERMISSIONS.includes(data.permission);
+ } catch (error) {
+ console.log(
+ `Cannot read repository permission for \`${username}\` (HTTP ${error.status}); applying the limit anyway.`
+ );
+ return true;
+ }
+}
+
+function buildComment(author, total, limit, openPrs) {
+ const listed = openPrs
+ .slice(0, MAX_LISTED_PRS)
+ .map((pr) => `- #${pr.number} ${pr.title}`);
+ const hidden = openPrs.length - listed.length;
+ const list = hidden > 0 ? `${listed.join("\n")}\n- ...and ${hidden} more` : listed.join("\n");
+
+ return `${MARKER}
+> [!WARNING]
+> @${author} has **${total}** open pull requests in this repository, over the limit of **${limit}**.
+
+Review is the scarcest resource here. Please land or close some of these before
+pushing this one forward:
+
+${list}
+
+This check is advisory for now and blocks nothing.`;
+}
+
+async function upsertComment(octokit, params, body) {
+ const comments = await octokit.paginate(octokit.issues.listComments, {
+ ...params,
+ per_page: 100,
+ });
+ const existing = comments.find(
+ (comment) =>
+ comment.user?.login === COMMENT_AUTHOR && comment.body?.includes(MARKER)
+ );
+
+ if (existing) {
+ await octokit.issues.updateComment({
+ owner: params.owner,
+ repo: params.repo,
+ comment_id: existing.id,
+ body,
+ });
+ } else {
+ await octokit.issues.createComment({ ...params, body });
+ }
+}
+
+(async () => {
+ const { Octokit } = await import("@octokit/rest");
+
+ const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
+ const prNumber = Number(process.env.PR_NUMBER);
+ const author = process.env.PR_AUTHOR;
+ const rawLimit = Number(process.env.MAX_OPEN_PRS);
+ const limit = Number.isInteger(rawLimit) && rawLimit >= 0 ? rawLimit : 5;
+
+ if (author.endsWith("[bot]")) {
+ summary(`Skipping bot author \`${author}\`.`);
+ return;
+ }
+
+ if (process.env.PR_IS_DRAFT === "true") {
+ summary(`Skipping #${prNumber}: draft.`);
+ return;
+ }
+
+ const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
+
+ if (!(await isTeamMember(octokit, owner, repo, author))) {
+ summary(`Skipping \`${author}\`: not a team member.`);
+ return;
+ }
+
+ const allOpen = await octokit.paginate(octokit.pulls.list, {
+ owner,
+ repo,
+ state: "open",
+ sort: "created",
+ direction: "asc",
+ per_page: 100,
+ });
+ // The pull request that triggered this run is already open, so exclude it and
+ // report the total separately.
+ const others = allOpen.filter(
+ (pr) => pr.user?.login === author && pr.number !== prNumber && !pr.draft
+ );
+ const total = others.length + 1;
+
+ if (others.length < limit) {
+ summary(`\`${author}\` has ${total} open pull requests (limit ${limit}). OK.`);
+ return;
+ }
+
+ summary(`\`${author}\` has ${total} open pull requests, over the limit of ${limit}.`);
+ await upsertComment(
+ octokit,
+ { owner, repo, issue_number: prNumber },
+ buildComment(author, total, limit, others)
+ );
+})().catch((error) => {
+ console.error(error);
+ process.exit(1);
+});
diff --git a/.github/scripts/query-regression-comment.cjs b/.github/scripts/query-regression-comment.cjs
index 130b1c7efa3..2d6c9c40dc8 100644
--- a/.github/scripts/query-regression-comment.cjs
+++ b/.github/scripts/query-regression-comment.cjs
@@ -92,7 +92,7 @@ function thresholdStatus(thresholds, query) {
const hits = (Array.isArray(thresholds) ? thresholds : [])
.filter(item => query === undefined || (hasScopedQuery(item) && String(item.query) === query))
.map(formatThreshold);
- return hits.length > 0 ? hits.join(', ') : 'N/A';
+ return hits.length > 0 ? hits.join('; ') : 'N/A';
}
function hasScopedQuery(threshold) {
@@ -115,7 +115,7 @@ function formatThreshold(threshold) {
return `${name}${scope.length > 0 ? ` [${scope.join(', ')}]` : ''}: ${status}${reason}`;
}
-function syntheticThresholdStatus(thresholds, measurementNames) {
+function classifyThresholds(thresholds, measurementNames) {
const unscoped = [];
const unmatched = new Map();
for (const threshold of Array.isArray(thresholds) ? thresholds : []) {
@@ -130,7 +130,11 @@ function syntheticThresholdStatus(thresholds, measurementNames) {
unmatched.set(query, entries);
}
}
+ return { unscoped, unmatched };
+}
+function syntheticThresholdStatus(thresholds, measurementNames) {
+ const { unscoped, unmatched } = classifyThresholds(thresholds, measurementNames);
const parts = [];
if (unscoped.length > 0) {
parts.push(`case/storage threshold: ${thresholdStatus(unscoped)}`);
@@ -141,6 +145,21 @@ function syntheticThresholdStatus(thresholds, measurementNames) {
return parts.length > 0 ? parts.join('; ') : 'N/A';
}
+// Case-level (query-unscoped) thresholds formatted for the collapsible details
+// block below the summary table: individual items, `; `-separated, without the
+// `case/storage threshold:` label (the section heading already says that).
+function syntheticThresholdDetail(thresholds, measurementNames) {
+ const { unscoped, unmatched } = classifyThresholds(thresholds, measurementNames);
+ const items = [];
+ if (unscoped.length > 0) {
+ items.push(thresholdStatus(unscoped));
+ }
+ for (const query of Array.from(unmatched.keys()).sort()) {
+ items.push(`unmatched query ${query}: ${thresholdStatus(unmatched.get(query))}`);
+ }
+ return items.length > 0 ? items.join('; ') : 'N/A';
+}
+
function joinDetails(...details) {
const present = details.filter(detail => detail && detail !== 'N/A');
return present.length > 0 ? present.join('; ') : 'N/A';
@@ -229,7 +248,7 @@ function collectReportRows(report, reportPath) {
),
};
});
- const syntheticThresholds = syntheticThresholdStatus(thresholds, measurementNames);
+ const syntheticThresholds = syntheticThresholdDetail(thresholds, measurementNames);
if (syntheticThresholds !== 'N/A') {
rows.push({
caseName: name,
@@ -239,22 +258,46 @@ function collectReportRows(report, reportPath) {
candidateMedian: 'N/A',
regression: 'N/A',
threshold: syntheticThresholds,
+ kind: 'case-thresholds',
});
}
return rows;
}
+function renderThresholdDetails(rows) {
+ const entries = rows.filter(row => row.kind === 'case-thresholds');
+ if (entries.length === 0) {
+ return '';
+ }
+ // The / tags are emitted literally; only the entry content
+ // goes through text() (so `[ ] ( ) |` etc. stay escaped while the tags render).
+ const lines = [
+ 'Case / storage thresholds',
+ '',
+ ];
+ for (const row of entries) {
+ lines.push(`- ${text(row.caseName)}: ${text(row.threshold)}`);
+ }
+ lines.push('');
+ return lines.join('\n');
+}
+
function renderSummaryTable(rows) {
const lines = [
'| Case | Query | Case status | Base median ms | Candidate median ms | Regression | Threshold |',
'| --- | --- | --- | ---: | ---: | ---: | --- |',
];
for (const row of rows) {
+ if (row.kind === 'case-thresholds') {
+ continue;
+ }
lines.push(
- `| ${text(row.caseName)} | ${text(row.query)} | ${statusEmoji(row.status)} \`${text(row.status)}\` | ${text(row.baseMedian)} | ${text(row.candidateMedian)} | ${text(row.regression)} | ${text(row.threshold)} |`
+ `| ${text(row.caseName)} | ${text(row.query)} | ${statusEmoji(row.status)} ${text(row.status)} | ${text(row.baseMedian)} | ${text(row.candidateMedian)} | ${text(row.regression)} | ${text(row.threshold)} |`
);
}
- return lines.join('\n');
+ const details = renderThresholdDetails(rows);
+ const table = lines.join('\n');
+ return details === '' ? table : `${table}\n\n${details}`;
}
module.exports = async function validateQueryRegressionComment({ github, context, core }) {
diff --git a/.github/scripts/query-regression-comment.test.cjs b/.github/scripts/query-regression-comment.test.cjs
index 7a74a0d88c1..4b3d1a5cbfd 100644
--- a/.github/scripts/query-regression-comment.test.cjs
+++ b/.github/scripts/query-regression-comment.test.cjs
@@ -187,11 +187,11 @@ test('sorts the base and candidate query union and aggregates scoped thresholds'
assert.equal(rows[0].threshold, 'base measurement missing');
assert.equal(
rows[1].threshold,
- 'candidate measurement missing; p95 [target=base]: warn, absolute [target=candidate, encoding=plain]: pass'
+ 'candidate measurement missing; p95 [target=base]: warn; absolute [target=candidate, encoding=plain]: pass'
);
});
-test('preserves unscoped and unmatched thresholds in a synthetic N/A row', () => {
+test('keeps unscoped and unmatched thresholds in a case-thresholds detail row', () => {
const rows = collectReportRows(report('thresholds', {
base: [{ name: 'measured', latency_ms_median: 10 }],
candidate: [{ name: 'measured', latency_ms_median: 11 }],
@@ -214,9 +214,10 @@ test('preserves unscoped and unmatched thresholds in a synthetic N/A row', () =>
assert.equal(rows[0].query, 'measured');
assert.equal(rows[0].threshold, 'query limit [target=base]: passed');
assert.equal(rows[1].query, 'N/A');
+ assert.equal(rows[1].kind, 'case-thresholds');
assert.equal(
rows[1].threshold,
- 'case/storage threshold: min_files [target=base]: passed, min_files [target=candidate]: failed, encoding limit [target=candidate, encoding=plain]: failed; unmatched query not-measured: orphaned limit [target=base, encoding=json]: failed (reason: measurement unavailable)'
+ 'min_files [target=base]: passed; min_files [target=candidate]: failed; encoding limit [target=candidate, encoding=plain]: failed; unmatched query not-measured: orphaned limit [target=base, encoding=json]: failed (reason: measurement unavailable)'
);
});
@@ -239,12 +240,50 @@ test('keeps unscoped thresholds out of undefined and null query rows', () => {
assert.equal(byQuery.get('undefined').threshold, 'N/A');
assert.equal(byQuery.get('null').threshold, 'N/A');
assert.equal(rows.filter(row => row.query === 'N/A').length, 1);
+ assert.equal(byQuery.get('N/A').kind, 'case-thresholds');
assert.equal(
byQuery.get('N/A').threshold,
- 'case/storage threshold: min_files [target=base]: passed, min_files [target=candidate]: failed'
+ 'min_files [target=base]: passed; min_files [target=candidate]: failed'
);
});
+test('renders case/storage thresholds in a collapsible details block below the table', () => {
+ const rows = [
+ ...collectReportRows(report('first', {
+ base: [{ name: 'q1', latency_ms_median: 10 }],
+ candidate: [{ name: 'q1', latency_ms_median: 11 }],
+ }, [
+ { query: 'q1', threshold: 'query limit', target: 'base', status: 'passed' },
+ { threshold: 'min_files', target: 'base', status: 'passed' },
+ { threshold: 'min_files', target: 'candidate', status: 'failed' },
+ ]), '/reports/first/query-regression-report.json'),
+ ...collectReportRows({
+ case: { name: 'broken' },
+ status: 'failed',
+ error: 'connection refused',
+ }, '/reports/broken/query-regression-report.json'),
+ ];
+
+ const rendered = renderSummaryTable(rows);
+ const detailsIndex = rendered.indexOf('');
+ const table = rendered.slice(0, detailsIndex);
+ const details = rendered.slice(detailsIndex);
+
+ // Query rows and abnormal N/A rows stay in the main table.
+ assert.match(table, /\| first \| q1 \| ✅ ok \|/);
+ assert.match(table, /\| broken \| N\/A \| ❌ failed \|/);
+ // Storage thresholds are not main-table rows.
+ assert.doesNotMatch(table, /^\| first \| N\/A \|/m);
+ assert.doesNotMatch(table, /min_files/);
+ // Status column is plain text without code-span backticks.
+ assert.doesNotMatch(table, /`/);
+ // Details block keeps its tags unescaped and its items '; '-separated.
+ assert.ok(details.startsWith('Case / storage thresholds'));
+ assert.ok(details.includes('- first: min_files \\[target=base\\]: passed; min_files \\[target=candidate\\]: failed'));
+ assert.ok(details.endsWith(''));
+ assert.ok(!rendered.includes('<details>'));
+});
+
test('escapes Markdown table content, including bare carriage returns', () => {
const table = renderSummaryTable([{
caseName: 'safe\r| injected |\n@user ',
diff --git a/.github/scripts/query-regression-nightly-refs.py b/.github/scripts/query-regression-nightly-refs.py
new file mode 100644
index 00000000000..6e9f54682d4
--- /dev/null
+++ b/.github/scripts/query-regression-nightly-refs.py
@@ -0,0 +1,270 @@
+#!/usr/bin/env python3
+# Copyright 2023 Greptime Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Resolve consecutive successful Nightly Build SHAs for query-regression.
+
+Query regression builds both binaries from git; this script only picks the
+head SHAs of two Nightly Build workflow runs (today vs the previous success).
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import os
+import sys
+import urllib.error
+import urllib.parse
+import urllib.request
+from dataclasses import dataclass
+from typing import Any
+
+
+NIGHTLY_WORKFLOW = "nightly-build.yml"
+NIGHTLY_EVENTS = frozenset({"schedule", "workflow_dispatch"})
+
+
+@dataclass(frozen=True)
+class WorkflowRun:
+ id: int
+ head_sha: str
+ head_branch: str
+ html_url: str
+ created_at: str
+ conclusion: str
+ event: str
+
+
+@dataclass(frozen=True)
+class RefPair:
+ base: WorkflowRun | None
+ candidate: WorkflowRun | None
+ skip: bool
+ reason: str
+
+
+def parse_run(payload: dict[str, Any]) -> WorkflowRun:
+ return WorkflowRun(
+ id=int(payload["id"]),
+ head_sha=str(payload["head_sha"]),
+ head_branch=str(payload.get("head_branch") or ""),
+ html_url=str(payload.get("html_url") or ""),
+ created_at=str(payload.get("created_at") or ""),
+ conclusion=str(payload.get("conclusion") or ""),
+ event=str(payload.get("event") or ""),
+ )
+
+
+def github_get(token: str, path: str, query: dict[str, str] | None = None) -> dict[str, Any]:
+ encoded = f"?{urllib.parse.urlencode(query)}" if query else ""
+ request = urllib.request.Request(
+ f"https://api.github.com{path}{encoded}",
+ method="GET",
+ headers={
+ "Accept": "application/vnd.github+json",
+ "Authorization": f"Bearer {token}",
+ "X-GitHub-Api-Version": "2022-11-28",
+ },
+ )
+ try:
+ with urllib.request.urlopen(request, timeout=30) as response:
+ return json.loads(response.read().decode("utf-8"))
+ except urllib.error.HTTPError as error:
+ body = error.read().decode("utf-8", "replace")
+ raise SystemExit(
+ f"GitHub API GET {path} failed: HTTP {error.code}: {body}"
+ ) from error
+
+
+def list_successful_nightly_runs(
+ token: str,
+ repo: str,
+ *,
+ branch: str | None = None,
+ per_page: int = 30,
+) -> list[WorkflowRun]:
+ query = {
+ "status": "success",
+ "per_page": str(per_page),
+ }
+ if branch:
+ query["branch"] = branch
+ payload = github_get(
+ token,
+ f"/repos/{repo}/actions/workflows/{NIGHTLY_WORKFLOW}/runs",
+ query,
+ )
+ runs = [parse_run(item) for item in payload.get("workflow_runs") or []]
+ return [
+ run
+ for run in runs
+ if run.conclusion == "success" and run.event in NIGHTLY_EVENTS and run.head_sha
+ ]
+
+
+def fetch_run(token: str, repo: str, run_id: int) -> WorkflowRun:
+ payload = github_get(token, f"/repos/{repo}/actions/runs/{run_id}")
+ return parse_run(payload)
+
+
+def select_base_and_candidate(
+ runs: list[WorkflowRun],
+ *,
+ candidate_run_id: int | None = None,
+ candidate: WorkflowRun | None = None,
+) -> RefPair:
+ """Pick candidate (newest / requested) and the previous successful run.
+
+ `runs` must be newest-first. Same-SHA consecutive nightlies are skipped
+ (no commits that day).
+ """
+ if candidate is None:
+ if candidate_run_id is not None:
+ candidate = next((run for run in runs if run.id == candidate_run_id), None)
+ if candidate is None:
+ return RefPair(
+ None,
+ None,
+ True,
+ f"candidate nightly run {candidate_run_id} was not a successful "
+ f"{NIGHTLY_WORKFLOW} run",
+ )
+ elif runs:
+ candidate = runs[0]
+ else:
+ return RefPair(None, None, True, "no successful Nightly Build runs")
+
+ branch = candidate.head_branch
+ older = [
+ run
+ for run in runs
+ if run.id != candidate.id
+ and (not branch or not run.head_branch or run.head_branch == branch)
+ and (not candidate.created_at or run.created_at <= candidate.created_at)
+ ]
+ if not older:
+ return RefPair(
+ None,
+ candidate,
+ True,
+ "no previous successful Nightly Build to compare against",
+ )
+ base = older[0]
+ if base.head_sha.lower() == candidate.head_sha.lower():
+ return RefPair(
+ base,
+ candidate,
+ True,
+ f"previous nightly SHA {base.head_sha} matches candidate; nothing to compare",
+ )
+ return RefPair(base, candidate, False, "")
+
+
+def _override_run(sha: str) -> WorkflowRun:
+ return WorkflowRun(
+ id=0,
+ head_sha=sha,
+ head_branch="",
+ html_url="",
+ created_at="",
+ conclusion="success",
+ event="workflow_dispatch",
+ )
+
+
+def override_pair(base_ref: str, candidate_ref: str) -> RefPair:
+ return RefPair(_override_run(base_ref), _override_run(candidate_ref), False, "explicit refs")
+
+
+def write_outputs(pair: RefPair) -> None:
+ values = {
+ "skip": "true" if pair.skip else "false",
+ "reason": pair.reason,
+ "base_sha": pair.base.head_sha if pair.base else "",
+ "candidate_sha": pair.candidate.head_sha if pair.candidate else "",
+ "base_run_url": pair.base.html_url if pair.base else "",
+ "candidate_run_url": pair.candidate.html_url if pair.candidate else "",
+ "base_run_id": str(pair.base.id) if pair.base and pair.base.id else "",
+ "candidate_run_id": str(pair.candidate.id) if pair.candidate and pair.candidate.id else "",
+ }
+ output_path = os.environ.get("GITHUB_OUTPUT")
+ if output_path:
+ with open(output_path, "a", encoding="utf-8") as handle:
+ for key, value in values.items():
+ handle.write(f"{key}={value}\n")
+ for key, value in values.items():
+ print(f"{key}={value}")
+
+
+def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--repo", default=os.environ.get("GITHUB_REPOSITORY"))
+ parser.add_argument(
+ "--token",
+ default=os.environ.get("GITHUB_TOKEN") or os.environ.get("GH_TOKEN"),
+ )
+ parser.add_argument("--branch", default=os.environ.get("NIGHTLY_BRANCH") or "")
+ parser.add_argument(
+ "--candidate-run-id",
+ default=os.environ.get("CANDIDATE_RUN_ID") or "",
+ )
+ parser.add_argument("--base-ref", default=os.environ.get("BASE_REF") or "")
+ parser.add_argument("--candidate-ref", default=os.environ.get("CANDIDATE_REF") or "")
+ return parser.parse_args(argv)
+
+
+def main(argv: list[str] | None = None) -> int:
+ args = parse_args(argv)
+ base_ref = args.base_ref.strip()
+ candidate_ref = args.candidate_ref.strip()
+ if base_ref and candidate_ref:
+ write_outputs(override_pair(base_ref, candidate_ref))
+ return 0
+ if bool(base_ref) != bool(candidate_ref):
+ print("Provide both --base-ref and --candidate-ref, or neither.", file=sys.stderr)
+ return 2
+ if not args.repo or not args.token:
+ print("--repo and --token (or GITHUB_REPOSITORY / GITHUB_TOKEN) are required.", file=sys.stderr)
+ return 2
+
+ candidate_run_id = int(args.candidate_run_id) if str(args.candidate_run_id).strip() else None
+ candidate: WorkflowRun | None = None
+ branch = args.branch.strip() or None
+ if candidate_run_id is not None:
+ candidate = fetch_run(args.token, args.repo, candidate_run_id)
+ if candidate.conclusion != "success":
+ write_outputs(
+ RefPair(
+ None,
+ candidate,
+ True,
+ f"nightly run {candidate_run_id} conclusion is {candidate.conclusion}",
+ )
+ )
+ return 0
+ branch = branch or candidate.head_branch or None
+
+ runs = list_successful_nightly_runs(args.token, args.repo, branch=branch)
+ pair = select_base_and_candidate(
+ runs,
+ candidate_run_id=candidate_run_id if candidate is None else None,
+ candidate=candidate,
+ )
+ write_outputs(pair)
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/.github/scripts/query-regression-run.py b/.github/scripts/query-regression-run.py
index 3392a0658c9..d293aa3e0c9 100644
--- a/.github/scripts/query-regression-run.py
+++ b/.github/scripts/query-regression-run.py
@@ -18,10 +18,17 @@
from __future__ import annotations
import argparse
+import json
import os
import re
+import signal
+import socket
import subprocess
+import time
+import urllib.request
+from dataclasses import dataclass
from pathlib import Path
+from typing import Any
DEFAULT_CASES = [
@@ -100,38 +107,479 @@ def append_step_summary(summary: Path) -> None:
out.write(summary.read_text())
+@dataclass(frozen=True)
+class RunTarget:
+ name: str
+ binary: Path
+ work_dir: Path
+ http_port: int
+ grpc_port: int
+ mysql_port: int
+ postgres_port: int
+ metasrv_rpc_port: int
+ metasrv_http_port: int
+ datanode_rpc_port: int
+ datanode_http_port: int
+ datanode_data_dir: Path
+ frontend_config: Path | None = None
+
+
+def allocate_ports(n: int) -> list[int]:
+ socks = []
+ try:
+ for _ in range(n):
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ sock.bind(("127.0.0.1", 0))
+ socks.append(sock)
+ return [sock.getsockname()[1] for sock in socks]
+ finally:
+ for sock in socks:
+ sock.close()
+
+
+def make_target(
+ name: str,
+ binary: Path,
+ root: Path,
+ ports: list[int],
+ frontend_config: Path | None = None,
+) -> RunTarget:
+ work_dir = root / name
+ return RunTarget(
+ name=name,
+ binary=binary,
+ work_dir=work_dir,
+ http_port=ports[4],
+ grpc_port=ports[5],
+ mysql_port=ports[6],
+ postgres_port=ports[7],
+ metasrv_rpc_port=ports[0],
+ metasrv_http_port=ports[1],
+ datanode_rpc_port=ports[2],
+ datanode_http_port=ports[3],
+ datanode_data_dir=work_dir / "datanode-0" / "data",
+ frontend_config=frontend_config,
+ )
+
+
+def wait_health(port: int, timeout_s: float = 60.0) -> None:
+ deadline = time.monotonic() + timeout_s
+ last: Exception | None = None
+ while time.monotonic() < deadline:
+ try:
+ with urllib.request.urlopen(f"http://127.0.0.1:{port}/health", timeout=2) as response:
+ if response.status < 500:
+ return
+ except Exception as err: # noqa: BLE001 - retain the last health diagnostic
+ last = err
+ time.sleep(0.5)
+ raise TimeoutError(f"health check timed out on port {port}: {last}")
+
+
+def component_log_dir(target: RunTarget, name: str) -> Path:
+ return target.work_dir / "logs" / ("datanode-0" if name == "datanode" else name)
+
+
+def component_command(target: RunTarget, name: str) -> list[str]:
+ log_dir = component_log_dir(target, name)
+ if name == "metasrv":
+ return [
+ str(target.binary), "metasrv", "start",
+ "--grpc-bind-addr", f"127.0.0.1:{target.metasrv_rpc_port}",
+ "--grpc-server-addr", f"127.0.0.1:{target.metasrv_rpc_port}",
+ "--http-addr", f"127.0.0.1:{target.metasrv_http_port}",
+ "--backend", "memory-store", "--enable-region-failover", "false",
+ "--log-dir", str(log_dir),
+ ]
+ if name == "datanode":
+ return [
+ str(target.binary), "datanode", "start",
+ "--grpc-bind-addr", f"127.0.0.1:{target.datanode_rpc_port}",
+ "--grpc-server-addr", f"127.0.0.1:{target.datanode_rpc_port}",
+ "--http-addr", f"127.0.0.1:{target.datanode_http_port}",
+ "--data-home", str(target.datanode_data_dir), "--log-dir", str(log_dir),
+ "--node-id", "0", "--metasrv-addrs", f"127.0.0.1:{target.metasrv_rpc_port}",
+ ]
+ if name == "frontend":
+ command = [str(target.binary), "frontend", "start"]
+ if target.frontend_config is not None:
+ command.extend(["--config-file", str(target.frontend_config)])
+ command.extend([
+ "--metasrv-addrs", f"127.0.0.1:{target.metasrv_rpc_port}",
+ "--http-addr", f"127.0.0.1:{target.http_port}",
+ "--grpc-bind-addr", f"127.0.0.1:{target.grpc_port}",
+ "--grpc-server-addr", f"127.0.0.1:{target.grpc_port}",
+ "--mysql-addr", f"127.0.0.1:{target.mysql_port}",
+ "--postgres-addr", f"127.0.0.1:{target.postgres_port}",
+ "--log-dir", str(log_dir),
+ ])
+ return command
+ raise ValueError(f"unknown component: {name}")
+
+
+def start_component(
+ target: RunTarget,
+ name: str,
+ procs: dict[tuple[str, str], subprocess.Popen[bytes]],
+) -> None:
+ if name != "metasrv":
+ metasrv = procs.get((target.name, "metasrv"))
+ if metasrv is None or metasrv.poll() is not None:
+ raise RuntimeError("metasrv exited; memory-store metadata is no longer valid")
+ if name == "datanode":
+ target.datanode_data_dir.mkdir(parents=True, exist_ok=True)
+ logs = component_log_dir(target, name)
+ logs.mkdir(parents=True, exist_ok=True)
+ with (logs / "stdout.log").open("ab") as out, (logs / "stderr.log").open("ab") as err:
+ procs[(target.name, name)] = subprocess.Popen(
+ component_command(target, name),
+ stdout=out,
+ stderr=err,
+ start_new_session=True,
+ )
+ wait_health({
+ "metasrv": target.metasrv_http_port,
+ "datanode": target.datanode_http_port,
+ "frontend": target.http_port,
+ }[name])
+
+
+def stop_component(
+ target: RunTarget,
+ name: str,
+ procs: dict[tuple[str, str], subprocess.Popen[bytes]],
+) -> None:
+ proc = procs.pop((target.name, name), None)
+ if proc is None or proc.poll() is not None:
+ return
+ try:
+ os.killpg(proc.pid, signal.SIGTERM)
+ except ProcessLookupError:
+ return
+ try:
+ proc.wait(timeout=20)
+ except subprocess.TimeoutExpired:
+ try:
+ os.killpg(proc.pid, signal.SIGKILL)
+ except ProcessLookupError:
+ return
+ proc.wait(timeout=20)
+
+
+def restart_component(
+ target: RunTarget,
+ name: str,
+ procs: dict[tuple[str, str], subprocess.Popen[bytes]],
+) -> None:
+ stop_component(target, name, procs)
+ start_component(target, name, procs)
+
+
+def stop_all(targets: list[RunTarget], procs: dict[tuple[str, str], subprocess.Popen[bytes]]) -> None:
+ for target in reversed(targets):
+ for name in ("frontend", "datanode", "metasrv"):
+ stop_component(target, name, procs)
+
+
+def load_plan(fixture_generator: Path, case_path: Path) -> dict[str, Any]:
+ result = subprocess.run(
+ [str(fixture_generator), "plan", "--case", str(case_path)],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ text=True,
+ check=False,
+ )
+ if result.returncode != 0:
+ raise RuntimeError(f"query_perf_fixture plan failed: {result.stderr[:2000]}")
+ return json.loads(result.stdout)
+
+
+def run_direct_case(
+ args: argparse.Namespace,
+ case_path: Path,
+ work_dir: Path,
+ base_bin: Path,
+ candidate_bin: Path,
+ fixture_generator: Path,
+ runner: Path,
+) -> int:
+ ports = allocate_ports(16)
+ targets = [
+ make_target("base", base_bin, work_dir, ports[:8]),
+ make_target("candidate", candidate_bin, work_dir, ports[8:]),
+ ]
+ for target in targets:
+ if target.work_dir.exists() and any(target.work_dir.iterdir()):
+ raise RuntimeError(f"target work_dir exists and is non-empty: {target.work_dir}")
+ target.work_dir.mkdir(parents=True, exist_ok=True)
+
+ procs: dict[tuple[str, str], subprocess.Popen[bytes]] = {}
+ try:
+ for target in targets:
+ start_component(target, "metasrv", procs)
+ start_component(target, "datanode", procs)
+ start_component(target, "frontend", procs)
+
+ prepare = [
+ str(runner), "prepare-direct", "--case", str(case_path),
+ "--fixture-generator", str(fixture_generator),
+ "--base-http-port", str(targets[0].http_port),
+ "--candidate-http-port", str(targets[1].http_port),
+ "--fixture-dir", str(work_dir / "fixture"),
+ "--output", str(work_dir / "prepare-direct.json"),
+ "--http-timeout", str(args.http_timeout),
+ ]
+ if parse_bool(args.allow_large_fixture):
+ prepare.append("--allow-large-fixture")
+ prepare_status = subprocess.run(prepare, check=False).returncode
+ if prepare_status != 0:
+ return prepare_status
+
+ for target in targets:
+ stop_component(target, "datanode", procs)
+
+ prepared = json.loads((work_dir / "prepare-direct.json").read_text(encoding="utf-8"))
+ fixtures = prepared.get("fixtures")
+ if not isinstance(fixtures, list):
+ raise RuntimeError("prepare-direct report has no fixtures array")
+ for target in targets:
+ destination = target.work_dir / "materialize-destination.toml"
+ destination.write_text(
+ f"data_home = {json.dumps(str(target.datanode_data_dir))}\n"
+ "object_store = { type = \"File\" }\n",
+ encoding="utf-8",
+ )
+ for fixture in fixtures:
+ fixture_dir = fixture.get("fixture_dir") if isinstance(fixture, dict) else None
+ if not isinstance(fixture_dir, str):
+ raise RuntimeError("prepare-direct fixture record has no fixture_dir")
+ materialize = [
+ str(runner), "materialize", "--fixture-dir", fixture_dir,
+ "--destination", str(destination),
+ ]
+ materialize_status = subprocess.run(materialize, check=False).returncode
+ if materialize_status != 0:
+ return materialize_status
+
+ for target in targets:
+ start_component(target, "datanode", procs)
+
+ measure = [
+ str(runner), "measure", "--case", str(case_path),
+ "--fixture-generator", str(fixture_generator),
+ "--base-http-port", str(targets[0].http_port),
+ "--candidate-http-port", str(targets[1].http_port),
+ "--output", str(work_dir / "query-regression-report.json"),
+ "--http-timeout", str(args.http_timeout),
+ ]
+ status = subprocess.run(measure, check=False).returncode
+ if status != 0:
+ for target in targets:
+ restart_component(target, "frontend", procs)
+ status = subprocess.run(measure, check=False).returncode
+ return status
+ finally:
+ stop_all(targets, procs)
+
+
+def run_remote_case(
+ args: argparse.Namespace,
+ case_path: Path,
+ work_dir: Path,
+ base_bin: Path,
+ candidate_bin: Path,
+ fixture_generator: Path,
+ runner: Path,
+) -> int:
+ ports = allocate_ports(16)
+ targets = [
+ make_target(
+ "base",
+ base_bin,
+ work_dir,
+ ports[:8],
+ work_dir / "base" / "frontend-prom-store.toml",
+ ),
+ make_target(
+ "candidate",
+ candidate_bin,
+ work_dir,
+ ports[8:],
+ work_dir / "candidate" / "frontend-prom-store.toml",
+ ),
+ ]
+ for target in targets:
+ if target.work_dir.exists() and any(target.work_dir.iterdir()):
+ raise RuntimeError(f"target work_dir exists and is non-empty: {target.work_dir}")
+ target.work_dir.mkdir(parents=True, exist_ok=True)
+ if target.frontend_config is None:
+ raise RuntimeError(f"remote target has no frontend config path: {target.name}")
+ render = [
+ str(runner), "render-remote-config", "--case", str(case_path),
+ "--fixture-generator", str(fixture_generator),
+ "--output", str(target.frontend_config),
+ ]
+ render_status = subprocess.run(render, check=False).returncode
+ if render_status != 0:
+ return render_status
+
+ procs: dict[tuple[str, str], subprocess.Popen[bytes]] = {}
+ report = work_dir / "query-regression-report.json"
+ try:
+ for target in targets:
+ start_component(target, "metasrv", procs)
+ start_component(target, "datanode", procs)
+ start_component(target, "frontend", procs)
+
+ prepare = [
+ str(runner), "prepare-remote", "--case", str(case_path),
+ "--fixture-generator", str(fixture_generator),
+ "--base-http-port", str(targets[0].http_port),
+ "--candidate-http-port", str(targets[1].http_port),
+ "--output", str(work_dir / "prepare-remote.json"),
+ "--http-timeout", str(args.http_timeout),
+ ]
+ prepare_status = subprocess.run(prepare, check=False).returncode
+ if prepare_status != 0:
+ return prepare_status
+
+ measure = [
+ str(runner), "measure", "--case", str(case_path),
+ "--fixture-generator", str(fixture_generator),
+ "--base-http-port", str(targets[0].http_port),
+ "--candidate-http-port", str(targets[1].http_port),
+ "--output", str(report), "--http-timeout", str(args.http_timeout),
+ ]
+ measure_status = subprocess.run(measure, check=False).returncode
+ if measure_status != 0 and not report.exists():
+ return measure_status
+
+ for target in targets:
+ stop_component(target, "datanode", procs)
+
+ finalize = [
+ str(runner), "finalize-remote", "--case", str(case_path),
+ "--fixture-generator", str(fixture_generator),
+ "--candidate-bin", str(candidate_bin),
+ "--base-data-home", str(targets[0].datanode_data_dir),
+ "--candidate-data-home", str(targets[1].datanode_data_dir),
+ "--report", str(report),
+ ]
+ finalize_status = subprocess.run(finalize, check=False).returncode
+ if finalize_status != 0:
+ return finalize_status
+ final_report = json.loads(report.read_text(encoding="utf-8"))
+ return 1 if measure_status != 0 or final_report.get("status") == "failed" else 0
+ finally:
+ stop_all(targets, procs)
+
+
+def run_otlp_case(
+ args: argparse.Namespace,
+ case_path: Path,
+ work_dir: Path,
+ base_bin: Path,
+ candidate_bin: Path,
+ fixture_generator: Path,
+ runner: Path,
+) -> int:
+ if args.otelgen_bin is None:
+ raise ValueError("--otelgen-bin is required for otlp_trace_load")
+ ports = allocate_ports(16)
+ targets = [
+ make_target("base", base_bin, work_dir, ports[:8]),
+ make_target("candidate", candidate_bin, work_dir, ports[8:]),
+ ]
+ for target in targets:
+ if target.work_dir.exists() and any(target.work_dir.iterdir()):
+ raise RuntimeError(f"target work_dir exists and is non-empty: {target.work_dir}")
+ target.work_dir.mkdir(parents=True, exist_ok=True)
+
+ procs: dict[tuple[str, str], subprocess.Popen[bytes]] = {}
+ try:
+ for target in targets:
+ try:
+ start_component(target, "metasrv", procs)
+ start_component(target, "datanode", procs)
+ start_component(target, "frontend", procs)
+ command = [
+ str(runner), "run-otlp-target", "--case", str(case_path),
+ "--fixture-generator", str(fixture_generator),
+ "--otelgen-bin", str(args.otelgen_bin),
+ "--http-port", str(target.http_port),
+ "--target-name", target.name,
+ "--work-dir", str(target.work_dir),
+ "--output", str(target.work_dir / "report.json"),
+ "--http-timeout", str(args.http_timeout),
+ ]
+ status = subprocess.run(command, check=False).returncode
+ finally:
+ stop_all([target], procs)
+ if status != 0:
+ return status
+
+ output = work_dir / "query-regression-report.json"
+ finalize = [
+ str(runner), "finalize-otlp", "--case", str(case_path),
+ "--fixture-generator", str(fixture_generator),
+ "--base-result", str(targets[0].work_dir / "report.json"),
+ "--candidate-result", str(targets[1].work_dir / "report.json"),
+ "--output", str(output),
+ ]
+ status = subprocess.run(finalize, check=False).returncode
+ if status != 0:
+ return status
+ report = json.loads(output.read_text(encoding="utf-8"))
+ return 1 if report.get("status") == "failed" else 0
+ finally:
+ stop_all(targets, procs)
+
+
def run_case(args: argparse.Namespace, case_path: Path, work_dir: Path) -> int:
target_dir = profile_dir(args.cargo_profile)
base_bin = args.base_bin or args.base_src / "target" / target_dir / "greptime"
candidate_bin = args.candidate_bin or args.candidate_src / "target" / target_dir / "greptime"
fixture_generator = args.fixture_generator or args.candidate_src / "target" / target_dir / "query_perf_fixture"
- cmd = [
- "uv",
- "run",
- "--no-project",
- "python",
- str(args.candidate_src / "tests/perf/query_regression_runner.py"),
- "--case",
- str(case_path),
- "--base-bin",
- str(base_bin),
- "--candidate-bin",
- str(candidate_bin),
- "--fixture-generator",
- str(fixture_generator),
- "--work-dir",
- str(work_dir),
- "--http-timeout",
- str(args.http_timeout),
- ]
- if parse_bool(args.allow_large_fixture):
- cmd.append("--allow-large-fixture")
- if args.otelgen_bin is not None:
- cmd.extend(["--otelgen-bin", str(args.otelgen_bin)])
-
+ runner = args.runner or args.candidate_src / "target" / target_dir / "query_regression_runner"
+ plan = load_plan(fixture_generator, case_path)
+ scenario = plan.get("scenario")
+ kind = scenario.get("kind") if isinstance(scenario, dict) else None
print(f"::group::Query regression case: {case_path}", flush=True)
try:
- return subprocess.run(cmd, check=False).returncode
+ if kind == "direct_readable_sst":
+ return run_direct_case(
+ args,
+ case_path,
+ work_dir,
+ base_bin,
+ candidate_bin,
+ fixture_generator,
+ runner,
+ )
+ if kind == "prom_remote_write_then_query":
+ return run_remote_case(
+ args,
+ case_path,
+ work_dir,
+ base_bin,
+ candidate_bin,
+ fixture_generator,
+ runner,
+ )
+ if kind == "otlp_trace_load":
+ return run_otlp_case(
+ args,
+ case_path,
+ work_dir,
+ base_bin,
+ candidate_bin,
+ fixture_generator,
+ runner,
+ )
+ raise ValueError(
+ f"unsupported scenario kind {kind!r}; supported: "
+ "'direct_readable_sst', 'prom_remote_write_then_query', 'otlp_trace_load'"
+ )
finally:
print("::endgroup::", flush=True)
@@ -157,6 +605,27 @@ def write_summary(args: argparse.Namespace, reports: list[Path]) -> int:
return subprocess.run(cmd, check=False).returncode
+def write_failed_report(work_dir: Path, case_path: Path, error: Exception) -> None:
+ work_dir.mkdir(parents=True, exist_ok=True)
+ path = work_dir / "query-regression-report.json"
+ try:
+ report = json.loads(path.read_text(encoding="utf-8"))
+ if not isinstance(report, dict) or not isinstance(report.get("targets"), list) or not isinstance(report.get("thresholds"), list):
+ raise ValueError("existing report is malformed")
+ except (OSError, ValueError, json.JSONDecodeError):
+ report = {
+ "case_path": str(case_path),
+ "targets": [],
+ "thresholds": [],
+ }
+ report["status"] = "failed"
+ report["error"] = repr(error)
+ path.write_text(
+ json.dumps(report, indent=2, sort_keys=True) + "\n",
+ encoding="utf-8",
+ )
+
+
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("--cases", action="append", help="'all', 'heavy', or comma/space separated case paths")
@@ -170,6 +639,7 @@ def main() -> int:
default=configured_path(os.environ.get("FIXTURE_GENERATOR")),
)
parser.add_argument("--otelgen-bin", type=Path, default=configured_path(os.environ.get("OTELGEN_BIN")))
+ parser.add_argument("--runner", type=Path, default=configured_path(os.environ.get("QUERY_REGRESSION_RUNNER")))
parser.add_argument("--cargo-profile", default=os.environ.get("CARGO_PROFILE", "nightly"))
parser.add_argument("--work-dir", default=Path("query-regression-work"), type=Path)
parser.add_argument("--http-timeout", default=os.environ.get("HTTP_TIMEOUT", "300"))
@@ -199,7 +669,12 @@ def main() -> int:
case_path = resolve_case_path(args.candidate_src, case)
work_dir = args.work_dir / case_slug(case_path)
reports.append(work_dir / "query-regression-report.json")
- case_status = run_case(args, case_path, work_dir)
+ try:
+ case_status = run_case(args, case_path, work_dir)
+ except Exception as err: # noqa: BLE001 - preserve an aggregate report for the summary step
+ print(f"error: query regression case {case_path}: {err}", flush=True)
+ write_failed_report(work_dir, case_path, err)
+ case_status = 1
if case_status != 0:
status = case_status or 1
diff --git a/.github/scripts/run-compat.py b/.github/scripts/run-compat.py
index 8f1245bd396..2490caf833c 100644
--- a/.github/scripts/run-compat.py
+++ b/.github/scripts/run-compat.py
@@ -62,6 +62,10 @@ def parse_args() -> argparse.Namespace:
action="store_true",
help="Pass --preserve-state to the real compat run for artifact upload.",
)
+ parser.add_argument(
+ "--from-versions-extra",
+ help="Comma-separated extra from-versions appended to the ci.toml window (for nightly runs).",
+ )
return parser.parse_args()
@@ -108,6 +112,28 @@ def load_versions(
return validated
+def load_extra_versions(raw: str | None, window: list[str]) -> list[str]:
+ """Parse --from-versions-extra, skipping versions already in the window.
+
+ Each entry must match VERSION_RE; like load_versions, no version may appear
+ twice in the effective list, so window entries and duplicates are skipped.
+ Order is preserved.
+ """
+ if not raw:
+ return []
+ extra: list[str] = []
+ seen: set[str] = set()
+ for item in raw.split(","):
+ version = item.strip()
+ if VERSION_RE.fullmatch(version) is None:
+ raise SystemExit(f"Invalid compat from-versions-extra version: {version!r}")
+ if version in window or version in seen:
+ continue
+ seen.add(version)
+ extra.append(version)
+ return extra
+
+
def check_inputs(runner: Path, to_bins_dir: Path) -> None:
if not runner.is_file():
raise SystemExit(f"sqlness-runner binary not found: {runner}")
@@ -253,6 +279,7 @@ def main() -> int:
check_inputs(runner, to_bins_dir)
from_versions = load_versions(config_path, "from_versions")
+ extra_versions = load_extra_versions(args.from_versions_extra, from_versions)
downgrade_to_versions = load_versions(
config_path, "downgrade_to_versions", required=False
)
@@ -260,8 +287,10 @@ def main() -> int:
print("Compatibility from-version window:", flush=True)
for version in from_versions:
print(f" - {version}", flush=True)
+ for version in extra_versions:
+ print(f" - {version} (nightly extra)", flush=True)
- for from_version in from_versions:
+ for from_version in [*from_versions, *extra_versions]:
run_for_version(
runner=runner,
to_bins_dir=to_bins_dir,
diff --git a/.github/scripts/tests/test_update_compat_versions.py b/.github/scripts/tests/test_update_compat_versions.py
new file mode 100644
index 00000000000..7bfc3d1414b
--- /dev/null
+++ b/.github/scripts/tests/test_update_compat_versions.py
@@ -0,0 +1,332 @@
+#!/usr/bin/env python3
+# Copyright 2023 Greptime Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import contextlib
+import importlib.util
+import io
+import json
+import tempfile
+import unittest
+import urllib.error
+from pathlib import Path
+from unittest import mock
+
+
+SCRIPT = Path(__file__).resolve().parents[1] / "update-compat-versions.py"
+SPEC = importlib.util.spec_from_file_location("update_compat_versions", SCRIPT)
+assert SPEC is not None and SPEC.loader is not None
+UPDATER = importlib.util.module_from_spec(SPEC)
+SPEC.loader.exec_module(UPDATER)
+
+
+class UpdateCompatVersionsTest(unittest.TestCase):
+ def write_case(self, root: Path, name: str, from_range: str) -> None:
+ case_dir = root / "tests" / "compatibility" / "cases" / name
+ case_dir.mkdir(parents=True)
+ (case_dir / "case.toml").write_text(
+ f'name = "{name}"\nfrom_range = {from_range}\n', encoding="utf-8"
+ )
+
+ def write_config(self, root: Path, versions: str, trailer: str = "") -> Path:
+ config = root / "tests" / "compatibility" / "ci.toml"
+ config.parent.mkdir(parents=True, exist_ok=True)
+ config.write_text(
+ "# Keep these comments when the window is regenerated.\n"
+ f"from_versions = {versions}\n{trailer}",
+ encoding="utf-8",
+ )
+ return config
+
+ def test_stable_tags_filter_prereleases_and_nightlies(self) -> None:
+ self.assertEqual(
+ ["v1.0.0", "v1.0.2", "v1.1.0"],
+ UPDATER.stable_tags(
+ ["v1.1.0-nightly-20260101", "v1.0.2", "v1.0.0", "v1.1.0", "v1.0.0-rc.1"]
+ ),
+ )
+
+ def test_sliding_versions_roll_over_to_two_newest_minor_lines(self) -> None:
+ self.assertEqual(
+ ["v1.9.4", "v2.0.1"],
+ UPDATER.sliding_versions(["v1.8.9", "v1.9.0", "v1.9.4", "v2.0.0", "v2.0.1"]),
+ )
+
+ def test_sliding_versions_supports_one_minor_line(self) -> None:
+ self.assertEqual(["v1.1.3"], UPDATER.sliding_versions(["v1.1.0", "v1.1.3"]))
+
+ def test_sliding_versions_rejects_no_stable_tags(self) -> None:
+ with self.assertRaisesRegex(UPDATER.CompatVersionError, "No stable release tags"):
+ UPDATER.sliding_versions(["v1.1.0-rc.1", "v1.1.0-nightly-20260101"])
+
+ def test_effective_versions_returns_only_the_sliding_window(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_case(root, "historical", '["=v1.0.2", ">=v1.1.0"]')
+ versions = UPDATER.effective_versions(["v1.0.2", "v1.1.0", "v1.1.1", "v1.1.3"])
+ self.assertEqual(["v1.0.2", "v1.1.3"], versions)
+
+ def test_nightly_versions_includes_anchors_and_sliding(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_case(root, "historical", '["=v1.0.2", ">=v1.1.0"]')
+ self.write_case(root, "more_history", '["=v1.1.0", "=v1.1.1"]')
+ versions = UPDATER.nightly_versions(
+ ["v1.0.2", "v1.1.0", "v1.1.1", "v1.1.3"],
+ root / "tests" / "compatibility" / "cases",
+ )
+ self.assertEqual(["v1.0.2", "v1.1.0", "v1.1.1", "v1.1.3"], versions)
+
+ def test_exact_anchor_syntaxes_are_normalized(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_case(
+ root,
+ "historical",
+ '[" = v1.0.2 ", " == v1.1.0 ", " v1.1.1 ", "1.1.2", "v01.01.003-rc.1"]',
+ )
+ anchors = UPDATER.extract_pinned_anchors(root / "tests" / "compatibility" / "cases")
+ self.assertEqual(
+ {"v1.0.2", "v1.1.0", "v1.1.1", "v1.1.2", "v1.1.3"}, anchors
+ )
+
+ def test_ordered_ranges_and_wildcard_are_not_anchors(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_case(
+ root,
+ "non_exact",
+ '[">= v1.0.0", "<=v1.1.0", ">v1.0.2", "< v2.0.0", "*"]',
+ )
+ anchors = UPDATER.extract_pinned_anchors(root / "tests" / "compatibility" / "cases")
+ self.assertEqual(set(), anchors)
+
+ def test_update_is_sorted_and_idempotent(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ config = self.write_config(
+ root,
+ '[\n "v1.1.0",\n "v1.0.2",\n]',
+ "# This trailing comment must remain.\nother_setting = true\n",
+ )
+ self.write_case(root, "historical", '["=v1.0.2"]')
+ tags = ["v1.0.2", "v1.1.0", "v1.1.1", "v1.1.3"]
+ with mock.patch.object(UPDATER, "git_tags", return_value=tags):
+ self.assertEqual(0, UPDATER.main(["--repo-root", str(root), "--update"]))
+ first_update = config.read_text(encoding="utf-8")
+ self.assertEqual(0, UPDATER.main(["--repo-root", str(root), "--update"]))
+ self.assertEqual(first_update, config.read_text(encoding="utf-8"))
+ self.assertIn('from_versions = ["v1.0.2", "v1.1.3"]', first_update)
+ self.assertIn("# Keep these comments when the window is regenerated.", first_update)
+ self.assertIn("# This trailing comment must remain.\nother_setting = true\n", first_update)
+
+ def test_check_reports_a_unified_diff_for_stale_config(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_config(root, '["v1.0.2"]')
+ self.write_case(root, "historical", '["=v1.0.2"]')
+ stderr = io.StringIO()
+ with mock.patch.object(UPDATER, "git_tags", return_value=["v1.0.2", "v1.1.3"]):
+ with contextlib.redirect_stderr(stderr):
+ result = UPDATER.main(["--repo-root", str(root), "--check"])
+ self.assertEqual(1, result)
+ self.assertIn("--- a/tests/compatibility/ci.toml", stderr.getvalue())
+ self.assertIn("+++ b/tests/compatibility/ci.toml", stderr.getvalue())
+
+ def test_rejects_duplicate_config_versions(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ config = self.write_config(Path(directory), '["v1.0.2", "v1.0.2"]')
+ with self.assertRaisesRegex(UPDATER.CompatVersionError, "Duplicate from_versions"):
+ UPDATER.load_from_versions(config)
+
+ def test_rejects_unavailable_pinned_anchor(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_case(root, "historical", '["=v1.0.2"]')
+ with self.assertRaisesRegex(UPDATER.CompatVersionError, "unavailable"):
+ UPDATER.nightly_versions(
+ ["v1.1.0"], root / "tests" / "compatibility" / "cases"
+ )
+
+ def test_rejects_malformed_exact_constraint(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_case(root, "historical", '["=v1.0"]')
+ with self.assertRaisesRegex(UPDATER.CompatVersionError, "Malformed version"):
+ UPDATER.extract_pinned_anchors(root / "tests" / "compatibility" / "cases")
+
+ def test_rejects_malformed_bare_exact_constraint(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_case(root, "historical", '["v1.0"]')
+ with self.assertRaisesRegex(UPDATER.CompatVersionError, "Malformed version"):
+ UPDATER.extract_pinned_anchors(root / "tests" / "compatibility" / "cases")
+
+ def test_rejects_malformed_ordered_constraint(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_case(root, "historical", '[">=v1.0"]')
+ with self.assertRaisesRegex(UPDATER.CompatVersionError, "Malformed version"):
+ UPDATER.extract_pinned_anchors(root / "tests" / "compatibility" / "cases")
+
+ def test_published_only_excludes_failed_release_tags(self) -> None:
+ self.assertEqual(
+ ["v1.0.2", "v1.1.3"],
+ UPDATER.effective_versions(
+ ["v1.0.2", "v1.1.3", "v1.1.4"], published={"v1.0.2", "v1.1.3"}
+ ),
+ )
+
+ def test_published_only_empty_intersection_raises(self) -> None:
+ with self.assertRaisesRegex(UPDATER.CompatVersionError, "published release assets"):
+ UPDATER.effective_versions(["v1.0.2"], published={"v1.1.4"})
+
+ def test_required_asset_names(self) -> None:
+ self.assertEqual(
+ {
+ "greptime-linux-amd64-v1.1.4.tar.gz",
+ "greptime-linux-amd64-v1.1.4.sha256sum",
+ },
+ UPDATER.required_asset_names("v1.1.4"),
+ )
+
+ class _FakeResponse:
+ def __init__(self, payload) -> None:
+ self._payload = payload
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *exc) -> None:
+ return None
+
+ def read(self) -> bytes:
+ return json.dumps(self._payload).encode("utf-8")
+
+ def _release(self, tag: str, *, draft=False, prerelease=False, assets=()) -> dict:
+ return {
+ "tag_name": tag,
+ "draft": draft,
+ "prerelease": prerelease,
+ "assets": [{"name": name} for name in assets],
+ }
+
+ def test_published_release_tags_parses_and_filters(self) -> None:
+ required = {
+ "greptime-linux-amd64-v1.1.4.tar.gz",
+ "greptime-linux-amd64-v1.1.4.sha256sum",
+ }
+ page_one = [
+ self._release(f"preview-{i}", assets=required) for i in range(96)
+ ] + [
+ self._release("v1.1.4", assets=required),
+ self._release("v1.1.3", draft=True, assets=required),
+ self._release("v1.1.2", prerelease=True, assets=UPDATER.required_asset_names("v1.1.2")),
+ self._release("v1.1.1", assets={"greptime-linux-amd64-v1.1.1.tar.gz"}),
+ ]
+ self.assertEqual(100, len(page_one))
+ page_two = [
+ self._release("v1.0.2", assets=UPDATER.required_asset_names("v1.0.2")),
+ self._release("v1.0.1-beta", assets=required),
+ ]
+ calls: list[str] = []
+
+ def fake_urlopen(request, *args, **kwargs):
+ calls.append(request.full_url)
+ payload = page_two if "page=2" in request.full_url else page_one
+ return self._FakeResponse(payload)
+
+ with mock.patch.object(UPDATER.urllib.request, "urlopen", side_effect=fake_urlopen):
+ published = UPDATER.published_release_tags("GreptimeTeam", "greptimedb", None)
+ # Draft releases are excluded; prerelease releases with the required
+ # assets are included; releases missing assets or with non-stable tags
+ # are excluded.
+ self.assertEqual({"v1.1.4", "v1.1.2", "v1.0.2"}, published)
+ self.assertEqual(2, len(calls))
+ self.assertTrue(all("per_page=100" in url for url in calls))
+
+ def test_published_release_tags_http_error_raises(self) -> None:
+ with mock.patch.object(
+ UPDATER.urllib.request,
+ "urlopen",
+ side_effect=urllib.error.HTTPError(
+ "https://api.github.com/repos/GreptimeTeam/greptimedb/releases",
+ 403,
+ "Forbidden",
+ None,
+ None,
+ ),
+ ):
+ with self.assertRaisesRegex(
+ UPDATER.CompatVersionError, "Unable to fetch published releases"
+ ):
+ UPDATER.published_release_tags("GreptimeTeam", "greptimedb", None)
+
+ def test_check_anchors_rejects_unpublished_anchor(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_case(root, "historical", '["=v1.0.2", "=v1.1.0"]')
+ with mock.patch.object(UPDATER, "git_tags", return_value=["v1.0.2", "v1.1.0"]):
+ with mock.patch.object(
+ UPDATER, "published_release_tags", return_value={"v1.0.2"}
+ ):
+ result = UPDATER.main(["--check-anchors", "--repo-root", str(root)])
+ self.assertEqual(2, result)
+
+ def test_check_anchors_passes(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_case(root, "historical", '["=v1.0.2", "=v1.1.0"]')
+ with mock.patch.object(UPDATER, "git_tags", return_value=["v1.0.2", "v1.1.0"]):
+ with mock.patch.object(
+ UPDATER, "published_release_tags", return_value={"v1.0.2", "v1.1.0"}
+ ):
+ result = UPDATER.main(["--check-anchors", "--repo-root", str(root)])
+ self.assertEqual(0, result)
+
+ def test_nightly_window_prints_csv(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ self.write_case(root, "historical", '["=v1.0.2"]')
+ self.write_case(root, "more_history", '["=v1.1.0", "=v1.1.1"]')
+ stdout = io.StringIO()
+ with mock.patch.object(
+ UPDATER, "git_tags", return_value=["v1.0.2", "v1.1.0", "v1.1.1", "v1.1.3"]
+ ):
+ with contextlib.redirect_stdout(stdout):
+ result = UPDATER.main(["--nightly-window", "--repo-root", str(root)])
+ self.assertEqual(0, result)
+ self.assertEqual("v1.0.2,v1.1.0,v1.1.1,v1.1.3\n", stdout.getvalue())
+
+ def test_update_with_published_only(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ config = self.write_config(root, '["v1.0.2"]')
+ self.write_case(root, "historical", '["=v1.0.2"]')
+ with mock.patch.object(
+ UPDATER, "git_tags", return_value=["v1.0.2", "v1.1.3", "v1.1.4"]
+ ):
+ with mock.patch.object(
+ UPDATER, "published_release_tags", return_value={"v1.0.2", "v1.1.3"}
+ ):
+ result = UPDATER.main(
+ ["--update", "--published-only", "--repo-root", str(root)]
+ )
+ updated = config.read_text(encoding="utf-8")
+ self.assertEqual(0, result)
+ self.assertIn('from_versions = ["v1.0.2", "v1.1.3"]', updated)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/.github/scripts/update-compat-versions.py b/.github/scripts/update-compat-versions.py
new file mode 100644
index 00000000000..2e8fec928fe
--- /dev/null
+++ b/.github/scripts/update-compat-versions.py
@@ -0,0 +1,468 @@
+#!/usr/bin/env python3
+# Copyright 2023 Greptime Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Update the compatibility CI version window from local release tags and cases.
+
+The PR window keeps only the sliding window over stable release tags whose
+GitHub releases carry the sqlness compat artifacts (greptime-linux-amd64
+tar.gz and sha256sum). Exact =vX.Y.Z `from_range` anchors in case.toml are not
+retained in the PR window: they are validated with --check-anchors and
+exercised by nightly runs via --nightly-window.
+"""
+
+from __future__ import annotations
+
+import argparse
+import ast
+import difflib
+import json
+import os
+import re
+import subprocess
+import sys
+import urllib.error
+import urllib.request
+from pathlib import Path
+from typing import Iterable
+
+
+VERSION_RE = re.compile(r"^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$")
+FROM_VERSIONS_RE = re.compile(
+ r"(?ms)^(?P[ \t]*)from_versions[ \t]*=[ \t]*(?P\[(?:[^\]]|\n)*?\])"
+)
+FROM_VERSIONS_ASSIGNMENT_RE = re.compile(r"(?m)^[ \t]*from_versions[ \t]*=")
+FROM_RANGE_RE = re.compile(
+ r"(?ms)^[ \t]*from_range[ \t]*=[ \t]*(?P\[(?:[^\]]|\n)*?\])"
+)
+FROM_RANGE_ASSIGNMENT_RE = re.compile(r"(?m)^[ \t]*from_range[ \t]*=")
+
+
+class CompatVersionError(ValueError):
+ """A compatibility version source does not satisfy the updater policy."""
+
+
+def version_key(version: str) -> tuple[int, int, int]:
+ """Return a sortable semantic-version key for a stable version tag."""
+ match = VERSION_RE.fullmatch(version)
+ if match is None:
+ raise CompatVersionError(f"Not a stable release tag: {version!r}")
+ major, minor, patch = (int(part) for part in match.groups())
+ return major, minor, patch
+
+
+def stable_tags(tags: Iterable[str]) -> list[str]:
+ """Keep only exact stable release tags, excluding prereleases and nightlies."""
+ return sorted({tag for tag in tags if VERSION_RE.fullmatch(tag)}, key=version_key)
+
+
+def sliding_versions(tags: Iterable[str]) -> list[str]:
+ """Return the latest patch in each of the two newest stable minor lines."""
+ stable = stable_tags(tags)
+ if not stable:
+ raise CompatVersionError("No stable release tags found (expected exact v.. tags)")
+
+ latest_by_minor: dict[tuple[int, int], str] = {}
+ for tag in stable:
+ major, minor, _ = version_key(tag)
+ minor_line = (major, minor)
+ if minor_line not in latest_by_minor or version_key(tag) > version_key(
+ latest_by_minor[minor_line]
+ ):
+ latest_by_minor[minor_line] = tag
+
+ newest_minor_lines = sorted(latest_by_minor, reverse=True)[:2]
+ return sorted((latest_by_minor[line] for line in newest_minor_lines), key=version_key)
+
+
+def _parse_string_array(array: str, context: str) -> list[str]:
+ without_comments = "\n".join(line.split("#", 1)[0] for line in array.splitlines())
+ try:
+ values = ast.literal_eval(without_comments)
+ except (SyntaxError, ValueError) as err:
+ raise CompatVersionError(f"Malformed string array in {context}: {err}") from err
+
+ if not isinstance(values, list) or any(not isinstance(value, str) for value in values):
+ raise CompatVersionError(f"{context} must be a TOML string array")
+ return values
+
+
+def _from_versions_match(content: str, config_path: Path) -> re.Match[str]:
+ matches = list(FROM_VERSIONS_RE.finditer(content))
+ assignments = list(FROM_VERSIONS_ASSIGNMENT_RE.finditer(content))
+ if len(assignments) != 1 or len(matches) != 1:
+ raise CompatVersionError(f"{config_path} must define exactly one from_versions array")
+ match = matches[0]
+ remainder = content[match.end() :].split("\n", 1)[0].strip()
+ if remainder and not remainder.startswith("#"):
+ raise CompatVersionError(f"Malformed from_versions assignment in {config_path}")
+ return match
+
+
+def load_from_versions(config_path: Path) -> list[str]:
+ """Validate and load the current checked-in compatibility window."""
+ if not config_path.is_file():
+ raise CompatVersionError(f"Compatibility CI config not found: {config_path}")
+
+ match = _from_versions_match(config_path.read_text(encoding="utf-8"), config_path)
+ versions = _parse_string_array(match.group("array"), str(config_path))
+ if not versions:
+ raise CompatVersionError(f"{config_path} must define a non-empty from_versions list")
+
+ duplicates = {version for version in versions if versions.count(version) > 1}
+ if duplicates:
+ raise CompatVersionError(
+ f"Duplicate from_versions in {config_path}: {', '.join(sorted(duplicates))}"
+ )
+ for version in versions:
+ version_key(version)
+ return versions
+
+
+def extract_pinned_anchors(cases_dir: Path) -> set[str]:
+ """Extract exact from_range constraints that must remain in the CI window."""
+ if not cases_dir.is_dir():
+ raise CompatVersionError(f"Compatibility cases directory not found: {cases_dir}")
+ anchors: set[str] = set()
+ for case_path in sorted(cases_dir.glob("**/case.toml")):
+ content = case_path.read_text(encoding="utf-8")
+ assignments = list(FROM_RANGE_ASSIGNMENT_RE.finditer(content))
+ matches = list(FROM_RANGE_RE.finditer(content))
+ if len(assignments) != 1 or len(matches) != 1:
+ raise CompatVersionError(f"{case_path} must define exactly one from_range array")
+
+ for constraint in _parse_string_array(matches[0].group("array"), str(case_path)):
+ anchor = exact_anchor(constraint, case_path)
+ if anchor is not None:
+ anchors.add(anchor)
+ return anchors
+
+
+def _runner_version(raw: str, case_path: Path, constraint: str) -> str:
+ """Parse and normalize a version exactly like compat_case.rs Version::parse."""
+ stripped = raw.strip()
+ if stripped.startswith("v"):
+ stripped = stripped[1:]
+ core = stripped.split("-", 1)[0].split("+", 1)[0]
+ parts = core.split(".")
+ if len(parts) != 3:
+ raise CompatVersionError(
+ f"Malformed version in from_range constraint in {case_path}: {constraint!r}"
+ )
+
+ numbers: list[int] = []
+ for part in parts:
+ if not part.isascii() or not part.isdigit():
+ raise CompatVersionError(
+ f"Malformed version in from_range constraint in {case_path}: {constraint!r}"
+ )
+ value = int(part)
+ if value > 2**64 - 1:
+ raise CompatVersionError(
+ f"Version component overflows u64 in {case_path}: {constraint!r}"
+ )
+ numbers.append(value)
+ return f"v{numbers[0]}.{numbers[1]}.{numbers[2]}"
+
+
+def exact_anchor(constraint: str, case_path: Path) -> str | None:
+ """Validate a runner constraint and return its normalized exact anchor."""
+ normalized = constraint.strip()
+ if not normalized:
+ raise CompatVersionError(f"Empty from_range constraint in {case_path}")
+ if normalized == "*":
+ return None
+
+ for operator in (">=", "<=", "==", "=", ">", "<"):
+ if normalized.startswith(operator):
+ version = _runner_version(normalized[len(operator) :], case_path, constraint)
+ return version if operator in ("==", "=") else None
+
+ return _runner_version(normalized, case_path, constraint)
+
+
+def required_asset_names(tag: str) -> set[str]:
+ """Return the release assets the sqlness compat runner downloads for a tag."""
+ return {
+ f"greptime-linux-amd64-{tag}.tar.gz",
+ f"greptime-linux-amd64-{tag}.sha256sum",
+ }
+
+
+def published_release_tags(owner: str, repo: str, token: str | None) -> set[str]:
+ """Return stable tags whose non-draft GitHub releases carry the required assets.
+
+ Only draft releases are skipped: prerelease-flagged releases with the
+ required assets are included, and VERSION_RE already excludes prerelease
+ version tags (e.g. v1.2.0-beta.1).
+ """
+ published: set[str] = set()
+ page = 1
+ while True:
+ url = (
+ f"https://api.github.com/repos/{owner}/{repo}/releases"
+ f"?per_page=100&page={page}"
+ )
+ headers = {
+ "Accept": "application/vnd.github+json",
+ "User-Agent": "update-compat-versions",
+ }
+ if token:
+ headers["Authorization"] = f"Bearer {token}"
+ request = urllib.request.Request(url, headers=headers)
+ try:
+ with urllib.request.urlopen(request) as response:
+ payload = json.loads(response.read().decode("utf-8"))
+ except (urllib.error.HTTPError, urllib.error.URLError, OSError, ValueError) as err:
+ raise CompatVersionError(
+ f"Unable to fetch published releases from {url}: {err}"
+ ) from err
+ if not isinstance(payload, list):
+ raise CompatVersionError(
+ f"Unexpected response from {url}: expected a JSON release list"
+ )
+
+ for release in payload:
+ if not isinstance(release, dict):
+ continue
+ if release.get("draft"):
+ continue
+ tag = release.get("tag_name")
+ if not isinstance(tag, str) or VERSION_RE.fullmatch(tag) is None:
+ continue
+ assets = release.get("assets")
+ asset_names: set[str] = set()
+ if isinstance(assets, list):
+ asset_names = {
+ asset.get("name")
+ for asset in assets
+ if isinstance(asset, dict) and isinstance(asset.get("name"), str)
+ }
+ if required_asset_names(tag) <= asset_names:
+ published.add(tag)
+
+ if len(payload) < 100:
+ break
+ page += 1
+ return published
+
+
+def effective_versions(tags: Iterable[str], published: set[str] | None = None) -> list[str]:
+ """Return the PR window: the sliding window over stable release tags.
+
+ Exact =vX.Y.Z case anchors are intentionally excluded; they are validated
+ with --check-anchors and exercised by nightly runs (--nightly-window).
+ When ``published`` is given, only stable tags with published release
+ assets are considered.
+ """
+ stable = stable_tags(tags)
+ if published is not None:
+ stable = sorted(set(stable) & set(published), key=version_key)
+ if not stable:
+ raise CompatVersionError(
+ "No stable tags have published release assets "
+ "(greptime-linux-amd64 tar.gz and sha256sum); cannot compute the sliding window"
+ )
+ return sliding_versions(stable)
+
+
+def nightly_versions(
+ tags: Iterable[str], cases_dir: Path, published: set[str] | None = None
+) -> list[str]:
+ """Return the nightly window: exact anchors plus the sliding release window."""
+ anchors = extract_pinned_anchors(cases_dir)
+ window = effective_versions(tags, published)
+ available = set(stable_tags(tags))
+ if published is not None:
+ available &= set(published)
+ unavailable = sorted(anchors - available, key=version_key)
+ if unavailable:
+ raise CompatVersionError(
+ "Pinned compatibility anchor(s) are unavailable as stable git tags: "
+ + ", ".join(unavailable)
+ )
+ return sorted(anchors | set(window), key=version_key)
+
+
+def updated_config(content: str, config_path: Path, versions: list[str]) -> str:
+ """Return config content with only the from_versions assignment replaced."""
+ match = _from_versions_match(content, config_path)
+ # Validate the existing setting before replacing it, so malformed or duplicate
+ # checked-in configs never get silently repaired by automation.
+ load_from_versions(config_path)
+ rendered = (
+ f'{match.group("indent")}from_versions = ['
+ + ", ".join(f'"{version}"' for version in versions)
+ + "]"
+ )
+ return content[: match.start()] + rendered + content[match.end() :]
+
+
+def git_tags(repo_root: Path) -> list[str]:
+ try:
+ result = subprocess.run(
+ ["git", "tag", "--list"],
+ cwd=repo_root,
+ check=True,
+ text=True,
+ capture_output=True,
+ )
+ except (OSError, subprocess.CalledProcessError) as err:
+ raise CompatVersionError(f"Unable to read local git tags in {repo_root}: {err}") from err
+ return result.stdout.splitlines()
+
+
+def _owner_repo() -> tuple[str, str]:
+ """Return the (owner, repo) pair from GITHUB_REPOSITORY or the default repo."""
+ repository = os.environ.get("GITHUB_REPOSITORY", "GreptimeTeam/greptimedb")
+ owner, _, repo = repository.partition("/")
+ if not owner or not repo:
+ return "GreptimeTeam", "greptimedb"
+ return owner, repo
+
+
+def _github_token() -> str | None:
+ """Return the GitHub token from the environment, if any."""
+ return os.environ.get("GH_TOKEN") or os.environ.get("GITHUB_TOKEN")
+
+
+def check_anchors(repo_root: Path, cases_dir: Path) -> int:
+ """Validate every exact anchor is a stable git tag with a published release.
+
+ Returns 0 when all anchors are runnable; prints problems to stderr and
+ returns 2 when any anchor fails.
+ """
+ tags = set(git_tags(repo_root))
+ anchors = extract_pinned_anchors(cases_dir)
+ if not anchors:
+ return 0
+ published = published_release_tags(*_owner_repo(), _github_token())
+ problems: list[str] = []
+ for anchor in sorted(anchors, key=version_key):
+ if anchor not in tags:
+ problems.append(f"{anchor}: not a stable git tag")
+ elif anchor not in published:
+ problems.append(f"{anchor}: missing published release with required assets")
+ if problems:
+ print(
+ "error: exact from_range anchor(s) are not runnable in compatibility CI:",
+ file=sys.stderr,
+ )
+ for problem in problems:
+ print(f" - {problem}", file=sys.stderr)
+ return 2
+ return 0
+
+
+def _path_from_repo(repo_root: Path, value: str | None, default: str) -> Path:
+ path = Path(value) if value is not None else Path(default)
+ return path if path.is_absolute() else repo_root / path
+
+
+def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
+ parser = argparse.ArgumentParser(description=__doc__)
+ modes = parser.add_mutually_exclusive_group()
+ modes.add_argument("--check", action="store_true", help="Fail if ci.toml is stale.")
+ modes.add_argument("--update", action="store_true", help="Rewrite only ci.toml from_versions.")
+ modes.add_argument(
+ "--nightly-window",
+ action="store_true",
+ help="Print the comma-separated nightly window (anchors plus sliding) to stdout.",
+ )
+ parser.add_argument(
+ "--check-anchors",
+ action="store_true",
+ help="Validate exact case anchors are stable git tags with published release assets.",
+ )
+ parser.add_argument(
+ "--published-only",
+ action="store_true",
+ help=(
+ "With --check/--update, restrict the window to stable tags with "
+ "published release assets (requires network)."
+ ),
+ )
+ parser.add_argument(
+ "--repo-root",
+ default=str(Path(__file__).resolve().parents[2]),
+ help="Repository root used for default paths and git tags.",
+ )
+ parser.add_argument("--config", help="Compatibility CI TOML path, relative to --repo-root.")
+ parser.add_argument("--cases-dir", help="Compatibility cases path, relative to --repo-root.")
+ return parser.parse_args(argv)
+
+
+def main(argv: list[str] | None = None) -> int:
+ args = parse_args(argv)
+ repo_root = Path(args.repo_root).resolve()
+ config_path = _path_from_repo(repo_root, args.config, "tests/compatibility/ci.toml")
+ cases_dir = _path_from_repo(repo_root, args.cases_dir, "tests/compatibility/cases")
+
+ if not (args.check or args.update or args.nightly_window or args.check_anchors):
+ print(
+ "error: one of --check, --update, --nightly-window, or --check-anchors is required",
+ file=sys.stderr,
+ )
+ return 2
+
+ try:
+ if args.nightly_window:
+ versions = nightly_versions(git_tags(repo_root), cases_dir)
+ print(",".join(versions))
+ return 0
+
+ if args.check or args.update:
+ content = config_path.read_text(encoding="utf-8")
+ published = (
+ published_release_tags(*_owner_repo(), _github_token())
+ if args.published_only
+ else None
+ )
+ versions = effective_versions(git_tags(repo_root), published)
+ updated = updated_config(content, config_path, versions)
+ else:
+ content = updated = ""
+
+ if args.check:
+ if content == updated:
+ if args.check_anchors:
+ return check_anchors(repo_root, cases_dir)
+ return 0
+ try:
+ display_path = config_path.relative_to(repo_root)
+ except ValueError:
+ display_path = config_path
+ sys.stderr.writelines(
+ difflib.unified_diff(
+ content.splitlines(keepends=True),
+ updated.splitlines(keepends=True),
+ fromfile=f"a/{display_path}",
+ tofile=f"b/{display_path}",
+ )
+ )
+ return 1
+
+ if content != updated:
+ config_path.write_text(updated, encoding="utf-8")
+
+ if args.check_anchors:
+ return check_anchors(repo_root, cases_dir)
+ except (CompatVersionError, OSError) as err:
+ print(f"error: {err}", file=sys.stderr)
+ return 2
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index 7f064f52eb5..8d7a37080b3 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -80,6 +80,14 @@ jobs:
run: python3 scripts/check-enterprise-license-test.py
- name: Run fuzz orchestration script tests
run: .github/scripts/run-fuzz-targets-test.sh
+ - name: Run query-regression Python tooling tests
+ run: |
+ python3 tests/perf/test_query_regression_runner_compaction_toctou.py
+ python3 tests/perf/test_query_regression_runner_otlp_trace_load.py
+ python3 tests/perf/test_query_regression_summary_otlp.py
+ python3 tests/perf/test_query_regression_case_selection.py
+ python3 tests/perf/test_query_regression_nightly_refs.py
+ python3 tests/perf/test_aliyun_ecs_runner_scripts.py
check:
if: ${{ github.repository == 'GreptimeTeam/greptimedb' }}
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 9095c4c19c4..b8868123a4a 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -237,6 +237,23 @@ jobs:
with:
artifact-name: bins
+ compat-updater-check:
+ if: ${{ github.repository == 'GreptimeTeam/greptimedb' && (github.event_name == 'merge_group' || github.event_name == 'pull_request') }}
+ name: Check compat version updater
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+ fetch-depth: 0
+ - name: Run compat updater unit tests
+ run: python3 -m unittest discover -s .github/scripts/tests -p 'test_*.py'
+ - name: Check compat version window and anchors
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: python3 .github/scripts/update-compat-versions.py --check --published-only --check-anchors
+
compat:
if: ${{ github.repository == 'GreptimeTeam/greptimedb' && (github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || (github.event_name == 'pull_request' && (github.event.action == 'ready_for_review' || (github.event.action == 'opened' && github.event.pull_request.draft == false)))) }}
name: Compatibility Test (recent releases)
@@ -247,6 +264,7 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
+ fetch-depth: 0
- name: Download pre-built binaries
uses: actions/download-artifact@v4
with:
@@ -254,8 +272,20 @@ jobs:
path: .
- name: Unzip binaries
run: tar -xvf ./bins.tar.gz
+ - name: Compute nightly compat window
+ id: nightly
+ if: ${{ github.event_name == 'schedule' }}
+ shell: bash
+ run: echo "extra=$(python3 .github/scripts/update-compat-versions.py --nightly-window)" >> "$GITHUB_OUTPUT"
- name: Run compatibility test
- run: python3 .github/scripts/run-compat.py --preserve-state
+ env:
+ NIGHTLY_EXTRA: ${{ steps.nightly.outputs.extra }}
+ run: |
+ EXTRA=""
+ if [[ "${GITHUB_EVENT_NAME}" == "schedule" && -n "${NIGHTLY_EXTRA}" ]]; then
+ EXTRA="--from-versions-extra=${NIGHTLY_EXTRA}"
+ fi
+ python3 .github/scripts/run-compat.py --preserve-state ${EXTRA}
- name: Upload compatibility logs
if: failure()
uses: actions/upload-artifact@v4
diff --git a/.github/workflows/pr-open-limit.yml b/.github/workflows/pr-open-limit.yml
new file mode 100644
index 00000000000..081454cb00e
--- /dev/null
+++ b/.github/workflows/pr-open-limit.yml
@@ -0,0 +1,48 @@
+name: PR Open Limit
+
+on:
+ pull_request_target:
+ types:
+ - opened
+ - reopened
+ - ready_for_review
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+ pull-requests: write
+ issues: write
+
+jobs:
+ check-open-limit:
+ name: Check Open Pull Request Limit
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ # Advisory: a script failure must not put a red cross on the pull request.
+ continue-on-error: true
+ if: ${{ github.repository == 'GreptimeTeam/greptimedb' }}
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '20'
+
+ - name: Install dependencies
+ working-directory: .github/scripts
+ run: npm ci
+
+ - name: Check open pull request limit
+ working-directory: .github/scripts
+ run: node pr-open-limit.js
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ PR_AUTHOR: ${{ github.event.pull_request.user.login }}
+ PR_IS_DRAFT: ${{ github.event.pull_request.draft }}
+ MAX_OPEN_PRS: ${{ vars.MAX_OPEN_PRS_PER_AUTHOR || 5 }}
diff --git a/.github/workflows/query-regression-janitor.yml b/.github/workflows/query-regression-janitor.yml
new file mode 100644
index 00000000000..ce277ce2f02
--- /dev/null
+++ b/.github/workflows/query-regression-janitor.yml
@@ -0,0 +1,36 @@
+name: Query Regression ECS Janitor
+
+# Safety net for the aliyun-ecs query-regression path: deletes managed ECS
+# instances (and their runner registrations) that outlived their workflow run,
+# so a failed teardown never leaks pay-as-you-go spend.
+
+on:
+ schedule:
+ - cron: "23 3 * * *"
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ sweep:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - name: Checkout teardown script
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+
+ - name: Install uv
+ uses: astral-sh/setup-uv@v6
+
+ - name: Sweep expired ECS runners
+ env:
+ ALIBABA_CLOUD_ACCESS_KEY_ID: ${{ secrets.ALICLOUD_ECS_ACCESS_KEY_ID }}
+ ALIBABA_CLOUD_ACCESS_KEY_SECRET: ${{ secrets.ALICLOUD_ECS_ACCESS_KEY_SECRET }}
+ GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
+ ALIYUN_ECS_REGION_ID: ${{ vars.ALIYUN_ECS_REGION_ID }}
+ run: >-
+ uv run .github/scripts/aliyun-ecs-runner-teardown.py
+ --sweep --sweep-ttl-hours 4
diff --git a/.github/workflows/query-regression-nightly.yml b/.github/workflows/query-regression-nightly.yml
new file mode 100644
index 00000000000..027fcd16987
--- /dev/null
+++ b/.github/workflows/query-regression-nightly.yml
@@ -0,0 +1,104 @@
+name: Query Regression Nightly
+
+# After a successful GreptimeDB Nightly Build, compare that commit against
+# the previous successful nightly. The reusable Query Regression workflow
+# still compiles both SHAs; this wrapper only resolves which two SHAs.
+
+on:
+ workflow_run:
+ workflows:
+ - GreptimeDB Nightly Build
+ types:
+ - completed
+ workflow_dispatch:
+ inputs:
+ base_ref:
+ description: Base ref/SHA (empty = previous successful nightly)
+ required: false
+ type: string
+ default: ""
+ candidate_ref:
+ description: Candidate ref/SHA (empty = latest successful nightly)
+ required: false
+ type: string
+ default: ""
+ candidate_run_id:
+ description: Nightly Build run id to treat as candidate (empty = latest)
+ required: false
+ type: string
+ default: ""
+ case:
+ description: Query perf case path(s), all, or heavy
+ required: false
+ type: string
+ default: all
+
+permissions:
+ contents: read
+ actions: read
+
+jobs:
+ resolve-refs:
+ name: Resolve previous vs current nightly SHAs
+ if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ outputs:
+ skip: ${{ steps.refs.outputs.skip }}
+ reason: ${{ steps.refs.outputs.reason }}
+ base_sha: ${{ steps.refs.outputs.base_sha }}
+ candidate_sha: ${{ steps.refs.outputs.candidate_sha }}
+ steps:
+ - name: Checkout ref resolver
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+
+ - name: Resolve nightly SHAs
+ id: refs
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ GITHUB_REPOSITORY: ${{ github.repository }}
+ CANDIDATE_RUN_ID: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.id || inputs.candidate_run_id || '' }}
+ BASE_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.base_ref || '' }}
+ CANDIDATE_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.candidate_ref || '' }}
+ run: python3 .github/scripts/query-regression-nightly-refs.py
+
+ - name: Summarize comparison
+ if: always()
+ env:
+ SKIP: ${{ steps.refs.outputs.skip }}
+ REASON: ${{ steps.refs.outputs.reason }}
+ BASE_SHA: ${{ steps.refs.outputs.base_sha }}
+ CANDIDATE_SHA: ${{ steps.refs.outputs.candidate_sha }}
+ BASE_RUN_URL: ${{ steps.refs.outputs.base_run_url }}
+ CANDIDATE_RUN_URL: ${{ steps.refs.outputs.candidate_run_url }}
+ run: |
+ set -euo pipefail
+ {
+ if [[ "${SKIP}" == "true" ]]; then
+ printf 'Skipping query-regression nightly: %s\n' "${REASON}"
+ else
+ printf 'Comparing previous nightly `%s` -> current nightly `%s`\n' \
+ "${BASE_SHA}" "${CANDIDATE_SHA}"
+ if [[ -n "${BASE_RUN_URL}" ]]; then
+ printf -- '- Previous Nightly Build: %s\n' "${BASE_RUN_URL}"
+ fi
+ if [[ -n "${CANDIDATE_RUN_URL}" ]]; then
+ printf -- '- Current Nightly Build: %s\n' "${CANDIDATE_RUN_URL}"
+ fi
+ fi
+ } | tee -a "${GITHUB_STEP_SUMMARY}"
+
+ query-regression:
+ name: Query regression nightly
+ needs: [resolve-refs]
+ if: ${{ needs.resolve-refs.outputs.skip != 'true' && needs.resolve-refs.outputs.base_sha != '' && needs.resolve-refs.outputs.candidate_sha != '' }}
+ uses: ./.github/workflows/query-regression.yml
+ secrets: inherit
+ with:
+ case: ${{ github.event_name == 'workflow_dispatch' && inputs.case || 'all' }}
+ base_ref: ${{ needs.resolve-refs.outputs.base_sha }}
+ candidate_ref: ${{ needs.resolve-refs.outputs.candidate_sha }}
+ cargo_profile: nightly
+ runner: aliyun-ecs
diff --git a/.github/workflows/query-regression.yml b/.github/workflows/query-regression.yml
index fd15e659604..209c8d76fff 100644
--- a/.github/workflows/query-regression.yml
+++ b/.github/workflows/query-regression.yml
@@ -32,10 +32,10 @@ on:
type: string
default: nightly
runner:
- description: Self-hosted runner label or ARC runner scale set for this query regression run
+ description: Self-hosted runner label; aliyun-ecs provisions a fresh ECS instance per run
required: false
type: string
- default: perf-regression-8-cores
+ default: aliyun-ecs
workflow_dispatch:
inputs:
case:
@@ -68,12 +68,20 @@ on:
- release
- dev
runner:
- description: Self-hosted runner label or ARC runner scale set for this query regression run
+ description: >-
+ Self-hosted runner label; aliyun-ecs provisions a fresh ECS instance
+ per run, any other value is used as a literal runner label
required: true
- type: choice
- default: perf-regression-8-cores
- options:
- - perf-regression-8-cores
+ type: string
+ default: aliyun-ecs
+ keep_instance:
+ description: >-
+ Debug: keep the ECS instance after the run (skip teardown) so its
+ runner _diag logs, journal, and telemetry can be inspected; the
+ janitor still sweeps it after the TTL
+ required: false
+ type: boolean
+ default: false
pull_request:
types: [labeled]
@@ -81,19 +89,99 @@ permissions:
contents: read
jobs:
- query-regression:
+ test-tooling:
+ # Stdlib unittests for the workflow Python (case selection, report
+ # helpers, nightly SHA picking, and rendered ECS user-data). They do
+ # not talk to Aliyun or the Actions runner process; running them on
+ # ubuntu-latest fails fast before any ECS spend. Not gated on the
+ # regression labels: those labels boot a VM, these tests should not.
+ # Ordinary PRs also run the same tests from checks.yml, because this
+ # workflow only starts on `labeled` (or dispatch / workflow_call).
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+
+ - name: Test query regression tooling
+ run: |
+ python3 tests/perf/test_query_regression_runner_compaction_toctou.py
+ python3 tests/perf/test_query_regression_runner_otlp_trace_load.py
+ python3 tests/perf/test_query_regression_summary_otlp.py
+ python3 tests/perf/test_query_regression_case_selection.py
+ python3 tests/perf/test_query_regression_nightly_refs.py
+ python3 tests/perf/test_aliyun_ecs_runner_scripts.py
+
+ provision:
+ # Runs when the aliyun-ecs path is selected: explicitly via the runner
+ # input, or for PR labels by default (a QUERY_REGRESSION_PR_RUNNER
+ # repository variable set to another value redirects PRs to that literal
+ # runner label instead). Uses trusted scripts from the PR base (or the
+ # dispatched ref), never from candidate code. Waits for test-tooling so
+ # a broken user-data template does not still create a VM.
+ needs: [test-tooling]
if: >-
- ${{ github.event_name != 'pull_request' ||
- (github.event_name == 'pull_request' &&
- !github.event.pull_request.draft &&
- (github.event.label.name == 'query-regression' ||
- github.event.label.name == 'heavy-regression')) }}
- runs-on: ${{ github.event_name != 'pull_request' && inputs.runner || 'perf-regression-8-cores' }}
+ ${{ !failure() && !cancelled() &&
+ ((github.event_name != 'pull_request' && inputs.runner == 'aliyun-ecs') ||
+ (github.event_name == 'pull_request' &&
+ !github.event.pull_request.draft &&
+ (github.event.label.name == 'query-regression' ||
+ github.event.label.name == 'heavy-regression') &&
+ (vars.QUERY_REGRESSION_PR_RUNNER || 'aliyun-ecs') == 'aliyun-ecs')) }}
+ runs-on: ubuntu-latest
+ timeout-minutes: 45
+ outputs:
+ label: ${{ steps.provision.outputs.label }}
+ instance_id: ${{ steps.provision.outputs.instance_id }}
+ runner_name: ${{ steps.provision.outputs.runner_name }}
+ steps:
+ - name: Checkout trusted provisioning scripts
+ uses: actions/checkout@v4
+ with:
+ repository: ${{ github.repository }}
+ ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.sha }}
+ persist-credentials: false
+
+ - name: Install uv
+ uses: astral-sh/setup-uv@v6
+
+ - name: Provision ECS runner
+ id: provision
+ env:
+ ALIBABA_CLOUD_ACCESS_KEY_ID: ${{ secrets.ALICLOUD_ECS_ACCESS_KEY_ID }}
+ ALIBABA_CLOUD_ACCESS_KEY_SECRET: ${{ secrets.ALICLOUD_ECS_ACCESS_KEY_SECRET }}
+ GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
+ ALIYUN_ECS_REGION_ID: ${{ vars.ALIYUN_ECS_REGION_ID }}
+ ALIYUN_ECS_VSWITCH_ID: ${{ vars.ALIYUN_ECS_VSWITCH_ID }}
+ ALIYUN_ECS_SECURITY_GROUP_ID: ${{ vars.ALIYUN_ECS_SECURITY_GROUP_ID }}
+ ALIYUN_ECS_INSTANCE_TYPE: ${{ vars.ALIYUN_ECS_INSTANCE_TYPE }}
+ ALIYUN_ECS_RESOURCE_GROUP_ID: ${{ vars.ALIYUN_ECS_RESOURCE_GROUP_ID }}
+ QUERY_REGRESSION_ECS_IMAGE_ID: ${{ vars.QUERY_REGRESSION_ECS_IMAGE_ID }}
+ QUERY_REGRESSION_RUNNER_UID: ${{ vars.QUERY_REGRESSION_RUNNER_UID || '1001' }}
+ QUERY_REGRESSION_RUNNER_GID: ${{ vars.QUERY_REGRESSION_RUNNER_GID || '1001' }}
+ run: >-
+ uv run .github/scripts/aliyun-ecs-runner-provision.py
+
+ query-regression:
+ needs: [provision, test-tooling]
+ # `!failure() && !cancelled()` both suppresses the implicit success() and
+ # lets the job run when provision was intentionally skipped because a
+ # literal runner label was selected; a failed or cancelled provision still
+ # blocks the run because no ECS runner would be waiting.
+ if: >-
+ ${{ !failure() && !cancelled() &&
+ (github.event_name != 'pull_request' ||
+ (github.event_name == 'pull_request' &&
+ !github.event.pull_request.draft &&
+ (github.event.label.name == 'query-regression' ||
+ github.event.label.name == 'heavy-regression'))) }}
+ runs-on: >-
+ ${{ needs.provision.outputs.label ||
+ (github.event_name != 'pull_request' && inputs.runner ||
+ (vars.QUERY_REGRESSION_PR_RUNNER || 'aliyun-ecs')) }}
timeout-minutes: 180
- concurrency:
- group: query-regression-persistent-cache-v1
- queue: max
- cancel-in-progress: false
env:
CARGO_PROFILE: ${{ github.event_name == 'pull_request' && 'nightly' || inputs.cargo_profile }}
CARGO_HOME: /home/runner/.cargo
@@ -105,7 +193,8 @@ jobs:
QUERY_REGRESSION_CACHE_META: /home/runner/query-regression-cache-meta
RUSTC_WRAPPER: /usr/local/bin/sccache
SCCACHE_DIR: /home/runner/.cache/sccache
- SCCACHE_CACHE_SIZE: 40G
+ # Caps the local sccache on the system disk next to target and cargo.
+ SCCACHE_CACHE_SIZE: 10G
CARGO_INCREMENTAL: "0"
RUSTFLAGS: -D warnings -C link-arg=-fuse-ld=mold
QUERY_REGRESSION_CACHE_EPOCH: "1"
@@ -114,7 +203,55 @@ jobs:
EVENT_MERGE_SHA: ${{ github.event_name == 'pull_request' && github.sha || '' }}
EVENT_HEAD_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
EVENT_BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || '' }}
+ # Runner identity contract. The ECS image uses 1001; a manually prepared
+ # host may override via repo variables when 1001 is already taken.
+ EXPECTED_RUNNER_UID: ${{ vars.QUERY_REGRESSION_RUNNER_UID || '1001' }}
+ EXPECTED_RUNNER_GID: ${{ vars.QUERY_REGRESSION_RUNNER_GID || '1001' }}
steps:
+ - name: Report provisioned ECS runner
+ if: ${{ needs.provision.outputs.instance_id != '' }}
+ shell: bash
+ run: |
+ set -euo pipefail
+ {
+ printf -- '- ECS instance: `%s` (type `%s`, image `%s`, region `%s`)\n' \
+ "${{ needs.provision.outputs.instance_id }}" \
+ "${{ vars.ALIYUN_ECS_INSTANCE_TYPE }}" \
+ "${{ vars.QUERY_REGRESSION_ECS_IMAGE_ID }}" \
+ "${{ vars.ALIYUN_ECS_REGION_ID }}"
+ } >> "${GITHUB_STEP_SUMMARY}"
+
+ - name: Start machine telemetry sampler
+ shell: bash
+ # The ECS instance is deleted when the run ends, so machine state must
+ # be captured while the job runs. A background sampler appends load,
+ # memory, disk, and top-memory processes to a log every 30s; the
+ # "Dump machine telemetry" step (if: always()) prints and uploads it.
+ # Note: when the job is *cancelled*, even always() steps are killed —
+ # telemetry covers failures, not cancellations.
+ run: |
+ set -euo pipefail
+ log="${GITHUB_WORKSPACE}/machine-telemetry.log"
+ {
+ echo "== baseline $(date -u +%Y-%m-%dT%H:%M:%SZ) =="
+ nproc
+ free -h
+ df -h / /home/runner
+ } >> "${log}"
+ nohup bash -c "
+ while true; do
+ {
+ date -u '+== %Y-%m-%dT%H:%M:%SZ =='
+ uptime
+ free -m
+ df -h / /home/runner
+ ps -eo pid,comm,%mem,%cpu --sort=-%mem | head -6
+ } >> '${log}' 2>&1
+ sleep 30
+ done
+ " >/dev/null 2>&1 &
+ echo "Telemetry sampler started (pid $!), logging to ${log}"
+
- name: Checkout base source
uses: actions/checkout@v4
with:
@@ -263,14 +400,64 @@ jobs:
shell: bash
run: |
set -euo pipefail
- [[ "$(id -u)" == "1001" ]]
- [[ "$(id -g)" == "1001" ]]
- [[ "${UV_CACHE_DIR}" == "/home/runner/.cargo/uv-cache" ]]
- [[ "$(protoc --version)" == "libprotoc 3.21.12" ]]
+ errors=()
+ record() {
+ printf 'FAIL %s\n' "$*"
+ errors+=("$*")
+ }
+ require_eq() {
+ local name="$1" actual="$2" expected="$3"
+ printf 'check %s: %s\n' "${name}" "${actual}"
+ [[ "${actual}" == "${expected}" ]] || record "${name}: expected '${expected}', got '${actual}'"
+ }
+ require_match() {
+ local name="$1" actual="$2" pattern="$3"
+ printf 'check %s: %s\n' "${name}" "${actual}"
+ [[ "${actual}" =~ $pattern ]] || record "${name}: expected to match ${pattern}, got '${actual}'"
+ }
+ require() {
+ local name="$1"
+ shift
+ printf 'check %s\n' "${name}"
+ "$@" || record "${name}"
+ }
+ capture() {
+ local out
+ if out="$("$@" 2>&1)"; then
+ printf '%s' "${out}"
+ else
+ printf '' "$*"
+ fi
+ }
+
+ printf 'uid=%s gid=%s PATH=%s CARGO_HOME=%s\n' "$(id -u)" "$(id -g)" "${PATH}" "${CARGO_HOME}"
+ ls -la "${CARGO_HOME}" 2>&1 || printf '(CARGO_HOME missing)\n'
+
+ # Image/host hygiene: CARGO_HOME must be empty of config and
+ # install-state before cargo/rustup run. Those tools create
+ # .package-cache / bin on first use, so this cannot come after.
+ cargo_home_dirty=()
+ for entry in config config.toml credentials credentials.toml bin .crates.toml .crates2.json .global-cache .package-cache; do
+ if [[ -e "${CARGO_HOME}/${entry}" ]]; then
+ cargo_home_dirty+=("${entry}")
+ record "CARGO_HOME must not contain ${entry}"
+ fi
+ done
+ if (( ${#cargo_home_dirty[@]} > 0 )); then
+ printf 'CARGO_HOME contents:\n' >&2
+ ls -la "${CARGO_HOME}" >&2 || true
+ fi
+
+ require_eq uid "$(id -u)" "${EXPECTED_RUNNER_UID}"
+ require_eq gid "$(id -g)" "${EXPECTED_RUNNER_GID}"
+ require_eq UV_CACHE_DIR "${UV_CACHE_DIR}" "/home/runner/.cargo/uv-cache"
+ require_eq protoc "$(capture protoc --version)" "libprotoc 3.21.12"
temporary_proto_dir="$(mktemp --directory)"
trap 'rm -rf "${temporary_proto_dir}"' EXIT
- test -r /usr/include/google/protobuf/any.proto
- test -r /usr/include/google/protobuf/empty.proto
+ require "readable /usr/include/google/protobuf/any.proto" \
+ test -r /usr/include/google/protobuf/any.proto
+ require "readable /usr/include/google/protobuf/empty.proto" \
+ test -r /usr/include/google/protobuf/empty.proto
printf '%s\n' \
'syntax = "proto3";' \
'package smoke;' \
@@ -278,47 +465,51 @@ jobs:
'import "google/protobuf/empty.proto";' \
'message Smoke { google.protobuf.Any any = 1; google.protobuf.Empty empty = 2; }' \
> "${temporary_proto_dir}/smoke.proto"
- protoc --proto_path="${temporary_proto_dir}" --proto_path=/usr/include \
+ if protoc --proto_path="${temporary_proto_dir}" --proto_path=/usr/include \
--descriptor_set_out="${temporary_proto_dir}/smoke.pb" \
- "${temporary_proto_dir}/smoke.proto"
- test -s "${temporary_proto_dir}/smoke.pb"
- [[ "$(uv --version)" =~ ^uv[[:space:]]0\.11\.26([[:space:]]|$) ]]
- mold_version="$(mold --version)"
- [[ "${mold_version}" =~ ^mold[[:space:]]2\.30\.0([[:space:]]|$) ]]
- [[ "$(python3 --version)" == "Python 3.12.3" ]]
+ "${temporary_proto_dir}/smoke.proto"; then
+ require "protoc smoke descriptor is non-empty" test -s "${temporary_proto_dir}/smoke.pb"
+ else
+ record "protoc smoke compile failed"
+ fi
+ require_match uv "$(capture uv --version)" '^uv[[:space:]]0\.11\.26([[:space:]]|$)'
+ require_match mold "$(capture mold --version)" '^mold[[:space:]]2\.40\.4([[:space:]]|$)'
+ require_eq python3 "$(capture python3 --version)" "Python 3.14.4"
otelgen_path="$(command -v otelgen || true)"
otelgen_version=""
if [[ -n "${otelgen_path}" ]]; then
- otelgen_version="$("${otelgen_path}" --version 2>&1 || true)"
+ otelgen_version="$(capture "${otelgen_path}" --version)"
fi
- printf 'otelgen path: %s\n' "${otelgen_path:-}"
- printf 'otelgen version: %s\n' "${otelgen_version}"
- [[ "${otelgen_path}" == "/usr/local/bin/otelgen" ]]
- [[ "${otelgen_version}" == *"863a3f395d062c7322cc1de08a38774b7fdaa6c8"* ]]
- sccache_version="$(sccache --version)"
- [[ "${sccache_version}" =~ ^sccache[[:space:]]0\.16\.0([[:space:]]|$) ]]
- [[ "$(command -v rustup)" == "/opt/cargo/bin/rustup" ]]
- [[ "$(command -v cargo)" == "/opt/cargo/bin/cargo" ]]
- [[ "$(command -v rustc)" == "/opt/cargo/bin/rustc" ]]
- [[ "$(rustup --version)" =~ ^rustup[[:space:]]1\.29\.0([[:space:]]|$) ]]
- cargo_version="$(cargo --version)"
- [[ "${cargo_version}" =~ ^cargo[[:space:]]1\.96\.0-nightly[[:space:]]\(cbb9bb8bd[[:space:]][0-9]{4}-[0-9]{2}-[0-9]{2}\)$ ]]
- rustc_version="$(rustc --version)"
- [[ "${rustc_version}" =~ ^rustc[[:space:]]1\.96\.0-nightly[[:space:]]\(ac7f9ec7d[[:space:]][0-9]{4}-[0-9]{2}-[0-9]{2}\)$ ]]
- active_toolchain="$(rustup show active-toolchain)"
- [[ "${active_toolchain}" =~ ^nightly-2026-03-21-x86_64-unknown-linux-gnu([[:space:]]|$) ]]
- [[ "${RUSTUP_HOME}" == "/opt/rustup" ]]
- [[ "${RUSTUP_TOOLCHAIN}" == "nightly-2026-03-21" ]]
- [[ "${RUSTUP_AUTO_INSTALL}" == "0" ]]
- test -r /opt/rustup && test -x /opt/rustup
- test ! -w /opt/rustup
- test ! -w /opt/cargo/bin
- for entry in config config.toml credentials credentials.toml bin .crates.toml .crates2.json .global-cache .package-cache; do
- test ! -e "${CARGO_HOME}/${entry}"
- done
+ require_eq otelgen_path "${otelgen_path}" "/usr/local/bin/otelgen"
+ printf 'check otelgen_version: %s\n' "${otelgen_version}"
+ [[ "${otelgen_version}" == *"863a3f395d062c7322cc1de08a38774b7fdaa6c8"* ]] \
+ || record "otelgen_version: expected commit 863a3f395d062c7322cc1de08a38774b7fdaa6c8, got '${otelgen_version}'"
+ require_match sccache "$(capture sccache --version)" '^sccache[[:space:]]0\.16\.0([[:space:]]|$)'
+ require_eq rustup_path "$(command -v rustup || true)" "/opt/cargo/bin/rustup"
+ require_eq cargo_path "$(command -v cargo || true)" "/opt/cargo/bin/cargo"
+ require_eq rustc_path "$(command -v rustc || true)" "/opt/cargo/bin/rustc"
+ require_match rustup "$(capture rustup --version)" '^rustup[[:space:]]1\.29\.0([[:space:]]|$)'
+ require_match cargo "$(capture cargo --version)" \
+ '^cargo[[:space:]]1\.96\.0-nightly[[:space:]]\(cbb9bb8bd[[:space:]][0-9]{4}-[0-9]{2}-[0-9]{2}\)$'
+ require_match rustc "$(capture rustc --version)" \
+ '^rustc[[:space:]]1\.96\.0-nightly[[:space:]]\(ac7f9ec7d[[:space:]][0-9]{4}-[0-9]{2}-[0-9]{2}\)$'
+ require_match active_toolchain "$(capture rustup show active-toolchain)" \
+ '^nightly-2026-03-21-x86_64-unknown-linux-gnu([[:space:]]|$)'
+ require_eq RUSTUP_HOME "${RUSTUP_HOME}" "/opt/rustup"
+ require_eq RUSTUP_TOOLCHAIN "${RUSTUP_TOOLCHAIN}" "nightly-2026-03-21"
+ require_eq RUSTUP_AUTO_INSTALL "${RUSTUP_AUTO_INSTALL}" "0"
+ require "readable /opt/rustup" test -r /opt/rustup
+ require "executable /opt/rustup" test -x /opt/rustup
+ require "runner cannot write /opt/rustup" test ! -w /opt/rustup
+ require "runner cannot write /opt/cargo/bin" test ! -w /opt/cargo/bin
mkdir -p "${CARGO_HOME}/registry" "${CARGO_HOME}/git"
+ if (( ${#errors[@]} > 0 )); then
+ printf '\nVerify runner image tools failed (%d checks):\n' "${#errors[@]}" >&2
+ printf ' - %s\n' "${errors[@]}" >&2
+ exit 1
+ fi
- - name: Prepare persistent query regression cache
+ - name: Prepare query regression cache
shell: bash
working-directory: src
run: |
@@ -362,24 +553,6 @@ jobs:
find "${root}" -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +
}
- clear_cargo_extracted_trees() {
- require_expected_root CARGO_REGISTRY "${CARGO_HOME}/registry" "${EXPECTED_CARGO_REGISTRY}"
- require_expected_root CARGO_GIT "${CARGO_HOME}/git" "${EXPECTED_CARGO_GIT}"
- rm -rf -- "${CARGO_HOME}/registry/src" "${CARGO_HOME}/git/checkouts"
- }
-
- cargo_size_kib() {
- du -sk -- "${CARGO_HOME}/registry" "${CARGO_HOME}/git" | awk '{ total += $1 } END { print total }'
- }
-
- target_size_kib() {
- du -sk -- "${CARGO_TARGET_DIR}" | cut -f1
- }
-
- free_kib() {
- df -Pk "${CARGO_TARGET_DIR}" | awk 'NR == 2 { print $4 }'
- }
-
report_cache_usage() {
du -sh -- "${CARGO_HOME}" "${CARGO_HOME}/registry" "${CARGO_HOME}/git" \
"${RUSTUP_HOME}" "${CARGO_TARGET_DIR}" "${QUERY_REGRESSION_CACHE_META}" "${SCCACHE_DIR}"
@@ -400,7 +573,7 @@ jobs:
printf 'Refusing unexpected RUSTC_WRAPPER: %s\n' "${RUSTC_WRAPPER}" >&2
exit 1
}
- [[ "${SCCACHE_CACHE_SIZE}" == "40G" ]] || {
+ [[ "${SCCACHE_CACHE_SIZE}" == "10G" ]] || {
printf 'Refusing unexpected SCCACHE_CACHE_SIZE: %s\n' "${SCCACHE_CACHE_SIZE}" >&2
exit 1
}
@@ -487,46 +660,10 @@ jobs:
report_cache_usage
- target_size="$(target_size_kib)"
- if (( target_size >= 400 * 1024 * 1024 )); then
- printf 'Warning: target cache is at least 400 GiB (%s KiB)\n' "${target_size}" >&2
- fi
- if (( target_size >= 450 * 1024 * 1024 )); then
- printf 'Target cache is at least 450 GiB; clearing complete target root\n' >&2
- clear_directory "${CARGO_TARGET_DIR}"
- fi
-
- cargo_size="$(cargo_size_kib)"
- if (( cargo_size >= 60 * 1024 * 1024 )); then
- printf 'Warning: Cargo cache is at least 60 GiB (%s KiB)\n' "${cargo_size}" >&2
- fi
- if (( cargo_size >= 80 * 1024 * 1024 )); then
- printf 'Cargo cache is at least 80 GiB; removing extracted sources and checkouts\n' >&2
- clear_cargo_extracted_trees
- cargo_size="$(cargo_size_kib)"
- if (( cargo_size >= 80 * 1024 * 1024 )); then
- printf 'Cargo cache remains at least 80 GiB after cleanup (%s KiB)\n' "${cargo_size}" >&2
- exit 1
- fi
- fi
-
- free_space="$(free_kib)"
- if (( free_space < 300 * 1024 * 1024 )); then
- printf 'Free space is below 300 GiB; clearing complete target root\n' >&2
- clear_directory "${CARGO_TARGET_DIR}"
- free_space="$(free_kib)"
- if (( free_space < 300 * 1024 * 1024 )); then
- printf 'Free space remains below 300 GiB; removing Cargo extracted sources and checkouts\n' >&2
- clear_cargo_extracted_trees
- free_space="$(free_kib)"
- if (( free_space < 300 * 1024 * 1024 )); then
- printf 'Free space remains below 300 GiB after cleanup (%s KiB)\n' "${free_space}" >&2
- exit 1
- fi
- fi
- fi
-
- report_cache_usage
+ # Every run starts from a fresh system disk, so size/free-space
+ # watermarks from the retired retained-disk era are not restored.
+ # A run that overflows the disk fails the build outright, which the
+ # telemetry step makes diagnosable.
sccache --start-server
sccache --zero-stats
@@ -567,24 +704,17 @@ jobs:
git reset --hard "${VERIFIED_CANDIDATE_SHA}"
git clean -ffdx
- - name: Test query regression tooling
- working-directory: src
- run: |
- uv run --no-project python tests/perf/test_query_regression_runner_compaction_toctou.py
- uv run --no-project python tests/perf/test_query_regression_runner_otlp_trace_load.py
- uv run --no-project python tests/perf/test_query_regression_summary_otlp.py
- uv run --no-project python tests/perf/test_query_regression_case_selection.py
-
- - name: Build candidate greptime and fixture generators
+ - name: Build candidate greptime and query regression helpers
working-directory: src
run: |
set -euo pipefail
SECONDS=0
cargo build --profile "${CARGO_PROFILE}" -p cmd --bin greptime
cargo build --profile "${CARGO_PROFILE}" -p cmd --bin query_perf_fixture --features dev-tools
+ cargo build --profile "${CARGO_PROFILE}" -p cmd --bin query_regression_runner --features dev-tools
candidate_build_elapsed="${SECONDS}"
- printf 'Candidate greptime and fixture generator cargo builds elapsed: %s seconds\n' "${candidate_build_elapsed}"
- printf -- '- Candidate greptime and fixture generator cargo builds: %s seconds\n' "${candidate_build_elapsed}" >> "${GITHUB_STEP_SUMMARY}"
+ printf 'Candidate greptime and query regression helper cargo builds elapsed: %s seconds\n' "${candidate_build_elapsed}"
+ printf -- '- Candidate greptime and query regression helper cargo builds: %s seconds\n' "${candidate_build_elapsed}" >> "${GITHUB_STEP_SUMMARY}"
sccache --show-stats
target_dir="${CARGO_PROFILE}"
if [[ "${CARGO_PROFILE}" == "dev" ]]; then
@@ -595,6 +725,8 @@ jobs:
"${GITHUB_WORKSPACE}/query-regression-bins/candidate/greptime"
cp "${CARGO_TARGET_DIR}/${target_dir}/query_perf_fixture" \
"${GITHUB_WORKSPACE}/query-regression-bins/candidate/query_perf_fixture"
+ cp "${CARGO_TARGET_DIR}/${target_dir}/query_regression_runner" \
+ "${GITHUB_WORKSPACE}/query-regression-bins/candidate/query_regression_runner"
- name: Run query regression
id: run
@@ -609,6 +741,7 @@ jobs:
FIXTURE_GENERATOR: ${{ github.workspace }}/query-regression-bins/candidate/query_perf_fixture
OTELGEN_BIN: /usr/local/bin/otelgen
SUMMARY_SCRIPT: ${{ github.event_name == 'pull_request' && 'query-regression-trusted-scripts/query-regression-summary.py' || 'src/.github/scripts/query-regression-summary.py' }}
+ QUERY_REGRESSION_RUNNER: ${{ github.workspace }}/query-regression-bins/candidate/query_regression_runner
run: >-
uv run --no-project python src/.github/scripts/query-regression-run.py
--base-src src
@@ -639,6 +772,7 @@ jobs:
query-regression-work/**/logs/**
query-regression-work/**/otelgen/**
query-regression-summary.md
+ machine-telemetry.log
if-no-files-found: warn
retention-days: 7
@@ -653,7 +787,7 @@ jobs:
if-no-files-found: warn
retention-days: 7
- - name: Report persistent cache usage
+ - name: Report cache usage
if: ${{ always() }}
shell: bash
run: |
@@ -693,6 +827,55 @@ jobs:
printf 'sccache is unavailable (report only)\n' >&2
fi
+ - name: Dump machine telemetry
+ if: ${{ always() }}
+ shell: bash
+ run: |
+ log="${GITHUB_WORKSPACE}/machine-telemetry.log"
+ if [[ -f "${log}" ]]; then
+ echo "::group::Machine telemetry (last 200 lines)"
+ tail -n 200 "${log}"
+ echo "::endgroup::"
+ else
+ echo "No telemetry log found (sampler never started?)"
+ fi
+ echo "::group::dmesg tail (OOM killer records)"
+ sudo dmesg -T 2>/dev/null | tail -n 50 || dmesg -T 2>/dev/null | tail -n 50 || \
+ echo "dmesg unavailable without root"
+ echo "::endgroup::"
+
- name: Fail on regression failure
if: ${{ steps.run.outputs.status != '0' }}
run: exit 1
+
+ teardown:
+ # Releases the dynamically provisioned ECS runner. Runs even when the
+ # benchmark job fails or is cancelled; skipped when a literal runner label
+ # was selected because the provision outputs are empty, or when the
+ # dispatch set keep_instance to preserve the machine for post-mortem
+ # debugging (the janitor sweep still reclaims it after the TTL).
+ if: ${{ always() && needs.provision.outputs.instance_id != '' && !inputs.keep_instance }}
+ needs: [provision, query-regression]
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - name: Checkout trusted teardown scripts
+ uses: actions/checkout@v4
+ with:
+ repository: ${{ github.repository }}
+ ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.sha }}
+ persist-credentials: false
+
+ - name: Install uv
+ uses: astral-sh/setup-uv@v6
+
+ - name: Teardown ECS runner
+ env:
+ ALIBABA_CLOUD_ACCESS_KEY_ID: ${{ secrets.ALICLOUD_ECS_ACCESS_KEY_ID }}
+ ALIBABA_CLOUD_ACCESS_KEY_SECRET: ${{ secrets.ALICLOUD_ECS_ACCESS_KEY_SECRET }}
+ GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
+ ALIYUN_ECS_REGION_ID: ${{ vars.ALIYUN_ECS_REGION_ID }}
+ QUERY_REGRESSION_ECS_INSTANCE_ID: ${{ needs.provision.outputs.instance_id }}
+ QUERY_REGRESSION_ECS_RUNNER_NAME: ${{ needs.provision.outputs.runner_name }}
+ run: >-
+ uv run .github/scripts/aliyun-ecs-runner-teardown.py
diff --git a/.github/workflows/release-dev-builder-images.yaml b/.github/workflows/release-dev-builder-images.yaml
index e6a33dcceb0..bebd5ed61e7 100644
--- a/.github/workflows/release-dev-builder-images.yaml
+++ b/.github/workflows/release-dev-builder-images.yaml
@@ -24,6 +24,11 @@ on:
description: Release dev-builder-android image
required: false
default: false
+ release_dev_builder_riscv64_image:
+ type: boolean
+ description: Release dev-builder-riscv64 image
+ required: false
+ default: false
update_dev_builder_image_tag:
type: boolean
description: Update the DEV_BUILDER_IMAGE_TAG in Makefile and create a PR
@@ -36,7 +41,7 @@ jobs:
# The jobs are triggered by the following events:
# 1. Manually triggered workflow_dispatch event
# 2. Push event when the PR that modifies the `rust-toolchain.toml` or `docker/dev-builder/**` is merged to main
- if: ${{ github.event_name == 'push' || inputs.release_dev_builder_ubuntu_image || inputs.release_dev_builder_centos_image || inputs.release_dev_builder_android_image }}
+ if: ${{ github.event_name == 'push' || inputs.release_dev_builder_ubuntu_image || inputs.release_dev_builder_centos_image || inputs.release_dev_builder_android_image || inputs.release_dev_builder_riscv64_image }}
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set-version.outputs.version }}
@@ -68,6 +73,7 @@ jobs:
build-dev-builder-ubuntu: ${{ inputs.release_dev_builder_ubuntu_image || github.event_name == 'push' }}
build-dev-builder-centos: ${{ inputs.release_dev_builder_centos_image || github.event_name == 'push' }}
build-dev-builder-android: ${{ inputs.release_dev_builder_android_image || github.event_name == 'push' }}
+ build-dev-builder-riscv64: ${{ inputs.release_dev_builder_riscv64_image || github.event_name == 'push' }}
release-dev-builder-images-ecr:
name: Release dev builder images to AWS ECR
@@ -154,6 +160,35 @@ jobs:
copy -a docker://docker.io/$IMAGE_NAMESPACE/dev-builder-android:latest \
docker://$ECR_IMAGE_REGISTRY/$ECR_IMAGE_NAMESPACE/dev-builder-android:latest
+ - name: Push dev-builder-riscv64 image
+ shell: bash
+ if: ${{ inputs.release_dev_builder_riscv64_image || github.event_name == 'push' }}
+ env:
+ IMAGE_VERSION: ${{ needs.release-dev-builder-images.outputs.version }}
+ IMAGE_NAMESPACE: ${{ vars.IMAGE_NAMESPACE }}
+ ECR_IMAGE_REGISTRY: ${{ vars.ECR_IMAGE_REGISTRY }}
+ ECR_IMAGE_NAMESPACE: ${{ vars.ECR_IMAGE_NAMESPACE }}
+ run: |
+ docker run -v "${DOCKER_CONFIG:-$HOME/.docker}:/root/.docker:ro" \
+ -e "REGISTRY_AUTH_FILE=/root/.docker/config.json" \
+ quay.io/skopeo/stable:latest \
+ copy -a docker://docker.io/$IMAGE_NAMESPACE/dev-builder-riscv64:$IMAGE_VERSION \
+ docker://$ECR_IMAGE_REGISTRY/$ECR_IMAGE_NAMESPACE/dev-builder-riscv64:$IMAGE_VERSION
+
+ - name: Push latest dev-builder-riscv64 image
+ shell: bash
+ if: ${{ github.event_name == 'push' }}
+ env:
+ IMAGE_NAMESPACE: ${{ vars.IMAGE_NAMESPACE }}
+ ECR_IMAGE_REGISTRY: ${{ vars.ECR_IMAGE_REGISTRY }}
+ ECR_IMAGE_NAMESPACE: ${{ vars.ECR_IMAGE_NAMESPACE }}
+ run: |
+ docker run -v "${DOCKER_CONFIG:-$HOME/.docker}:/root/.docker:ro" \
+ -e "REGISTRY_AUTH_FILE=/root/.docker/config.json" \
+ quay.io/skopeo/stable:latest \
+ copy -a docker://docker.io/$IMAGE_NAMESPACE/dev-builder-riscv64:latest \
+ docker://$ECR_IMAGE_REGISTRY/$ECR_IMAGE_NAMESPACE/dev-builder-riscv64:latest
+
release-dev-builder-images-cn: # Note: Be careful issue: https://github.com/containers/skopeo/issues/1874 and we decide to use the latest stable skopeo container.
name: Release dev builder images to CN region
runs-on: ubuntu-latest
@@ -209,6 +244,19 @@ jobs:
quay.io/skopeo/stable:latest \
copy -a docker://docker.io/$IMAGE_NAMESPACE/dev-builder-android:$IMAGE_VERSION \
docker://$ACR_IMAGE_REGISTRY/$IMAGE_NAMESPACE/dev-builder-android:$IMAGE_VERSION
+ - name: Push dev-builder-riscv64 image
+ shell: bash
+ if: ${{ inputs.release_dev_builder_riscv64_image || github.event_name == 'push' }}
+ env:
+ IMAGE_VERSION: ${{ needs.release-dev-builder-images.outputs.version }}
+ IMAGE_NAMESPACE: ${{ vars.IMAGE_NAMESPACE }}
+ ACR_IMAGE_REGISTRY: ${{ vars.ACR_IMAGE_REGISTRY }}
+ run: |
+ docker run -v "${DOCKER_CONFIG:-$HOME/.docker}:/root/.docker:ro" \
+ -e "REGISTRY_AUTH_FILE=/root/.docker/config.json" \
+ quay.io/skopeo/stable:latest \
+ copy -a docker://docker.io/$IMAGE_NAMESPACE/dev-builder-riscv64:$IMAGE_VERSION \
+ docker://$ACR_IMAGE_REGISTRY/$IMAGE_NAMESPACE/dev-builder-riscv64:$IMAGE_VERSION
update-dev-builder-image-tag:
name: Update dev-builder image tag
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ee1754dd6b8..0a9c39c9034 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -52,7 +52,7 @@ on:
default: true
build_linux_artifacts:
type: boolean
- description: Build linux artifacts (both amd64 and arm64)
+ description: Build linux artifacts (amd64, arm64, and riscv64)
required: false
default: false
build_macos_artifacts:
@@ -225,6 +225,52 @@ jobs:
image-namespace: ${{ vars.ECR_IMAGE_NAMESPACE }}
large-page-size: true
+ build-linux-riscv64-artifacts:
+ name: Build linux-riscv64 artifacts
+ if: ${{ inputs.build_linux_artifacts || inputs.publish_github_release || inputs.release_images || github.event_name == 'push' || github.event_name == 'schedule' }}
+ needs: [
+ allocate-runners,
+ ]
+ runs-on: ${{ needs.allocate-runners.outputs.linux-amd64-runner }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+
+ - name: Prepare riscv64 dev-builder image
+ shell: bash
+ env:
+ IMAGE_REGISTRY: ${{ vars.ECR_IMAGE_REGISTRY }}
+ IMAGE_NAMESPACE: ${{ vars.ECR_IMAGE_NAMESPACE }}
+ run: |
+ builder_tag=$(grep '^DEV_BUILDER_IMAGE_TAG ?=' Makefile | awk '{print $3}')
+ builder_image="${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/dev-builder-riscv64:${builder_tag}"
+ if ! docker pull "${builder_image}"; then
+ make dev-builder-riscv64 \
+ IMAGE_REGISTRY="${IMAGE_REGISTRY}" \
+ IMAGE_NAMESPACE="${IMAGE_NAMESPACE}"
+ fi
+
+ # Cross-compile greptime for riscv64gc-unknown-linux-gnu on the amd64 runner
+ # with the riscv64 cross dev-builder image. Integration tests are skipped
+ # because the cross-compiled binary cannot run on the amd64 host.
+ - name: Build greptime riscv64 binary
+ shell: bash
+ run: |
+ make build-riscv64-bin \
+ CARGO_PROFILE=${{ env.CARGO_PROFILE }} \
+ FEATURES=servers/dashboard \
+ IMAGE_REGISTRY=${{ vars.ECR_IMAGE_REGISTRY }} \
+ IMAGE_NAMESPACE=${{ vars.ECR_IMAGE_NAMESPACE }}
+
+ - name: Upload artifacts
+ uses: ./.github/actions/upload-artifacts
+ with:
+ artifacts-dir: greptime-linux-riscv64-${{ needs.allocate-runners.outputs.version }}
+ target-files: ./target/riscv64gc-unknown-linux-gnu/${{ env.CARGO_PROFILE }}/greptime
+ version: ${{ needs.allocate-runners.outputs.version }}
+
build-macos-artifacts:
name: Build macOS artifacts
strategy:
@@ -464,7 +510,7 @@ jobs:
base_ref: ${{ needs.prepare-release-validation.outputs.previous-release-tag }}
candidate_ref: ${{ needs.prepare-release-validation.outputs.candidate-ref }}
cargo_profile: nightly
- runner: perf-regression-8-cores
+ runner: aliyun-ecs
release-images-to-dockerhub:
name: Build and push images to DockerHub
@@ -520,6 +566,7 @@ jobs:
build-linux-amd64-artifacts,
build-linux-arm64-artifacts,
build-macos-artifacts,
+ build-linux-riscv64-artifacts,
build-windows-artifacts,
release-images-to-dockerhub,
]
@@ -568,6 +615,7 @@ jobs:
(needs.prepare-release-validation.outputs.run-query-regression == 'false' && needs.query-regression-release.result == 'skipped')) &&
needs.build-linux-amd64-artifacts.result == 'success' &&
needs.build-linux-arm64-artifacts.result == 'success' &&
+ needs.build-linux-riscv64-artifacts.result == 'success' &&
(needs.build-macos-artifacts.result == 'success' || needs.build-macos-artifacts.result == 'skipped') &&
(needs.build-windows-artifacts.result == 'success' || needs.build-windows-artifacts.result == 'skipped') &&
(needs.release-images-to-dockerhub.result == 'success' ||
@@ -581,6 +629,7 @@ jobs:
build-linux-amd64-artifacts,
build-linux-arm64-artifacts,
build-macos-artifacts,
+ build-linux-riscv64-artifacts,
build-windows-artifacts,
release-images-to-dockerhub,
prepare-release-validation,
@@ -599,6 +648,15 @@ jobs:
with:
version: ${{ needs.allocate-runners.outputs.version }}
+ update-compat-versions:
+ name: Update compatibility versions
+ needs: [allocate-runners, publish-github-release]
+ if: ${{ needs.publish-github-release.result == 'success' }}
+ uses: ./.github/workflows/update-compat-versions.yml
+ with:
+ release_tag: ${{ needs.allocate-runners.outputs.version }}
+ secrets: inherit
+
### Stop runners ###
# It's very necessary to split the job of releasing runners into 'stop-linux-amd64-runner' and 'stop-linux-arm64-runner'.
# Because we can terminate the specified EC2 instance immediately after the job is finished without unnecessary waiting.
@@ -610,6 +668,7 @@ jobs:
needs: [
allocate-runners,
build-linux-amd64-artifacts,
+ build-linux-riscv64-artifacts,
]
steps:
- name: Checkout
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 1302f00201c..6d12566b684 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -96,6 +96,32 @@ jobs:
- name: Check unused dependencies
run: make check-udeps
+ check-riscv64:
+ if: ${{ github.repository == 'GreptimeTeam/greptimedb' }}
+ name: Check riscv64 build
+ runs-on: ubuntu-latest
+ timeout-minutes: 90
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+ - uses: arduino/setup-protoc@v3
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ - name: Install riscv64 cross toolchain
+ run: sudo apt-get update && sudo apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
+ - uses: actions-rust-lang/setup-rust-toolchain@v1
+ - name: Add riscv64 target
+ run: rustup target add riscv64gc-unknown-linux-gnu
+ - name: Rust Cache
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "check-riscv64"
+ cache-all-crates: "true"
+ save-if: ${{ github.ref == 'refs/heads/main' }}
+ - name: Run cargo check for riscv64
+ run: cargo check --locked --workspace --all-targets --features servers/dashboard --target riscv64gc-unknown-linux-gnu
+
conflict-check:
if: ${{ github.repository == 'GreptimeTeam/greptimedb' }}
name: Check for conflict
@@ -139,9 +165,7 @@ jobs:
run: ../../.github/scripts/pull-test-deps-images.sh && docker compose up -d --wait
- name: Run nextest cases
- run: |
- cargo nextest run --workspace -F dashboard -F pg_kvbackend -F mysql_kvbackend -F vector_index
- cargo nextest run -p tests-integration --test main --features enterprise -E 'test(=table_ddl_event::test_table_ddl_procedure_events)'
+ run: cargo nextest run --workspace -F dashboard -F pg_kvbackend -F mysql_kvbackend -F vector_index
env:
CARGO_BUILD_RUSTFLAGS: "-C link-arg=-fuse-ld=mold"
RUST_BACKTRACE: 1
diff --git a/.github/workflows/update-compat-versions.yml b/.github/workflows/update-compat-versions.yml
new file mode 100644
index 00000000000..460a2c30815
--- /dev/null
+++ b/.github/workflows/update-compat-versions.yml
@@ -0,0 +1,136 @@
+name: Update compatibility versions
+
+on:
+ workflow_call:
+ inputs:
+ release_tag:
+ description: Stable release tag that triggered the caller.
+ required: true
+ type: string
+ release:
+ types: [published]
+ schedule:
+ # Release events created with GITHUB_TOKEN do not trigger workflows.
+ - cron: "17 3 * * *"
+ workflow_dispatch:
+
+concurrency:
+ group: update-compat-versions
+ cancel-in-progress: false
+
+jobs:
+ validate-release:
+ if: ${{ github.repository == 'GreptimeTeam/greptimedb' }}
+ runs-on: ubuntu-latest
+ outputs:
+ should-run: ${{ steps.gate.outputs.should-run }}
+ steps:
+ - id: gate
+ shell: bash
+ env:
+ EVENT_NAME: ${{ github.event_name }}
+ RELEASE_DRAFT: ${{ github.event.release.draft }}
+ RELEASE_PRERELEASE: ${{ github.event.release.prerelease }}
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
+ WORKFLOW_RELEASE_TAG: ${{ inputs.release_tag }}
+ run: |
+ set -euo pipefail
+ should_run=true
+ stable_tag_re='^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$'
+ if [[ -n "${WORKFLOW_RELEASE_TAG}" ]]; then
+ if [[ ! "${WORKFLOW_RELEASE_TAG}" =~ ${stable_tag_re} ]]; then
+ should_run=false
+ fi
+ elif [[ "${EVENT_NAME}" == "release" ]]; then
+ if [[ "${RELEASE_DRAFT}" == "true" || "${RELEASE_PRERELEASE}" == "true" || ! "${RELEASE_TAG}" =~ ${stable_tag_re} ]]; then
+ should_run=false
+ fi
+ elif [[ "${EVENT_NAME}" == "workflow_call" ]]; then
+ should_run=false
+ fi
+ echo "should-run=${should_run}" >> "${GITHUB_OUTPUT}"
+
+ update:
+ needs: validate-release
+ if: ${{ github.repository == 'GreptimeTeam/greptimedb' && needs.validate-release.outputs.should-run == 'true' }}
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ pull-requests: write
+ env:
+ BRANCH: ci/update-compat-versions
+ steps:
+ # Always use main: release events otherwise provide the release-tag revision.
+ - name: Checkout main
+ uses: actions/checkout@v4
+ with:
+ ref: main
+ fetch-depth: 0
+ token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
+
+ - name: Validate updater on main
+ shell: bash
+ env:
+ GH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
+ run: |
+ set -euo pipefail
+ python3 -m unittest discover -s .github/scripts/tests -p 'test_*.py'
+ python3 -m py_compile .github/scripts/update-compat-versions.py
+ # Log-only: a stale window is expected here (it is exactly what the
+ # updater fixes below), so a stale --check must not fail the job.
+ python3 .github/scripts/update-compat-versions.py --check --published-only || true
+ python3 .github/scripts/update-compat-versions.py --check-anchors
+
+ - name: Prepare updater branch
+ id: prepare
+ shell: bash
+ env:
+ GH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
+ run: |
+ set -euo pipefail
+ git fetch origin main
+ git config user.name "greptimedb-ci"
+ git config user.email "greptimedb-ci@users.noreply.github.com"
+ remote_oid="$(git ls-remote --heads origin "refs/heads/${BRANCH}" | cut -f1)"
+ if [[ -n "${remote_oid}" ]]; then
+ git fetch origin "refs/heads/${BRANCH}:refs/remotes/origin/${BRANCH}"
+ fi
+ git checkout -B "${BRANCH}" origin/main
+ git reset --hard origin/main
+ python3 .github/scripts/update-compat-versions.py --update --published-only
+ if git diff --quiet -- tests/compatibility/ci.toml; then
+ echo "Compatibility version window is already current."
+ exit 0
+ fi
+ desired_blob="$(git hash-object tests/compatibility/ci.toml)"
+ if [[ -n "${remote_oid}" ]]; then
+ remote_blob="$(git rev-parse "${remote_oid}:tests/compatibility/ci.toml" 2>/dev/null || true)"
+ if [[ "${desired_blob}" == "${remote_blob}" ]]; then
+ echo "Remote updater branch already has the desired compatibility window."
+ echo "branch-ready=true" >> "${GITHUB_OUTPUT}"
+ exit 0
+ fi
+ fi
+ git add tests/compatibility/ci.toml
+ git commit -s -m "chore(ci): update compatibility versions"
+ git push --force-with-lease="refs/heads/${BRANCH}:${remote_oid}" origin "HEAD:refs/heads/${BRANCH}"
+ echo "branch-ready=true" >> "${GITHUB_OUTPUT}"
+
+ - name: Create compatibility version PR
+ if: ${{ steps.prepare.outputs.branch-ready == 'true' }}
+ shell: bash
+ env:
+ GH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
+ run: |
+ set -euo pipefail
+ open_prs="$(gh pr list --head "${BRANCH}" --base main --state open --json number --jq 'length')"
+ if [[ "${open_prs}" != "0" ]]; then
+ echo "An open compatibility updater PR already exists."
+ exit 0
+ fi
+ gh pr create \
+ --base main \
+ --head "${BRANCH}" \
+ --title "chore(ci): update compatibility versions" \
+ --reviewer "GreptimeTeam/db-approver" \
+ --body $'I hereby agree to the terms of the [GreptimeDB CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).\n\n## Refer to a related PR or issue link (optional)\n\nAutomated after a stable release or the daily fallback.\n\n## What\047s changed and what\047s your intention?\n\nUpdates `tests/compatibility/ci.toml` from checked-out `main` tags that have published release assets. The PR window keeps the latest patch of the two most recent stable minor lines; exact `=vX.Y.Z` case anchors are validated nightly instead of being added to the PR window.\n\n## PR Checklist\n\n- [ ] I have written the necessary rustdoc comments.\n- [ ] I have added the necessary unit tests and integration tests.\n- [ ] This PR requires documentation updates.\n- [x] API changes are backward compatible.\n- [x] Schema or data changes are backward compatible.'
diff --git a/AGENTS.md b/AGENTS.md
index a00889b855f..70f2ae20b41 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -18,7 +18,8 @@ provides sub-second querying at PB scale with high cost efficiency.
| Build (debug) | `make build` |
| Build (release) | `make build RELEASE=true` |
| Run standalone | `cargo run -- standalone start` |
-| Test | `cargo nextest run` (preferred over `cargo test`) |
+| Targeted Rust tests | `cargo nextest run -p ` (preferred over `cargo test`) |
+| Full local Rust suite | `make test` |
| SQL tests | `cargo sqlness bare` (single case: `cargo sqlness bare -t `) |
| Format | `make fmt` (and `make fmt-toml` for TOML) |
| Lint | `make clippy` (= `cargo clippy --workspace --all-targets --all-features -- -D warnings`) |
@@ -43,14 +44,30 @@ GreptimeDB is a Cargo workspace rooted at the repository; most crates live under
- **Shared**: `src/common/`, `src/datatypes/`, `src/store-api/` (engine contract),
`src/catalog/`, `src/table/`
-Hot crates carry their own `AGENTS.md` with a module map, read/write paths,
-change-coupling points, and gotchas:
+Before editing a path, read every `AGENTS.md` from the repository root down to
+that path. The root guide always applies; a nested guide adds or overrides rules
+for its subtree. Changes spanning multiple subtrees must follow every applicable
+guide.
+`AGENTS.md` files are maps, not manuals. Keep them short and stable: record
+where code lives, important boundaries or change-coupling, high-cost gotchas,
+and the validation entry point. Implementation details belong in code. Do not
+copy exhaustive test lists or workflow logic; link to the source of truth.
+
+High-change areas and specialized test suites carry their own `AGENTS.md` with
+a module map, read/write paths, change-coupling points, and gotchas:
+
+- [`src/common/meta/AGENTS.md`](src/common/meta/AGENTS.md)
+- [`src/query/AGENTS.md`](src/query/AGENTS.md)
+- [`src/servers/AGENTS.md`](src/servers/AGENTS.md)
+- [`src/operator/AGENTS.md`](src/operator/AGENTS.md)
- [`src/mito2/AGENTS.md`](src/mito2/AGENTS.md)
- [`src/metric-engine/AGENTS.md`](src/metric-engine/AGENTS.md)
- [`src/flow/AGENTS.md`](src/flow/AGENTS.md)
- [`src/frontend/AGENTS.md`](src/frontend/AGENTS.md)
- [`src/meta-srv/AGENTS.md`](src/meta-srv/AGENTS.md)
+- [`tests/compatibility/AGENTS.md`](tests/compatibility/AGENTS.md)
+- [`tests/perf/AGENTS.md`](tests/perf/AGENTS.md)
## Read before changing code
@@ -71,24 +88,51 @@ change-coupling points, and gotchas:
- Error handling: `src/common/error/` (`ErrorExt`, `StatusCode`)
- Protocol implementations: `src/servers/src/`
+## Worktree safety
+
+- Check `git status --short` before editing. Preserve unrelated tracked changes
+ and untracked files; re-read files changed by another process.
+- Do not rewrite history, force-push, or remove files in bulk unless the user
+ explicitly requests it.
+- Update generated artifacts only through the generators documented in
+ [`.agents/generated-files.md`](.agents/generated-files.md).
+
+## Validation by change type
+
+Use the narrowest command that covers the change, then expand only when its
+blast radius requires it.
+
+| Change | Minimum validation |
+| --- | --- |
+| One Rust crate | `cargo nextest run -p ` |
+| Cross-workspace Rust behavior | `make test`; inspect `.github/workflows/rust.yml` when CI parity matters |
+| SQL parsing, planning, execution, or output | `cargo sqlness bare -t `; inspect regenerated `.result` files |
+| Persisted metadata or wire format | Add/run a case under `tests/compatibility/`; follow its `README.md` and `AGENTS.md` |
+| Public configuration | Update example TOMLs, loading/serialization snapshots, and docs; run `make config-docs` |
+| Query regression harness or DSL | Follow `tests/perf/AGENTS.md` |
+| Enterprise-gated code | Build/test with `--features enterprise` where applicable and run `make check-enterprise-license` |
+
## Before opening a PR
-1. `make fmt`
-2. `make clippy`
-3. `make test` (or `cargo nextest run`)
-4. `make check-udeps` (run `make fix-udeps` if it reports unused dependencies).
-5. If you added or changed a public configuration option, update the applicable
+1. If you added a `.rs`, `.py`, or `.ts` file, apply and verify its license
+ header with `hawkeye format` followed by `hawkeye check`. Use the inception
+ year from `licenserc.toml`, not the current year.
+2. `make fmt`
+3. `make clippy`
+4. `make test`
+5. `make check-udeps` (run `make fix-udeps` if it reports unused dependencies).
+6. If you added or changed a public configuration option, update the applicable
example TOMLs, configuration-loading and serialized-config snapshot tests,
and related user-facing documentation. Run `make config-docs` (needs Docker)
and commit the regenerated `config/config.md`.
-6. If you changed a persisted or wire format, add a compatibility test case (see
+7. If you changed a persisted or wire format, add a compatibility test case (see
`.agents/architecture-invariants.md`).
-7. If you added or gated an enterprise-only file, give it the enterprise license
+8. If you added or gated an enterprise-only file, give it the enterprise license
header, list it in `licenserc-enterprise.toml` (`includes`) and
`licenserc.toml` (`excludes`), and run `make check-enterprise-license`.
-8. Use a conventional-commit title, sign off commits (`git commit -s`), and sign
+9. Use a conventional-commit title, sign off commits (`git commit -s`), and sign
the CLA.
-9. When creating or updating a pull request, follow
+10. When creating or updating a pull request, follow
[`.github/pull_request_template.md`](.github/pull_request_template.md): include
the CLA statement, fill the change-intention section with enough detail, and
update checklist items accurately.
diff --git a/Cargo.lock b/Cargo.lock
index ccfb23c51af..8fe6d74dd2f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -219,7 +219,7 @@ checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c"
[[package]]
name = "api"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"arrow-schema 58.3.0",
"common-base",
@@ -424,7 +424,7 @@ checksum = "0c6cd424c2693bcdbc150d843dc9d4d137dd2de4782ce6df491ad11a3a0416c0"
dependencies = [
"bytes",
"half",
- "num-bigint",
+ "num-bigint 0.4.6",
"num-traits",
]
@@ -942,7 +942,7 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]]
name = "auth"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"async-trait",
@@ -977,27 +977,12 @@ dependencies = [
"syn 2.0.117",
]
-[[package]]
-name = "auto_ops"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7460f7dd8e100147b82a63afca1a20eb6c231ee36b90ba7272e14951cb58af59"
-
[[package]]
name = "autocfg"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
-[[package]]
-name = "autotools"
-version = "0.2.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef941527c41b0fc0dd48511a8154cd5fc7e29200a0ff8b7203c5d777dbc795cf"
-dependencies = [
- "cc",
-]
-
[[package]]
name = "aws-lc-rs"
version = "1.17.0"
@@ -1225,6 +1210,12 @@ version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
+[[package]]
+name = "base64"
+version = "0.23.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"
+
[[package]]
name = "base64-simd"
version = "0.8.0"
@@ -1257,7 +1248,7 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa"
dependencies = [
- "num-bigint",
+ "num-bigint 0.4.6",
"num-integer",
"num-traits",
"serde",
@@ -1271,7 +1262,7 @@ checksum = "1a22f228ab7a1b23027ccc6c350b72868017af7ea8356fbdf19f8d991c690013"
dependencies = [
"autocfg",
"libm",
- "num-bigint",
+ "num-bigint 0.4.6",
"num-integer",
"num-traits",
]
@@ -1520,6 +1511,15 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "btoi"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b5ab9db53bcda568284df0fd39f6eac24ad6f7ba7ff1168b9e76eba6576b976"
+dependencies = [
+ "num-traits",
+]
+
[[package]]
name = "bufstream"
version = "0.1.4"
@@ -1592,7 +1592,7 @@ dependencies = [
[[package]]
name = "cache"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"catalog",
"common-error",
@@ -1658,7 +1658,7 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "catalog"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"arrow 58.3.0",
@@ -1993,7 +1993,7 @@ checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675"
[[package]]
name = "cli"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"async-stream",
"async-trait",
@@ -2052,7 +2052,7 @@ dependencies = [
[[package]]
name = "client"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"arc-swap",
@@ -2085,7 +2085,7 @@ dependencies = [
"serde_json",
"snafu 0.8.6",
"store-api",
- "substrait 1.2.0",
+ "substrait 1.3.0",
"tokio",
"tokio-stream",
"tonic 0.14.2",
@@ -2134,7 +2134,7 @@ dependencies = [
[[package]]
name = "cmd"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"async-trait",
@@ -2167,6 +2167,7 @@ dependencies = [
"common-time",
"common-version",
"common-wal",
+ "daemonize",
"datafusion",
"datafusion-common",
"datafusion-physical-plan",
@@ -2190,6 +2191,8 @@ dependencies = [
"mito2",
"moka",
"object-store",
+ "object_store",
+ "object_store_opendal",
"parquet",
"plugins",
"pprof",
@@ -2260,7 +2263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c"
dependencies = [
"lazy_static",
- "windows-sys 0.48.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -2286,7 +2289,7 @@ dependencies = [
[[package]]
name = "common-base"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"ahash 0.8.12",
"anymap2",
@@ -2299,6 +2302,7 @@ dependencies = [
"pin-project",
"regex",
"serde",
+ "strum 0.27.1",
"tokio",
"toml 0.8.23",
"zeroize",
@@ -2306,14 +2310,14 @@ dependencies = [
[[package]]
name = "common-catalog"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"const_format",
]
[[package]]
name = "common-config"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"common-base",
"common-error",
@@ -2337,7 +2341,7 @@ dependencies = [
[[package]]
name = "common-datasource"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"arrow 58.3.0",
"arrow-schema 58.3.0",
@@ -2373,7 +2377,7 @@ dependencies = [
[[package]]
name = "common-decimal"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"bigdecimal 0.4.8",
"common-error",
@@ -2386,7 +2390,7 @@ dependencies = [
[[package]]
name = "common-error"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"common-macro",
"http 1.3.1",
@@ -2398,7 +2402,7 @@ dependencies = [
[[package]]
name = "common-event-recorder"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"async-trait",
@@ -2415,6 +2419,7 @@ dependencies = [
"serde_json",
"snafu 0.8.6",
"store-api",
+ "strum 0.27.1",
"tokio",
"tokio-util",
"toml 0.8.23",
@@ -2422,7 +2427,7 @@ dependencies = [
[[package]]
name = "common-frontend"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"async-trait",
@@ -2444,7 +2449,7 @@ dependencies = [
[[package]]
name = "common-function"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"ahash 0.8.12",
"api",
@@ -2467,6 +2472,7 @@ dependencies = [
"common-telemetry",
"common-time",
"common-version",
+ "criterion 0.7.0",
"datafusion",
"datafusion-common",
"datafusion-expr",
@@ -2501,13 +2507,14 @@ dependencies = [
"store-api",
"table",
"tokio",
- "uddsketch",
+ "uddsketch-rs",
+ "vu128",
"wkt",
]
[[package]]
name = "common-greptimedb-telemetry"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"async-trait",
"common-runtime",
@@ -2524,7 +2531,7 @@ dependencies = [
[[package]]
name = "common-grpc"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"arrow-flight",
@@ -2559,7 +2566,7 @@ dependencies = [
[[package]]
name = "common-grpc-expr"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"common-base",
@@ -2579,7 +2586,7 @@ dependencies = [
[[package]]
name = "common-macro"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"greptime-proto",
"once_cell",
@@ -2590,7 +2597,7 @@ dependencies = [
[[package]]
name = "common-mem-prof"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"anyhow",
"common-error",
@@ -2606,7 +2613,7 @@ dependencies = [
[[package]]
name = "common-memory-manager"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"common-error",
"common-macro",
@@ -2618,7 +2625,7 @@ dependencies = [
[[package]]
name = "common-meta"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"anymap2",
"api",
@@ -2691,7 +2698,7 @@ dependencies = [
[[package]]
name = "common-options"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"common-base",
"common-grpc",
@@ -2702,11 +2709,11 @@ dependencies = [
[[package]]
name = "common-plugins"
-version = "1.2.0"
+version = "1.3.0"
[[package]]
name = "common-pprof"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"common-error",
"common-macro",
@@ -2717,7 +2724,7 @@ dependencies = [
[[package]]
name = "common-procedure"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"async-stream",
@@ -2746,7 +2753,7 @@ dependencies = [
[[package]]
name = "common-procedure-test"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"async-trait",
"common-procedure",
@@ -2756,7 +2763,7 @@ dependencies = [
[[package]]
name = "common-query"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"async-trait",
@@ -2786,7 +2793,7 @@ dependencies = [
[[package]]
name = "common-recordbatch"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"arc-swap",
"common-base",
@@ -2811,7 +2818,7 @@ dependencies = [
[[package]]
name = "common-runtime"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"async-trait",
"clap",
@@ -2840,7 +2847,7 @@ dependencies = [
[[package]]
name = "common-session"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"serde",
"strum 0.27.1",
@@ -2848,7 +2855,7 @@ dependencies = [
[[package]]
name = "common-sql"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"arrow-schema 58.3.0",
"common-base",
@@ -2868,7 +2875,7 @@ dependencies = [
[[package]]
name = "common-stat"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"common-base",
"common-runtime",
@@ -2883,7 +2890,7 @@ dependencies = [
[[package]]
name = "common-telemetry"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"backtrace",
"common-base",
@@ -2894,10 +2901,10 @@ dependencies = [
"humantime-serde",
"lazy_static",
"once_cell",
- "opentelemetry 0.30.0",
+ "opentelemetry",
"opentelemetry-otlp",
"opentelemetry-semantic-conventions 0.30.0",
- "opentelemetry_sdk 0.30.0",
+ "opentelemetry_sdk",
"parking_lot 0.12.4",
"prometheus 0.14.0",
"serde",
@@ -2912,9 +2919,8 @@ dependencies = [
[[package]]
name = "common-test-util"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
- "client",
"common-grpc",
"common-query",
"common-recordbatch",
@@ -2925,7 +2931,7 @@ dependencies = [
[[package]]
name = "common-time"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"arrow 58.3.0",
"chrono",
@@ -2943,7 +2949,7 @@ dependencies = [
[[package]]
name = "common-version"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"cargo-manifest",
"const_format",
@@ -2953,7 +2959,7 @@ dependencies = [
[[package]]
name = "common-wal"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"common-base",
"common-error",
@@ -2976,7 +2982,7 @@ dependencies = [
[[package]]
name = "common-workload"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"common-telemetry",
"serde",
@@ -3565,6 +3571,15 @@ dependencies = [
"syn 2.0.117",
]
+[[package]]
+name = "daemonize"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ab8bfdaacb3c887a54d41bdf48d3af8873b3f5566469f8ba21b92057509f116e"
+dependencies = [
+ "libc",
+]
+
[[package]]
name = "darling"
version = "0.14.4"
@@ -3733,7 +3748,7 @@ checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8"
[[package]]
name = "datafusion"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"arrow-schema 58.3.0",
@@ -3787,7 +3802,7 @@ dependencies = [
[[package]]
name = "datafusion-catalog"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"async-trait",
@@ -3811,7 +3826,7 @@ dependencies = [
[[package]]
name = "datafusion-catalog-listing"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"async-trait",
@@ -3833,7 +3848,7 @@ dependencies = [
[[package]]
name = "datafusion-common"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"ahash 0.8.12",
"arrow 58.3.0",
@@ -3857,7 +3872,7 @@ dependencies = [
[[package]]
name = "datafusion-common-runtime"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"futures",
"log",
@@ -3867,7 +3882,7 @@ dependencies = [
[[package]]
name = "datafusion-datasource"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"async-compression",
@@ -3901,7 +3916,7 @@ dependencies = [
[[package]]
name = "datafusion-datasource-arrow"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"arrow-ipc 58.3.0",
@@ -3924,7 +3939,7 @@ dependencies = [
[[package]]
name = "datafusion-datasource-csv"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"async-trait",
@@ -3946,7 +3961,7 @@ dependencies = [
[[package]]
name = "datafusion-datasource-json"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"async-trait",
@@ -3969,7 +3984,7 @@ dependencies = [
[[package]]
name = "datafusion-datasource-parquet"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"async-trait",
@@ -3998,12 +4013,12 @@ dependencies = [
[[package]]
name = "datafusion-doc"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
[[package]]
name = "datafusion-execution"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"arrow-buffer 58.3.0",
@@ -4025,7 +4040,7 @@ dependencies = [
[[package]]
name = "datafusion-expr"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"async-trait",
@@ -4047,7 +4062,7 @@ dependencies = [
[[package]]
name = "datafusion-expr-common"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"datafusion-common",
@@ -4059,7 +4074,7 @@ dependencies = [
[[package]]
name = "datafusion-functions"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"arrow-buffer 58.3.0",
@@ -4090,7 +4105,7 @@ dependencies = [
[[package]]
name = "datafusion-functions-aggregate"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"ahash 0.8.12",
"arrow 58.3.0",
@@ -4111,7 +4126,7 @@ dependencies = [
[[package]]
name = "datafusion-functions-aggregate-common"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"ahash 0.8.12",
"arrow 58.3.0",
@@ -4123,7 +4138,7 @@ dependencies = [
[[package]]
name = "datafusion-functions-nested"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"arrow-ord 58.3.0",
@@ -4147,7 +4162,7 @@ dependencies = [
[[package]]
name = "datafusion-functions-table"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"async-trait",
@@ -4162,7 +4177,7 @@ dependencies = [
[[package]]
name = "datafusion-functions-window"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"datafusion-common",
@@ -4179,7 +4194,7 @@ dependencies = [
[[package]]
name = "datafusion-functions-window-common"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"datafusion-common",
"datafusion-physical-expr-common",
@@ -4188,7 +4203,7 @@ dependencies = [
[[package]]
name = "datafusion-macros"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"datafusion-doc",
"quote",
@@ -4198,7 +4213,7 @@ dependencies = [
[[package]]
name = "datafusion-optimizer"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"chrono",
@@ -4247,7 +4262,7 @@ dependencies = [
[[package]]
name = "datafusion-physical-expr"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"ahash 0.8.12",
"arrow 58.3.0",
@@ -4270,7 +4285,7 @@ dependencies = [
[[package]]
name = "datafusion-physical-expr-adapter"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"datafusion-common",
@@ -4284,7 +4299,7 @@ dependencies = [
[[package]]
name = "datafusion-physical-expr-common"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"ahash 0.8.12",
"arrow 58.3.0",
@@ -4300,7 +4315,7 @@ dependencies = [
[[package]]
name = "datafusion-physical-optimizer"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"datafusion-common",
@@ -4318,7 +4333,7 @@ dependencies = [
[[package]]
name = "datafusion-physical-plan"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"ahash 0.8.12",
"arrow 58.3.0",
@@ -4349,7 +4364,7 @@ dependencies = [
[[package]]
name = "datafusion-proto"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"chrono",
@@ -4376,7 +4391,7 @@ dependencies = [
[[package]]
name = "datafusion-proto-common"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"datafusion-common",
@@ -4386,7 +4401,7 @@ dependencies = [
[[package]]
name = "datafusion-pruning"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"datafusion-common",
@@ -4402,7 +4417,7 @@ dependencies = [
[[package]]
name = "datafusion-session"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"async-trait",
"datafusion-common",
@@ -4415,7 +4430,7 @@ dependencies = [
[[package]]
name = "datafusion-sql"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"arrow 58.3.0",
"bigdecimal 0.4.8",
@@ -4433,7 +4448,7 @@ dependencies = [
[[package]]
name = "datafusion-substrait"
version = "53.1.0"
-source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=6d6ae9a8073900bdf89d098d491d4dc0269699b0#6d6ae9a8073900bdf89d098d491d4dc0269699b0"
+source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=4c8a6bf28347b346348136247eb67dfb933f1147#4c8a6bf28347b346348136247eb67dfb933f1147"
dependencies = [
"async-recursion",
"async-trait",
@@ -4451,7 +4466,7 @@ dependencies = [
[[package]]
name = "datanode"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"arrow-flight",
@@ -4526,7 +4541,7 @@ checksum = "c286de4e81ea2590afc24d754e0f83810c566f50a1388fa75ebd57928c0d9745"
[[package]]
name = "datatypes"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"arrow 58.3.0",
"arrow-array 58.3.0",
@@ -4543,6 +4558,9 @@ dependencies = [
"num",
"num-traits",
"ordered-float 4.6.0",
+ "parquet-variant",
+ "parquet-variant-compute",
+ "parquet-variant-json",
"paste",
"regex",
"serde",
@@ -4620,10 +4638,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
dependencies = [
"const-oid 0.9.6",
+ "der_derive",
+ "flagset",
"pem-rfc7468",
"zeroize",
]
+[[package]]
+name = "der_derive"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.117",
+]
+
[[package]]
name = "deranged"
version = "0.5.8"
@@ -5263,7 +5294,7 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]]
name = "file-engine"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"async-trait",
@@ -5271,7 +5302,6 @@ dependencies = [
"common-datasource",
"common-error",
"common-macro",
- "common-procedure",
"common-query",
"common-recordbatch",
"common-telemetry",
@@ -5327,6 +5357,12 @@ version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99"
+[[package]]
+name = "flagset"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7ac824320a75a52197e8f2d787f6a38b6718bb6897a35142d749af3c0e8f4fe"
+
[[package]]
name = "flatbuffers"
version = "25.2.10"
@@ -5394,7 +5430,7 @@ checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8"
[[package]]
name = "flow"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"arrow 58.3.0",
@@ -5464,7 +5500,7 @@ dependencies = [
"sql",
"store-api",
"strum 0.27.1",
- "substrait 1.2.0",
+ "substrait 1.3.0",
"table",
"tokio",
"tokio-stream",
@@ -5547,7 +5583,7 @@ checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619"
[[package]]
name = "frontend"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"arc-swap",
@@ -5584,7 +5620,6 @@ dependencies = [
"dashmap",
"datafusion",
"datafusion-expr",
- "datanode",
"datatypes",
"futures",
"hostname 0.4.1",
@@ -5594,9 +5629,8 @@ dependencies = [
"lazy_static",
"log-query",
"meta-client",
- "meta-srv",
"num_cpus",
- "opentelemetry-proto 0.31.0",
+ "opentelemetry-proto",
"opentelemetry-semantic-conventions 0.31.0",
"operator",
"otel-arrow-rust",
@@ -5968,7 +6002,7 @@ dependencies = [
"cfg-if",
"js-sys",
"libc",
- "wasi",
+ "wasi 0.11.1+wasi-snapshot-preview1",
"wasm-bindgen",
]
@@ -6042,7 +6076,7 @@ dependencies = [
[[package]]
name = "greptime-proto"
version = "0.1.0"
-source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=032510ded061277b7d1bbb29d4046abb5b1cbf4b#032510ded061277b7d1bbb29d4046abb5b1cbf4b"
+source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=32f467fa2ba2b3588a58381a24af83de09fbb00a#32f467fa2ba2b3588a58381a24af83de09fbb00a"
dependencies = [
"prost 0.14.1",
"prost-types 0.14.1",
@@ -6200,6 +6234,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
dependencies = [
"allocator-api2",
+ "equivalent",
+ "foldhash 0.2.0",
]
[[package]]
@@ -6542,7 +6578,7 @@ dependencies = [
"tokio",
"tokio-rustls",
"tower-service",
- "webpki-roots 1.0.1",
+ "webpki-roots 1.0.9",
]
[[package]]
@@ -6659,7 +6695,7 @@ dependencies = [
"js-sys",
"log",
"wasm-bindgen",
- "windows-core 0.57.0",
+ "windows-core 0.61.2",
]
[[package]]
@@ -6850,7 +6886,7 @@ dependencies = [
[[package]]
name = "index"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"async-trait",
"asynchronous-codec",
@@ -7828,7 +7864,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
dependencies = [
"cfg-if",
- "windows-targets 0.48.5",
+ "windows-targets 0.53.5",
]
[[package]]
@@ -7859,13 +7895,14 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
[[package]]
name = "libredox"
-version = "0.1.4"
+version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638"
+checksum = "28d0a00925a9f930d679b6789b721e3a7f9ed110f41b86d2497caa780c3a070a"
dependencies = [
"bitflags 2.12.1",
"libc",
- "redox_syscall 0.5.13",
+ "plain",
+ "redox_syscall 0.9.3",
]
[[package]]
@@ -7971,7 +8008,7 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
[[package]]
name = "log-query"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"chrono",
"common-error",
@@ -7983,7 +8020,7 @@ dependencies = [
[[package]]
name = "log-store"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"async-stream",
"async-trait",
@@ -8010,7 +8047,8 @@ dependencies = [
"pin-project",
"prometheus 0.14.0",
"protobuf 2.28.0",
- "protobuf-build",
+ "protoc-bin-vendored",
+ "protoc-rust",
"raft-engine",
"rand 0.9.4",
"rskafka",
@@ -8101,15 +8139,6 @@ dependencies = [
"vob",
]
-[[package]]
-name = "lru"
-version = "0.12.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
-dependencies = [
- "hashbrown 0.15.4",
-]
-
[[package]]
name = "lru"
version = "0.16.4"
@@ -8119,6 +8148,15 @@ dependencies = [
"hashbrown 0.16.1",
]
+[[package]]
+name = "lru"
+version = "0.18.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d2f2f9b4ba7e6b24d95e7e899329d35be83bcded72c8540cdd5368932d1d90a"
+dependencies = [
+ "hashbrown 0.17.1",
+]
+
[[package]]
name = "lru-slab"
version = "0.1.2"
@@ -8308,12 +8346,13 @@ dependencies = [
[[package]]
name = "meta-client"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"async-trait",
"common-base",
"common-error",
+ "common-event-recorder",
"common-grpc",
"common-macro",
"common-meta",
@@ -8340,7 +8379,7 @@ dependencies = [
[[package]]
name = "meta-srv"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"async-trait",
@@ -8399,7 +8438,6 @@ dependencies = [
"serde",
"serde_json",
"servers",
- "session",
"snafu 0.8.6",
"sqlx",
"store-api",
@@ -8440,7 +8478,7 @@ dependencies = [
[[package]]
name = "metric-engine"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"aquamarine",
@@ -8535,13 +8573,13 @@ checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda"
dependencies = [
"libc",
"log",
- "wasi",
+ "wasi 0.11.1+wasi-snapshot-preview1",
"windows-sys 0.61.2",
]
[[package]]
name = "mito-codec"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"bytes",
@@ -8566,7 +8604,7 @@ dependencies = [
[[package]]
name = "mito2"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"aquamarine",
@@ -8736,28 +8774,29 @@ checksum = "2195bf6aa996a481483b29d62a7663eed3fe39600c460e323f8ff41e90bdd89b"
[[package]]
name = "mysql"
-version = "26.0.0"
+version = "28.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64453aedc258ac8c720b46c8264302fad39cef6c02483f68adbad4bcd22d6fab"
+checksum = "4a732193888328fc060ab901c0ed1355521267a51ffbfd9a0b3786434c6b8e7f"
dependencies = [
"bufstream",
"bytes",
"crossbeam-queue",
+ "crossbeam-utils",
"flate2",
"io-enum",
"libc",
- "lru 0.12.5",
- "mysql_common 0.34.1",
+ "lru 0.16.4",
+ "mysql_common 0.37.3",
"named_pipe",
"pem",
"percent-encoding",
"rustls",
"rustls-pemfile",
- "socket2 0.5.10",
+ "socket2 0.6.4",
"twox-hash",
"url",
"webpki",
- "webpki-roots 0.26.11",
+ "webpki-roots 1.0.9",
]
[[package]]
@@ -8768,7 +8807,7 @@ checksum = "63c3512cf11487168e0e9db7157801bf5273be13055a9cc95356dc9e0035e49c"
dependencies = [
"darling 0.20.11",
"heck 0.5.0",
- "num-bigint",
+ "num-bigint 0.4.6",
"proc-macro-crate 3.3.0",
"proc-macro-error2",
"proc-macro2",
@@ -8786,7 +8825,7 @@ checksum = "66f62cad7623a9cb6f8f64037f0c4f69c8db8e82914334a83c9788201c2c1bfa"
dependencies = [
"darling 0.20.11",
"heck 0.5.0",
- "num-bigint",
+ "num-bigint 0.4.6",
"proc-macro-crate 3.3.0",
"proc-macro-error2",
"proc-macro2",
@@ -8798,36 +8837,32 @@ dependencies = [
[[package]]
name = "mysql_async"
-version = "0.35.1"
+version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d14cf024116ba8fef4a7fec5abf0bd5de89b9fb29a7e55818a119ac5ec745077"
+checksum = "3519e91b0d254ac1ffa495bc42053286cb2172ad7241d5b3b1b9f8a891f21ee2"
dependencies = [
"bytes",
- "crossbeam",
+ "crossbeam-queue",
+ "crossbeam-utils",
"flate2",
"futures-core",
"futures-sink",
"futures-util",
"keyed_priority_queue",
- "lru 0.12.5",
- "mysql_common 0.34.1",
- "pem",
+ "lru 0.18.2",
+ "mysql_common 0.37.3",
"percent-encoding",
- "pin-project",
- "rand 0.8.5",
+ "rand 0.10.1",
"rustls",
- "rustls-pemfile",
"serde",
- "serde_json",
- "socket2 0.5.10",
+ "socket2 0.6.4",
"thiserror 2.0.17",
"tokio",
"tokio-rustls",
"tokio-util",
"twox-hash",
"url",
- "webpki",
- "webpki-roots 0.26.11",
+ "webpki-roots 1.0.9",
]
[[package]]
@@ -8841,7 +8876,7 @@ dependencies = [
"bindgen",
"bitflags 2.12.1",
"bitvec",
- "btoi",
+ "btoi 0.4.3",
"byteorder",
"bytes",
"cc",
@@ -8852,7 +8887,7 @@ dependencies = [
"frunk",
"lazy_static",
"mysql-common-derive 0.31.2",
- "num-bigint",
+ "num-bigint 0.4.6",
"num-traits",
"rand 0.8.5",
"regex",
@@ -8872,35 +8907,58 @@ dependencies = [
[[package]]
name = "mysql_common"
-version = "0.34.1"
+version = "0.37.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34a9141e735d5bb02414a7ac03add09522466d4db65bdd827069f76ae0850e58"
+checksum = "0f27695f286b461da077b8c2f72f47feaa04ce3c3f9c0976257410e90e21208a"
dependencies = [
"base64 0.22.1",
"bitflags 2.12.1",
- "btoi",
+ "btoi 0.5.0",
"byteorder",
"bytes",
- "cc",
- "cmake",
"crc32fast",
"flate2",
- "lazy_static",
+ "getrandom 0.3.4",
"mysql-common-derive 0.32.1",
- "num-bigint",
+ "num-bigint 0.4.6",
"num-traits",
- "rand 0.8.5",
"regex",
"saturating",
"serde",
"serde_json",
"sha1 0.10.6",
"sha2 0.10.9",
- "subprocess",
- "thiserror 1.0.69",
+ "thiserror 2.0.17",
"time",
"uuid",
- "zstd",
+]
+
+[[package]]
+name = "mysql_common"
+version = "0.38.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d11189bb0e285f58b71744ee23aa8b943bd5120ef0877555813d2107374d3970"
+dependencies = [
+ "base64 0.22.1",
+ "bitflags 2.12.1",
+ "btoi 0.5.0",
+ "byteorder",
+ "bytes",
+ "crc32fast",
+ "flate2",
+ "getrandom 0.4.1",
+ "hex",
+ "mysql-common-derive 0.32.1",
+ "num-bigint 0.5.1",
+ "num-traits",
+ "regex",
+ "saturating",
+ "serde",
+ "serde_json",
+ "sha1 0.11.0",
+ "sha2 0.11.0",
+ "thiserror 2.0.17",
+ "uuid",
]
[[package]]
@@ -9105,7 +9163,7 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23"
dependencies = [
- "num-bigint",
+ "num-bigint 0.4.6",
"num-complex",
"num-integer",
"num-iter",
@@ -9123,6 +9181,16 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "num-bigint"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93e7820bc0a80a0238e650327316f929ba18d5be054b647490a3a6a339f3e7c0"
+dependencies = [
+ "num-integer",
+ "num-traits",
+]
+
[[package]]
name = "num-bigint-dig"
version = "0.8.6"
@@ -9207,7 +9275,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
dependencies = [
- "num-bigint",
+ "num-bigint 0.4.6",
"num-integer",
"num-traits",
]
@@ -9320,6 +9388,15 @@ dependencies = [
"objc2-encode",
]
+[[package]]
+name = "objc2-core-foundation"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
+dependencies = [
+ "bitflags 2.12.1",
+]
+
[[package]]
name = "objc2-encode"
version = "4.1.0"
@@ -9336,6 +9413,15 @@ dependencies = [
"objc2",
]
+[[package]]
+name = "objc2-system-configuration"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7216bd11cbda54ccabcab84d523dc93b858ec75ecfb3a7d89513fa22464da396"
+dependencies = [
+ "objc2-core-foundation",
+]
+
[[package]]
name = "object"
version = "0.36.7"
@@ -9356,7 +9442,7 @@ dependencies = [
[[package]]
name = "object-store"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"anyhow",
"async-trait",
@@ -9758,17 +9844,6 @@ dependencies = [
"url",
]
-[[package]]
-name = "openmetrics-parser"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e40a68c62e09c5dfec2f6472af3bd5e8ddf506fcf14c78ece23794ffbb874eca"
-dependencies = [
- "auto_ops",
- "pest",
- "pest_derive",
-]
-
[[package]]
name = "opensrv-mysql"
version = "0.8.0"
@@ -9793,23 +9868,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
[[package]]
name = "opentelemetry"
-version = "0.30.0"
+version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aaf416e4cb72756655126f7dd7bb0af49c674f4c1b9903e80c009e0c37e552e6"
-dependencies = [
- "futures-core",
- "futures-sink",
- "js-sys",
- "pin-project-lite",
- "thiserror 2.0.17",
- "tracing",
-]
-
-[[package]]
-name = "opentelemetry"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b84bcd6ae87133e903af7ef497404dda70c60d0ea14895fc8a5e6722754fc2a0"
+checksum = "b0142c63252a9e054e68a4c61a5778f7b14f576274d593f8ce883d191a099682"
dependencies = [
"futures-core",
"futures-sink",
@@ -9821,61 +9882,48 @@ dependencies = [
[[package]]
name = "opentelemetry-http"
-version = "0.30.0"
+version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50f6639e842a97dbea8886e3439710ae463120091e2e064518ba8e716e6ac36d"
+checksum = "5683015d09e2df236ef005b17f6f196f0d5f6313c4fa43a7b6a53b52776e4331"
dependencies = [
"async-trait",
"bytes",
"http 1.3.1",
- "opentelemetry 0.30.0",
- "reqwest 0.12.24",
+ "opentelemetry",
+ "reqwest 0.13.4",
]
[[package]]
name = "opentelemetry-otlp"
-version = "0.30.0"
+version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dbee664a43e07615731afc539ca60c6d9f1a9425e25ca09c57bc36c87c55852b"
+checksum = "9966929966d17620d7c316c643ba62631826e10021409357772d5eea84f62c35"
dependencies = [
"http 1.3.1",
- "opentelemetry 0.30.0",
+ "opentelemetry",
"opentelemetry-http",
- "opentelemetry-proto 0.30.0",
- "opentelemetry_sdk 0.30.0",
- "prost 0.13.5",
- "reqwest 0.12.24",
+ "opentelemetry-proto",
+ "opentelemetry_sdk",
+ "prost 0.14.1",
+ "reqwest 0.13.4",
"thiserror 2.0.17",
"tokio",
- "tonic 0.13.1",
- "tracing",
+ "tonic 0.14.2",
+ "tonic-types",
]
[[package]]
name = "opentelemetry-proto"
-version = "0.30.0"
+version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e046fd7660710fe5a05e8748e70d9058dc15c94ba914e7c4faa7c728f0e8ddc"
-dependencies = [
- "opentelemetry 0.30.0",
- "opentelemetry_sdk 0.30.0",
- "prost 0.13.5",
- "tonic 0.13.1",
-]
-
-[[package]]
-name = "opentelemetry-proto"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7175df06de5eaee9909d4805a3d07e28bb752c34cab57fa9cff549da596b30f"
+checksum = "56d658ba1faf63f7b9c492cfbe6e0ec365440a16132d3270c1065f7b33f1b638"
dependencies = [
"base64 0.22.1",
"const-hex",
- "opentelemetry 0.31.0",
- "opentelemetry_sdk 0.31.0",
+ "opentelemetry",
+ "opentelemetry_sdk",
"prost 0.14.1",
"serde",
- "serde_json",
"tonic 0.14.2",
"tonic-prost",
]
@@ -9894,40 +9942,25 @@ checksum = "e62e29dfe041afb8ed2a6c9737ab57db4907285d999ef8ad3a59092a36bdc846"
[[package]]
name = "opentelemetry_sdk"
-version = "0.30.0"
+version = "0.32.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11f644aa9e5e31d11896e024305d7e3c98a88884d9f8919dbf37a9991bc47a4b"
+checksum = "9b59f80e1ac4d5ff7a2db8fb6c80badb7f0f3f858211fba08dd9aaec750894f9"
dependencies = [
"futures-channel",
"futures-executor",
"futures-util",
- "opentelemetry 0.30.0",
+ "opentelemetry",
"percent-encoding",
+ "portable-atomic",
"rand 0.9.4",
- "serde_json",
"thiserror 2.0.17",
"tokio",
"tokio-stream",
]
-[[package]]
-name = "opentelemetry_sdk"
-version = "0.31.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e14ae4f5991976fd48df6d843de219ca6d31b01daaab2dad5af2badeded372bd"
-dependencies = [
- "futures-channel",
- "futures-executor",
- "futures-util",
- "opentelemetry 0.31.0",
- "percent-encoding",
- "rand 0.9.4",
- "thiserror 2.0.17",
-]
-
[[package]]
name = "operator"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"ahash 0.8.12",
"api",
@@ -9943,6 +9976,7 @@ dependencies = [
"common-catalog",
"common-datasource",
"common-error",
+ "common-event-recorder",
"common-frontend",
"common-function",
"common-grpc",
@@ -9980,13 +10014,15 @@ dependencies = [
"prost-types 0.14.1",
"query",
"regex",
+ "serde",
"serde_json",
+ "serde_yaml_ng",
"session",
"snafu 0.8.6",
"sql",
"sqlparser",
"store-api",
- "substrait 1.2.0",
+ "substrait 1.3.0",
"table",
"tokio",
"tokio-util",
@@ -10243,7 +10279,7 @@ dependencies = [
"half",
"hashbrown 0.17.1",
"lz4_flex 0.13.1",
- "num-bigint",
+ "num-bigint 0.4.6",
"num-integer",
"num-traits",
"object_store",
@@ -10257,6 +10293,53 @@ dependencies = [
"zstd",
]
+[[package]]
+name = "parquet-variant"
+version = "58.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "74c8db065291f088a2aad8ab831853eae1871c0d311c8d0b83bbc3b7e735d0fc"
+dependencies = [
+ "arrow 58.3.0",
+ "arrow-schema 58.3.0",
+ "chrono",
+ "half",
+ "indexmap 2.13.0",
+ "num-traits",
+ "simdutf8",
+ "uuid",
+]
+
+[[package]]
+name = "parquet-variant-compute"
+version = "58.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a530e8d5b5e14efcb39c9a6ec55432ad11f6afb7dc4455a79be0dc615fe3cc31"
+dependencies = [
+ "arrow 58.3.0",
+ "arrow-schema 58.3.0",
+ "chrono",
+ "half",
+ "indexmap 2.13.0",
+ "parquet-variant",
+ "parquet-variant-json",
+ "serde_json",
+ "uuid",
+]
+
+[[package]]
+name = "parquet-variant-json"
+version = "58.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00ed89908289f67caa2ca078f9ff9aacd6229a313ec92b12bf4f48f613dc2b97"
+dependencies = [
+ "arrow-schema 58.3.0",
+ "base64 0.22.1",
+ "chrono",
+ "parquet-variant",
+ "serde_json",
+ "uuid",
+]
+
[[package]]
name = "parse-size"
version = "1.1.0"
@@ -10271,7 +10354,7 @@ checksum = "e3c406c9e2aa74554e662d2c2ee11cd3e73756988800be7e6f5eddb16fed4699"
[[package]]
name = "partition"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"async-trait",
@@ -10489,13 +10572,13 @@ dependencies = [
[[package]]
name = "pgwire"
-version = "0.40.1"
+version = "0.40.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f690fba3b77370e278b606b75c6857d3f33f3e570781a75ef7516e76e44c0b19"
+checksum = "8265901ede50d0879fe401c6fe282e7e4ff83ae10a48c1f8e4f89b92f7d5f604"
dependencies = [
"async-trait",
"aws-lc-rs",
- "base64 0.22.1",
+ "base64 0.23.1",
"bytes",
"chrono",
"derive-new",
@@ -10517,16 +10600,7 @@ dependencies = [
"tokio",
"tokio-rustls",
"tokio-util",
- "x509-certificate 0.25.0",
-]
-
-[[package]]
-name = "phf"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
-dependencies = [
- "phf_shared 0.11.3",
+ "x509-certificate",
]
[[package]]
@@ -10665,7 +10739,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pipeline"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"ahash 0.8.12",
"api",
@@ -10779,6 +10853,12 @@ version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
+[[package]]
+name = "plain"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
+
[[package]]
name = "plist"
version = "1.7.2"
@@ -10822,7 +10902,7 @@ dependencies = [
[[package]]
name = "plugins"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"auth",
"catalog",
@@ -10871,34 +10951,34 @@ dependencies = [
[[package]]
name = "postgres-protocol"
-version = "0.6.8"
+version = "0.6.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76ff0abab4a9b844b93ef7b81f1efc0a366062aaef2cd702c76256b5dc075c54"
+checksum = "08808e3c483c46e999108051c78334f473d5adb59d78bb80a1268c7e6aa6c514"
dependencies = [
"base64 0.22.1",
"byteorder",
"bytes",
"fallible-iterator",
- "hmac 0.12.1",
- "md-5 0.10.6",
+ "hmac 0.13.0",
+ "md-5 0.11.0",
"memchr",
- "rand 0.9.4",
- "sha2 0.10.9",
+ "rand 0.10.1",
+ "sha2 0.11.0",
"stringprep",
]
[[package]]
name = "postgres-types"
-version = "0.2.9"
+version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "613283563cd90e1dfc3518d548caee47e0e725455ed619881f5cf21f36de4b48"
+checksum = "851ca9db4932932d69f3ea811b1abe63087a0f740a47692619dd40d4899b68be"
dependencies = [
"array-init",
"bytes",
"chrono",
"fallible-iterator",
"postgres-protocol",
- "serde",
+ "serde_core",
"serde_json",
]
@@ -11162,7 +11242,7 @@ dependencies = [
[[package]]
name = "promql"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"ahash 0.8.12",
"async-trait",
@@ -11285,7 +11365,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac6c3320f9abac597dcbc668774ef006702672474aad53c6d596b62e487b40b1"
dependencies = [
"heck 0.5.0",
- "itertools 0.11.0",
+ "itertools 0.14.0",
"log",
"multimap",
"once_cell",
@@ -11333,7 +11413,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d"
dependencies = [
"anyhow",
- "itertools 0.11.0",
+ "itertools 0.14.0",
"proc-macro2",
"quote",
"syn 2.0.117",
@@ -11346,7 +11426,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9120690fafc389a67ba3803df527d0ec9cbbc9cc45e4cc20b332996dfb672425"
dependencies = [
"anyhow",
- "itertools 0.11.0",
+ "itertools 0.14.0",
"proc-macro2",
"quote",
"syn 2.0.117",
@@ -11419,19 +11499,6 @@ dependencies = [
"thiserror 1.0.69",
]
-[[package]]
-name = "protobuf-build"
-version = "0.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c852d9625b912c3e50480cdc701f60f49890b5d7ad46198dd583600f15e7c6ec"
-dependencies = [
- "bitflags 1.3.2",
- "protobuf 2.28.0",
- "protobuf-codegen",
- "protobuf-src",
- "regex",
-]
-
[[package]]
name = "protobuf-codegen"
version = "2.28.0"
@@ -11441,15 +11508,6 @@ dependencies = [
"protobuf 2.28.0",
]
-[[package]]
-name = "protobuf-src"
-version = "1.1.0+21.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1"
-dependencies = [
- "autotools",
-]
-
[[package]]
name = "protobuf-support"
version = "3.7.2"
@@ -11459,6 +11517,92 @@ dependencies = [
"thiserror 1.0.69",
]
+[[package]]
+name = "protoc"
+version = "2.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a0218039c514f9e14a5060742ecd50427f8ac4f85a6dc58f2ddb806e318c55ee"
+dependencies = [
+ "log",
+ "which",
+]
+
+[[package]]
+name = "protoc-bin-vendored"
+version = "3.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1c381df33c98266b5f08186583660090a4ffa0889e76c7e9a5e175f645a67fa"
+dependencies = [
+ "protoc-bin-vendored-linux-aarch_64",
+ "protoc-bin-vendored-linux-ppcle_64",
+ "protoc-bin-vendored-linux-s390_64",
+ "protoc-bin-vendored-linux-x86_32",
+ "protoc-bin-vendored-linux-x86_64",
+ "protoc-bin-vendored-macos-aarch_64",
+ "protoc-bin-vendored-macos-x86_64",
+ "protoc-bin-vendored-win32",
+]
+
+[[package]]
+name = "protoc-bin-vendored-linux-aarch_64"
+version = "3.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c350df4d49b5b9e3ca79f7e646fde2377b199e13cfa87320308397e1f37e1a4c"
+
+[[package]]
+name = "protoc-bin-vendored-linux-ppcle_64"
+version = "3.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a55a63e6c7244f19b5c6393f025017eb5d793fd5467823a099740a7a4222440c"
+
+[[package]]
+name = "protoc-bin-vendored-linux-s390_64"
+version = "3.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1dba5565db4288e935d5330a07c264a4ee8e4a5b4a4e6f4e83fad824cc32f3b0"
+
+[[package]]
+name = "protoc-bin-vendored-linux-x86_32"
+version = "3.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8854774b24ee28b7868cd71dccaae8e02a2365e67a4a87a6cd11ee6cdbdf9cf5"
+
+[[package]]
+name = "protoc-bin-vendored-linux-x86_64"
+version = "3.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b38b07546580df720fa464ce124c4b03630a6fb83e05c336fea2a241df7e5d78"
+
+[[package]]
+name = "protoc-bin-vendored-macos-aarch_64"
+version = "3.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "89278a9926ce312e51f1d999fee8825d324d603213344a9a706daa009f1d8092"
+
+[[package]]
+name = "protoc-bin-vendored-macos-x86_64"
+version = "3.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "81745feda7ccfb9471d7a4de888f0652e806d5795b61480605d4943176299756"
+
+[[package]]
+name = "protoc-bin-vendored-win32"
+version = "3.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "95067976aca6421a523e491fce939a3e65249bac4b977adee0ee9771568e8aa3"
+
+[[package]]
+name = "protoc-rust"
+version = "2.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22f8a182bb17c485f20bdc4274a8c39000a61024cfe461c799b50fec77267838"
+dependencies = [
+ "protobuf 2.28.0",
+ "protobuf-codegen",
+ "protoc",
+ "tempfile",
+]
+
[[package]]
name = "psl"
version = "2.1.123"
@@ -11515,7 +11659,7 @@ dependencies = [
[[package]]
name = "puffin"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"async-compression",
"async-trait",
@@ -11577,7 +11721,7 @@ dependencies = [
[[package]]
name = "query"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"ahash 0.8.12",
"api",
@@ -11648,7 +11792,7 @@ dependencies = [
"sql",
"sqlparser",
"store-api",
- "substrait 1.2.0",
+ "substrait 1.3.0",
"table",
"tokio",
"tokio-stream",
@@ -11988,6 +12132,15 @@ dependencies = [
"bitflags 2.12.1",
]
+[[package]]
+name = "redox_syscall"
+version = "0.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d678d17679829e73d371e96880897e98fee2ded7acc0a50bdf8af2affa4b2fe5"
+dependencies = [
+ "bitflags 2.12.1",
+]
+
[[package]]
name = "redox_users"
version = "0.4.6"
@@ -12245,7 +12398,6 @@ checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f"
dependencies = [
"base64 0.22.1",
"bytes",
- "futures-channel",
"futures-core",
"futures-util",
"h2 0.4.11",
@@ -12278,7 +12430,7 @@ dependencies = [
"wasm-bindgen-futures",
"wasm-streams 0.4.2",
"web-sys",
- "webpki-roots 1.0.1",
+ "webpki-roots 1.0.9",
]
[[package]]
@@ -12289,6 +12441,7 @@ checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3"
dependencies = [
"base64 0.22.1",
"bytes",
+ "futures-channel",
"futures-core",
"futures-util",
"http 1.3.1",
@@ -13268,7 +13421,7 @@ dependencies = [
[[package]]
name = "servers"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"ahash 0.8.12",
"api",
@@ -13341,13 +13494,12 @@ dependencies = [
"mime_guess",
"moka",
"mysql_async",
- "mysql_common 0.34.1",
+ "mysql_common 0.38.2",
"notify",
"object-pool",
"once_cell",
- "openmetrics-parser",
"opensrv-mysql",
- "opentelemetry-proto 0.31.0",
+ "opentelemetry-proto",
"operator",
"otel-arrow-rust",
"parking_lot 0.12.4",
@@ -13372,8 +13524,10 @@ dependencies = [
"rustls",
"rustls-pemfile",
"rustls-pki-types",
+ "ryu",
"serde",
"serde_json",
+ "servers",
"session",
"simd-json",
"simdutf8",
@@ -13408,12 +13562,13 @@ dependencies = [
[[package]]
name = "session"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"ahash 0.8.12",
"api",
"arc-swap",
"auth",
+ "common-base",
"common-catalog",
"common-error",
"common-macro",
@@ -13761,7 +13916,7 @@ dependencies = [
[[package]]
name = "sql"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"arrow-buffer 58.3.0",
@@ -13822,7 +13977,7 @@ dependencies = [
[[package]]
name = "sqlness-runner"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"async-trait",
"clap",
@@ -14016,7 +14171,7 @@ dependencies = [
"stringprep",
"thiserror 2.0.17",
"tracing",
- "whoami",
+ "whoami 1.6.0",
]
[[package]]
@@ -14055,7 +14210,7 @@ dependencies = [
"stringprep",
"thiserror 2.0.17",
"tracing",
- "whoami",
+ "whoami 1.6.0",
]
[[package]]
@@ -14104,8 +14259,9 @@ dependencies = [
[[package]]
name = "standalone"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
+ "api",
"async-trait",
"catalog",
"client",
@@ -14119,6 +14275,7 @@ dependencies = [
"common-options",
"common-procedure",
"common-query",
+ "common-recordbatch",
"common-stat",
"common-telemetry",
"common-time",
@@ -14150,7 +14307,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "store-api"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"aquamarine",
@@ -14343,7 +14500,7 @@ dependencies = [
[[package]]
name = "substrait"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"async-trait",
"bytes",
@@ -14465,7 +14622,7 @@ dependencies = [
[[package]]
name = "table"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"arc-swap",
@@ -14748,7 +14905,7 @@ checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683"
[[package]]
name = "tests-fuzz"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"arbitrary",
"async-trait",
@@ -14796,7 +14953,7 @@ dependencies = [
[[package]]
name = "tests-integration"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"api",
"arrow-flight",
@@ -14855,7 +15012,7 @@ dependencies = [
"mito2",
"mysql_async",
"object-store",
- "opentelemetry-proto 0.31.0",
+ "opentelemetry-proto",
"operator",
"otel-arrow-rust",
"partition",
@@ -14878,7 +15035,7 @@ dependencies = [
"sqlx",
"standalone",
"store-api",
- "substrait 1.2.0",
+ "substrait 1.3.0",
"table",
"tempfile",
"time",
@@ -15072,6 +15229,27 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
+[[package]]
+name = "tls_codec"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0de2e01245e2bb89d6f05801c564fa27624dbd7b1846859876c7dad82e90bf6b"
+dependencies = [
+ "tls_codec_derive",
+ "zeroize",
+]
+
+[[package]]
+name = "tls_codec_derive"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2d2e76690929402faae40aebdda620a2c0e25dd6d3b9afe48867dfd95991f4bd"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.117",
+]
+
[[package]]
name = "tokio"
version = "1.52.3"
@@ -15138,9 +15316,9 @@ dependencies = [
[[package]]
name = "tokio-postgres"
-version = "0.7.13"
+version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c95d533c83082bb6490e0189acaa0bbeef9084e60471b696ca6988cd0541fb0"
+checksum = "a528f7d280f6d5b9cd149635c8705b0dd049754bc67d81d31fa25169a93809d3"
dependencies = [
"async-trait",
"byteorder",
@@ -15151,29 +15329,29 @@ dependencies = [
"log",
"parking_lot 0.12.4",
"percent-encoding",
- "phf 0.11.3",
+ "phf 0.13.1",
"pin-project-lite",
"postgres-protocol",
"postgres-types",
- "rand 0.9.4",
- "socket2 0.5.10",
+ "rand 0.10.1",
+ "socket2 0.6.4",
"tokio",
"tokio-util",
- "whoami",
+ "whoami 2.1.3",
]
[[package]]
name = "tokio-postgres-rustls"
-version = "0.12.0"
+version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04fb792ccd6bbcd4bba408eb8a292f70fc4a3589e5d793626f45190e6454b6ab"
+checksum = "4c2ad44aa0ae96db89c4742212ed41645b2f597311ff6e1945542a4d9fadc2fb"
dependencies = [
- "ring",
"rustls",
+ "sha2 0.11.0",
"tokio",
"tokio-postgres",
"tokio-rustls",
- "x509-certificate 0.23.1",
+ "x509-cert",
]
[[package]]
@@ -15316,32 +15494,6 @@ dependencies = [
"tracing",
]
-[[package]]
-name = "tonic"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e581ba15a835f4d9ea06c55ab1bd4dce26fc53752c69a04aac00703bfb49ba9"
-dependencies = [
- "async-trait",
- "base64 0.22.1",
- "bytes",
- "http 1.3.1",
- "http-body 1.0.1",
- "http-body-util",
- "hyper 1.6.0",
- "hyper-timeout 0.5.2",
- "hyper-util",
- "percent-encoding",
- "pin-project",
- "prost 0.13.5",
- "tokio",
- "tokio-stream",
- "tower 0.5.2",
- "tower-layer",
- "tower-service",
- "tracing",
-]
-
[[package]]
name = "tonic"
version = "0.14.2"
@@ -15428,6 +15580,17 @@ dependencies = [
"tonic-prost",
]
+[[package]]
+name = "tonic-types"
+version = "0.14.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2a875a902255423d34c1f20838ab374126db8eb41625b7947a1d54113b0b7399"
+dependencies = [
+ "prost 0.14.1",
+ "prost-types 0.14.1",
+ "tonic 0.14.2",
+]
+
[[package]]
name = "tonic-web"
version = "0.14.5"
@@ -15550,9 +15713,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]]
name = "tracing"
-version = "0.1.41"
+version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
+checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
dependencies = [
"log",
"pin-project-lite",
@@ -15574,9 +15737,9 @@ dependencies = [
[[package]]
name = "tracing-attributes"
-version = "0.1.28"
+version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d"
+checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
dependencies = [
"proc-macro2",
"quote",
@@ -15585,9 +15748,9 @@ dependencies = [
[[package]]
name = "tracing-core"
-version = "0.1.34"
+version = "0.1.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
+checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
dependencies = [
"once_cell",
"valuable",
@@ -15606,14 +15769,12 @@ dependencies = [
[[package]]
name = "tracing-opentelemetry"
-version = "0.31.0"
+version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddcf5959f39507d0d04d6413119c04f33b623f4f951ebcbdddddfad2d0623a9c"
+checksum = "adbc64cba7137545b8044cb1fe9814f7aacf3c6b5f9b45be8bb5db538befdb26"
dependencies = [
"js-sys",
- "once_cell",
- "opentelemetry 0.30.0",
- "opentelemetry_sdk 0.30.0",
+ "opentelemetry",
"smallvec",
"tracing",
"tracing-core",
@@ -15634,9 +15795,9 @@ dependencies = [
[[package]]
name = "tracing-subscriber"
-version = "0.3.20"
+version = "0.3.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
+checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319"
dependencies = [
"matchers",
"nu-ansi-term",
@@ -15772,11 +15933,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
[[package]]
-name = "uddsketch"
+name = "uddsketch-rs"
version = "0.1.0"
-source = "git+https://github.com/GreptimeTeam/timescaledb-toolkit.git?rev=84828fe8fb494a6a61412a3da96517fc80f7bb20#84828fe8fb494a6a61412a3da96517fc80f7bb20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f0495d3e02c0e9b074e5631de7af419b9f4fdbfec4b1ca1b3180c8b3a926cb5"
dependencies = [
- "serde",
+ "thiserror 2.0.17",
+ "vu128",
]
[[package]]
@@ -16165,6 +16328,12 @@ dependencies = [
"memchr",
]
+[[package]]
+name = "vu128"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b18da3bd753c6f4373511e5f025423986560dfe4a5e7d642cc9a0266847f9fdd"
+
[[package]]
name = "walkdir"
version = "2.5.0"
@@ -16190,6 +16359,15 @@ version = "0.11.1+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
+[[package]]
+name = "wasi"
+version = "0.14.7+wasi-0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c"
+dependencies = [
+ "wasip2",
+]
+
[[package]]
name = "wasip2"
version = "1.0.2+wasi-0.2.9"
@@ -16214,6 +16392,15 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
+[[package]]
+name = "wasite"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66fe902b4a6b8028a753d5424909b764ccf79b7a209eac9bf97e59cda9f71a42"
+dependencies = [
+ "wasi 0.14.7+wasi-0.2.4",
+]
+
[[package]]
name = "wasm-bindgen"
version = "0.2.122"
@@ -16405,18 +16592,30 @@ version = "0.26.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9"
dependencies = [
- "webpki-roots 1.0.1",
+ "webpki-roots 1.0.9",
]
[[package]]
name = "webpki-roots"
-version = "1.0.1"
+version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8782dd5a41a24eed3a4f40b606249b3e236ca61adf1f25ea4d45c73de122b502"
+checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a"
dependencies = [
"rustls-pki-types",
]
+[[package]]
+name = "which"
+version = "4.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7"
+dependencies = [
+ "either",
+ "home",
+ "once_cell",
+ "rustix 0.38.44",
+]
+
[[package]]
name = "whoami"
version = "1.6.0"
@@ -16424,7 +16623,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7"
dependencies = [
"redox_syscall 0.5.13",
- "wasite",
+ "wasite 0.1.0",
+]
+
+[[package]]
+name = "whoami"
+version = "2.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "626c4bac6755d76ffc12cb01b2eac751db1996b9e0041de9aa02c8c211ddc82c"
+dependencies = [
+ "libc",
+ "libredox",
+ "objc2-system-configuration",
+ "wasite 1.0.2",
"web-sys",
]
@@ -16460,7 +16671,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
- "windows-sys 0.48.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -17033,22 +17244,15 @@ dependencies = [
]
[[package]]
-name = "x509-certificate"
-version = "0.23.1"
+name = "x509-cert"
+version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "66534846dec7a11d7c50a74b7cdb208b9a581cad890b7866430d438455847c85"
+checksum = "1301e935010a701ae5f8655edc0ad17c44bad3ac5ce8c39185f75453b720ae94"
dependencies = [
- "bcder",
- "bytes",
- "chrono",
+ "const-oid 0.9.6",
"der",
- "hex",
- "pem",
- "ring",
- "signature",
"spki",
- "thiserror 1.0.69",
- "zeroize",
+ "tls_codec",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index a9d509031cd..fab7b2aa736 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -75,7 +75,7 @@ members = [
resolver = "2"
[workspace.package]
-version = "1.2.0"
+version = "1.3.0"
edition = "2024"
license = "Apache-2.0"
@@ -159,7 +159,7 @@ fs2 = "0.4"
fst = "0.4.7"
futures = "0.3"
futures-util = "0.3"
-greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "032510ded061277b7d1bbb29d4046abb5b1cbf4b" }
+greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "32f467fa2ba2b3588a58381a24af83de09fbb00a" }
hex = "0.4"
http = "1"
humantime = "2.1"
@@ -182,7 +182,7 @@ notify = "8.0"
num_cpus = "1.16"
object_store_opendal = "0.57"
once_cell = "1.18"
-opentelemetry-proto = { version = "0.31", features = [
+opentelemetry-proto = { version = "0.32", features = [
"gen-tonic",
"metrics",
"trace",
@@ -195,6 +195,9 @@ otel-arrow-rust = { git = "https://github.com/GreptimeTeam/otel-arrow", rev = "5
] }
parking_lot = "0.12"
parquet = { version = "58.3", default-features = false, features = ["arrow", "async", "object_store"] }
+parquet-variant = "58.3"
+parquet-variant-compute = "58.3"
+parquet-variant-json = "58.3"
paste = "1.0"
pin-project = "1.0"
pretty_assertions = "1.4.0"
@@ -202,6 +205,8 @@ prometheus = { version = "0.14", features = ["process"] }
promql-parser = { version = "0.10.0", features = ["ser"] }
prost = { version = "0.14", features = ["no-recursion-limit"] }
prost-types = "0.14"
+protoc-bin-vendored = "3.2"
+protoc-rust = "2.28"
raft-engine = { version = "0.4.1", default-features = false }
rand = "0.9"
ratelimit = "0.10"
@@ -226,10 +231,12 @@ rstest_reuse = "0.7"
rust_decimal = "1.33"
rustc-hash = "2.0"
rustls = { version = "0.23.25", default-features = false }
+ryu = "1.0"
sea-query = "0.32"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["float_roundtrip"] }
serde_with = "3"
+serde_yaml_ng = "0.10"
simd-json = "0.15"
similar-asserts = "1.6.0"
smallvec = { version = "1", features = ["serde"] }
@@ -248,7 +255,7 @@ strum = { version = "0.27", features = ["derive"] }
sysinfo = "0.33"
tempfile = "3"
tokio = { version = "1.47", features = ["full"] }
-tokio-postgres = "0.7"
+tokio-postgres = "0.7.18"
tokio-rustls = { version = "0.26.2", default-features = false }
tokio-stream = "0.1"
tokio-util = { version = "0.7", features = ["io-util", "compat"] }
@@ -260,11 +267,13 @@ tower = "0.5"
tower-http = "0.6"
tracing = "0.1"
tracing-appender = "0.2"
-tracing-opentelemetry = "0.31.0"
+tracing-opentelemetry = "0.33.0"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "fmt"] }
typetag = "0.2"
+uddsketch-rs = "0.1.0"
uuid = { version = "1.17", features = ["serde", "v4", "v7", "fast-rng"] }
vrl = "0.33"
+vu128 = "1.1"
zstd = "0.13"
# DO_NOT_REMOVE_THIS: END_OF_EXTERNAL_DEPENDENCIES
@@ -343,21 +352,21 @@ git = "https://github.com/GreptimeTeam/greptime-meter.git"
rev = "5618e779cf2bb4755b499c630fba4c35e91898cb"
[patch.crates-io]
-datafusion = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-datasource = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-expr-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-functions = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-functions-aggregate-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-functions-window-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-optimizer = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-physical-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-physical-expr-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-physical-plan = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-proto = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-sql = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
-datafusion-substrait = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "6d6ae9a8073900bdf89d098d491d4dc0269699b0" }
+datafusion = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-datasource = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-expr-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-functions = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-functions-aggregate-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-functions-window-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-optimizer = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-physical-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-physical-expr-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-physical-plan = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-proto = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-sql = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
+datafusion-substrait = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "4c8a6bf28347b346348136247eb67dfb933f1147" }
sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "2aefa08a8d69c96eec2d6d6703598a009bba6e4c" } # on branch v0.61.x
[profile.release]
diff --git a/Makefile b/Makefile
index de93a2f113a..0f280b7b9be 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,10 @@ CARGO_BUILD_OPTS := --locked
IMAGE_REGISTRY ?= docker.io
IMAGE_NAMESPACE ?= greptime
IMAGE_TAG ?= latest
-DEV_BUILDER_IMAGE_TAG ?= 2026-03-21-9c9d9e9e-20260331090344
+DEV_BUILDER_IMAGE_TAG ?= 2026-03-21-7fa6f5f9-20260810091725
+DEV_BUILDER_RISCV64_IMAGE_TAG ?= $(DEV_BUILDER_IMAGE_TAG)
+DEV_BUILDER_RISCV64_BASE_IMAGE ?= ubuntu:22.04
+RISCV64_TARGET ?= riscv64gc-unknown-linux-gnu
BUILDX_MULTI_PLATFORM_BUILD ?= false
BUILDX_BUILDER_NAME ?= gtbuilder
BASE_IMAGE ?= ubuntu
@@ -98,6 +101,21 @@ build-by-dev-builder: ## Build greptime by dev-builder.
RELEASE=${RELEASE} \
CARGO_BUILD_EXTRA_OPTS="${CARGO_BUILD_EXTRA_OPTS}"
+.PHONY: build-riscv64-bin
+build-riscv64-bin: ## Build greptime binary for riscv64 (linux-gnu) by the riscv64 cross dev-builder image.
+ docker run --network=host \
+ ${ASSEMBLED_EXTRA_BUILD_ENV} \
+ -v ${PWD}:/greptimedb -v ${CARGO_REGISTRY_CACHE}:/root/.cargo/registry -v ${CARGO_GIT_CACHE}:/root/.cargo/git \
+ -w /greptimedb ${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/dev-builder-riscv64:${DEV_BUILDER_RISCV64_IMAGE_TAG} \
+ make build \
+ CARGO_EXTENSION="${CARGO_EXTENSION}" \
+ CARGO_PROFILE=${CARGO_PROFILE} \
+ FEATURES=${FEATURES} \
+ TARGET_DIR=${TARGET_DIR} \
+ TARGET=${RISCV64_TARGET} \
+ RELEASE=${RELEASE} \
+ CARGO_BUILD_EXTRA_OPTS="${CARGO_BUILD_EXTRA_OPTS}"
+
.PHONY: build-android-bin
build-android-bin: ## Build greptime binary for android.
docker run --network=host \
@@ -158,6 +176,14 @@ dev-builder: multi-platform-buildx ## Build dev-builder image.
-f docker/dev-builder/${BASE_IMAGE}/Dockerfile \
-t ${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/dev-builder-${BASE_IMAGE}:${DEV_BUILDER_IMAGE_TAG} ${BUILDX_MULTI_PLATFORM_BUILD_OPTS} .
+.PHONY: dev-builder-riscv64
+dev-builder-riscv64: ## Build the riscv64 cross dev-builder image.
+ docker build --network=host \
+ --build-arg="BASE_IMAGE=${DEV_BUILDER_RISCV64_BASE_IMAGE}" \
+ --build-arg="RUST_TOOLCHAIN=${RUST_TOOLCHAIN}" \
+ -f docker/dev-builder/riscv64/Dockerfile \
+ -t ${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/dev-builder-riscv64:${DEV_BUILDER_RISCV64_IMAGE_TAG} .
+
.PHONY: multi-platform-buildx
multi-platform-buildx: ## Create buildx multi-platform builder.
docker buildx inspect ${BUILDX_BUILDER_NAME} || docker buildx create --name ${BUILDX_BUILDER_NAME} --driver docker-container --bootstrap --use
diff --git a/README.md b/README.md
index 019a7c848ba..e95f7849e4b 100644
--- a/README.md
+++ b/README.md
@@ -6,10 +6,11 @@
-
One database for metrics, logs, and traces
-replacing Prometheus, Loki, and Elasticsearch
+
Metrics, logs, and traces.
+One engine, on your infrastructure.
-> The unified OpenTelemetry backend — with SQL + PromQL on object storage.
+> A columnar database for metrics, logs, and traces on object storage.
+> Apache-2.0 licensed core.
@@ -28,7 +29,7 @@ replacing Prometheus, Loki, and Elasticsearch
-stable for production · latest includes pre-releases · nightly is a weekly snapshot of main
+stable for production · canary includes pre-releases · nightly is a weekly snapshot of main
@@ -57,9 +58,11 @@ replacing Prometheus, Loki, and Elasticsearch
- [Introduction](#introduction)
+- [Why You Might Use It](#why-you-might-use-it)
- [Overview](#overview)
-- [Features](#features)
-- [How GreptimeDB Compares](#how-greptimedb-compares)
+- [What's Supported](#whats-supported)
+- [Compatibility and Migration](#compatibility-and-migration)
+- [Limitations and Edition Boundary](#limitations-and-edition-boundary)
- [Architecture](#architecture)
- [Try GreptimeDB](#try-greptimedb)
- [Getting Started](#getting-started)
@@ -74,9 +77,20 @@ replacing Prometheus, Loki, and Elasticsearch
## Introduction
-**GreptimeDB** is an open-source observability database built for [Observability 2.0](https://docs.greptime.com/user-guide/concepts/observability-2/) — treating metrics, logs, and traces as one unified data model (wide events) instead of three separate pillars.
+**GreptimeDB** is an open-source observability database. Metrics, logs, and traces run on one columnar engine over object storage and share one [table model](https://docs.greptime.com/user-guide/concepts/data-model/): tags, timestamp, and fields. When signals carry common identifiers such as service, host, or trace ID, you can correlate them in SQL without moving data between databases.
-Use it as the single OpenTelemetry backend — replacing Prometheus, Loki, and Elasticsearch with one database built on object storage. Query with SQL and PromQL, scale without pain, cut costs up to 50×.
+Ingest through OpenTelemetry, Prometheus Remote Write, Loki Push, or Elasticsearch Bulk. Use SQL across observability data and PromQL for metrics. Migrate ingestion one signal at a time without rebuilding your collectors.
+
+## Why You Might Use It
+
+- You run Prometheus plus Loki or Elasticsearch and want one backend instead of three
+- You have outgrown Prometheus on cardinality or retention and don't want the Thanos/Mimir operational surface
+- You need long retention on object storage without a separate analytics stack
+- You want to query telemetry with SQL, not only a domain query language
+- You are storing GenAI or agent telemetry ([OTel GenAI conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/)) alongside infrastructure signals
+- You need the same engine and semantics on resource-constrained devices
+
+Learn more in [Why GreptimeDB](https://docs.greptime.com/user-guide/concepts/why-greptimedb).
## Overview
@@ -88,42 +102,38 @@ A quick overview of what GreptimeDB ingests, how it connects to other systems, a
-## Features
+## What's Supported
-| Feature | Description |
-|---------|-------------|
-| **Observability 2.0 native** | Logs, metrics, and traces in one engine with [SQL + PromQL](https://docs.greptime.com/user-guide/query-data/overview/). Native [OpenTelemetry](https://docs.greptime.com/user-guide/ingest-data/for-observability/opentelemetry/), [Prometheus remote write](https://docs.greptime.com/user-guide/ingest-data/for-observability/prometheus/), and [Jaeger](https://docs.greptime.com/user-guide/query-data/jaeger/). Migrate one signal at a time, or use as a single backend. |
-| **Elastic compute-storage separation** | Scale reads independently with horizontal replicas. Serve high-concurrency workloads from dashboards, alerting, and AI agents — without resharding or data migration. |
-| **Sub-second on PB–EB-scale data** | Columnar engine with [fulltext, inverted, and skipping indexes](https://docs.greptime.com/user-guide/manage-data/data-index). Written in Rust. Designed for high-concurrency point queries, not just analytical scans. |
-| **50× lower cost** | Object storage (S3, GCS, Azure Blob) as [primary storage](https://docs.greptime.com/user-guide/deployments-administration/configuration/#storage-options), with a tiered cache (memory + local disk) to keep writes and queries fast. |
+| | |
+|---|---|
+| **Ingest** | [OpenTelemetry (OTLP)](https://docs.greptime.com/user-guide/ingest-data/for-observability/opentelemetry/), [Prometheus Remote Write](https://docs.greptime.com/user-guide/ingest-data/for-observability/prometheus/), [Loki Push](https://docs.greptime.com/user-guide/ingest-data/for-observability/loki), [Elasticsearch Bulk](https://docs.greptime.com/user-guide/ingest-data/for-observability/elasticsearch), [InfluxDB line protocol](https://docs.greptime.com/user-guide/protocols/influxdb-line-protocol), [gRPC](https://docs.greptime.com/user-guide/protocols/grpc/) |
+| **Query** | [SQL](https://docs.greptime.com/user-guide/query-data/overview/), [PromQL](https://docs.greptime.com/user-guide/query-data/promql/), [Jaeger-compatible trace queries](https://docs.greptime.com/user-guide/query-data/jaeger/), MySQL and PostgreSQL wire protocols |
+| **Storage** | S3, GCS, Azure Blob and S3-compatible endpoints as [primary storage](https://docs.greptime.com/user-guide/deployments-administration/configuration/#storage-options), with memory and local-disk caches |
+| **Built in** | Retention policies, downsampling, [continuous aggregation](https://docs.greptime.com/user-guide/flow-computation/overview), explicit table partitioning, and [inverted / skipping / fulltext indexes](https://docs.greptime.com/user-guide/manage-data/data-index) |
-**Perfect for:**
- * Replacing Prometheus + Loki + Elasticsearch with a single observability backend
- * Scaling past Prometheus — high cardinality, long-term storage, no Thanos/Mimir overhead
- * AI/agent workloads — store GenAI telemetry ([OTel GenAI conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/)), and serve high-concurrency reads from SRE/developer agents via horizontal read replicas
- * Cutting observability costs with object storage (up to 50× savings on traces, 30% on logs)
- * Edge-to-cloud observability with unified APIs on resource-constrained devices
+Compute and storage are disaggregated: object storage holds the data, while memory and local-disk caches keep recent and frequently queried data close to compute.
-> **Why Observability 2.0?** Three separate databases for metrics, logs, and traces means three storage layers, three query languages, and three sets of dashboards. GreptimeDB stores all three as timestamped wide events in one columnar engine — JOIN across signals in SQL, run one stack instead of three, and ingest AI agent telemetry the same way. Read more: [Observability 2.0 and the Database for It](https://greptime.com/blogs/2025-04-25-greptimedb-observability2-new-database).
+## Compatibility and Migration
-Learn more in [Why GreptimeDB](https://docs.greptime.com/user-guide/concepts/why-greptimedb).
+Compatibility is per protocol, and query-side coverage is narrower than ingestion.
-## How GreptimeDB Compares
-
-| Capability | GreptimeDB | Prometheus / Thanos / Mimir | Grafana Loki | Elasticsearch |
-|---|---|---|---|---|
-| Data types | Metrics, logs, traces | Metrics only | Logs only | Logs, traces |
-| Query language | SQL + PromQL | PromQL | LogQL | Query DSL |
-| Storage | Native object storage (S3, etc.) | Local disk + object storage (Thanos/Mimir) | Object storage (chunks) | Local disk |
-| Scaling | Compute-storage separation, stateless nodes | Federation / Thanos / Mimir — multi-component, ops heavy | Stateless + object storage | Shard-based, ops heavy |
-| Cost efficiency | Up to 50× lower storage cost | High at scale | Moderate | High (inverted index overhead) |
-| OpenTelemetry | Native (metrics + logs + traces) | Partial (metrics only) | Partial (logs only) | Via instrumentation |
+| | Compatible | Not compatible |
+|---|---|---|
+| **Prometheus** | Remote Write ingestion; PromQL queries | Gaps are listed in [PromQL compatibility](https://docs.greptime.com/user-guide/query-data/promql/) |
+| **Loki** | Push ingestion; dual-write through Grafana Alloy makes the [cutover gradual](https://greptime.com/blogs/2026-07-23-from-loki-to-greptimedb-dual-write-migration) | LogQL and the rest of the Loki query API |
+| **Elasticsearch** | `_bulk` ingestion in the open-source core; [QueryDSL](https://docs.greptime.com/enterprise/elasticsearch-compatible/query/) partially, in Enterprise | Most other Elasticsearch APIs |
**Benchmarks:**
* [GreptimeDB tops JSONBench's billion-record cold run test](https://greptime.com/blogs/2025-03-18-jsonbench-greptimedb-performance)
* [TSBS Benchmark](https://github.com/GreptimeTeam/greptimedb/tree/main/docs/benchmarks/tsbs)
* [More benchmark reports](https://docs.greptime.com/user-guide/concepts/features-that-you-concern#how-is-greptimedbs-performance-compared-to-other-solutions)
+## Limitations and Edition Boundary
+
+Cluster deployment, object storage, the Flow engine, and every ingestion protocol listed above are in the Apache-2.0 build. Repartitioning, region migration, and index creation are manual operations there.
+
+Read replicas, workload isolation, and automated repartitioning are **GreptimeDB Enterprise** features, along with enterprise security and governance. The [Enterprise overview](https://docs.greptime.com/enterprise/overview/) has the current list, and [pricing](https://www.greptime.com/pricing#differences) has the edition comparison.
+
## Architecture
GreptimeDB can run in two modes:
@@ -131,7 +141,7 @@ GreptimeDB can run in two modes:
* **Distributed** — four components, each independently scalable:
- **Frontend** — protocol entry (OTel, Prometheus, MySQL/PostgreSQL, gRPC, ingestion APIs for Elasticsearch/InfluxDB/Loki) and the distributed query engine. Stateless, scales horizontally.
- **Datanode** — region engine with WAL, memtable, SST, cache, compaction, and indexes. Persists data to object storage. Elastic.
- - **Metasrv** — metadata, routing, repartitioning, autopilot, and security. Backed by a pluggable KV layer (etcd or RDS).
+ - **Metasrv** — metadata, routing, repartitioning, and security. Backed by a pluggable KV layer (etcd or RDS).
- **Flownode** (optional) — continuous flow computation (streaming and materialized views).
For deeper coverage, see the [architecture doc](https://docs.greptime.com/contributor-guide/overview/#architecture) or [DeepWiki](https://deepwiki.com/GreptimeTeam/greptimedb/1-overview).
@@ -203,13 +213,13 @@ See the [Contribution Guidelines](CONTRIBUTING.md) for the full developer workfl
- **Kubernetes**: [GreptimeDB Operator](https://github.com/GreptimeTeam/greptimedb-operator)
- **Helm Charts**: [Greptime Helm Charts](https://github.com/GreptimeTeam/helm-charts)
- **Dashboard**: [Web UI](https://github.com/GreptimeTeam/dashboard)
-- **gRPC Ingester**: [Go](https://github.com/GreptimeTeam/greptimedb-ingester-go), [Java](https://github.com/GreptimeTeam/greptimedb-ingester-java), [C++](https://github.com/GreptimeTeam/greptimedb-ingester-cpp), [Erlang](https://github.com/GreptimeTeam/greptimedb-ingester-erl), [Rust](https://github.com/GreptimeTeam/greptimedb-ingester-rust), [.NET](https://github.com/GreptimeTeam/greptimedb-ingester-dotnet)
+- **gRPC Ingester**: [Go](https://github.com/GreptimeTeam/greptimedb-ingester-go), [Java](https://github.com/GreptimeTeam/greptimedb-ingester-java), [C++](https://github.com/GreptimeTeam/greptimedb-ingester-cpp), [Erlang](https://github.com/GreptimeTeam/greptimedb-ingester-erl), [Rust](https://github.com/GreptimeTeam/greptimedb-ingester-rust), [.NET](https://github.com/GreptimeTeam/greptimedb-ingester-dotnet), [TypeScript](https://github.com/GreptimeTeam/greptimedb-ingester-ts)
- **Grafana Data Source**: [GreptimeDB Grafana data source plugin](https://github.com/GreptimeTeam/greptimedb-grafana-datasource)
- **Grafana Dashboard**: [Official Dashboard for monitoring](https://github.com/GreptimeTeam/greptimedb/blob/main/grafana/README.md)
## Project Status
-GreptimeDB is at [v1.0 GA](https://github.com/GreptimeTeam/greptimedb/releases/tag/v1.0.0) with stable APIs and regular releases. It runs in production at scale — [OceanBase Cloud](https://greptime.com/blogs/2025-07-22-user-case-obcloud-log-management-greptimedb) operates 80+ GreptimeDB clusters managing 300 TB of logs, cutting log storage cost by 60% after migrating from Grafana Loki. See more in [case studies](https://greptime.com/blogs/?category=Use%20Case).
+GreptimeDB is generally available, with stable APIs and regular releases. It runs in production at scale — [OceanBase Cloud](https://greptime.com/blogs/2025-07-22-user-case-obcloud-log-management-greptimedb) operates 80+ GreptimeDB clusters managing 300 TB of logs, cutting log storage cost by 60%+ after migrating from Grafana Loki. See more in [case studies](https://greptime.com/blogs/?category=Use%20Case).
Read the [v1.0 highlights](https://greptime.com/blogs/2025-11-05-greptimedb-v1-highlights) and [2026 roadmap](https://greptime.com/blogs/2026-02-11-greptimedb-roadmap-2026), or browse the [version reference](https://docs.greptime.com/nightly/reference/about-greptimedb-version).
@@ -241,8 +251,9 @@ that license carry an explicit Enterprise License header.
## Commercial Support
-Running GreptimeDB in your organization?
-We offer enterprise add-ons, services, training, and consulting.
+Scaling observability on your infrastructure?
+[GreptimeDB Enterprise](https://docs.greptime.com/enterprise/overview/) adds the operational,
+security, and support layer for production deployments.
[Contact us](https://greptime.com/contactus) for details.
## Contributing
diff --git a/config/config.md b/config/config.md
index 40272ddcfda..e8a89e94e1f 100644
--- a/config/config.md
+++ b/config/config.md
@@ -25,7 +25,7 @@
| `runtime` | -- | -- | The runtime options. |
| `runtime.global_rt_size` | Integer | `8` | The number of threads to execute the runtime for global read operations. |
| `runtime.compact_rt_size` | Integer | `4` | The number of threads to execute compact operations. |
-| `runtime.compact_rt_max_blocking_threads` | Integer | `4` | The maximum number of blocking threads for compact operations. Defaults to max(num_cpus / 2, 1). |
+| `runtime.compact_rt_max_blocking_threads` | Integer | `4` | The maximum number of blocking threads for compact operations. Defaults to max(num_cpus / 2, 2). |
| `http` | -- | -- | The HTTP server options. |
| `http.addr` | String | `127.0.0.1:4000` | The address to bind the HTTP server. |
| `http.timeout` | String | `0s` | HTTP request timeout. Set to 0 to disable timeout. When Prometheus pending-row batching is enabled, a nonzero timeout less than or equal to the `prom_store.pending_rows_flush_interval` plus 1 second is adjusted to that value. |
@@ -74,7 +74,9 @@
| `jaeger.enable` | Bool | `true` | Whether to enable Jaeger protocol in HTTP API. |
| `otlp` | -- | -- | OpenTelemetry protocol options. |
| `otlp.enable` | Bool | `true` | Whether to enable OpenTelemetry protocol in HTTP API. |
+| `otlp.experimental_enable_exponential_histogram` | Bool | `false` | Experimental: enable cumulative OTLP exponential histogram ingestion. |
| `otlp.trace_ingest_chunk_size` | Integer | `512` | Maximum spans per trace ingest chunk. Set to 0 to disable splitting. |
+| `otlp.experimental_enable_resource_info` | Bool | `false` | Whether to synthesize the `greptime_otel_resource_info` table from OTLP metric resource attributes, so metrics-only services reach the semantic graph. |
| `prom_store` | -- | -- | Prometheus remote storage options |
| `prom_store.enable` | Bool | `true` | Whether to enable Prometheus remote write and read in HTTP API. |
| `prom_store.with_metric_engine` | Bool | `true` | Whether to store the data from Prometheus remote write in metric engine. |
@@ -159,7 +161,7 @@
| `region_engine.mito.max_background_purges` | Integer | Auto | Max number of running background purge jobs (default: number of cpu cores). |
| `region_engine.mito.experimental_compaction_memory_limit` | String | 0 | Memory budget for compaction tasks. Supports absolute size (e.g., "2GiB", "512MB") or percentage of system memory (e.g., "50%"). Setting it to 0 or "unlimited" disables the limit. |
| `region_engine.mito.experimental_compaction_on_exhausted` | String | wait | Behavior when compaction cannot acquire memory from the budget. Options: "wait" (default, 10s), "wait()", "fail" |
-| `region_engine.mito.auto_flush_interval` | String | `1h` | Interval to auto flush a region if it has not flushed yet. |
+| `region_engine.mito.auto_flush_interval` | String | `10m` | Interval to auto flush a region if it has not flushed yet. |
| `region_engine.mito.global_write_buffer_size` | String | Auto | Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB. |
| `region_engine.mito.global_write_buffer_reject_size` | String | Auto | Global write buffer size threshold to reject write requests. If not set, it's default to 2 times of `global_write_buffer_size`. |
| `region_engine.mito.default_region_write_buffer_size` | String | `0` | Default write buffer size for each region. Regions stall at this size and reject writes at twice this size. Setting it to 0 disables both limits unless the table specifies `write_buffer_size`. |
@@ -185,6 +187,7 @@
| `region_engine.mito.min_compaction_interval` | String | `0m` | Minimum time interval between two compactions. To align with the old behavior, the default value is 0 (no restrictions). |
| `region_engine.mito.schedule_compaction_after_edit` | Bool | `true` | Whether to allow to schedule a compaction after a successful region edit.
Setting this to "true" is a necessary but not sufficient condition for scheduling compaction after a region edit. Other constraints, such as "min_compaction_interval", may still prevent compaction from being scheduled. Setting this to "false", however, guarantees that compaction will not be scheduled after a region edit. |
| `region_engine.mito.default_flat_format` | Bool | `true` | Whether to enable flat format as the default SST format. |
+| `region_engine.mito.experimental_series_scan_v2` | Bool | `true` | Whether to enable the experimental two-phase mode for eligible metric series scans. |
| `region_engine.mito.index` | -- | -- | The options for index in Mito engine. |
| `region_engine.mito.index.aux_path` | String | `""` | Auxiliary directory path for the index in filesystem, used to store intermediate files for creating the index and staging files for searching the index, defaults to `{data_home}/index_intermediate`. The default name for this directory is `index_intermediate` for backward compatibility.
This path contains two subdirectories: - `__intm`: for storing intermediate files used during creating index. - `staging`: for storing staging files used during searching index. |
| `region_engine.mito.index.staging_size` | String | `2GB` | The max capacity of the staging directory. |
@@ -234,7 +237,7 @@
| `tracing.tokio_console_addr` | String | Unset | The tokio console address. |
| `event_recorder` | -- | -- | Configuration options for the event recorder. |
| `event_recorder.ttl` | String | `90d` | TTL for the events table that will be used to store the events. Default is `90d`. |
-| `event_recorder.event_types` | Array | -- | Event types to record. Current available event types: `create_database`, `alter_database`, `drop_database`, `create_flow`, `drop_flow`, `create_table`, `create_logical_tables`, `alter_table`, `alter_logical_tables`, `drop_table`, `undrop_table`, `purge_dropped_table`, `truncate_table`, `create_view`, `drop_view`. When omitted, all current and future event types are recorded. Set to an empty array to disable event recording. |
+| `event_recorder.event_types` | Array | -- | Event types to record. Current available event types: `create_database`, `alter_database`, `drop_database`, `create_flow`, `drop_flow`, `create_table`, `create_logical_tables`, `alter_table`, `alter_logical_tables`, `drop_table`, `undrop_table`, `purge_dropped_table`, `truncate_table`, `create_view`, `drop_view`, `admin_function`, `reconcile_table`. When omitted, all current and future event types are recorded. Set to an empty array to disable event recording. |
| `memory` | -- | -- | The memory options. |
| `memory.enable_heap_profiling` | Bool | `true` | Whether to enable heap profiling activation during startup. When enabled, heap profiling will be activated if the `MALLOC_CONF` environment variable is set to "prof:true,prof_active:false". The official image adds this env variable. Default is true. |
@@ -254,7 +257,7 @@
| `runtime` | -- | -- | The runtime options. |
| `runtime.global_rt_size` | Integer | `8` | The number of threads to execute the runtime for global read operations. |
| `runtime.compact_rt_size` | Integer | `4` | The number of threads to execute compact operations. |
-| `runtime.compact_rt_max_blocking_threads` | Integer | `4` | The maximum number of blocking threads for compact operations. Defaults to max(num_cpus / 2, 1). |
+| `runtime.compact_rt_max_blocking_threads` | Integer | `4` | The maximum number of blocking threads for compact operations. Defaults to max(num_cpus / 2, 2). |
| `http` | -- | -- | The HTTP server options. |
| `http.addr` | String | `127.0.0.1:4000` | The address to bind the HTTP server. |
| `http.timeout` | String | `0s` | HTTP request timeout. Set to 0 to disable timeout. When Prometheus pending-row batching is enabled, a nonzero timeout less than or equal to the `prom_store.pending_rows_flush_interval` plus 1 second is adjusted to that value. |
@@ -315,7 +318,9 @@
| `jaeger.enable` | Bool | `true` | Whether to enable Jaeger protocol in HTTP API. |
| `otlp` | -- | -- | OpenTelemetry protocol options. |
| `otlp.enable` | Bool | `true` | Whether to enable OpenTelemetry protocol in HTTP API. |
+| `otlp.experimental_enable_exponential_histogram` | Bool | `false` | Experimental: enable cumulative OTLP exponential histogram ingestion. |
| `otlp.trace_ingest_chunk_size` | Integer | `512` | Maximum spans per trace ingest chunk. Set to 0 to disable splitting. |
+| `otlp.experimental_enable_resource_info` | Bool | `false` | Whether to synthesize the `greptime_otel_resource_info` table from OTLP metric resource attributes, so metrics-only services reach the semantic graph. |
| `prom_store` | -- | -- | Prometheus remote storage options |
| `prom_store.enable` | Bool | `true` | Whether to enable Prometheus remote write and read in HTTP API. |
| `prom_store.with_metric_engine` | Bool | `true` | Whether to store the data from Prometheus remote write in metric engine. |
@@ -372,6 +377,7 @@
| `memory.enable_heap_profiling` | Bool | `true` | Whether to enable heap profiling activation during startup. When enabled, heap profiling will be activated if the `MALLOC_CONF` environment variable is set to "prof:true,prof_active:false". The official image adds this env variable. Default is true. |
| `event_recorder` | -- | -- | Configuration options for the event recorder. |
| `event_recorder.ttl` | String | `90d` | TTL for the events table that will be used to store the events. Default is `90d`. |
+| `event_recorder.event_types` | Array | -- | Event types to record. Current available event type: `admin_function`. When omitted, all current and future event types are recorded. Set to an empty array to disable event recording. |
### Metasrv
@@ -396,7 +402,7 @@
| `runtime` | -- | -- | The runtime options. |
| `runtime.global_rt_size` | Integer | `8` | The number of threads to execute the runtime for global read operations. |
| `runtime.compact_rt_size` | Integer | `4` | The number of threads to execute compact operations. |
-| `runtime.compact_rt_max_blocking_threads` | Integer | `4` | The maximum number of blocking threads for compact operations. Defaults to max(num_cpus / 2, 1). |
+| `runtime.compact_rt_max_blocking_threads` | Integer | `4` | The maximum number of blocking threads for compact operations. Defaults to max(num_cpus / 2, 2). |
| `backend_tls` | -- | -- | TLS configuration for kv store backend (applicable for etcd, PostgreSQL, and MySQL backends) When using etcd, PostgreSQL, or MySQL as metadata store, you can configure TLS here
Note: if TLS is configured in both this section and the `store_addrs` connection string, the settings here will override the TLS settings in `store_addrs`. |
| `backend_tls.mode` | String | `prefer` | TLS mode, refer to https://www.postgresql.org/docs/current/libpq-ssl.html - "disable" - No TLS - "prefer" (default) - Try TLS, fallback to plain - "require" - Require TLS - "verify_ca" - Require TLS and verify CA - "verify_full" - Require TLS and verify hostname |
| `backend_tls.cert_path` | String | `""` | Path to client certificate file (for client authentication) Like "/path/to/client.crt" |
@@ -450,7 +456,7 @@
| `wal.create_topic_timeout` | String | `30s` | The timeout for creating a Kafka topic. **It's only used when the provider is `kafka`**. |
| `event_recorder` | -- | -- | Configuration options for the event recorder. |
| `event_recorder.ttl` | String | `90d` | TTL for the events table that will be used to store the events. Default is `90d`. |
-| `event_recorder.event_types` | Array | -- | Event types to record. Current available event types: `region_migration`, `create_database`, `alter_database`, `drop_database`, `create_flow`, `drop_flow`, `create_table`, `create_logical_tables`, `alter_table`, `alter_logical_tables`, `drop_table`, `undrop_table`, `purge_dropped_table`, `truncate_table`, `create_view`, `drop_view`, `repartition`, `repartition_group`, `wal_prune`, `batch_gc`. When omitted, all current and future event types are recorded. Set to an empty array to disable event recording. |
+| `event_recorder.event_types` | Array | -- | Event types to record. Current available event types: `region_migration`, `create_database`, `alter_database`, `drop_database`, `create_flow`, `drop_flow`, `create_table`, `create_logical_tables`, `alter_table`, `alter_logical_tables`, `drop_table`, `undrop_table`, `purge_dropped_table`, `truncate_table`, `create_view`, `drop_view`, `repartition`, `repartition_group`, `wal_prune`, `batch_gc`, `reconcile_table`. When omitted, all current and future event types are recorded. Set to an empty array to disable event recording. |
| `stats_persistence` | -- | -- | Configuration options for the stats persistence. |
| `stats_persistence.ttl` | String | `0s` | TTL for the stats table that will be used to store the stats. Set to `0s` to disable stats persistence. Default is `0s`. If you want to enable stats persistence, set the TTL to a value greater than 0. It is recommended to set a small value, e.g., `3h`. |
| `stats_persistence.interval` | String | `10m` | The interval to persist the stats. Default is `10m`. The minimum value is `10m`, if the value is less than `10m`, it will be overridden to `10m`. |
@@ -507,8 +513,8 @@
| `runtime` | -- | -- | The runtime options. |
| `runtime.global_rt_size` | Integer | `8` | The number of threads to execute the runtime for global read operations. |
| `runtime.compact_rt_size` | Integer | `4` | The number of threads to execute compact operations. |
-| `runtime.compact_rt_max_blocking_threads` | Integer | `4` | The maximum number of blocking threads for compact operations. Defaults to max(num_cpus / 2, 1). |
-| `runtime.query_rt_size` | Integer | `7` | The number of threads to execute datanode query operations. Defaults to max(num_cpus - 1, 1). |
+| `runtime.compact_rt_max_blocking_threads` | Integer | `4` | The maximum number of blocking threads for compact operations. Defaults to max(num_cpus / 2, 2). |
+| `runtime.query_rt_size` | Integer | `7` | The number of threads to execute datanode query operations. Defaults to max(num_cpus - 1, 2). |
| `runtime.ingest_rt_size` | Integer | `8` | The number of threads to execute datanode ingestion operations. |
| `meta_client` | -- | -- | The metasrv client options. |
| `meta_client.metasrv_addrs` | Array | -- | The addresses of the metasrv. |
@@ -579,7 +585,7 @@
| `region_engine.mito.max_background_purges` | Integer | Auto | Max number of running background purge jobs (default: number of cpu cores). |
| `region_engine.mito.experimental_compaction_memory_limit` | String | 0 | Memory budget for compaction tasks. Supports absolute size (e.g., "2GiB", "512MB") or percentage of system memory (e.g., "50%"). Setting it to 0 or "unlimited" disables the limit. |
| `region_engine.mito.experimental_compaction_on_exhausted` | String | wait | Behavior when compaction cannot acquire memory from the budget. Options: "wait" (default, 10s), "wait()", "fail" |
-| `region_engine.mito.auto_flush_interval` | String | `1h` | Interval to auto flush a region if it has not flushed yet. |
+| `region_engine.mito.auto_flush_interval` | String | `10m` | Interval to auto flush a region if it has not flushed yet. |
| `region_engine.mito.global_write_buffer_size` | String | Auto | Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB. |
| `region_engine.mito.global_write_buffer_reject_size` | String | Auto | Global write buffer size threshold to reject write requests. If not set, it's default to 2 times of `global_write_buffer_size` |
| `region_engine.mito.default_region_write_buffer_size` | String | `0` | Default write buffer size for each region. Regions stall at this size and reject writes at twice this size. Setting it to 0 disables both limits unless the table specifies `write_buffer_size`. |
@@ -605,6 +611,7 @@
| `region_engine.mito.min_compaction_interval` | String | `0m` | Minimum time interval between two compactions. To align with the old behavior, the default value is 0 (no restrictions). |
| `region_engine.mito.schedule_compaction_after_edit` | Bool | `true` | Whether to allow to schedule a compaction after a successful region edit.
Setting this to "true" is a necessary but not sufficient condition for scheduling compaction after a region edit. Other constraints, such as "min_compaction_interval", may still prevent compaction from being scheduled. Setting this to "false", however, guarantees that compaction will not be scheduled after a region edit. |
| `region_engine.mito.default_flat_format` | Bool | `true` | Whether to enable flat format as the default SST format. |
+| `region_engine.mito.experimental_series_scan_v2` | Bool | `true` | Whether to enable the experimental two-phase mode for eligible metric series scans. |
| `region_engine.mito.index` | -- | -- | The options for index in Mito engine. |
| `region_engine.mito.index.aux_path` | String | `""` | Auxiliary directory path for the index in filesystem, used to store intermediate files for creating the index and staging files for searching the index, defaults to `{data_home}/index_intermediate`. The default name for this directory is `index_intermediate` for backward compatibility.
This path contains two subdirectories: - `__intm`: for storing intermediate files used during creating index. - `staging`: for storing staging files used during searching index. |
| `region_engine.mito.index.staging_size` | String | `2GB` | The max capacity of the staging directory. |
diff --git a/config/datanode.example.toml b/config/datanode.example.toml
index 3426630d7b6..20c84fd9ee4 100644
--- a/config/datanode.example.toml
+++ b/config/datanode.example.toml
@@ -84,10 +84,10 @@ watch = false
## The number of threads to execute compact operations.
#+ compact_rt_size = 4
## The maximum number of blocking threads for compact operations.
-## Defaults to max(num_cpus / 2, 1).
+## Defaults to max(num_cpus / 2, 2).
#+ compact_rt_max_blocking_threads = 4
## The number of threads to execute datanode query operations.
-## Defaults to max(num_cpus - 1, 1).
+## Defaults to max(num_cpus - 1, 2).
#+ query_rt_size = 7
## The number of threads to execute datanode ingestion operations.
#+ ingest_rt_size = 8
@@ -462,7 +462,7 @@ compress_manifest = false
#+ experimental_compaction_on_exhausted = "wait"
## Interval to auto flush a region if it has not flushed yet.
-auto_flush_interval = "1h"
+auto_flush_interval = "10m"
## Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB.
## @toml2docs:none-default="Auto"
@@ -571,6 +571,9 @@ schedule_compaction_after_edit = true
## Whether to enable flat format as the default SST format.
default_flat_format = true
+## Whether to enable the experimental two-phase mode for eligible metric series scans.
+experimental_series_scan_v2 = true
+
## The options for index in Mito engine.
[region_engine.mito.index]
diff --git a/config/frontend.example.toml b/config/frontend.example.toml
index a5907545eba..80534855721 100644
--- a/config/frontend.example.toml
+++ b/config/frontend.example.toml
@@ -44,7 +44,7 @@ default_column_prefix = "greptime"
## The number of threads to execute compact operations.
#+ compact_rt_size = 4
## The maximum number of blocking threads for compact operations.
-## Defaults to max(num_cpus / 2, 1).
+## Defaults to max(num_cpus / 2, 2).
#+ compact_rt_max_blocking_threads = 4
## The HTTP server options.
@@ -237,8 +237,13 @@ enable = true
[otlp]
## Whether to enable OpenTelemetry protocol in HTTP API.
enable = true
+## Experimental: enable cumulative OTLP exponential histogram ingestion.
+experimental_enable_exponential_histogram = false
## Maximum spans per trace ingest chunk. Set to 0 to disable splitting.
trace_ingest_chunk_size = 512
+## Whether to synthesize the `greptime_otel_resource_info` table from OTLP metric
+## resource attributes, so metrics-only services reach the semantic graph.
+experimental_enable_resource_info = false
## Prometheus remote storage options
[prom_store]
@@ -405,3 +410,7 @@ enable_heap_profiling = true
[event_recorder]
## TTL for the events table that will be used to store the events. Default is `90d`.
ttl = "90d"
+## Event types to record. Current available event type: `admin_function`.
+## When omitted, all current and future event types are recorded.
+## Set to an empty array to disable event recording.
+#+ event_types = ["admin_function"]
diff --git a/config/metasrv.example.toml b/config/metasrv.example.toml
index f607211d636..ae373d07482 100644
--- a/config/metasrv.example.toml
+++ b/config/metasrv.example.toml
@@ -92,7 +92,7 @@ node_max_idle_time = "24hours"
## The number of threads to execute compact operations.
#+ compact_rt_size = 4
## The maximum number of blocking threads for compact operations.
-## Defaults to max(num_cpus / 2, 1).
+## Defaults to max(num_cpus / 2, 2).
#+ compact_rt_max_blocking_threads = 4
## TLS configuration for kv store backend (applicable for etcd, PostgreSQL, and MySQL backends)
@@ -320,7 +320,7 @@ ttl = "90d"
## `drop_flow`, `create_table`, `create_logical_tables`, `alter_table`,
## `alter_logical_tables`, `drop_table`, `undrop_table`, `purge_dropped_table`,
## `truncate_table`, `create_view`, `drop_view`, `repartition`,
-## `repartition_group`, `wal_prune`, `batch_gc`.
+## `repartition_group`, `wal_prune`, `batch_gc`, `reconcile_table`.
## When omitted, all current and future event types are recorded.
## Set to an empty array to disable event recording.
#+ event_types = ["region_migration"]
diff --git a/config/standalone.example.toml b/config/standalone.example.toml
index d256d681f9f..1fd8fe5a522 100644
--- a/config/standalone.example.toml
+++ b/config/standalone.example.toml
@@ -57,7 +57,7 @@ max_concurrent_queries = 0
## The number of threads to execute compact operations.
#+ compact_rt_size = 4
## The maximum number of blocking threads for compact operations.
-## Defaults to max(num_cpus / 2, 1).
+## Defaults to max(num_cpus / 2, 2).
#+ compact_rt_max_blocking_threads = 4
## The HTTP server options.
@@ -204,8 +204,13 @@ enable = true
[otlp]
## Whether to enable OpenTelemetry protocol in HTTP API.
enable = true
+## Experimental: enable cumulative OTLP exponential histogram ingestion.
+experimental_enable_exponential_histogram = false
## Maximum spans per trace ingest chunk. Set to 0 to disable splitting.
trace_ingest_chunk_size = 512
+## Whether to synthesize the `greptime_otel_resource_info` table from OTLP metric
+## resource attributes, so metrics-only services reach the semantic graph.
+experimental_enable_resource_info = false
## Prometheus remote storage options
[prom_store]
@@ -620,7 +625,7 @@ compress_manifest = false
#+ experimental_compaction_on_exhausted = "wait"
## Interval to auto flush a region if it has not flushed yet.
-auto_flush_interval = "1h"
+auto_flush_interval = "10m"
## Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB.
## @toml2docs:none-default="Auto"
@@ -729,6 +734,9 @@ schedule_compaction_after_edit = true
## Whether to enable flat format as the default SST format.
default_flat_format = true
+## Whether to enable the experimental two-phase mode for eligible metric series scans.
+experimental_series_scan_v2 = true
+
## The options for index in Mito engine.
[region_engine.mito.index]
@@ -922,7 +930,7 @@ ttl = "90d"
## `alter_database`, `drop_database`, `create_flow`, `drop_flow`,
## `create_table`, `create_logical_tables`, `alter_table`, `alter_logical_tables`,
## `drop_table`, `undrop_table`, `purge_dropped_table`, `truncate_table`,
-## `create_view`, `drop_view`.
+## `create_view`, `drop_view`, `admin_function`, `reconcile_table`.
## When omitted, all current and future event types are recorded.
## Set to an empty array to disable event recording.
#+ event_types = ["create_database"]
diff --git a/docker/dev-builder/riscv64/Dockerfile b/docker/dev-builder/riscv64/Dockerfile
new file mode 100644
index 00000000000..8505fa3b49a
--- /dev/null
+++ b/docker/dev-builder/riscv64/Dockerfile
@@ -0,0 +1,55 @@
+# Cross-build environment for producing riscv64 (riscv64gc-unknown-linux-gnu)
+# greptime binaries on x86_64/aarch64 hosts.
+ARG BASE_IMAGE=ubuntu:22.04
+FROM ${BASE_IMAGE}
+
+ENV LANG=en_US.utf8
+WORKDIR /greptimedb
+
+RUN apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
+# Install dependencies, including the riscv64 cross toolchain.
+RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
+ libssl-dev \
+ tzdata \
+ curl \
+ unzip \
+ ca-certificates \
+ git \
+ build-essential \
+ pkg-config \
+ gcc-riscv64-linux-gnu \
+ g++-riscv64-linux-gnu
+
+ARG TARGETPLATFORM
+RUN echo "host platform: $TARGETPLATFORM"
+
+ARG PROTOBUF_VERSION=29.3
+
+# Install protobuf for the host arch (build scripts and protoc run on the host),
+# because the one in the apt is too old (v3.12).
+RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
+ curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-aarch_64.zip && \
+ unzip -o protoc-${PROTOBUF_VERSION}-linux-aarch_64.zip -d protoc3; \
+else \
+ curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip && \
+ unzip -o protoc-${PROTOBUF_VERSION}-linux-x86_64.zip -d protoc3; \
+fi
+RUN mv -f protoc3/bin/* /usr/local/bin/
+# Use cp -r instead of mv so that it also works when the base image already
+# contains protobuf headers under /usr/local/include.
+RUN cp -r protoc3/include/* /usr/local/include/
+
+# Silence all `safe.directory` warnings, to avoid the "detect dubious repository"
+# error when building with the repository mounted from a different user.
+RUN git config --global --add safe.directory '*'
+
+# Install Rust.
+SHELL ["/bin/bash", "-c"]
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y
+ENV PATH=/root/.cargo/bin/:$PATH
+
+# Install Rust toolchains and the riscv64 target std.
+ARG RUST_TOOLCHAIN
+RUN rustup toolchain install ${RUST_TOOLCHAIN}
+RUN rustup target add --toolchain ${RUST_TOOLCHAIN} riscv64gc-unknown-linux-gnu
diff --git a/docs/parquet-tools.md b/docs/parquet-tools.md
new file mode 100644
index 00000000000..9dfe404626e
--- /dev/null
+++ b/docs/parquet-tools.md
@@ -0,0 +1,255 @@
+# Parquet Development Tools
+
+GreptimeDB provides the following datanode CLI commands for inspecting,
+rewriting, benchmarking, and replacing Parquet SST files:
+
+- `parquet-meta`: inspect a local Parquet file.
+- `parquet-rewrite`: rewrite a local Parquet file with different writer
+ properties.
+- `parquetbench`: benchmark reads from a local GreptimeDB SST or an SST in a
+ configured object store.
+- `sst-replace`: replace an existing Mito SST object and update its manifest
+ metadata.
+
+These are development and recovery tools, not stable user-facing interfaces.
+Always test a workflow on disposable data before using it on an important
+region.
+
+## Build
+
+`parquet-meta`, `parquet-rewrite`, and `sst-replace` require the `dev-tools`
+feature. The same build also includes `parquetbench`:
+
+```bash
+cargo build -p cmd --bin greptime --features dev-tools
+```
+
+The examples below use:
+
+```bash
+GREPTIME=./target/debug/greptime
+```
+
+Run `$GREPTIME datanode --help` for the authoritative argument list.
+
+## Inspect a Parquet file
+
+`parquet-meta` reads a local Parquet footer and optional page indexes. It reports
+file, row-group, and column metadata, including compression, encodings, sizes,
+page offsets, statistics presence, and bloom-filter/index offsets.
+
+Text output:
+
+```bash
+$GREPTIME datanode parquet-meta \
+ --input /tmp/source.parquet
+```
+
+Machine-readable JSON output:
+
+```bash
+$GREPTIME datanode parquet-meta \
+ --input /tmp/source.parquet \
+ --format json > /tmp/source-meta.json
+```
+
+`--format` accepts `text` (the default) or `json`. This command can inspect a
+general Parquet file; it does not require GreptimeDB SST key-value metadata.
+
+## Rewrite a Parquet file
+
+`parquet-rewrite` has two modes. First, dump a TOML properties file inferred
+from an existing file:
+
+```bash
+$GREPTIME datanode parquet-rewrite \
+ --input /tmp/source.parquet \
+ --dump-properties /tmp/writer-properties.toml
+```
+
+Review and edit the generated file. Its shape is:
+
+```toml
+[writer]
+dictionary_enabled = true
+compression = "zstd"
+max_row_group_row_count = 8192
+
+[[columns]]
+path = ["host"]
+dictionary_enabled = true
+compression = "zstd"
+encoding = "plain"
+```
+
+Supported compression names are `uncompressed`, `snappy`, `gzip`, `lzo`,
+`brotli`, `lz4`, `zstd`, and `lz4-raw`. Supported encodings are `plain`,
+`delta-binary-packed`, `delta-length-byte-array`, `delta-byte-array`, and
+`byte-stream-split`.
+
+The `[writer]` table also accepts `compression_level`,
+`data_page_size_limit`, `data_page_row_count_limit`, and
+`dictionary_page_size_limit`. It also accepts
+`column_index_truncate_length` and `statistics_truncate_length`; set either to
+zero to disable that truncation. A `[[columns]]` entry overrides dictionary,
+compression, compression level, or encoding for its column path. Unknown TOML
+fields are rejected. Compression levels are supported for `gzip`, `brotli`, and
+`zstd`. A column-level `compression_level` without `compression` inherits the
+writer compression codec; it is rejected when there is no writer codec to
+inherit.
+
+Rewrite the data using the edited properties:
+
+```bash
+$GREPTIME datanode parquet-rewrite \
+ --input /tmp/source.parquet \
+ --properties /tmp/writer-properties.toml \
+ --output /tmp/rewritten.parquet
+```
+
+Use `--batch-size ` to control reader batch size. Output and dumped
+properties files are not replaced unless `--overwrite` is passed. The output or
+dump path must not be exactly the same path as the input, even with
+`--overwrite`. This check does not resolve symbolic links, hard links, or other
+spellings of the same path.
+
+The rewrite decodes and writes the Arrow record batches and copies the Parquet
+key-value metadata, but it creates a new physical Parquet layout. Inspect and
+validate the result before using it as an SST:
+
+```bash
+$GREPTIME datanode parquet-meta \
+ --input /tmp/rewritten.parquet
+```
+
+The dumped properties are inferred primarily from the first row group. Review
+them when the source uses different properties across row groups.
+
+## Benchmark an SST
+
+`parquetbench` expects GreptimeDB region metadata embedded in the SST. It can
+read a local file with the direct reader:
+
+```bash
+$GREPTIME datanode parquetbench \
+ --file-path /tmp/rewritten.parquet \
+ --reader direct \
+ --iterations 5 \
+ --batch-size 8192
+```
+
+Local-file mode cannot be combined with `--config`, `--region-id`,
+`--table-dir`, or `--file-id`, and it does not support the `flat-prune` reader.
+
+To benchmark an SST in the object store configured for a datanode or standalone
+deployment:
+
+```bash
+$GREPTIME datanode parquetbench \
+ --config /path/to/datanode.toml \
+ --region-id 1024:0 \
+ --table-dir data/greptime/public/1024 \
+ --file-id 00020380-009c-426d-953e-b4e34c15af34 \
+ --path-type bare \
+ --reader flat-prune \
+ --iterations 5
+```
+
+Region mode requires all four of `--config`, `--region-id`, `--table-dir`, and
+`--file-id`. `--region-id` accepts either the packed unsigned integer or
+`:`. `--path-type` accepts `bare`, `data`, or
+`metadata` and defaults to `bare`.
+
+An optional scan configuration selects columns and row groups:
+
+```json
+{
+ "projection_names": ["host", "value", "ts"],
+ "row_groups": [0, 2]
+}
+```
+
+```bash
+$GREPTIME datanode parquetbench \
+ --file-path /tmp/rewritten.parquet \
+ --scan-config /tmp/parquet-scan.json \
+ --iterations 5
+```
+
+Use `--pk-as-binary` to expose `__primary_key` as binary with the direct reader.
+On Unix, `--pprof-file