diff --git a/.github/actions/build-linux-artifacts/action.yml b/.github/actions/build-linux-artifacts/action.yml
index 26028485061..a16c1a72405 100644
--- a/.github/actions/build-linux-artifacts/action.yml
+++ b/.github/actions/build-linux-artifacts/action.yml
@@ -50,6 +50,11 @@ inputs:
runs:
using: composite
steps:
+ - name: Set up Linux runner
+ uses: ./.github/actions/setup-linux-runner
+ with:
+ tools: make shasum
+
- name: Run integration test
if: ${{ inputs.disable-run-tests == 'false' }}
shell: bash
diff --git a/.github/actions/setup-benchmark/action.yml b/.github/actions/setup-linux-runner/action.yml
similarity index 60%
rename from .github/actions/setup-benchmark/action.yml
rename to .github/actions/setup-linux-runner/action.yml
index a446a78a2c3..95de8e465c5 100644
--- a/.github/actions/setup-benchmark/action.yml
+++ b/.github/actions/setup-linux-runner/action.yml
@@ -1,19 +1,41 @@
-name: Set up benchmark dependencies
+name: Set up Linux runner dependencies
description: Reuse installed tools and install missing dependencies on an Ubuntu self-hosted runner
+inputs:
+ tools:
+ description: Space-separated commands to install if missing (Ubuntu package names, except shasum)
+ required: false
+ default: curl
+ expected-architecture:
+ description: Optional uname architecture required by the workload
+ required: false
+ default: ''
runs:
using: composite
steps:
- name: Check host and install missing tools
shell: bash
+ env:
+ REQUIRED_TOOLS: ${{ inputs.tools }}
+ EXPECTED_ARCH: ${{ inputs.expected-architecture }}
run: |
set -euo pipefail
- [[ "$(uname -m)" == x86_64 ]]
+ if [[ -n "$EXPECTED_ARCH" ]]; then
+ [[ "$(uname -m)" == "$EXPECTED_ARCH" ]]
+ fi
command -v git
missing=()
- for tool in curl jq python3 rsync; do
- command -v "$tool" >/dev/null || missing+=("$tool")
+ read -r -a tools <<< "$REQUIRED_TOOLS"
+ for tool in "${tools[@]}"; do
+ if ! command -v "$tool" >/dev/null; then
+ case "$tool" in
+ shasum) missing+=(libdigest-sha-perl) ;;
+ *) missing+=("$tool") ;;
+ esac
+ fi
done
if ((${#missing[@]})); then
+ . /etc/os-release
+ [[ "$ID" == ubuntu ]]
sudo -n apt-get update
sudo -n env DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=l apt-get install -y --no-install-recommends "${missing[@]}"
fi
@@ -24,6 +46,8 @@ runs:
if ! command -v docker >/dev/null; then
. /etc/os-release
[[ "$ID" == ubuntu ]]
+ sudo -n apt-get update
+ sudo -n env DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=l apt-get install -y --no-install-recommends curl ca-certificates
sudo -n install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo -n tee /etc/apt/keyrings/docker.asc >/dev/null
sudo -n chmod a+r /etc/apt/keyrings/docker.asc
diff --git a/.github/scripts/agent-observability-summary.py b/.github/scripts/agent-observability-summary.py
index 33ba3ad7e6e..29e3e995536 100644
--- a/.github/scripts/agent-observability-summary.py
+++ b/.github/scripts/agent-observability-summary.py
@@ -133,9 +133,10 @@ def benchmark(root, targets):
return '\n'.join(lines)
-def lifecycle(root, targets):
- manifest = read(root / 'run-manifest.json')
- corpus = read(root / 'corpus' / 'summary.json')
+def lifecycle(root, targets, data_root=None):
+ data_root = data_root or root
+ manifest = read(data_root / 'run-manifest.json')
+ corpus = read(data_root / 'corpus' / 'summary.json')
lines = ['# Load / lifecycle summary', '',
f'Dataset: **{cell(manifest.get("profile", corpus.get("data_profile", {}).get("id")))}**; rows: **{cell(corpus.get("line_count"))}**; '
f'seed: `{cell(corpus.get("seed"))}`.',
@@ -161,12 +162,13 @@ def lifecycle(root, targets):
physical_rows = []
load_rows = []
details = ['', 'DDL, index configuration and image provenance', '']
- raw_bytes = read(root / 'corpus' / 'size.json').get('raw_jsonl_bytes')
+ raw_bytes = read(data_root / 'corpus' / 'size.json').get('raw_jsonl_bytes')
for t in targets:
directory = result_dir(root, t)
physical = read(directory / 'physical-evidence.json')
storage = physical.get('storage', {})
- total = storage.get('engine_total_bytes')
+ s3 = read(root / f'{t}-1' / 'storage.json').get('type') == 's3'
+ total = None if s3 else storage.get('engine_total_bytes')
stats = read(root / f'{t}-1' / 'post-load-docker-stats.json')
ratio = f'{raw_bytes / total:.2f}×' if (physical.get('passed') is True and
isinstance(raw_bytes, (int, float)) and raw_bytes > 0 and
@@ -186,6 +188,7 @@ def lifecycle(root, targets):
lines += ['## Load and physical evidence', '', table(['DB', 'Write transport', 'Batches', 'Load smoke rows'], load_rows), '',
f'Raw JSONL size: **{size(raw_bytes)}**. Ratio = raw JSONL / engine bytes at collection time; '
'not a settled-storage guarantee. CPU/memory are post-load snapshots, not peaks. '
+ 'S3 total/compression is omitted: local files exclude remote objects. '
'Missing artifacts remain blank; pre-cleanup stats are not substituted.', '',
table(['DB', 'Engine size', 'Size ratio', 'Materialization', 'SSTs / active parts',
'Post-load CPU', 'Post-load memory / limit'], physical_rows), '', *details, '', '']
diff --git a/.github/scripts/benchmark-version-comparison.py b/.github/scripts/benchmark-version-comparison.py
index 1aa744df9ad..527797a2cb5 100644
--- a/.github/scripts/benchmark-version-comparison.py
+++ b/.github/scripts/benchmark-version-comparison.py
@@ -62,11 +62,12 @@ def row(query, metric, old, new, compatible, reason):
improvement_percent=delta, status='comparable' if delta is not None else reason)
-def agent(root):
+def agent(root, storage="file"):
+ candidate, baseline = (root, root / "baseline") if storage == "file" else (root / "s3", root / "baseline/s3")
def load(r):
return read(r / 'greptimedb-1/greptimedb-1/measured-summary.json')
- a, b = load(root / 'baseline'), load(root)
- finished = [r / 'greptimedb-1/exit-code.txt' for r in (root / 'baseline', root)]
+ a, b = load(baseline), load(candidate)
+ finished = [r / 'greptimedb-1/exit-code.txt' for r in (baseline, candidate)]
compatible = (all(p.is_file() and p.read_text().strip() == '0' for p in finished)
and a.get('passed') is True and b.get('passed') is True
and same(a, b, ('contract_sha256', 'data_profile', 'query_window', 'warmup_runs', 'measured_runs')))
@@ -81,8 +82,9 @@ def agent(root):
return rows
-def traces(root):
- a, b = (read(r / 'runs/greptimedb/run.json') for r in (root / 'baseline', root))
+def traces(root, storage="file"):
+ candidate, baseline = (root, root / "baseline") if storage == "file" else (root / "s3", root / "baseline/s3")
+ a, b = (read(r / 'runs/greptimedb/run.json') for r in (baseline, candidate))
compatible = (a.get('success') is True and b.get('success') is True
and same(a, b, ('expected', 'protocol', 'audit_expected', 'corpus'))
and same(a.get('execution', {}), b.get('execution', {}),
@@ -110,18 +112,22 @@ def traces(root):
return rows
-def long_range(root):
+def long_range(root, storage="file"):
+ names = ("greptimedb-baseline", "greptimedb") if storage == "file" else ("greptimedb-s3-baseline", "greptimedb-s3")
+ def target_root(name):
+ nested = root / "o11ybench" / ("o11ybench-" + name)
+ return nested if nested.exists() else root
rows = []
- manifest = read(root / 'run-manifest.json')
+ manifests = {name: read(target_root(name) / 'run-manifest.json') for name in names}
healthy = all(
- all(field in (manifest.get(phase, {}).get(target, {}).get('docker', {}) if phase == 'post_load_results'
- else manifest.get(phase, {}).get(target, {})).get('state', '').split()
+ all(field in (manifests[target].get(phase, {}).get(target, {}).get('docker', {}) if phase == 'post_load_results'
+ else manifests[target].get(phase, {}).get(target, {})).get('state', '').split()
for field in ('Running=true', 'ExitCode=0', 'OOMKilled=false'))
for phase in ('post_load_results', 'post_query_results')
- for target in ('greptimedb-baseline', 'greptimedb'))
+ for target in names)
for mode in ('serial', 'concurrent-duration-c1', 'concurrent-duration-c4'):
- a, b = (read(root / name / 'results-vmbench-long-range' / (mode + '-summary.json'))
- for name in ('greptimedb-baseline', 'greptimedb'))
+ a, b = (read(target_root(name) / name / 'results-vmbench-long-range' / (mode + '-summary.json'))
+ for name in names)
fields = ('workload', 'query_file_sha256', 'start', 'end', 'step', 'profile', 'data_duration',
'scrape_interval', 'cache_policy_effective', 'mode', 'connection_mode', 'request_timeout_seconds')
fields += ('tries', 'warmup_runs') if mode == 'serial' else ('concurrency', 'duration_seconds', 'warmup_seconds')
@@ -178,7 +184,13 @@ def main():
parser.error('report requires --root and --kind')
document = {'kind': args.kind, 'baseline_tag': os.environ.get('BASELINE_GREPTIMEDB_TAG', ''),
'candidate_tag': os.environ.get('GREPTIMEDB_TAG', ''),
- 'rows': {'agent': agent, 'traces': traces, 'long-range': long_range}[args.kind](args.root)}
+ 'rows': []}
+ mode = os.environ.get('GREPTIMEDB_STORAGE', 'file')
+ for storage in (['file', 's3'] if mode == 'both' else [mode]):
+ rows = {'agent': agent, 'traces': traces, 'long-range': long_range}[args.kind](args.root, storage)
+ for item in rows:
+ item['query'] = storage.upper() + '/' + item['query']
+ document['rows'].extend(rows)
text = render(document)
# Preserve partial comparisons even if a target failed before creating output.
args.root.mkdir(parents=True, exist_ok=True)
diff --git a/.github/scripts/ci-runners.md b/.github/scripts/ci-runners.md
index 6e4b2b3a4f7..f21bdbdb0af 100644
--- a/.github/scripts/ci-runners.md
+++ b/.github/scripts/ci-runners.md
@@ -13,8 +13,12 @@ AWS uses `aws-ec2-runner-provision.py` and `aws-ec2-runner-teardown.py` directly
Repository variables supply `EC2_RUNNER_REGION`, `EC2_RUNNER_SUBNET_ID`, and
`EC2_RUNNER_SECURITY_GROUP_ID`; credentials use `AWS_ACCESS_KEY_ID`,
`AWS_SECRET_ACCESS_KEY`, and `GH_PERSONAL_ACCESS_TOKEN` secrets.
-The current region is Singapore (`ap-southeast-1`). By default the script selects
-the newest available Canonical Ubuntu 24.04 amd64 server AMI in that region
+The runner region comes from `EC2_RUNNER_REGION` (currently `us-east-1`).
+The subnet and security group must belong to the selected AWS account and region.
+For benchmarks using real S3, `AWS_CI_TEST_BUCKET_REGION` must match the runner
+region; `AWS_CI_TEST_BUCKET` must be accessible with the configured credentials.
+By default the script selects the newest available Canonical Ubuntu 24.04 amd64
+server AMI in that region
(owner `099720109477`) and logs its ID. Set `BENCHMARK_EC2_IMAGE_ID` to pin a
prepared Ubuntu AMI. Existing build CI's `EC2_RUNNER_LINUX_AMD64_IMAGE_ID` is
unaffected. Both workflows default `system_disk_gib` to `auto` (also accepting
@@ -31,9 +35,12 @@ swappiness 10, disables systemd-oomd and background automatic updates, and sets
`OOMPolicy=continue` on the runner service. Explicit setup package installation
remains enabled.
-Both benchmark jobs call `.github/actions/setup-benchmark` after checkout. It
-reuses existing tools, installs missing curl/jq/python3/rsync, installs Docker CE
-if absent, and checks Docker access. Missing packages require passwordless sudo;
+Benchmark jobs call `.github/actions/setup-linux-runner` after checkout with
+`tools: curl jq python3 rsync` and require x86_64. Linux artifact builds reuse
+the same action with `tools: make shasum` on either amd64 or arm64; the RISC-V
+cross-build calls it on amd64 too. The action reuses installed commands, maps
+`shasum` to Ubuntu package `libdigest-sha-perl`, installs Docker CE if absent,
+and checks Docker access. Missing packages require passwordless sudo;
Aliyun's prepared image normally provides the tools and Docker already. Existing
Docker installations are preserved, so exact versions need not match between
providers. Provisioning must establish Docker permissions before starting the
diff --git a/.github/scripts/metric-snapshot-s3-bench.py b/.github/scripts/metric-snapshot-s3-bench.py
index 7bb01a410b1..6542a18ba04 100644
--- a/.github/scripts/metric-snapshot-s3-bench.py
+++ b/.github/scripts/metric-snapshot-s3-bench.py
@@ -105,8 +105,9 @@ class Benchmark:
self.endpoint = os.environ.get("S3_ENDPOINT", "")
if self.endpoint and not local_smoke:
raise ValueError("Custom S3 endpoints are restricted to local smoke")
- if not local_smoke and os.environ["S3_REGION"] != "ap-southeast-1":
- raise ValueError("Cloud benchmark requires ap-southeast-1")
+ if not local_smoke and (not os.environ["S3_REGION"].strip()
+ or os.environ["S3_REGION"] != os.environ["RUNNER_REGION"]):
+ raise ValueError("Cloud benchmark requires the same nonempty bucket and runner region")
self.containers = set()
self.network_created = False
self.phases = []
@@ -324,7 +325,7 @@ level = "info"
lines = ["# Metric packed snapshot benchmark", "", f"Image: `{self.image}`",
f"Source commit: `{self.commit}`", "",
"Local smoke only; timings are not AWS results." if self.local_smoke else
- "AWS S3 in ap-southeast-1; source and target use local File storage.", "",
+ f"S3 in {os.environ['S3_REGION']}; source and target use local File storage.", "",
"| Round | Phase | Seconds | Result |", "| --- | --- | ---: | --- |"]
for phase in self.phases:
lines.append(f"| {phase['round']} | {phase['phase']} | {phase['wall_seconds']:.3f} | {phase['outcome']} |")
diff --git a/.github/scripts/metric-snapshot-s3-ops.py b/.github/scripts/metric-snapshot-s3-ops.py
index f1e34defb89..f639ec90979 100644
--- a/.github/scripts/metric-snapshot-s3-ops.py
+++ b/.github/scripts/metric-snapshot-s3-ops.py
@@ -21,7 +21,7 @@
"""Budget preflight and strictly scoped S3 operations for the metric snapshot benchmark."""
import argparse
-from decimal import Decimal
+from decimal import Decimal, InvalidOperation
import json
import os
from pathlib import Path
@@ -29,8 +29,8 @@ import re
import time
import urllib.request
-REGION = "ap-southeast-1"
-HOURLY_USD = Decimal("0.9408")
+# Historical budget estimate; dispatch can supply a rate for the configured region.
+DEFAULT_HOURLY_USD = "0.9408"
OTHER_RESERVE_USD = Decimal("1.50")
@@ -40,6 +40,16 @@ def owned_prefix(prefix):
return prefix
+def hourly_estimate(env):
+ try:
+ estimate = Decimal(env.get("EC2_HOURLY_USD", DEFAULT_HOURLY_USD))
+ except InvalidOperation as error:
+ raise ValueError("EC2_HOURLY_USD must be a positive finite estimate") from error
+ if not estimate.is_finite() or estimate <= 0:
+ raise ValueError("EC2_HOURLY_USD must be a positive finite estimate")
+ return estimate
+
+
def plan(env):
image = env["GREPTIMEDB_IMAGE"]
if not re.fullmatch(r"greptime/greptimedb(?:-nightly)?@sha256:[0-9a-f]{64}", image):
@@ -49,21 +59,22 @@ def plan(env):
tables, minutes = int(env["LOGICAL_TABLES_PER_GROUP"]), int(env["BENCHMARK_TIMEOUT_MINUTES"])
if not 50 <= tables <= 10_000 or not 30 <= minutes <= 240:
raise ValueError("logical tables per group must be 50..10000; timeout must be 30..240 minutes")
- if env["S3_REGION"] != REGION or env["RUNNER_REGION"] != REGION:
- raise ValueError("bucket and runner must both use ap-southeast-1")
+ if not env["S3_REGION"].strip() or env["S3_REGION"] != env["RUNNER_REGION"]:
+ raise ValueError("bucket and runner must use the same nonempty region")
if not env["S3_BUCKET"]:
raise ValueError("S3 bucket is required")
prior = Decimal(env["PRIOR_SPEND_USD"])
# Reserve 45m provision, 10m queue allowance and 20m cleanup beyond the job timeout.
- reservation = HOURLY_USD * Decimal(minutes + 75) / 60 + OTHER_RESERVE_USD
+ hourly = hourly_estimate(env)
+ reservation = hourly * Decimal(minutes + 75) / 60 + OTHER_RESERVE_USD
if not prior.is_finite() or prior < 0 or prior >= 15 or prior + reservation > 20:
raise ValueError("campaign budget exhausted: prior spend must be below $15 and leave the full attempt reserve within $20")
return {"image": image, "expected_commit": env["EXPECTED_COMMIT"],
"logical_tables_per_group": tables, "smoke_logical_tables": 500,
"timeout_minutes": minutes, "prefix": owned_prefix(env["RUN_PREFIX"]),
- "instance_type": "c6id.4xlarge", "region": REGION,
+ "instance_type": "c6id.4xlarge", "region": env["S3_REGION"],
"prior_estimated_usd": str(prior), "attempt_reserve_usd": str(reservation),
- "ec2_hourly_usd": str(HOURLY_USD), "other_reserve_usd": str(OTHER_RESERVE_USD),
+ "ec2_hourly_usd": str(hourly), "other_reserve_usd": str(OTHER_RESERVE_USD),
"cost_note": "Estimate, not an AWS billing total or a hard spending cap."}
@@ -71,8 +82,8 @@ def client(region):
import boto3
from botocore.config import Config
- if region != REGION:
- raise ValueError("S3 region must be ap-southeast-1")
+ if not region.strip():
+ raise ValueError("S3 region is required")
return boto3.client("s3", region_name=region, config=Config(
connect_timeout=10, read_timeout=30, retries={"mode": "standard", "max_attempts": 3}))
@@ -193,8 +204,10 @@ def main():
if args.started_at is None:
parser.error("cost requires --started-at")
seconds = max(0, int(time.time()) - args.started_at)
- estimate = HOURLY_USD * Decimal(seconds) / 3600
- result = {"allocation_window_seconds": seconds, "ec2_estimate_usd": str(round(estimate, 4)),
+ hourly = hourly_estimate(os.environ)
+ estimate = hourly * Decimal(seconds) / 3600
+ result = {"allocation_window_seconds": seconds, "ec2_hourly_usd": str(hourly),
+ "ec2_estimate_usd": str(round(estimate, 4)),
"campaign_estimate_with_other_reserve_usd": str(round(
Decimal(os.environ["PRIOR_SPEND_USD"]) + estimate + OTHER_RESERVE_USD, 4)),
"note": "Allocation wall-time estimate plus $1.50 reserve for S3, disk and IPv4; not an AWS bill."}
diff --git a/.github/scripts/o11ybench-storage.py b/.github/scripts/o11ybench-storage.py
new file mode 100644
index 00000000000..e050e933d95
--- /dev/null
+++ b/.github/scripts/o11ybench-storage.py
@@ -0,0 +1,316 @@
+# 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.
+
+"""Select File/S3 benchmark arms without changing workload adapters."""
+import argparse
+import copy
+import importlib.util
+import json
+from pathlib import Path
+import sys
+import os
+import subprocess
+
+
+def validate(env):
+ mode = env.get('GREPTIMEDB_STORAGE', 'file')
+ if mode not in ('file', 's3', 'both'):
+ raise ValueError('GREPTIMEDB_STORAGE must be file, s3 or both')
+ if mode != 'file':
+ if env.get('RUN_GREPTIMEDB') != 'true':
+ raise ValueError('S3 requires Run GreptimeDB')
+ if env.get('PROVIDER') != 'AWS':
+ raise ValueError('S3 comparisons require an AWS runner')
+ if not env.get('S3_BUCKET') or not env.get('S3_REGION'):
+ raise ValueError('AWS_CI_TEST_BUCKET and AWS_CI_TEST_BUCKET_REGION must be configured')
+ if env['S3_REGION'] != env.get('RUNNER_REGION'):
+ raise ValueError('S3 bucket and EC2 runner regions must match')
+ return mode
+
+
+def replace(command, key, value):
+ result = list(command)
+ if key in result:
+ result[result.index(key) + 1] = value
+ else:
+ result += [key, value]
+ return result
+
+
+def commands(command, mode):
+ """Recovery visits each owned root; execution uses explicit workflow steps."""
+ stage = command[command.index('--stage') + 1]
+ if stage != 'cleanup':
+ raise ValueError('only cleanup may expand multiple arms')
+ result = [list(command)]
+ if mode != 'file':
+ root = command[command.index('--root') + 1]
+ owner = command[command.index('--owner') + 1]
+ secondary = replace(command, '--root', root + '/s3')
+ result.append(replace(secondary, '--owner', owner + '-s3'))
+ return result
+
+
+def module(path):
+ sys.path.insert(0, str(path.parent))
+ spec = importlib.util.spec_from_file_location(path.stem.replace('-', '_'), path)
+ result = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(result)
+ return result
+
+
+def summary(kind, root, targets, section, mode):
+ filename = 'agent-observability-summary.py' if kind == 'agent' else 'tracesbench-summary.py'
+ renderer = module(Path(__file__).with_name(filename))
+ primary = [t for t in targets if t != 'greptimedb' or mode != 's3']
+ arms = [(root, primary, 'File')]
+ if mode != 'file' and 'greptimedb' in targets:
+ arms.append((root / 's3', ['greptimedb'], 'S3'))
+ output = []
+ for arm, selected, label in arms:
+ if not selected:
+ continue
+ output.append('## ' + ('GreptimeDB S3' if label == 'S3' else 'Primary targets (GreptimeDB File)'))
+ if kind == 'agent':
+ body = (renderer.benchmark(arm, selected) if section == 'benchmark'
+ else renderer.lifecycle(arm, selected, data_root=root.parent if root.name == 'baseline' else root))
+ else:
+ report, runs = renderer.load(arm)
+ body = (renderer.benchmark(report, runs, selected) if section == 'benchmark'
+ else renderer.lifecycle(report, runs, arm, selected))
+ body = body.replace('| greptimedb |', '| GreptimeDB ' + label + ' |')
+ body = body.replace('**greptimedb**', '**GreptimeDB ' + label + '**')
+ output.append(body)
+ if label == 'S3':
+ directories = [arm / 'greptimedb-1'] if kind == 'agent' else [arm / 'runs/greptimedb']
+ for directory in directories:
+ for action in ('probe', 'inventory', 'cleanup'):
+ path = directory / ('s3-' + action + '.json')
+ data = json.loads(path.read_text()) if path.exists() else {}
+ status = 'passed' if data.get('passed') is True else 'failed / unavailable'
+ count = data.get('object_count', data.get('deleted_objects', '—'))
+ output.append(f'- S3 {action}: **{status}**; objects: {count}.')
+ return '\n\n'.join(output)
+
+
+def split_metrics(plan):
+ """One executor root per target, with the immutable dataset shared by all."""
+ result = {}
+ for target in plan['targets']:
+ child = copy.deepcopy(plan)
+ name = target['name']
+ dest = str(Path(plan['output_root']) / 'o11ybench' / ('o11ybench-' + name))
+ child['output_root'] = dest
+ child['run_id'] = plan['run_id'] + '-' + name
+ child['targets'] = [copy.deepcopy(target)]
+ child['data']['generate'] = False
+ child['report'].update(root=dest + '/report', index_html=dest + '/report/index.html')
+ child['artifacts'] = {k: dest + '/' + Path(v).name for k, v in plan['artifacts'].items()}
+ result[name] = child
+ return result
+
+
+def metrics(action, args):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--plan', type=Path, required=True)
+ parser.add_argument('--tools', type=Path, required=True)
+ parser.add_argument('--runtime-image', required=True)
+ parser.add_argument('--target')
+ a = parser.parse_args(args)
+ plan = json.loads(a.plan.read_text())
+ plan['runtime_image'] = a.runtime_image
+ executor = module(a.tools / 'scripts/run_benchmark_plan.py')
+ root = Path(plan['output_root'])
+ if action == 'metrics-prepare':
+ executor.require_safe_execute_root(root)
+ root.mkdir(parents=True, exist_ok=False)
+ manifest = executor.build_manifest(plan)
+ executor.run_checked([str(executor.DOWNLOAD_DATA)], manifest,
+ env=executor.generation_environment(plan))
+ (root / 'generation.json').write_text(json.dumps(manifest, indent=2) + '\n')
+ for name, child in split_metrics(plan).items():
+ (a.plan.parent / (name + '.json')).write_text(json.dumps(child, indent=2) + '\n')
+ elif action == 'metrics-run':
+ path = a.plan.parent / (a.target + '.json')
+ child = json.loads(path.read_text())
+ executor.execute_plan(child, executor.build_manifest(child), replace=False)
+ subprocess.run([sys.executable, str(a.tools / 'scripts/check_run_benchmark_plan.py'),
+ '--artifacts', child['output_root']], check=True)
+ else:
+ # Validate every selected target together, retaining cross-target gates.
+ manifests = [executor.build_manifest(child) for child in split_metrics(plan).values()]
+ combined = executor.build_manifest(plan)
+ combined['targets'] = [target for m in manifests for target in m['targets']]
+ for command in executor.validation_commands(combined):
+ subprocess.run(command, check=True)
+
+
+def overview(path):
+ """Render the same validated report data into the GitHub job summary."""
+ data = json.loads(path.read_text())
+ renderer = module(Path(__file__).with_name('agent-observability-summary.py'))
+ lines = ['# Storage comparison', '', 'Smoke results are diagnostic; see classification per arm. '
+ 'No cold-object-store performance claim. Missing results are not passes.', '']
+ for workload in data['workloads']:
+ labels = {p['id']: p['label'] for p in workload['participants']}
+ for scenario in workload['scenarios']:
+ lines += ['## ' + workload['title'] + ' / ' + scenario['label'], '']
+ rows = []
+ for result in scenario['results']:
+ lines += [labels[result['participant']] + ': ' + str(result.get('classification')), '']
+ for query_id, query in result['queries'].items():
+ m = query['metrics']
+ rows.append([query_id, labels[result['participant']], query['status'],
+ renderer.duration(m.get('p50_ms', m.get('median_ms'))),
+ renderer.duration(m.get('p95_ms')), renderer.duration(m.get('p99_ms'))])
+ lines.append(renderer.table(['Query', 'DB / storage', 'Status', 'P50 / median', 'P95', 'P99'], rows))
+ return '\n'.join(lines)
+
+
+def audit(root, report, targets, mode, baseline=False, allow_trace_query_failures=False):
+ data = json.loads(report.read_text())
+ actual = {(p['target'], p.get('storage', {}).get('type'), p['role'])
+ for w in data['workloads'] for p in w['participants']}
+ expected = {(t, None, 'comparison') for t in targets if t != 'greptimedb'}
+ modes = ['file', 's3'] if mode == 'both' else [mode]
+ if 'greptimedb' in targets:
+ expected |= {('greptimedb', m, role) for m in modes
+ for role in (['candidate', 'baseline'] if baseline else ['candidate'])}
+ if actual != expected:
+ raise ValueError(f'participant mismatch: expected {sorted(map(str, expected))}, got {sorted(map(str, actual))}')
+ query_failures = []
+ for w in data['workloads']:
+ partial = allow_trace_query_failures and w.get('id') == 'traces'
+ if partial and not w['scenarios']:
+ raise ValueError('missing trace scenarios')
+ for scenario in w['scenarios']:
+ if partial and {r['participant'] for r in scenario['results']} != {p['id'] for p in w['participants']}:
+ raise ValueError('missing trace participant results')
+ for result in scenario['results']:
+ if partial and result.get('health') != 'recorded healthy snapshots':
+ raise ValueError('missing or unhealthy trace evidence: ' + result['participant'])
+ queries = result['queries']
+ if not any(q['status'] == 'passed' for q in queries.values()):
+ raise ValueError('no successful measured queries: ' + result['participant'])
+ if any(q['status'] == 'unavailable' or (q['status'] == 'failed' and not partial)
+ for q in queries.values()):
+ raise ValueError('failed or unavailable queries: ' + result['participant'])
+ for query_id, query in queries.items():
+ if query['status'] == 'failed':
+ query_failures.append(dict(workload=w['id'], scenario=scenario['id'],
+ participant=result['participant'], query=query_id,
+ reason=query.get('reason', '')))
+ for manifest_path in root.glob('o11ybench/*/run-manifest.json'):
+ manifest = json.loads(manifest_path.read_text())
+ if manifest.get('status') != 'passed':
+ raise ValueError('incomplete target manifest: ' + str(manifest_path))
+ probes = list(root.rglob('s3-probe.json'))
+ expected_s3 = sum(m == 's3' for _, m, _ in expected)
+ if len(probes) != expected_s3:
+ raise ValueError('missing or duplicate S3 evidence')
+ for probe in probes:
+ for action in ('probe', 'inventory', 'cleanup'):
+ payload = json.loads(probe.with_name('s3-' + action + '.json').read_text())
+ if payload.get('passed') is not True or (action == 'inventory' and payload.get('object_count', 0) <= 0):
+ raise ValueError('failed S3 ' + action)
+ text = (root / 'ci-summary.md').read_text()
+ for m in modes if 'greptimedb' in targets else []:
+ if m.upper() not in text:
+ raise ValueError('storage mode missing from saved summary: ' + m)
+ result = dict(passed=True, participants=[dict(target=t, storage=m, role=role)
+ for t, m, role in sorted(expected, key=str)], s3_arms=len(probes), query_failures=query_failures)
+ (root / 'artifact-audit.json').write_text(json.dumps(result, indent=2) + '\n')
+ lines = ['## Artifact validation', '', '- Selected participants: ' + str(len(expected)) + '; all present.',
+ '- Query result coverage and S3 probe/inventory/cleanup: passed.', '']
+ if query_failures:
+ lines += ['- Collection completed with query failures; this is not an all-pass query run.', '']
+ lines += [f"- {f['participant']} / {f['query']}: failed (excluded from comparison)."
+ for f in query_failures]
+ lines.append('')
+ renderer = module(Path(__file__).with_name('agent-observability-summary.py'))
+ rows = []
+ for probe in probes:
+ inv = json.loads(probe.with_name('s3-inventory.json').read_text())
+ cleanup = json.loads(probe.with_name('s3-cleanup.json').read_text())
+ rows.append([str(probe.parent.relative_to(root)), inv['object_count'], inv['object_bytes'],
+ cleanup.get('deleted_objects'), 'passed'])
+ if rows:
+ lines.append(renderer.table(['S3 arm', 'Objects', 'Remote bytes', 'Deleted current objects', 'Cleanup'], rows))
+ text = '\n'.join(lines) + '\n'
+ with (root / 'ci-summary.md').open('a') as output:
+ output.write(text)
+ if os.environ.get('GITHUB_STEP_SUMMARY'):
+ with Path(os.environ['GITHUB_STEP_SUMMARY']).open('a') as output:
+ output.write(text)
+ return result
+
+
+def main():
+ if len(sys.argv) > 1 and sys.argv[1] == 'audit':
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--root', type=Path, required=True)
+ parser.add_argument('--report', type=Path, required=True)
+ parser.add_argument('--targets', required=True)
+ parser.add_argument('--allow-trace-query-failures', action='store_true',
+ help='Retain failed Traces queries after native validation; missing results still fail')
+ args = parser.parse_args(sys.argv[2:])
+ print(json.dumps(audit(args.root, args.report, args.targets.split(','),
+ os.environ.get('GREPTIMEDB_STORAGE', 'file'),
+ os.environ.get('COMPARE_GREPTIMEDB') == 'true', args.allow_trace_query_failures)))
+ return
+ if len(sys.argv) > 1 and sys.argv[1] == 'normalize-metrics':
+ path = Path(sys.argv[2])
+ plan = json.loads(path.read_text())
+ for target in plan['targets']:
+ if target.get('storage', {}).get('type') == 's3' and '-s3' not in target['name']:
+ target['name'] = target['name'].replace('-baseline', '-s3-baseline') if target['name'].endswith('-baseline') else target['name'] + '-s3'
+ path.write_text(json.dumps(plan, indent=2) + '\n')
+ return
+ if len(sys.argv) > 1 and sys.argv[1].startswith('metrics-'):
+ metrics(sys.argv[1], sys.argv[2:])
+ return
+ if len(sys.argv) > 1 and sys.argv[1] == 'overview':
+ print(overview(Path(sys.argv[2])))
+ return
+ if len(sys.argv) > 1 and sys.argv[1] == 'summary':
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--kind', choices=['agent', 'traces'], required=True)
+ parser.add_argument('--root', type=Path, required=True)
+ parser.add_argument('--targets', required=True)
+ parser.add_argument('--section', choices=['benchmark', 'lifecycle'], required=True)
+ args = parser.parse_args(sys.argv[2:])
+ print(summary(args.kind, args.root, args.targets.split(','), args.section,
+ os.environ.get('GREPTIMEDB_STORAGE', 'file')))
+ return
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('action', choices=['validate', 'run'])
+ parser.add_argument('command', nargs=argparse.REMAINDER)
+ args = parser.parse_args()
+ mode = validate(os.environ)
+ if args.action == 'validate':
+ print('GreptimeDB storage: ' + mode)
+ return
+ command = args.command[1:] if args.command[:1] == ['--'] else args.command
+ planned = commands(command, mode)
+ failed = 0
+ for cmd in planned:
+ result = subprocess.run(cmd)
+ failed = failed or result.returncode
+ # Cleanup must try both arms even if one failed. Target failures remain
+ # visible, while the other arm can still produce diagnostic evidence.
+ raise SystemExit(failed)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/.github/scripts/tests/test_metric_snapshot_s3_bench.py b/.github/scripts/tests/test_metric_snapshot_s3_bench.py
index c662ecbff76..092771e1154 100644
--- a/.github/scripts/tests/test_metric_snapshot_s3_bench.py
+++ b/.github/scripts/tests/test_metric_snapshot_s3_bench.py
@@ -28,6 +28,25 @@ SPEC.loader.exec_module(bench)
class PhaseTests(unittest.TestCase):
+ def test_cloud_region_configuration(self):
+ for bucket, runner, accepted in (("us-east-1", "us-east-1", True),
+ ("ap-southeast-1", "ap-southeast-1", True),
+ ("us-east-1", "ap-southeast-1", False),
+ ("", "", False)):
+ with self.subTest(bucket=bucket, runner=runner), tempfile.TemporaryDirectory() as directory:
+ env = dict(GREPTIMEDB_IMAGE="greptime/greptimedb@sha256:" + "a" * 64,
+ EXPECTED_COMMIT="b" * 40, RUN_PREFIX="metric-snapshot-bench/123-1/",
+ RESULTS=str(Path(directory) / "results"), DATA_ROOT=str(Path(directory) / "data"),
+ S3_REGION=bucket, RUNNER_REGION=runner, S3_ENDPOINT="")
+ with patch.dict(bench.os.environ, env):
+ if accepted:
+ benchmark = bench.Benchmark(local_smoke=False)
+ benchmark.summary()
+ self.assertIn(f"S3 in {bucket};", (benchmark.results / "summary.md").read_text())
+ else:
+ with self.assertRaisesRegex(ValueError, "same nonempty"):
+ bench.Benchmark(local_smoke=False)
+
def test_docker_nanosecond_timestamps(self):
start = bench.docker_timestamp("2026-10-14T06:06:44.72000818Z")
end = bench.docker_timestamp("2026-10-14T06:06:46.123456789Z")
diff --git a/.github/scripts/tests/test_metric_snapshot_s3_ops.py b/.github/scripts/tests/test_metric_snapshot_s3_ops.py
index d22c09044b2..5c1a265af0f 100644
--- a/.github/scripts/tests/test_metric_snapshot_s3_ops.py
+++ b/.github/scripts/tests/test_metric_snapshot_s3_ops.py
@@ -20,6 +20,7 @@ import io
import json
from pathlib import Path
import tempfile
+import types
import unittest
from unittest import mock
@@ -82,6 +83,45 @@ class OperationsTest(unittest.TestCase):
with self.subTest(changes=changes), self.assertRaises(ValueError):
ops.plan(self.env(**changes))
+ def test_regions_follow_configuration_and_reject_mismatch_or_empty(self):
+ for region in ("us-east-1", "ap-southeast-1"):
+ with self.subTest(region=region):
+ self.assertEqual(ops.plan(self.env(S3_REGION=region, RUNNER_REGION=region))["region"], region)
+ for bucket, runner in (("us-east-1", "ap-southeast-1"), ("", ""), (" ", " ")):
+ with self.subTest(bucket=bucket, runner=runner), self.assertRaises(ValueError):
+ ops.plan(self.env(S3_REGION=bucket, RUNNER_REGION=runner))
+
+ def test_client_uses_configured_region(self):
+ boto = types.ModuleType("boto3")
+ boto.client = mock.Mock()
+ config = types.ModuleType("botocore.config")
+ config.Config = mock.Mock()
+ with mock.patch.dict("sys.modules", {"boto3": boto, "botocore.config": config}):
+ for region in ("us-east-1", "ap-southeast-1"):
+ ops.client(region)
+ self.assertEqual(boto.client.call_args.kwargs["region_name"], region)
+ with self.assertRaises(ValueError):
+ ops.client("")
+
+ def test_hourly_estimate_controls_reservation_and_cost(self):
+ env = self.env(EC2_HOURLY_USD="2", BENCHMARK_TIMEOUT_MINUTES="30")
+ plan = ops.plan(env)
+ self.assertEqual(plan["ec2_hourly_usd"], "2")
+ self.assertEqual(plan["attempt_reserve_usd"], "5.00")
+ with mock.patch.dict(ops.os.environ, env), mock.patch.object(ops.time, "time", return_value=4600), \
+ mock.patch("sys.argv", ["ops", "cost", "--started-at", "1000"]), \
+ mock.patch("sys.stdout", new_callable=io.StringIO) as output:
+ ops.main()
+ cost = json.loads(output.getvalue())
+ self.assertEqual(cost["ec2_hourly_usd"], "2")
+ self.assertEqual(cost["ec2_estimate_usd"], "2.0000")
+ self.assertEqual(cost["campaign_estimate_with_other_reserve_usd"], "3.5000")
+ for rate in ("", "invalid", "0", "-1", "NaN", "Infinity", "-Infinity"):
+ with self.subTest(rate=rate), self.assertRaises(ValueError):
+ ops.plan(self.env(EC2_HOURLY_USD=rate))
+ with self.assertRaises(ValueError):
+ ops.plan(self.env(EC2_HOURLY_USD="4"))
+
def watcher_env(self):
return self.env(GITHUB_REPOSITORY="GreptimeTeam/greptimedb", GITHUB_RUN_ID="123",
GITHUB_RUN_ATTEMPT="2", GH_TOKEN="test-token", BENCHMARK_TIMEOUT_MINUTES="30")
diff --git a/.github/workflows/agent-observability.yml b/.github/workflows/agent-observability.yml
index 90840536594..055af1d0f26 100644
--- a/.github/workflows/agent-observability.yml
+++ b/.github/workflows/agent-observability.yml
@@ -2,6 +2,11 @@ name: Agent Observability Benchmark
on:
workflow_dispatch:
inputs:
+ greptimedb_storage:
+ description: 'GreptimeDB data storage (S3 requires AWS in the bucket region; WAL stays local)'
+ type: choice
+ options: [file, s3, both]
+ default: file
run_greptimedb:
description: Run GreptimeDB
type: boolean
@@ -56,7 +61,7 @@ on:
type: string
required: false
runtime_image:
- description: 'Runtime image: auto = AWS ECR Public or Aliyun ACR by provider; explicit tag/digest overrides'
+ description: 'Runtime image: auto = pinned S3 test runtime on ACR; explicit tag/digest overrides'
type: string
default: auto
required: true
@@ -99,6 +104,11 @@ on:
permissions:
contents: read
env:
+ GREPTIMEDB_STORAGE: ${{ inputs.greptimedb_storage || 'file' }}
+ S3_BUCKET: ${{ vars.AWS_CI_TEST_BUCKET }}
+ S3_REGION: ${{ vars.AWS_CI_TEST_BUCKET_REGION }}
+ RUNNER_REGION: ${{ vars.EC2_RUNNER_REGION }}
+ RUN_GREPTIMEDB: ${{ inputs.run_greptimedb }}
COMPARE_GREPTIMEDB: ${{ inputs.compare_greptimedb }}
BASELINE_GREPTIMEDB_TAG: ${{ inputs.baseline_greptimedb_tag }}
PROFILE: ${{ inputs.dataset }}
@@ -106,7 +116,7 @@ env:
CLICKHOUSE_TAG: ${{ inputs.clickhouse_tag }}
VICTORIALOGS_TAG: ${{ inputs.victorialogs_tag }}
O11YBENCH_REF: ${{ inputs.o11ybench_ref }}
- RUNTIME_IMAGE: ${{ inputs.runtime_image != 'auto' && inputs.runtime_image || inputs.provider == 'AWS' && 'public.ecr.aws/i8k6a5e1/greptime/o11ybenchruntime:2f40fb3fdbdc@sha256:8940782216bf5d066308fd71f6e346d950073c41cfb5756c5f3dc8aacf069cbc' || 'greptime-registry.cn-hangzhou.cr.aliyuncs.com/tools/o11ybench-runtime:2f40fb3fdbdc@sha256:8940782216bf5d066308fd71f6e346d950073c41cfb5756c5f3dc8aacf069cbc' }}
+ RUNTIME_IMAGE: ${{ inputs.runtime_image != 'auto' && inputs.runtime_image || 'greptime-registry.cn-hangzhou.cr.aliyuncs.com/tools/o11ybench-runtime:s3-test-b0cf5204d2fc@sha256:c2bf622db6056a2029842f4dc1cc1f37b82773bd45b134a0a83ffe2a8cd62214' }}
PROVIDER: ${{ inputs.provider }}
REQUESTED_INSTANCE_TYPE: ${{ inputs.instance_type }}
SYSTEM_DISK_GIB: ${{ inputs.system_disk_gib }}
@@ -130,6 +140,10 @@ jobs:
with:
path: greptimedb
persist-credentials: false
+ - name: Validate GreptimeDB storage
+ run: |
+ python3 greptimedb/tests/perf/test_o11ybench_storage.py
+ python3 greptimedb/.github/scripts/o11ybench-storage.py validate
- name: Validate version comparison
env:
RUN_GREPTIMEDB: ${{ inputs.run_greptimedb }}
@@ -287,7 +301,10 @@ jobs:
path: greptimedb
persist-credentials: false
- name: Set up benchmark dependencies
- uses: ./greptimedb/.github/actions/setup-benchmark
+ uses: ./greptimedb/.github/actions/setup-linux-runner
+ with:
+ tools: curl jq python3 rsync
+ expected-architecture: x86_64
- name: Check Docker on ephemeral Linux host
shell: bash
run: |
@@ -367,24 +384,48 @@ jobs:
--owner "$OWNER" --runtime-image "$RESOLVED_RUNTIME_IMAGE" \
--root "$ARTIFACT_ROOT" --profile "$PROFILE" --db-cpus "$DB_CPUS" --db-memory "$DB_MEMORY"
cp "$MANIFEST_PATH" "$ARTIFACT_ROOT/run-manifest.json"
- - name: Load and benchmark baseline GreptimeDB
- id: baseline_greptimedb
- if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' && inputs.compare_greptimedb }}
+ - name: Load and benchmark baseline GreptimeDB (File)
+ id: baseline_greptimedb_file
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' && inputs.greptimedb_storage != 's3' && inputs.compare_greptimedb }}
run: |-
- GITHUB_STEP_SUMMARY= bash o11ybench/scripts/run-agent-observability.sh --stage target --execute \
+ GITHUB_STEP_SUMMARY= bash o11ybench/scripts/run-agent-observability.sh --stage target --greptimedb-storage file --execute \
--owner "$OWNER-base" --runtime-image "$RESOLVED_RUNTIME_IMAGE" --root "$ARTIFACT_ROOT/baseline" --data-root "$ARTIFACT_ROOT" \
--profile "$PROFILE" --db-cpus "$DB_CPUS" --db-memory "$DB_MEMORY" \
--target greptimedb --image "$BASELINE_GREPTIMEDB_IMAGE" \
--greptimedb-http-port "$GREPTIMEDB_HTTP_PORT" --greptimedb-grpc-port "$GREPTIMEDB_GRPC_PORT"
- - name: Load and benchmark greptimedb
- id: greptimedb
- if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' }}
+ - name: Load and benchmark baseline GreptimeDB (S3)
+ env:
+ AWS_ACCESS_KEY_ID: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_ACCESS_KEY_ID || '' }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_SECRET_ACCESS_KEY || '' }}
+ id: baseline_greptimedb_s3
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' && inputs.greptimedb_storage != 'file' && inputs.compare_greptimedb }}
run: |-
- GITHUB_STEP_SUMMARY= bash o11ybench/scripts/run-agent-observability.sh --stage target --execute \
+ GITHUB_STEP_SUMMARY= bash o11ybench/scripts/run-agent-observability.sh --stage target --greptimedb-storage s3 --execute \
+ --owner "$OWNER-base-s3" --runtime-image "$RESOLVED_RUNTIME_IMAGE" --root "$ARTIFACT_ROOT/baseline/s3" --data-root "$ARTIFACT_ROOT" \
+ --profile "$PROFILE" --db-cpus "$DB_CPUS" --db-memory "$DB_MEMORY" \
+ --target greptimedb --image "$BASELINE_GREPTIMEDB_IMAGE" \
+ --greptimedb-http-port "$GREPTIMEDB_HTTP_PORT" --greptimedb-grpc-port "$GREPTIMEDB_GRPC_PORT"
+ - name: Load and benchmark greptimedb (File)
+ id: greptimedb_file
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' && inputs.greptimedb_storage != 's3' }}
+ run: |-
+ GITHUB_STEP_SUMMARY= bash o11ybench/scripts/run-agent-observability.sh --stage target --greptimedb-storage file --execute \
--owner "$OWNER" --runtime-image "$RESOLVED_RUNTIME_IMAGE" --root "$ARTIFACT_ROOT" \
--profile "$PROFILE" --db-cpus "$DB_CPUS" --db-memory "$DB_MEMORY" \
--target greptimedb --image "$GREPTIMEDB_IMAGE" \
--greptimedb-http-port "$GREPTIMEDB_HTTP_PORT" --greptimedb-grpc-port "$GREPTIMEDB_GRPC_PORT"
+ - name: Load and benchmark greptimedb (S3)
+ env:
+ AWS_ACCESS_KEY_ID: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_ACCESS_KEY_ID || '' }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_SECRET_ACCESS_KEY || '' }}
+ id: greptimedb_s3
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' && inputs.greptimedb_storage != 'file' }}
+ run: |-
+ GITHUB_STEP_SUMMARY= bash o11ybench/scripts/run-agent-observability.sh --stage target --greptimedb-storage s3 --execute \
+ --owner "$OWNER-s3" --runtime-image "$RESOLVED_RUNTIME_IMAGE" --root "$ARTIFACT_ROOT/s3" --data-root "$ARTIFACT_ROOT" \
+ --profile "$PROFILE" --db-cpus "$DB_CPUS" --db-memory "$DB_MEMORY" \
+ --target greptimedb --image "$GREPTIMEDB_IMAGE" \
+ --greptimedb-http-port "$GREPTIMEDB_HTTP_PORT" --greptimedb-grpc-port "$GREPTIMEDB_GRPC_PORT"
- name: Load and benchmark clickhouse
id: clickhouse
if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.clickhouse == 'true' }}
@@ -404,7 +445,7 @@ jobs:
--target victorialogs --image "$VICTORIALOGS_IMAGE" \
--victorialogs-http-port "$VICTORIALOGS_HTTP_PORT"
- name: Compare all three targets
- if: ${{ !cancelled() && steps.greptimedb.outcome == 'success' && steps.clickhouse.outcome == 'success' && steps.victorialogs.outcome
+ if: ${{ !cancelled() && steps.greptimedb_file.outcome == 'success' && steps.clickhouse.outcome == 'success' && steps.victorialogs.outcome
== 'success' }}
run: |-
docker run --rm --user "$(id -u):$(id -g)" --label "o11ybench.owner=$OWNER" \
@@ -415,45 +456,61 @@ jobs:
--victorialogs-summary /results/victorialogs-1/victorialogs-1/measured-summary.json \
--output /results/comparison.json
- name: Clean up owned containers
+ env:
+ AWS_ACCESS_KEY_ID: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_ACCESS_KEY_ID || '' }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_SECRET_ACCESS_KEY || '' }}
if: always()
run: |-
if [[ -f o11ybench/scripts/run-agent-observability.sh ]]; then
- GITHUB_STEP_SUMMARY= bash o11ybench/scripts/run-agent-observability.sh --stage cleanup --execute \
+ GITHUB_STEP_SUMMARY= python3 greptimedb/.github/scripts/o11ybench-storage.py run -- bash o11ybench/scripts/run-agent-observability.sh --stage cleanup --execute --runtime-image "$RESOLVED_RUNTIME_IMAGE" \
--owner "$OWNER" --root "$ARTIFACT_ROOT"
fi
- name: Clean up baseline containers
+ env:
+ AWS_ACCESS_KEY_ID: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_ACCESS_KEY_ID || '' }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_SECRET_ACCESS_KEY || '' }}
if: always() && inputs.compare_greptimedb
run: |-
if [[ -f o11ybench/scripts/run-agent-observability.sh ]]; then
- GITHUB_STEP_SUMMARY= bash o11ybench/scripts/run-agent-observability.sh --stage cleanup --execute \
+ GITHUB_STEP_SUMMARY= python3 greptimedb/.github/scripts/o11ybench-storage.py run -- bash o11ybench/scripts/run-agent-observability.sh --stage cleanup --execute --runtime-image "$RESOLVED_RUNTIME_IMAGE" \
--owner "$OWNER-base" --root "$ARTIFACT_ROOT/baseline"
fi
- name: Benchmark summary
if: always()
run: |
- python3 greptimedb/.github/scripts/agent-observability-summary.py \
- --root "$ARTIFACT_ROOT" --targets "$TARGETS" --section benchmark >> "$GITHUB_STEP_SUMMARY"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py summary --kind agent \
+ --root "$ARTIFACT_ROOT" --targets "$TARGETS" --section benchmark | tee -a "$ARTIFACT_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
- name: Load / lifecycle summary
if: always()
run: |
- python3 greptimedb/.github/scripts/agent-observability-summary.py \
- --root "$ARTIFACT_ROOT" --targets "$TARGETS" --section lifecycle >> "$GITHUB_STEP_SUMMARY"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py summary --kind agent \
+ --root "$ARTIFACT_ROOT" --targets "$TARGETS" --section lifecycle | tee -a "$ARTIFACT_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
- name: Baseline load / lifecycle summary
if: always() && inputs.compare_greptimedb
run: |
- echo '## Baseline GreptimeDB' >> "$GITHUB_STEP_SUMMARY"
- python3 greptimedb/.github/scripts/agent-observability-summary.py \
- --root "$ARTIFACT_ROOT/baseline" --targets greptimedb --section lifecycle >> "$GITHUB_STEP_SUMMARY"
+ echo '## Baseline GreptimeDB' | tee -a "$ARTIFACT_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py summary --kind agent \
+ --root "$ARTIFACT_ROOT/baseline" --targets greptimedb --section lifecycle | tee -a "$ARTIFACT_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
- name: GreptimeDB version comparison
if: always() && inputs.compare_greptimedb
run: |
- python3 greptimedb/.github/scripts/benchmark-version-comparison.py report --kind agent --root "$ARTIFACT_ROOT" >> "$GITHUB_STEP_SUMMARY"
+ python3 greptimedb/.github/scripts/benchmark-version-comparison.py report --kind agent --root "$ARTIFACT_ROOT" | tee -a "$ARTIFACT_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
+ - name: Render storage comparison overview
+ if: always() && steps.generate.outcome == 'success'
+ run: |
+ python3 o11ybench/scripts/build_query_performance_report.py --agent "$ARTIFACT_ROOT" \
+ --output "$ARTIFACT_ROOT-query-report.html" --json-output "$ARTIFACT_ROOT-query-report.json"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py overview "$ARTIFACT_ROOT-query-report.json" \
+ | tee -a "$ARTIFACT_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py audit --root "$ARTIFACT_ROOT" \
+ --report "$ARTIFACT_ROOT-query-report.json" --targets "$TARGETS"
- name: Upload results (no dataset)
if: always()
uses: actions/upload-artifact@v4
with:
name: agent-observability-${{ github.run_id }}-${{ github.run_attempt }}
path: |-
+ ${{ env.ARTIFACT_ROOT }}-query-report.*
${{ env.MANIFEST_PATH }}
${{ env.ARTIFACT_ROOT }}
!${{ env.ARTIFACT_ROOT }}/corpus/agent_observations.jsonl
diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml
index da514f27def..0295c5d2779 100644
--- a/.github/workflows/dev-build.yml
+++ b/.github/workflows/dev-build.yml
@@ -4,6 +4,11 @@ name: GreptimeDB Development Build
on:
workflow_dispatch: # Allows you to run this workflow manually.
inputs:
+ ec2_volume_size:
+ description: Root volume size in GiB for each EC2 build runner
+ type: number
+ required: false
+ default: 500
large-page-size:
description: Build GreptimeDB with large page size (65536).
type: boolean
@@ -133,6 +138,7 @@ jobs:
aws-region: ${{ vars.EC2_RUNNER_REGION }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
image-id: ${{ vars.EC2_RUNNER_LINUX_AMD64_IMAGE_ID }}
+ ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }}
security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }}
subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }}
@@ -147,6 +153,7 @@ jobs:
aws-region: ${{ vars.EC2_RUNNER_REGION }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
image-id: ${{ vars.EC2_RUNNER_LINUX_ARM64_IMAGE_ID }}
+ ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }}
security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }}
subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }}
diff --git a/.github/workflows/metric-snapshot-s3-bench.yml b/.github/workflows/metric-snapshot-s3-bench.yml
index 724108e4065..8b961b1d4fa 100644
--- a/.github/workflows/metric-snapshot-s3-bench.yml
+++ b/.github/workflows/metric-snapshot-s3-bench.yml
@@ -18,6 +18,11 @@ on:
description: 'Setup, 500-table smoke and full run timeout, 30..240 minutes'
type: number
default: 240
+ ec2_hourly_usd:
+ description: 'Positive EC2 hourly USD budget estimate; historical default, not live regional pricing'
+ required: true
+ type: string
+ default: '0.9408'
prior_spend_usd:
description: 'Cumulative estimated cloud spend for all earlier attempts in this $20 campaign'
required: true
@@ -34,6 +39,7 @@ env:
LOGICAL_TABLES_PER_GROUP: ${{ inputs.logical_tables_per_group }}
BENCHMARK_TIMEOUT_MINUTES: ${{ inputs.benchmark_timeout_minutes }}
PRIOR_SPEND_USD: ${{ inputs.prior_spend_usd }}
+ EC2_HOURLY_USD: ${{ inputs.ec2_hourly_usd }}
RUN_PREFIX: metric-snapshot-bench/${{ github.run_id }}-${{ github.run_attempt }}/
S3_BUCKET: ${{ vars.AWS_CI_TEST_BUCKET }}
S3_REGION: ${{ vars.AWS_CI_TEST_BUCKET_REGION }}
@@ -125,7 +131,10 @@ jobs:
path: greptimedb
persist-credentials: false
- name: Set up benchmark dependencies
- uses: ./greptimedb/.github/actions/setup-benchmark
+ uses: ./greptimedb/.github/actions/setup-linux-runner
+ with:
+ tools: curl jq python3 rsync
+ expected-architecture: x86_64
- uses: astral-sh/setup-uv@v6
- name: Mount the temporary local File data disk
run: |
diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml
index 7b173c9a2be..81627e9fa4c 100644
--- a/.github/workflows/nightly-build.yml
+++ b/.github/workflows/nightly-build.yml
@@ -9,6 +9,11 @@ on:
- cron: '0 0 * * 1-5'
workflow_dispatch: # Allows you to run this workflow manually.
inputs:
+ ec2_volume_size:
+ description: Root volume size in GiB for each EC2 build runner
+ type: number
+ required: false
+ default: 500
linux_amd64_runner:
type: choice
description: The runner uses to build linux-amd64 artifacts
@@ -113,6 +118,7 @@ jobs:
aws-region: ${{ vars.EC2_RUNNER_REGION }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
image-id: ${{ vars.EC2_RUNNER_LINUX_AMD64_IMAGE_ID }}
+ ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }}
security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }}
subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }}
@@ -127,6 +133,7 @@ jobs:
aws-region: ${{ vars.EC2_RUNNER_REGION }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
image-id: ${{ vars.EC2_RUNNER_LINUX_ARM64_IMAGE_ID }}
+ ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }}
security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }}
subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }}
diff --git a/.github/workflows/oswal-s3-bench.yml b/.github/workflows/oswal-s3-bench.yml
index 81fdc4eefb1..655582ff634 100644
--- a/.github/workflows/oswal-s3-bench.yml
+++ b/.github/workflows/oswal-s3-bench.yml
@@ -205,7 +205,10 @@ jobs:
path: greptimedb
persist-credentials: false
- name: Set up benchmark dependencies
- uses: ./greptimedb/.github/actions/setup-benchmark
+ uses: ./greptimedb/.github/actions/setup-linux-runner
+ with:
+ tools: curl jq python3 rsync
+ expected-architecture: x86_64
- uses: astral-sh/setup-uv@v6
- name: Start the MinIO fixture
if: inputs.smoke
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index d3c71199bc2..c4489f9aabd 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -20,6 +20,11 @@ on:
- cron: '0 0 * * 1-5'
workflow_dispatch: # Allows you to run this workflow manually.
inputs:
+ ec2_volume_size:
+ description: Root volume size in GiB for each EC2 build runner
+ type: number
+ required: false
+ default: 500
linux_amd64_runner:
type: choice
description: The runner uses to build linux-amd64 artifacts
@@ -215,6 +220,7 @@ jobs:
aws-region: ${{ vars.EC2_RUNNER_REGION }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
image-id: ${{ vars.EC2_RUNNER_LINUX_AMD64_IMAGE_ID }}
+ ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }}
security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }}
subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }}
@@ -229,6 +235,7 @@ jobs:
aws-region: ${{ vars.EC2_RUNNER_REGION }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
image-id: ${{ vars.EC2_RUNNER_LINUX_ARM64_IMAGE_ID }}
+ ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }}
security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }}
subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }}
@@ -298,6 +305,11 @@ jobs:
fetch-depth: 0
persist-credentials: false
+ - name: Set up Linux runner
+ uses: ./.github/actions/setup-linux-runner
+ with:
+ tools: make shasum
+
- name: Prepare riscv64 dev-builder image
shell: bash
env:
diff --git a/.github/workflows/tracesbench.yml b/.github/workflows/tracesbench.yml
index fd64ebfcf37..73fe62001df 100644
--- a/.github/workflows/tracesbench.yml
+++ b/.github/workflows/tracesbench.yml
@@ -2,6 +2,11 @@ name: Tracesbench
on:
workflow_dispatch:
inputs:
+ greptimedb_storage:
+ description: 'GreptimeDB data storage (S3 requires AWS in the bucket region; WAL stays local)'
+ type: choice
+ options: [file, s3, both]
+ default: file
run_greptimedb:
description: Run GreptimeDB
type: boolean
@@ -39,7 +44,7 @@ on:
default: sanity
required: true
runtime_image:
- description: 'Runtime image: auto = AWS ECR Public or Aliyun ACR by provider; explicit tag/digest overrides'
+ description: 'Runtime image: auto = pinned S3 test runtime on ACR; explicit tag/digest overrides'
type: string
default: auto
required: true
@@ -107,6 +112,11 @@ on:
permissions:
contents: read
env:
+ GREPTIMEDB_STORAGE: ${{ inputs.greptimedb_storage || 'file' }}
+ S3_BUCKET: ${{ vars.AWS_CI_TEST_BUCKET }}
+ S3_REGION: ${{ vars.AWS_CI_TEST_BUCKET_REGION }}
+ RUNNER_REGION: ${{ vars.EC2_RUNNER_REGION }}
+ RUN_GREPTIMEDB: ${{ inputs.run_greptimedb }}
COMPARE_GREPTIMEDB: ${{ inputs.compare_greptimedb }}
BASELINE_GREPTIMEDB_TAG: ${{ inputs.baseline_greptimedb_tag }}
DATASET: ${{ inputs.dataset }}
@@ -114,7 +124,7 @@ env:
RUNTIME_CPUS: ${{ inputs.runtime_cpus }}
RUNTIME_MEMORY: ${{ inputs.runtime_memory }}
BENCHMARK_ROOT: ${{ inputs.benchmark_root }}
- RUNTIME_IMAGE: ${{ inputs.runtime_image != 'auto' && inputs.runtime_image || inputs.provider == 'AWS' && 'public.ecr.aws/i8k6a5e1/greptime/o11ybenchruntime:77a84e1c8136@sha256:c482993ec177b026235d6cd0c61d4fb6d6f1088bc78bdc0e5964a5398de6dba0' || 'greptime-registry.cn-hangzhou.cr.aliyuncs.com/tools/o11ybench-runtime:77a84e1c8136@sha256:c482993ec177b026235d6cd0c61d4fb6d6f1088bc78bdc0e5964a5398de6dba0' }}
+ RUNTIME_IMAGE: ${{ inputs.runtime_image != 'auto' && inputs.runtime_image || 'greptime-registry.cn-hangzhou.cr.aliyuncs.com/tools/o11ybench-runtime:s3-test-b0cf5204d2fc@sha256:c2bf622db6056a2029842f4dc1cc1f37b82773bd45b134a0a83ffe2a8cd62214' }}
PROVIDER: ${{ inputs.provider }}
REQUESTED_INSTANCE_TYPE: ${{ inputs.instance_type }}
SYSTEM_DISK_GIB: ${{ inputs.system_disk_gib }}
@@ -162,6 +172,10 @@ jobs:
[[ "$GREPTIMEDB_TAG" =~ ^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$ ]] || { echo 'Invalid GreptimeDB image tag' >&2; exit 1; }
fi
printf 'targets=%s\n' "$selected" >> "$GITHUB_OUTPUT"
+ - name: Validate GreptimeDB storage
+ run: |
+ python3 greptimedb/tests/perf/test_o11ybench_storage.py
+ python3 greptimedb/.github/scripts/o11ybench-storage.py validate
- name: Validate version comparison
env:
RUN_GREPTIMEDB: ${{ inputs.run_greptimedb }}
@@ -317,7 +331,10 @@ jobs:
path: greptimedb
persist-credentials: false
- name: Set up benchmark dependencies
- uses: ./greptimedb/.github/actions/setup-benchmark
+ uses: ./greptimedb/.github/actions/setup-linux-runner
+ with:
+ tools: curl jq python3 rsync
+ expected-architecture: x86_64
- name: Checkout matching benchmark tools
uses: actions/checkout@v4
with:
@@ -386,22 +403,44 @@ jobs:
python3 o11ybench/scripts/run_tracesbench_docker.py --stage generate \
--dataset "$DATASET" --runtime-cpus "$RUNTIME_CPUS" --runtime-memory "$RUNTIME_MEMORY" \
--root "$RUN_ROOT" --owner "$OWNER" --runtime-image "$RESOLVED_RUNTIME_IMAGE"
- - name: Baseline GreptimeDB load, correctness and benchmark
- if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' && inputs.compare_greptimedb }}
+ - name: Baseline GreptimeDB load, correctness and benchmark (File)
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' && inputs.greptimedb_storage != 's3' && inputs.compare_greptimedb }}
run: |
- python3 o11ybench/scripts/run_tracesbench_docker.py --stage target --target greptimedb --port 14000 --greptimedb-image "$BASELINE_GREPTIMEDB_IMAGE" \
+ python3 o11ybench/scripts/run_tracesbench_docker.py --stage target --greptimedb-storage file --target greptimedb --port 14000 --greptimedb-image "$BASELINE_GREPTIMEDB_IMAGE" \
--db-cpus "$DB_CPUS" --db-memory "$DB_MEMORY" --query-timeout-seconds "$QUERY_TIMEOUT_SECONDS" --load-workers "$LOAD_WORKERS" \
--dataset "$DATASET" --runtime-cpus "$RUNTIME_CPUS" --runtime-memory "$RUNTIME_MEMORY" \
--root "$RUN_ROOT/baseline" --data-root "$RUN_ROOT" --owner "$OWNER-base" --runtime-image "$RESOLVED_RUNTIME_IMAGE"
python3 o11ybench/scripts/check_tracesbench_query_plans.py "$RUN_ROOT/baseline/runs/greptimedb"
- - name: GreptimeDB load, correctness and benchmark
- if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' }}
+ - name: Baseline GreptimeDB load, correctness and benchmark (S3)
+ env:
+ AWS_ACCESS_KEY_ID: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_ACCESS_KEY_ID || '' }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_SECRET_ACCESS_KEY || '' }}
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' && inputs.greptimedb_storage != 'file' && inputs.compare_greptimedb }}
run: |
- python3 o11ybench/scripts/run_tracesbench_docker.py --stage target --target greptimedb --port 14000 --greptimedb-image "$GREPTIMEDB_IMAGE" \
+ python3 o11ybench/scripts/run_tracesbench_docker.py --stage target --greptimedb-storage s3 --target greptimedb --port 14000 --greptimedb-image "$BASELINE_GREPTIMEDB_IMAGE" \
+ --db-cpus "$DB_CPUS" --db-memory "$DB_MEMORY" --query-timeout-seconds "$QUERY_TIMEOUT_SECONDS" --load-workers "$LOAD_WORKERS" \
+ --dataset "$DATASET" --runtime-cpus "$RUNTIME_CPUS" --runtime-memory "$RUNTIME_MEMORY" \
+ --root "$RUN_ROOT/baseline/s3" --data-root "$RUN_ROOT" --owner "$OWNER-base-s3" --runtime-image "$RESOLVED_RUNTIME_IMAGE"
+ python3 o11ybench/scripts/check_tracesbench_query_plans.py "$RUN_ROOT/baseline/s3/runs/greptimedb"
+ - name: GreptimeDB load, correctness and benchmark (File)
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' && inputs.greptimedb_storage != 's3' }}
+ run: |
+ python3 o11ybench/scripts/run_tracesbench_docker.py --stage target --greptimedb-storage file --target greptimedb --port 14000 --greptimedb-image "$GREPTIMEDB_IMAGE" \
--db-cpus "$DB_CPUS" --db-memory "$DB_MEMORY" --query-timeout-seconds "$QUERY_TIMEOUT_SECONDS" --load-workers "$LOAD_WORKERS" \
--dataset "$DATASET" --runtime-cpus "$RUNTIME_CPUS" --runtime-memory "$RUNTIME_MEMORY" \
--root "$RUN_ROOT" --owner "$OWNER" --runtime-image "$RESOLVED_RUNTIME_IMAGE"
python3 o11ybench/scripts/check_tracesbench_query_plans.py "$RUN_ROOT/runs/greptimedb"
+ - name: GreptimeDB load, correctness and benchmark (S3)
+ env:
+ AWS_ACCESS_KEY_ID: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_ACCESS_KEY_ID || '' }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_SECRET_ACCESS_KEY || '' }}
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.greptimedb == 'true' && inputs.greptimedb_storage != 'file' }}
+ run: |
+ python3 o11ybench/scripts/run_tracesbench_docker.py --stage target --greptimedb-storage s3 --target greptimedb --port 14000 --greptimedb-image "$GREPTIMEDB_IMAGE" \
+ --db-cpus "$DB_CPUS" --db-memory "$DB_MEMORY" --query-timeout-seconds "$QUERY_TIMEOUT_SECONDS" --load-workers "$LOAD_WORKERS" \
+ --dataset "$DATASET" --runtime-cpus "$RUNTIME_CPUS" --runtime-memory "$RUNTIME_MEMORY" \
+ --root "$RUN_ROOT/s3" --data-root "$RUN_ROOT" --owner "$OWNER-s3" --runtime-image "$RESOLVED_RUNTIME_IMAGE"
+ python3 o11ybench/scripts/check_tracesbench_query_plans.py "$RUN_ROOT/s3/runs/greptimedb"
- name: VictoriaTraces load, correctness and benchmark
if: ${{ !cancelled() && steps.generate.outcome == 'success' && needs.validate.outputs.victoriatraces == 'true' }}
run: |
@@ -419,49 +458,80 @@ jobs:
- name: GreptimeDB version comparison
if: always() && inputs.compare_greptimedb
run: |
- python3 greptimedb/.github/scripts/benchmark-version-comparison.py report --kind traces --root "$RUN_ROOT" >> "$GITHUB_STEP_SUMMARY"
- - name: Validate and render report
+ python3 greptimedb/.github/scripts/benchmark-version-comparison.py report --kind traces --root "$RUN_ROOT" | tee -a "$RUN_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
+ - name: Validate and render primary report
+ if: always() && steps.generate.outcome == 'success'
env:
+ AWS_ACCESS_KEY_ID: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_ACCESS_KEY_ID || '' }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_SECRET_ACCESS_KEY || '' }}
COMPARE_GREPTIMEDB: ${{ inputs.compare_greptimedb }}
run: |
+ if [[ "$GREPTIMEDB_STORAGE" == s3 ]]; then
+ TARGETS=$(tr "," "\n" <<< "$TARGETS" | sed "/^greptimedb$/d" | paste -sd, -)
+ [[ -n "$TARGETS" ]] || exit 0
+ fi
comparison_args=()
- if [[ "$COMPARE_GREPTIMEDB" == true ]]; then
+ if [[ "$COMPARE_GREPTIMEDB" == true && "$GREPTIMEDB_STORAGE" != s3 ]]; then
comparison_args+=(--baseline-run "$RUN_ROOT/baseline/runs/greptimedb/run.json")
fi
- python3 o11ybench/scripts/run_tracesbench_docker.py --stage report --targets "$TARGETS" "${comparison_args[@]}" \
+ python3 o11ybench/scripts/run_tracesbench_docker.py --stage report --targets "${TARGETS}" "${comparison_args[@]}" \
--dataset "$DATASET" --runtime-cpus "$RUNTIME_CPUS" --runtime-memory "$RUNTIME_MEMORY" \
--root "$RUN_ROOT" --owner "$OWNER" --runtime-image "$RESOLVED_RUNTIME_IMAGE"
+ - name: Validate and render S3 report
+ if: always() && steps.generate.outcome == 'success' && inputs.greptimedb_storage != 'file'
+ run: |
+ python3 o11ybench/scripts/run_tracesbench_docker.py --stage report --targets greptimedb \
+ --dataset "$DATASET" --runtime-cpus "$RUNTIME_CPUS" --runtime-memory "$RUNTIME_MEMORY" \
+ --root "$RUN_ROOT/s3" --data-root "$RUN_ROOT" --owner "$OWNER-s3" --runtime-image "$RESOLVED_RUNTIME_IMAGE"
- name: Clean up owned containers
+ env:
+ AWS_ACCESS_KEY_ID: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_ACCESS_KEY_ID || '' }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_SECRET_ACCESS_KEY || '' }}
if: always() && steps.runtime.outcome == 'success'
run: |
- python3 o11ybench/scripts/run_tracesbench_docker.py --stage cleanup \
+ python3 greptimedb/.github/scripts/o11ybench-storage.py run -- python3 o11ybench/scripts/run_tracesbench_docker.py --stage cleanup \
--dataset "$DATASET" --runtime-cpus "$RUNTIME_CPUS" --runtime-memory "$RUNTIME_MEMORY" \
--root "$RUN_ROOT" --owner "$OWNER" --runtime-image "$RESOLVED_RUNTIME_IMAGE"
- name: Clean up baseline containers
+ env:
+ AWS_ACCESS_KEY_ID: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_ACCESS_KEY_ID || '' }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_SECRET_ACCESS_KEY || '' }}
if: always() && steps.runtime.outcome == 'success' && inputs.compare_greptimedb
run: |
- python3 o11ybench/scripts/run_tracesbench_docker.py --stage cleanup \
+ python3 greptimedb/.github/scripts/o11ybench-storage.py run -- python3 o11ybench/scripts/run_tracesbench_docker.py --stage cleanup \
--root "$RUN_ROOT/baseline" --owner "$OWNER-base" --runtime-image "$RESOLVED_RUNTIME_IMAGE"
- name: Benchmark summary
if: always()
- run: python3 greptimedb/.github/scripts/tracesbench-summary.py --root "$RUN_ROOT" --targets "$TARGETS" --section benchmark >> "$GITHUB_STEP_SUMMARY"
+ run: python3 greptimedb/.github/scripts/o11ybench-storage.py summary --kind traces --root "$RUN_ROOT" --targets "$TARGETS" --section benchmark | tee -a "$RUN_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
- name: Load / lifecycle summary
if: always()
- run: python3 greptimedb/.github/scripts/tracesbench-summary.py --root "$RUN_ROOT" --targets "$TARGETS" --section lifecycle >> "$GITHUB_STEP_SUMMARY"
+ run: python3 greptimedb/.github/scripts/o11ybench-storage.py summary --kind traces --root "$RUN_ROOT" --targets "$TARGETS" --section lifecycle | tee -a "$RUN_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
- name: Baseline load / lifecycle summary
if: always() && inputs.compare_greptimedb
run: |
- echo '## Baseline GreptimeDB' >> "$GITHUB_STEP_SUMMARY"
- python3 greptimedb/.github/scripts/tracesbench-summary.py \
- --root "$RUN_ROOT/baseline" --targets greptimedb --section lifecycle >> "$GITHUB_STEP_SUMMARY"
+ echo '## Baseline GreptimeDB' | tee -a "$RUN_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py summary --kind traces \
+ --root "$RUN_ROOT/baseline" --targets greptimedb --section lifecycle | tee -a "$RUN_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
+ - name: Render storage comparison overview
+ if: always() && steps.generate.outcome == 'success'
+ run: |
+ mkdir -p "$RUN_ROOT/metadata"
+ cp "$METADATA_ROOT"/*-image.json "$RUN_ROOT/metadata/"
+ python3 o11ybench/scripts/build_query_performance_report.py --traces "$RUN_ROOT" \
+ --output "$RUN_ROOT-query-report.html" --json-output "$RUN_ROOT-query-report.json"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py overview "$RUN_ROOT-query-report.json" \
+ | tee -a "$RUN_ROOT/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py audit --root "$RUN_ROOT" \
+ --report "$RUN_ROOT-query-report.json" --targets "$TARGETS" --allow-trace-query-failures
- name: Stage benchmark artifacts
if: always()
run: |
mkdir -p "$RUNNER_TEMP/tracesbench-artifacts"
+ cp "$RUN_ROOT"-query-report.* "$RUNNER_TEMP/tracesbench-artifacts/" 2>/dev/null || true
if [[ -d "$METADATA_ROOT" ]]; then
rsync -a --no-owner --no-group "$METADATA_ROOT" "$RUNNER_TEMP/tracesbench-artifacts/"
fi
- for entry in runs report report.json report.md version-comparison.json version-comparison.md; do
+ for entry in artifact-audit.json metadata runs report report.json report.md ci-summary.md version-comparison.json version-comparison.md; do
if [[ -e "$RUN_ROOT/$entry" ]]; then
rsync -a --no-owner --no-group "$RUN_ROOT/$entry" "$RUNNER_TEMP/tracesbench-artifacts/"
fi
@@ -470,6 +540,12 @@ jobs:
mkdir -p "$RUNNER_TEMP/tracesbench-artifacts/baseline"
rsync -a --no-owner --no-group "$RUN_ROOT/baseline/runs" "$RUNNER_TEMP/tracesbench-artifacts/baseline/"
fi
+ for arm in s3 baseline/s3; do
+ if [[ -d "$RUN_ROOT/$arm" ]]; then
+ mkdir -p "$RUNNER_TEMP/tracesbench-artifacts/$arm"
+ rsync -a --no-owner --no-group --exclude scratch --exclude corpora "$RUN_ROOT/$arm/" "$RUNNER_TEMP/tracesbench-artifacts/$arm/"
+ fi
+ done
- name: Upload HTML and results (no corpus)
if: always()
uses: actions/upload-artifact@v4
diff --git a/.github/workflows/vmbench-long-range.yml b/.github/workflows/vmbench-long-range.yml
index d4e3ad124c1..625156b6652 100644
--- a/.github/workflows/vmbench-long-range.yml
+++ b/.github/workflows/vmbench-long-range.yml
@@ -2,6 +2,11 @@ name: VMBench Long Range
on:
workflow_dispatch:
inputs:
+ greptimedb_storage:
+ description: 'GreptimeDB data storage (S3 requires AWS in the bucket region; WAL stays local)'
+ type: choice
+ options: [file, s3, both]
+ default: file
run_greptimedb:
description: Run GreptimeDB
type: boolean
@@ -12,6 +17,11 @@ on:
type: boolean
default: false
required: false
+ run_prometheus:
+ description: Run Prometheus (requires a runtime image with managed Prometheus support)
+ type: boolean
+ default: false
+ required: false
range_preset:
description: Long-range query window (fixed dataset per preset)
type: choice
@@ -40,8 +50,13 @@ on:
type: string
default: v1.114.0@sha256:227ad53fd57a4b4430624898a1be0cac39431e1235fa0dc92f567cce38969344
required: true
+ prometheus_tag:
+ description: Docker Hub prom/prometheus tag or tag@sha256 digest
+ type: string
+ default: v3.2.1@sha256:6927e0919a144aa7616fd0137d4816816d42f6b816de3af269ab065250859a62
+ required: true
runtime_image:
- description: 'Runtime image: auto = AWS ECR Public or Aliyun ACR by provider; explicit tag/digest overrides'
+ description: 'Runtime image: auto = pinned Prometheus/File/S3 runtime on ACR; explicit tag/digest overrides'
type: string
default: auto
required: true
@@ -89,13 +104,19 @@ on:
permissions:
contents: read
env:
+ GREPTIMEDB_STORAGE: ${{ inputs.greptimedb_storage || 'file' }}
+ S3_BUCKET: ${{ vars.AWS_CI_TEST_BUCKET }}
+ S3_REGION: ${{ vars.AWS_CI_TEST_BUCKET_REGION }}
+ RUNNER_REGION: ${{ vars.EC2_RUNNER_REGION }}
+ RUN_GREPTIMEDB: ${{ inputs.run_greptimedb }}
COMPARE_GREPTIMEDB: ${{ inputs.compare_greptimedb }}
BASELINE_GREPTIMEDB_TAG: ${{ inputs.baseline_greptimedb_tag }}
BENCHMARK_ROOT: ${{ inputs.benchmark_root }}
RANGE_PRESET: ${{ inputs.range_preset }}
GREPTIMEDB_TAG: ${{ inputs.greptimedb_tag }}
VICTORIAMETRICS_TAG: ${{ inputs.victoriametrics_tag }}
- RUNTIME_IMAGE: ${{ inputs.runtime_image != 'auto' && inputs.runtime_image || inputs.provider == 'AWS' && 'public.ecr.aws/i8k6a5e1/greptime/o11ybenchruntime:b43785b56f42@sha256:e38811eb68caf3682ba56f5591a3e8e27e78e7983a923abb29fa2d7cd8fdbd46' || 'greptime-registry.cn-hangzhou.cr.aliyuncs.com/tools/o11ybench-runtime:b43785b56f42@sha256:e38811eb68caf3682ba56f5591a3e8e27e78e7983a923abb29fa2d7cd8fdbd46' }}
+ PROMETHEUS_TAG: ${{ inputs.prometheus_tag }}
+ RUNTIME_IMAGE: ${{ inputs.runtime_image != 'auto' && inputs.runtime_image || 'greptime-registry.cn-hangzhou.cr.aliyuncs.com/tools/o11ybench-runtime:345b6f7c-prometheus-s3@sha256:39d207f4a9c479b8614b8283e2d049fc8f430fcbd2b3362ce3035cfbf294edf9' }}
PROVIDER: ${{ inputs.provider }}
REQUESTED_INSTANCE_TYPE: ${{ inputs.instance_type }}
SYSTEM_DISK_GIB: ${{ inputs.system_disk_gib }}
@@ -119,6 +140,10 @@ jobs:
with:
path: greptimedb
persist-credentials: false
+ - name: Validate GreptimeDB storage
+ run: |
+ python3 greptimedb/tests/perf/test_o11ybench_storage.py
+ python3 greptimedb/.github/scripts/o11ybench-storage.py validate
- name: Validate version comparison
env:
RUN_GREPTIMEDB: ${{ inputs.run_greptimedb }}
@@ -149,6 +174,7 @@ jobs:
env:
RUN_GREPTIMEDB: ${{ inputs.run_greptimedb }}
RUN_VICTORIAMETRICS: ${{ inputs.run_victoriametrics }}
+ RUN_PROMETHEUS: ${{ inputs.run_prometheus }}
run: |
set -euo pipefail
[[ "$BENCHMARK_ROOT" == /* && "$BENCHMARK_ROOT" != / && "$BENCHMARK_ROOT" != */ ]]
@@ -173,17 +199,18 @@ jobs:
[[ "$revision" =~ ^[0-9a-f]{40}$ ]]
printf 'runtime_image=%s\no11ybench_ref=%s\nsystem_disk_gib=%s\n' "$resolved" "$revision" "$SYSTEM_DISK_GIB" >> "$GITHUB_OUTPUT"
printf 'run_id=long-range-%s-%s\nplan_artifact=vmbench-plan-%s-%s\n' "$GITHUB_RUN_ID" "$GITHUB_RUN_ATTEMPT" "$GITHUB_RUN_ID" "$GITHUB_RUN_ATTEMPT" >> "$GITHUB_OUTPUT"
- args=(--workload vmbench-long-range --range-preset "$RANGE_PRESET"
+ args=(--workload vmbench-long-range --range-preset "$RANGE_PRESET" --greptimedb-storage "$GREPTIMEDB_STORAGE"
--db-cpus "$DB_CPUS" --db-memory "$DB_MEMORY"
--run-classification controlled_server_benchmark --no-open-browser)
if [[ "$COMPARE_GREPTIMEDB" == true ]]; then
args+=(--target "greptimedb:name=greptimedb-baseline,image=greptime/greptimedb:$BASELINE_GREPTIMEDB_TAG,url=http://127.0.0.1:14000/v1/prometheus/api/v1/query_range")
fi
# Tags become target-spec fields; reject separators before passing them to the planner.
- for target in greptimedb victoriametrics; do
+ for target in greptimedb victoriametrics prometheus; do
case "$target" in
greptimedb) enabled=$RUN_GREPTIMEDB; tag=$GREPTIMEDB_TAG; repo=greptime/greptimedb; url=http://127.0.0.1:14000/v1/prometheus/api/v1/query_range ;;
victoriametrics) enabled=$RUN_VICTORIAMETRICS; tag=$VICTORIAMETRICS_TAG; repo=victoriametrics/victoria-metrics; url=http://127.0.0.1:18428/api/v1/query_range ;;
+ prometheus) enabled=$RUN_PROMETHEUS; tag=$PROMETHEUS_TAG; repo=prom/prometheus; url=http://127.0.0.1:19090/api/v1/query_range ;;
esac
[[ "$enabled" == true ]] || continue
[[ "$tag" =~ ^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}(@sha256:[0-9a-f]{64})?$ ]]
@@ -192,10 +219,11 @@ jobs:
# The packaged planner owns profile, target and resource-limit validation.
mkdir -p "$RUNNER_TEMP/vmbench-plans"
# Keep the original warm defaults: serial 5/1 and c1/c4 30s/5s.
- docker run --rm "$resolved" scripts/o11ybench_plan.py "${args[@]}" \
+ docker run --rm -e S3_BUCKET -e S3_REGION "$resolved" scripts/o11ybench_plan.py "${args[@]}" \
--run-id "long-range-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT-warm" \
--output-root "$BENCHMARK_ROOT/o11ybench/o11ybench-long-range-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT-warm" \
--cache-policy warm > "$RUNNER_TEMP/vmbench-plans/warm.json"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py normalize-metrics "$RUNNER_TEMP/vmbench-plans/warm.json"
- uses: actions/upload-artifact@v4
with:
name: vmbench-plan-${{ github.run_id }}-${{ github.run_attempt }}
@@ -278,7 +306,10 @@ jobs:
path: greptimedb
persist-credentials: false
- name: Set up benchmark dependencies
- uses: ./greptimedb/.github/actions/setup-benchmark
+ uses: ./greptimedb/.github/actions/setup-linux-runner
+ with:
+ tools: curl jq python3 rsync
+ expected-architecture: x86_64
- name: Checkout matching benchmark tools
uses: actions/checkout@v4
with:
@@ -337,25 +368,92 @@ jobs:
--plan "$METADATA_ROOT/warm.json" --runtime-image "$RESOLVED_RUNTIME_IMAGE" --dry-run \
> "$METADATA_ROOT/warm-execution-plan.json"
cat "$METADATA_ROOT/warm-execution-plan.json"
- - name: Warm serial and concurrent benchmarks
+ - name: Generate shared dataset and split target plans
+ id: generate
run: |
- set -euo pipefail
- python3 -u o11ybench/scripts/run_benchmark_plan.py \
- --plan "$METADATA_ROOT/warm.json" --runtime-image "$RESOLVED_RUNTIME_IMAGE" --execute \
- 2>&1 | tee "$METADATA_ROOT/warm-execution.log"
- python3 o11ybench/scripts/check_run_benchmark_plan.py --artifacts "$ARTIFACT_ROOT-warm"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py metrics-prepare \
+ --plan "$METADATA_ROOT/warm.json" --tools o11ybench --runtime-image "$RESOLVED_RUNTIME_IMAGE"
+ - name: Load and benchmark Baseline GreptimeDB File
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && inputs.compare_greptimedb && inputs.greptimedb_storage != 's3' }}
+ run: |
+ python3 greptimedb/.github/scripts/o11ybench-storage.py metrics-run --target greptimedb-baseline \
+ --plan "$METADATA_ROOT/warm.json" --tools o11ybench --runtime-image "$RESOLVED_RUNTIME_IMAGE"
+ - name: Load and benchmark Baseline GreptimeDB S3
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && inputs.compare_greptimedb && inputs.greptimedb_storage != 'file' }}
+ env:
+ AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
+ AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
+ run: |
+ python3 greptimedb/.github/scripts/o11ybench-storage.py metrics-run --target greptimedb-s3-baseline \
+ --plan "$METADATA_ROOT/warm.json" --tools o11ybench --runtime-image "$RESOLVED_RUNTIME_IMAGE"
+ - name: Load and benchmark GreptimeDB File
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && inputs.run_greptimedb && inputs.greptimedb_storage != 's3' }}
+ run: |
+ python3 greptimedb/.github/scripts/o11ybench-storage.py metrics-run --target greptimedb \
+ --plan "$METADATA_ROOT/warm.json" --tools o11ybench --runtime-image "$RESOLVED_RUNTIME_IMAGE"
+ - name: Load and benchmark GreptimeDB S3
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && inputs.run_greptimedb && inputs.greptimedb_storage != 'file' }}
+ env:
+ AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
+ AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
+ run: |
+ python3 greptimedb/.github/scripts/o11ybench-storage.py metrics-run --target greptimedb-s3 \
+ --plan "$METADATA_ROOT/warm.json" --tools o11ybench --runtime-image "$RESOLVED_RUNTIME_IMAGE"
+ - name: Load and benchmark VictoriaMetrics
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && inputs.run_victoriametrics }}
+ run: |
+ python3 greptimedb/.github/scripts/o11ybench-storage.py metrics-run --target victoriametrics \
+ --plan "$METADATA_ROOT/warm.json" --tools o11ybench --runtime-image "$RESOLVED_RUNTIME_IMAGE"
+ - name: Load and benchmark Prometheus
+ if: ${{ !cancelled() && steps.generate.outcome == 'success' && inputs.run_prometheus }}
+ run: |
+ python3 greptimedb/.github/scripts/o11ybench-storage.py metrics-run --target prometheus \
+ --plan "$METADATA_ROOT/warm.json" --tools o11ybench --runtime-image "$RESOLVED_RUNTIME_IMAGE"
+ - name: Validate all selected target results
+ if: always() && steps.generate.outcome == 'success'
+ run: |
+ python3 greptimedb/.github/scripts/o11ybench-storage.py metrics-validate \
+ --plan "$METADATA_ROOT/warm.json" --tools o11ybench --runtime-image "$RESOLVED_RUNTIME_IMAGE"
- name: Clean up owned containers
+ env:
+ AWS_ACCESS_KEY_ID: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_ACCESS_KEY_ID || '' }}
+ AWS_SECRET_ACCESS_KEY: ${{ inputs.greptimedb_storage != 'file' && secrets.AWS_SECRET_ACCESS_KEY || '' }}
if: always()
run: |
docker ps -aq --filter "label=o11ybench.run-id=$RUN_ID-warm" | xargs -r docker rm -fv
+ for name in greptimedb greptimedb-s3 greptimedb-baseline greptimedb-s3-baseline victoriametrics prometheus; do
+ plan="$METADATA_ROOT/$name.json"
+ [[ -f "$plan" ]] || continue
+ run_id=$(jq -r '.run_id // empty' "$plan")
+ [[ -n "$run_id" ]] || continue
+ docker ps -aq --filter "label=o11ybench.run-id=$run_id" | xargs -r docker rm -fv
+ done
+ if [[ -d "$ARTIFACT_ROOT-warm" ]]; then
+ for probe in "$ARTIFACT_ROOT-warm"/o11ybench/*/*/s3-probe.json; do
+ [[ -f "$probe" ]] || continue
+ python3 o11ybench/scripts/greptimedb_storage.py recover --runtime-image "$RESOLVED_RUNTIME_IMAGE" --output "${probe%/*}"
+ done
+ fi
- name: GreptimeDB version comparison
if: always() && inputs.compare_greptimedb
run: |
- python3 greptimedb/.github/scripts/benchmark-version-comparison.py report --kind long-range --root "$ARTIFACT_ROOT-warm" >> "$GITHUB_STEP_SUMMARY"
+ python3 greptimedb/.github/scripts/benchmark-version-comparison.py report --kind long-range --root "$ARTIFACT_ROOT-warm" | tee -a "$ARTIFACT_ROOT-warm/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
+ - name: Render storage comparison overview
+ if: always() && steps.generate.outcome == 'success'
+ run: |
+ mkdir -p "$ARTIFACT_ROOT-warm/metadata"
+ cp "$METADATA_ROOT"/*-image.json "$ARTIFACT_ROOT-warm/metadata/"
+ python3 o11ybench/scripts/build_query_performance_report.py --metrics "$ARTIFACT_ROOT-warm" \
+ --output "$ARTIFACT_ROOT-warm-query-report.html" --json-output "$ARTIFACT_ROOT-warm-query-report.json"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py overview "$ARTIFACT_ROOT-warm-query-report.json" \
+ | tee -a "$ARTIFACT_ROOT-warm/ci-summary.md" >> "$GITHUB_STEP_SUMMARY"
+ python3 greptimedb/.github/scripts/o11ybench-storage.py audit --root "$ARTIFACT_ROOT-warm" \
+ --report "$ARTIFACT_ROOT-warm-query-report.json" --targets "$(jq -r '[.targets[].kind] | unique | join(",")' "$METADATA_ROOT/warm.json")"
- name: Stage benchmark artifacts
if: always()
run: |
mkdir -p "$RUNNER_TEMP/vmbench-artifacts"
+ cp "$ARTIFACT_ROOT-warm"-query-report.* "$RUNNER_TEMP/vmbench-artifacts/" 2>/dev/null || true
if [[ -d "$METADATA_ROOT" ]]; then
rsync -a --no-owner --no-group "$METADATA_ROOT" "$RUNNER_TEMP/vmbench-artifacts/"
fi
diff --git a/Cargo.lock b/Cargo.lock
index e20142503f2..373ce2873e9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1657,7 +1657,7 @@ dependencies = [
"maybe-owned",
"rustix 1.0.7",
"rustix-linux-procfs",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
"winx",
]
@@ -2285,7 +2285,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]]
@@ -4518,6 +4518,7 @@ version = "1.4.0-alpha.0"
dependencies = [
"api",
"arrow-flight",
+ "async-stream",
"async-trait",
"bytes",
"cache",
@@ -4613,7 +4614,6 @@ dependencies = [
"parquet-variant-compute",
"parquet-variant-json",
"paste",
- "regex",
"serde",
"serde_json",
"snafu 0.8.6",
@@ -6158,7 +6158,7 @@ dependencies = [
[[package]]
name = "greptime-proto"
version = "0.1.0"
-source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=9eb24ddd94ddb9295bff9e596834832a7d8ba008#9eb24ddd94ddb9295bff9e596834832a7d8ba008"
+source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=1a30dcbfc215923ed8de0e80d8d9dbe1fc7917b6#1a30dcbfc215923ed8de0e80d8d9dbe1fc7917b6"
dependencies = [
"prost 0.14.1",
"prost-types 0.14.1",
@@ -6251,11 +6251,11 @@ dependencies = [
[[package]]
name = "halfbrown"
-version = "0.3.0"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa2c385c6df70fd180bbb673d93039dbd2cd34e41d782600bdf6e1ca7bce39aa"
+checksum = "0c7ed2f2edad8a14c8186b847909a41fbb9c3eafa44f88bd891114ed5019da09"
dependencies = [
- "hashbrown 0.15.4",
+ "hashbrown 0.16.1",
"serde",
]
@@ -6770,7 +6770,7 @@ dependencies = [
"libc",
"percent-encoding",
"pin-project-lite",
- "socket2 0.5.10",
+ "socket2 0.6.4",
"tokio",
"tower-service",
"tracing",
@@ -8195,6 +8195,7 @@ dependencies = [
"bytes",
"chrono",
"common-base",
+ "common-cache",
"common-config",
"common-error",
"common-macro",
@@ -9333,7 +9334,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -10816,9 +10817,9 @@ dependencies = [
[[package]]
name = "pgwire"
-version = "0.42.1"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1452e6541bcc64e166ff9d350c25c09334c0c80e8f60fde5e36ff81768eeaa55"
+checksum = "69354d96ef951739b5ccc75a99a8a1b09bc164afde265be9656ddab87395b481"
dependencies = [
"async-trait",
"aws-lc-rs",
@@ -11606,7 +11607,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac6c3320f9abac597dcbc668774ef006702672474aad53c6d596b62e487b40b1"
dependencies = [
"heck 0.5.0",
- "itertools 0.10.5",
+ "itertools 0.14.0",
"log",
"multimap",
"once_cell",
@@ -11654,7 +11655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d"
dependencies = [
"anyhow",
- "itertools 0.10.5",
+ "itertools 0.14.0",
"proc-macro2",
"quote",
"syn 2.0.117",
@@ -11667,7 +11668,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9120690fafc389a67ba3803df527d0ec9cbbc9cc45e4cc20b332996dfb672425"
dependencies = [
"anyhow",
- "itertools 0.10.5",
+ "itertools 0.14.0",
"proc-macro2",
"quote",
"syn 2.0.117",
@@ -11964,6 +11965,7 @@ dependencies = [
"async-stream",
"async-trait",
"bytes",
+ "cache",
"catalog",
"chrono",
"common-base",
@@ -11974,6 +11976,7 @@ dependencies = [
"common-macro",
"common-meta",
"common-plugins",
+ "common-procedure",
"common-query",
"common-recordbatch",
"common-runtime",
@@ -13221,7 +13224,7 @@ dependencies = [
"security-framework 3.7.0",
"security-framework-sys",
"webpki-root-certs",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -13991,13 +13994,11 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
[[package]]
name = "simd-json"
-version = "0.15.1"
+version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c962f626b54771990066e5435ec8331d1462576cd2d1e62f24076ae014f92112"
+checksum = "e8f2e4d523646f7da6dde3983bd18ede0babc21c258ab708b3dd93ea0259719d"
dependencies = [
- "getrandom 0.3.4",
"halfbrown",
- "ref-cast",
"serde",
"serde_json",
"simdutf8",
@@ -14146,7 +14147,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51"
dependencies = [
"libc",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -14717,7 +14718,7 @@ dependencies = [
"cfg-if",
"libc",
"psm",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -15342,7 +15343,7 @@ dependencies = [
"getrandom 0.3.4",
"once_cell",
"rustix 1.0.7",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -16595,9 +16596,9 @@ checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
[[package]]
name = "value-trait"
-version = "0.11.0"
+version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0508fce11ad19e0aab49ce20b6bec7f8f82902ded31df1c9fc61b90f0eb396b8"
+checksum = "545a3d7089f11f1741d12963c057adf9443fc24325110a6a6daf582e825fd51b"
dependencies = [
"float-cmp",
"halfbrown",
@@ -17112,7 +17113,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]]
diff --git a/Cargo.toml b/Cargo.toml
index a6f77b1e9de..48e39ada226 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -164,7 +164,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 = "9eb24ddd94ddb9295bff9e596834832a7d8ba008" }
+greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "1a30dcbfc215923ed8de0e80d8d9dbe1fc7917b6" }
hdfs-native = "0.14.6"
hex = "0.4"
hostname = "0.4.0"
@@ -248,7 +248,7 @@ serde_json = { version = "1.0", features = ["float_roundtrip"] }
serde_with = "3"
serde_yaml_ng = "0.10"
sha2 = "0.10"
-simd-json = "0.15"
+simd-json = "0.19"
similar-asserts = "1.6.0"
smallvec = { version = "1", features = ["serde"] }
snafu = "0.8"
diff --git a/README.md b/README.md
index 5204dab9513..7c9bdc01b96 100644
--- a/README.md
+++ b/README.md
@@ -9,13 +9,11 @@
Metrics, logs, and traces.
One engine, on your infrastructure.
-> A columnar database for metrics, logs, and traces on object storage.
-> Apache-2.0 licensed core.
-
User Guide ·
API Docs ·
+Live Demo ·
Roadmap 2026 ·
Slack
@@ -61,76 +59,6 @@ LIMIT 20;
Metrics join the same way, on any tag the tables share, such as `service`,
`host`, or `pod`.
-## 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 are hitting Loki's query performance limits as log volume grows
-- 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
-
-Learn more in [Why GreptimeDB](https://docs.greptime.com/user-guide/concepts/why-greptimedb).
-
-## What's Supported
-
-| | |
-|---|---|
-| **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) |
-
-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.
-
-
-
-## Benchmarks
-
-* [Agent RCA Bench](https://rca-bench.greptime.com/): LLM agents doing root cause analysis
- over GreptimeDB versus Prometheus + Loki + Tempo. 40% fewer wrong diagnoses, 48% fewer
- input tokens, 45% lower cost
- ([write-up](https://greptime.com/blogs/2026-09-08-agent-rca-bench-interface-semantic-layer))
-* [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)
-
-## Compatibility and Migration
-
-Compatibility is per protocol, and query-side coverage is narrower than ingestion.
-
-| | 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 |
-
-## 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:
-* **Standalone** — single binary for development and small deployments.
-* **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, 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).
-
-
-
-
-
## Try GreptimeDB
**For AI agents** — paste this prompt into your agent:
@@ -150,20 +78,81 @@ docker run -p 127.0.0.1:4000-4003:4000-4003 \
--mysql-addr 0.0.0.0:4002 \
--postgres-addr 0.0.0.0:4003
```
-Dashboard: [http://localhost:4000/dashboard](http://localhost:4000/dashboard)
+Dashboard: [http://localhost:4000/dashboard](http://localhost:4000/dashboard)
+Or skip the install and try the [Live Demo](https://live.greptime.cloud/dashboard/?info=eyJ1c2VybmFtZSI6ImdyZXB0aW1lIiwicGFzc3dvcmQiOiJkZW1vc2Vzc2lvbiJ9&query_guide=1&utm_source=github&utm_medium=readme&utm_campaign=greptimedb#/dashboard/explore).
-Read more in the [full Install Guide](https://docs.greptime.com/getting-started/installation/overview).
+Next: [Quickstart](https://docs.greptime.com/getting-started/quick-start), the [full Install Guide](https://docs.greptime.com/getting-started/installation/overview), [Demo Scenes](https://github.com/GreptimeTeam/demo-scene), and the [FAQ](https://docs.greptime.com/faq-and-others/faq).
-**Troubleshooting:**
-* Cannot connect to the database? Ensure that ports `4000`, `4001`, `4002`, and `4003` are not blocked by a firewall or used by other services.
-* Failed to start? Check the container logs with `docker logs greptime` for further details.
+## Why You Might Use It
-## Getting Started
+- 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 are hitting Loki's query performance limits as log volume grows
+- 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
-- [Quickstart](https://docs.greptime.com/getting-started/quick-start)
-- [User Guide](https://docs.greptime.com/user-guide/overview)
-- [Demo Scenes](https://github.com/GreptimeTeam/demo-scene)
-- [FAQ](https://docs.greptime.com/faq-and-others/faq)
+Learn more in [Why GreptimeDB](https://docs.greptime.com/user-guide/concepts/why-greptimedb).
+
+## What's Supported
+
+| | |
+|---|---|
+| **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/) (with [native histograms](https://docs.greptime.com/user-guide/ingest-data/for-observability/prometheus/#native-histograms) over Remote Write 2.0), [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** | [Pipelines](https://docs.greptime.com/user-guide/logs/use-custom-pipelines) that parse and transform logs at ingestion, 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) |
+
+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.
+
+
+
+## Benchmarks
+
+* [Agent RCA Bench](https://rca-bench.greptime.com/): LLM agents doing root cause analysis
+ over GreptimeDB versus Prometheus + Loki + Tempo, 168 investigations per interface across
+ six models. 40% fewer wrong diagnoses, about 48% fewer input tokens, about 45% lower
+ estimated cost
+ ([write-up](https://greptime.com/blogs/2026-09-08-agent-rca-bench-interface-semantic-layer))
+* [JSONBench billion-record cold run: first place as of March 2025](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)
+
+## Compatibility and Migration
+
+Compatibility is per protocol, and query-side coverage is narrower than ingestion.
+
+| | 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 |
+
+## 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 and region migration 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. For GreptimeDB Enterprise inquiries, [contact us](https://greptime.com/contactus).
+
+## Architecture
+
+GreptimeDB can run in two modes:
+* **Standalone** — single binary for development and small deployments.
+* **Distributed** — four components, each independently scalable:
+ - **Frontend** — protocol endpoints and the distributed query engine. Stateless, scales horizontally.
+ - **Datanode** — region engine with WAL, memtable, SST, cache, compaction, and indexes. Persists data to object storage.
+ - **Metasrv** — metadata, region routing, and cluster coordination (DDL procedures, failover, region migration, repartitioning). 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).
+
+
+
+
## Build From Source
@@ -202,12 +191,10 @@ See the [Contribution Guidelines](CONTRIBUTING.md) for the full developer workfl
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).
-Release lines and support windows are in the [version reference](https://docs.greptime.com/nightly/reference/about-greptimedb-version). For where the project is going, read the [v1.0 highlights](https://greptime.com/blogs/2025-11-05-greptimedb-v1-highlights), the [2026 roadmap](https://greptime.com/blogs/2026-02-11-greptimedb-roadmap-2026), and [what we mean by an observability database](https://greptime.com/blogs/2026-08-26-what-is-an-observability-database).
+Releases follow [Semantic Versioning](https://docs.greptime.com/reference/about-greptimedb-version). For where the project is going, read the [v1.0 highlights](https://greptime.com/blogs/2025-11-05-greptimedb-v1-highlights), the [2026 roadmap](https://github.com/GreptimeTeam/greptimedb/issues/7685), and [what we mean by an observability database](https://greptime.com/blogs/2026-08-26-what-is-an-observability-database).
## Community
-We invite you to engage and contribute!
-
- [Slack](https://greptime.com/slack)
- [Discussions](https://github.com/GreptimeTeam/greptimedb/discussions)
- [Official Website](https://greptime.com/)
@@ -218,6 +205,14 @@ We invite you to engage and contribute!
If GreptimeDB is useful to you, please star the repo.
+
+
+
+
+
+
+
+
## License
@@ -230,17 +225,10 @@ A small set of peripheral, enterprise-only features are gated behind the
separate [GreptimeDB Enterprise License](LICENSE-ENTERPRISE). Source files under
that license carry an explicit Enterprise License header.
-## Commercial Support
-
-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
- Read our [Contribution Guidelines](CONTRIBUTING.md).
-- Explore [Internal Concepts](https://docs.greptime.com/contributor-guide/overview.html) and [DeepWiki](https://deepwiki.com/GreptimeTeam/greptimedb).
+- Explore [Internal Concepts](https://docs.greptime.com/contributor-guide/overview/) and [DeepWiki](https://deepwiki.com/GreptimeTeam/greptimedb).
- Pick up a [good first issue](https://github.com/GreptimeTeam/greptimedb/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and join the #contributors [Slack](https://greptime.com/slack) channel.
[](https://github.com/GreptimeTeam/greptimedb/actions/workflows/integration.yml)
diff --git a/config/config.md b/config/config.md
index cd2b518f12c..9bbed619ab3 100644
--- a/config/config.md
+++ b/config/config.md
@@ -190,7 +190,7 @@
| `region_engine.mito.experimental_series_index_maintenance_interval` | String | `5m` | Interval between series-index maintenance runs. Zero uses the default of 5 min. |
| `region_engine.mito.experimental_series_index_bucket_width` | String | `5days` | Requested minimum series-index bucket width (default: 5 days), rounded up to an exact multiple of each region's compaction time window. |
| `region_engine.mito.max_background_flushes` | Integer | Auto | Max number of running background flush jobs (default: 1/2 of cpu cores). |
-| `region_engine.mito.max_background_compactions` | Integer | Auto | Max number of running background compaction jobs (default: 1/4 of cpu cores). |
+| `region_engine.mito.max_background_compactions` | Integer | Auto | Max number of running background compaction jobs (default: 1/4 of cpu cores). The same limit bounds engine-wide admission of local compaction units and the merge-output budget of each automatic per-region pick. Outputs sharing inputs form one unit. Expired SSTs may add one expiration-only unit outside the merge-output budget; it still consumes a slot in the same admission limit. Manual compaction keeps using the request's parallelism. |
| `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" |
@@ -276,6 +276,7 @@
| `pipeline` | -- | -- | The pipeline options. |
| `pipeline.cache_ttl` | String | `10s` | Time to live of the local pipeline cache. Default is `10s`. |
| `pipeline.allow_vrl_host_access` | Bool | `false` | Allow VRL to access the server environment, filesystem, hostname, local timezone, network, and logs. Default is false. Enable only for trusted pipeline authors. Applies to pipeline creation, execution, and dry-runs. Requires a restart. |
+| `pipeline.ignore_errors` | Bool | `false` | Default for the HTTP log ingestion and pipeline dry-run `ignore_errors` parameter. Explicit request values override this setting. Malformed input may be discarded, and invalid custom timestamps in identity ingestion fall back to server time. Pipeline execution errors are controlled separately by `skip_error`. Default is false. Requires a restart. |
| `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 | All | 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_catalog`, `reconcile_database`, `reconcile_table`, `reconcile_logical_tables`. When omitted, all current and future event types are recorded. Set to an empty array to disable event recording. |
@@ -438,6 +439,7 @@
| `pipeline` | -- | -- | The pipeline options. |
| `pipeline.cache_ttl` | String | `10s` | Time to live of the frontend-local pipeline cache. A pipeline created or deleted on another frontend takes effect on this one after at most this duration. |
| `pipeline.allow_vrl_host_access` | Bool | `false` | Allow VRL to access the server environment, filesystem, hostname, local timezone, network, and logs. Default is false. Enable only for trusted pipeline authors. Applies to pipeline creation, execution, and dry-runs. Requires a restart. |
+| `pipeline.ignore_errors` | Bool | `false` | Default for the HTTP log ingestion and pipeline dry-run `ignore_errors` parameter. Explicit request values override this setting. Malformed input may be discarded, and invalid custom timestamps in identity ingestion fall back to server time. Pipeline execution errors are controlled separately by `skip_error`. Default is false. Requires a restart. |
| `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 | All | 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. |
@@ -671,7 +673,7 @@
| `region_engine.mito.experimental_series_index_maintenance_interval` | String | `5m` | Interval between series-index maintenance runs. Zero uses the default of 5 min. |
| `region_engine.mito.experimental_series_index_bucket_width` | String | `5days` | Requested minimum series-index bucket width (default: 5 days), rounded up to an exact multiple of each region's compaction time window. |
| `region_engine.mito.max_background_flushes` | Integer | Auto | Max number of running background flush jobs (default: 1/2 of cpu cores). |
-| `region_engine.mito.max_background_compactions` | Integer | Auto | Max number of running background compaction jobs (default: 1/4 of cpu cores). |
+| `region_engine.mito.max_background_compactions` | Integer | Auto | Max number of running background compaction jobs (default: 1/4 of cpu cores). The same limit bounds engine-wide admission of local compaction units and the merge-output budget of each automatic per-region pick. Outputs sharing inputs form one unit. Expired SSTs may add one expiration-only unit outside the merge-output budget; it still consumes a slot in the same admission limit. Manual compaction keeps using the request's parallelism. |
| `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" |
diff --git a/config/datanode.example.toml b/config/datanode.example.toml
index a7e9417717f..45f1d93d39a 100644
--- a/config/datanode.example.toml
+++ b/config/datanode.example.toml
@@ -580,6 +580,11 @@ compress_manifest = false
#+ max_background_flushes = 4
## Max number of running background compaction jobs (default: 1/4 of cpu cores).
+## The same limit bounds engine-wide admission of local compaction units and
+## the merge-output budget of each automatic per-region pick. Outputs sharing
+## inputs form one unit. Expired SSTs may add one expiration-only unit outside
+## the merge-output budget; it still consumes a slot in the same admission limit.
+## Manual compaction keeps using the request's parallelism.
## @toml2docs:none-default="Auto"
#+ max_background_compactions = 2
diff --git a/config/frontend.example.toml b/config/frontend.example.toml
index c959dc10926..f0c1402327f 100644
--- a/config/frontend.example.toml
+++ b/config/frontend.example.toml
@@ -519,6 +519,12 @@ cache_ttl = "10s"
## network, and logs. Default is false. Enable only for trusted pipeline authors.
## Applies to pipeline creation, execution, and dry-runs. Requires a restart.
allow_vrl_host_access = false
+## Default for the HTTP log ingestion and pipeline dry-run `ignore_errors` parameter.
+## Explicit request values override this setting. Malformed input may be discarded,
+## and invalid custom timestamps in identity ingestion fall back to server time.
+## Pipeline execution errors are controlled separately by `skip_error`.
+## Default is false. Requires a restart.
+ignore_errors = false
## Configuration options for the event recorder.
[event_recorder]
diff --git a/config/standalone.example.toml b/config/standalone.example.toml
index 0fa5907f95b..7682e537861 100644
--- a/config/standalone.example.toml
+++ b/config/standalone.example.toml
@@ -795,6 +795,11 @@ compress_manifest = false
#+ max_background_flushes = 4
## Max number of running background compaction jobs (default: 1/4 of cpu cores).
+## The same limit bounds engine-wide admission of local compaction units and
+## the merge-output budget of each automatic per-region pick. Outputs sharing
+## inputs form one unit. Expired SSTs may add one expiration-only unit outside
+## the merge-output budget; it still consumes a slot in the same admission limit.
+## Manual compaction keeps using the request's parallelism.
## @toml2docs:none-default="Auto"
#+ max_background_compactions = 2
@@ -1151,6 +1156,12 @@ cache_ttl = "10s"
## network, and logs. Default is false. Enable only for trusted pipeline authors.
## Applies to pipeline creation, execution, and dry-runs. Requires a restart.
allow_vrl_host_access = false
+## Default for the HTTP log ingestion and pipeline dry-run `ignore_errors` parameter.
+## Explicit request values override this setting. Malformed input may be discarded,
+## and invalid custom timestamps in identity ingestion fall back to server time.
+## Pipeline execution errors are controlled separately by `skip_error`.
+## Default is false. Requires a restart.
+ignore_errors = false
## Configuration options for the event recorder.
[event_recorder]
diff --git a/docs/how-to/metric-snapshot-s3-bench.md b/docs/how-to/metric-snapshot-s3-bench.md
index 86468bf3ffd..7bd5fb2efed 100644
--- a/docs/how-to/metric-snapshot-s3-bench.md
+++ b/docs/how-to/metric-snapshot-s3-bench.md
@@ -1,14 +1,17 @@
# Metric snapshot benchmark on AWS S3
The manual `Metric Snapshot S3 Benchmark` workflow tests packed Metric export and
-restore against real S3 in `ap-southeast-1`. It must first exist on the repository's
-default branch for GitHub to register `workflow_dispatch`. It was validated on AWS
+restore against real S3 in the configured CI bucket region. It must first exist on
+the repository's default branch for GitHub to register `workflow_dispatch`. It was validated on AWS
by run [38544464731](https://github.com/GreptimeTeam/greptimedb/actions/runs/38544464731);
[#9573](https://github.com/GreptimeTeam/greptimedb/pull/9573) records its conditions and results.
## Run
Use the repository's existing EC2 runner configuration and CI S3 credentials.
+`AWS_CI_TEST_BUCKET_REGION` and `EC2_RUNNER_REGION` must be nonempty and equal;
+for example, both can be `us-east-1`. The configured subnet, security group and
+AMI (if explicitly supplied) must also belong to the runner region.
The workflow passes credentials only through CI; no local AWS credentials are
needed. Source, target and CLI use the same immutable image. This image's source
SHA and required CLI capabilities have been checked:
@@ -20,6 +23,7 @@ gh workflow run metric-snapshot-s3-bench.yml \
-f expected_commit=f690bbb2040865c0d22b0b57d51612b60ae27cd0 \
-f logical_tables_per_group=10000 \
-f benchmark_timeout_minutes=240 \
+ -f ec2_hourly_usd=0.9408 \
-f prior_spend_usd=0
```
@@ -28,9 +32,12 @@ earlier cloud attempts in the campaign, including failed setup and cleanup.
Do not reset the estimate to zero when retrying. The workflow accepts 50–10,000
logical tables per group and a 30–240 minute benchmark job timeout.
-The runner is fixed at `c6id.4xlarge` (16 vCPU, 32 GiB RAM). At the recorded
-Singapore Linux on-demand estimate of $0.9408/hour, the default attempt reserves
-$6.4392: four benchmark hours, 45 minutes of provisioning, 10 minutes for queueing,
+The runner is fixed at `c6id.4xlarge` (16 vCPU, 32 GiB RAM). Set
+`ec2_hourly_usd` to a positive, finite hourly budget estimate appropriate for the
+selected region and instance. Its default $0.9408/hour preserves the historical
+Singapore estimate; it is not a live regional price or a guaranteed upper bound.
+The same estimate is used for preflight reservation and the final cost summary.
+At that default rate, the default attempt reserves $6.4392: four benchmark hours, 45 minutes of provisioning, 10 minutes for queueing,
20 minutes of cleanup, and $1.50 for S3, disk and IPv4 costs. Preflight rejects prior spend at or above
$15, or an attempt whose reserve would exceed the cumulative $20 budget.
These estimates and checks are not an AWS hard spending cap or an AWS bill.
diff --git a/grafana/dashboards/metrics/cluster/dashboard.json b/grafana/dashboards/metrics/cluster/dashboard.json
index fd1d0257594..51e3de64414 100644
--- a/grafana/dashboards/metrics/cluster/dashboard.json
+++ b/grafana/dashboards/metrics/cluster/dashboard.json
@@ -13962,7 +13962,7 @@
"uid": "${metrics}"
},
"editorMode": "code",
- "expr": "sum by (result) (\n changes(greptime_region_balancer_actions_total[$__rate_interval])\n)",
+ "expr": "sum by (result) (\n increase(greptime_region_balancer_actions_total[$__rate_interval])\n)",
"hide": false,
"instant": false,
"legendFormat": "{{result}}",
@@ -14064,7 +14064,7 @@
"uid": "${metrics}"
},
"editorMode": "code",
- "expr": "sum by (gate, reason) (changes(greptime_region_balancer_gate_stop_total[$__rate_interval]))",
+ "expr": "sum by (gate, reason) (increase(greptime_region_balancer_gate_stop_total[$__rate_interval]))",
"hide": false,
"instant": false,
"legendFormat": "{{gate}} / {{reason}}",
@@ -14399,7 +14399,7 @@
"uid": "${metrics}"
},
"editorMode": "code",
- "expr": "sum by (result) (changes(greptime_auto_repartition_actions_total[$__rate_interval]))",
+ "expr": "sum by (result) (increase(greptime_auto_repartition_actions_total[$__rate_interval]))",
"hide": false,
"instant": false,
"legendFormat": "{{result}}",
@@ -14415,7 +14415,7 @@
"type": "prometheus",
"uid": "${metrics}"
},
- "description": "Auto repartition gate stop count by gate and reason",
+ "description": "Repartition gate stop increments. Baseline failures show detailed reasons when available; otherwise the aggregate invalid_baseline series is retained. Fallback is matched per source before aggregation to avoid double counting across mixed versions.",
"fieldConfig": {
"defaults": {
"color": {
@@ -14501,12 +14501,25 @@
"uid": "${metrics}"
},
"editorMode": "code",
- "expr": "sum by (gate, reason) (changes(greptime_auto_repartition_gate_stop_total[$__rate_interval]))",
+ "expr": "sum by (gate, reason) (\n increase(greptime_auto_repartition_gate_stop_total{reason!=\"invalid_baseline\"}[$__rate_interval])\n or\n (increase(greptime_auto_repartition_gate_stop_total{reason=\"invalid_baseline\"}[$__rate_interval])\n unless ignoring (gate, reason)\n increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))\n)",
"hide": false,
"instant": false,
"legendFormat": "{{gate}} / {{reason}}",
"range": true,
"refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${metrics}"
+ },
+ "editorMode": "code",
+ "expr": "sum by (reason) (increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))",
+ "hide": false,
+ "instant": false,
+ "legendFormat": "baseline / {{reason}}",
+ "range": true,
+ "refId": "B"
}
],
"title": "Auto Repartition Gate Stops",
diff --git a/grafana/dashboards/metrics/cluster/dashboard.md b/grafana/dashboards/metrics/cluster/dashboard.md
index 1c167af5152..a200b4c8338 100644
--- a/grafana/dashboards/metrics/cluster/dashboard.md
+++ b/grafana/dashboards/metrics/cluster/dashboard.md
@@ -241,14 +241,20 @@ ORDER BY data_size DESC;` | `piechart` | Distribution of leader regions and data
| Title | Query | Type | Description | Datasource | Unit | Legend Format |
| --- | --- | --- | --- | --- | --- | --- |
| Region Balancer Actions | `sum by (result) (
- changes(greptime_region_balancer_actions_total[$__rate_interval])
+ increase(greptime_region_balancer_actions_total[$__rate_interval])
)` | `timeseries` | Region balancer action count | `prometheus` | `short` | `{{result}}` |
-| Region Balancer Gate Stops | `sum by (gate, reason) (changes(greptime_region_balancer_gate_stop_total[$__rate_interval]))` | `timeseries` | Region balancer gate stop count by gate and reason | `prometheus` | `short` | `{{gate}} / {{reason}}` |
+| Region Balancer Gate Stops | `sum by (gate, reason) (increase(greptime_region_balancer_gate_stop_total[$__rate_interval]))` | `timeseries` | Region balancer gate stop count by gate and reason | `prometheus` | `short` | `{{gate}} / {{reason}}` |
| Region Balancer Datanodes | `sum by (state) (greptime_region_balancer_datanodes)` | `stat` | Region balancer datanode count by state | `prometheus` | `short` | `{{state}}` |
| Region Balancer Regions | `sum by (state) (greptime_region_balancer_regions)` | `stat` | Region balancer region count by state | `prometheus` | `short` | `{{state}}` |
| Region Balancer Datanode Stability | `sum by (state) (greptime_region_balancer_datanode_stability)` | `stat` | Region balancer datanode stability statistics by state | `prometheus` | `binBps` | `{{state}}` |
-| Auto Repartition Actions | `sum by (result) (changes(greptime_auto_repartition_actions_total[$__rate_interval]))` | `timeseries` | Auto repartition action count by result | `prometheus` | `short` | `{{result}}` |
-| Auto Repartition Gate Stops | `sum by (gate, reason) (changes(greptime_auto_repartition_gate_stop_total[$__rate_interval]))` | `timeseries` | Auto repartition gate stop count by gate and reason | `prometheus` | `short` | `{{gate}} / {{reason}}` |
+| Auto Repartition Actions | `sum by (result) (increase(greptime_auto_repartition_actions_total[$__rate_interval]))` | `timeseries` | Auto repartition action count by result | `prometheus` | `short` | `{{result}}` |
+| Auto Repartition Gate Stops | `sum by (gate, reason) (
+ increase(greptime_auto_repartition_gate_stop_total{reason!="invalid_baseline"}[$__rate_interval])
+ or
+ (increase(greptime_auto_repartition_gate_stop_total{reason="invalid_baseline"}[$__rate_interval])
+ unless ignoring (gate, reason)
+ increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))
+)` `sum by (reason) (increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))` | `timeseries` | Repartition gate stop increments. Baseline failures show detailed reasons when available; otherwise the aggregate invalid_baseline series is retained. Fallback is matched per source before aggregation to avoid double counting across mixed versions. | `prometheus` | `short` | `{{gate}} / {{reason}}` |
| Auto Repartition Sampling P99 | `histogram_quantile(0.99, sum by (le, stage) (rate(greptime_auto_repartition_sampling_elapsed_bucket[$__rate_interval])))` | `timeseries` | Auto repartition sampling elapsed time by stage | `prometheus` | `s` | `{{stage}}` |
| Auto Repartition Executor P99 | `histogram_quantile(0.99, sum by (le, stage) (rate(greptime_auto_repartition_executor_elapsed_bucket[$__rate_interval])))` | `timeseries` | Auto repartition executor elapsed time by stage | `prometheus` | `s` | `{{stage}}` |
# Object Store
diff --git a/grafana/dashboards/metrics/cluster/dashboard.yaml b/grafana/dashboards/metrics/cluster/dashboard.yaml
index 01fdb7bbc31..0c950ab1b8c 100644
--- a/grafana/dashboards/metrics/cluster/dashboard.yaml
+++ b/grafana/dashboards/metrics/cluster/dashboard.yaml
@@ -1904,7 +1904,7 @@ groups:
queries:
- expr: |-
sum by (result) (
- changes(greptime_region_balancer_actions_total[$__rate_interval])
+ increase(greptime_region_balancer_actions_total[$__rate_interval])
)
datasource:
type: prometheus
@@ -1915,7 +1915,7 @@ groups:
description: Region balancer gate stop count by gate and reason
unit: short
queries:
- - expr: sum by (gate, reason) (changes(greptime_region_balancer_gate_stop_total[$__rate_interval]))
+ - expr: sum by (gate, reason) (increase(greptime_region_balancer_gate_stop_total[$__rate_interval]))
datasource:
type: prometheus
uid: ${metrics}
@@ -1955,21 +1955,33 @@ groups:
description: Auto repartition action count by result
unit: short
queries:
- - expr: sum by (result) (changes(greptime_auto_repartition_actions_total[$__rate_interval]))
+ - expr: sum by (result) (increase(greptime_auto_repartition_actions_total[$__rate_interval]))
datasource:
type: prometheus
uid: ${metrics}
legendFormat: '{{result}}'
- title: Auto Repartition Gate Stops
type: timeseries
- description: Auto repartition gate stop count by gate and reason
+ description: Repartition gate stop increments. Baseline failures show detailed reasons when available; otherwise the aggregate invalid_baseline series is retained. Fallback is matched per source before aggregation to avoid double counting across mixed versions.
unit: short
queries:
- - expr: sum by (gate, reason) (changes(greptime_auto_repartition_gate_stop_total[$__rate_interval]))
+ - expr: |-
+ sum by (gate, reason) (
+ increase(greptime_auto_repartition_gate_stop_total{reason!="invalid_baseline"}[$__rate_interval])
+ or
+ (increase(greptime_auto_repartition_gate_stop_total{reason="invalid_baseline"}[$__rate_interval])
+ unless ignoring (gate, reason)
+ increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))
+ )
datasource:
type: prometheus
uid: ${metrics}
legendFormat: '{{gate}} / {{reason}}'
+ - expr: sum by (reason) (increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))
+ datasource:
+ type: prometheus
+ uid: ${metrics}
+ legendFormat: baseline / {{reason}}
- title: Auto Repartition Sampling P99
type: timeseries
description: Auto repartition sampling elapsed time by stage
diff --git a/grafana/dashboards/metrics/standalone/dashboard.json b/grafana/dashboards/metrics/standalone/dashboard.json
index d980fb500d6..fd5adec8c83 100644
--- a/grafana/dashboards/metrics/standalone/dashboard.json
+++ b/grafana/dashboards/metrics/standalone/dashboard.json
@@ -13962,7 +13962,7 @@
"uid": "${metrics}"
},
"editorMode": "code",
- "expr": "sum by (result) (\n changes(greptime_region_balancer_actions_total[$__rate_interval])\n)",
+ "expr": "sum by (result) (\n increase(greptime_region_balancer_actions_total[$__rate_interval])\n)",
"hide": false,
"instant": false,
"legendFormat": "{{result}}",
@@ -14064,7 +14064,7 @@
"uid": "${metrics}"
},
"editorMode": "code",
- "expr": "sum by (gate, reason) (changes(greptime_region_balancer_gate_stop_total[$__rate_interval]))",
+ "expr": "sum by (gate, reason) (increase(greptime_region_balancer_gate_stop_total[$__rate_interval]))",
"hide": false,
"instant": false,
"legendFormat": "{{gate}} / {{reason}}",
@@ -14399,7 +14399,7 @@
"uid": "${metrics}"
},
"editorMode": "code",
- "expr": "sum by (result) (changes(greptime_auto_repartition_actions_total[$__rate_interval]))",
+ "expr": "sum by (result) (increase(greptime_auto_repartition_actions_total[$__rate_interval]))",
"hide": false,
"instant": false,
"legendFormat": "{{result}}",
@@ -14415,7 +14415,7 @@
"type": "prometheus",
"uid": "${metrics}"
},
- "description": "Auto repartition gate stop count by gate and reason",
+ "description": "Repartition gate stop increments. Baseline failures show detailed reasons when available; otherwise the aggregate invalid_baseline series is retained. Fallback is matched per source before aggregation to avoid double counting across mixed versions.",
"fieldConfig": {
"defaults": {
"color": {
@@ -14501,12 +14501,25 @@
"uid": "${metrics}"
},
"editorMode": "code",
- "expr": "sum by (gate, reason) (changes(greptime_auto_repartition_gate_stop_total[$__rate_interval]))",
+ "expr": "sum by (gate, reason) (\n increase(greptime_auto_repartition_gate_stop_total{reason!=\"invalid_baseline\"}[$__rate_interval])\n or\n (increase(greptime_auto_repartition_gate_stop_total{reason=\"invalid_baseline\"}[$__rate_interval])\n unless ignoring (gate, reason)\n increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))\n)",
"hide": false,
"instant": false,
"legendFormat": "{{gate}} / {{reason}}",
"range": true,
"refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${metrics}"
+ },
+ "editorMode": "code",
+ "expr": "sum by (reason) (increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))",
+ "hide": false,
+ "instant": false,
+ "legendFormat": "baseline / {{reason}}",
+ "range": true,
+ "refId": "B"
}
],
"title": "Auto Repartition Gate Stops",
diff --git a/grafana/dashboards/metrics/standalone/dashboard.md b/grafana/dashboards/metrics/standalone/dashboard.md
index 7ed99d2ab2c..6dd5fd114fe 100644
--- a/grafana/dashboards/metrics/standalone/dashboard.md
+++ b/grafana/dashboards/metrics/standalone/dashboard.md
@@ -241,14 +241,20 @@ ORDER BY data_size DESC;` | `piechart` | Distribution of leader regions and data
| Title | Query | Type | Description | Datasource | Unit | Legend Format |
| --- | --- | --- | --- | --- | --- | --- |
| Region Balancer Actions | `sum by (result) (
- changes(greptime_region_balancer_actions_total[$__rate_interval])
+ increase(greptime_region_balancer_actions_total[$__rate_interval])
)` | `timeseries` | Region balancer action count | `prometheus` | `short` | `{{result}}` |
-| Region Balancer Gate Stops | `sum by (gate, reason) (changes(greptime_region_balancer_gate_stop_total[$__rate_interval]))` | `timeseries` | Region balancer gate stop count by gate and reason | `prometheus` | `short` | `{{gate}} / {{reason}}` |
+| Region Balancer Gate Stops | `sum by (gate, reason) (increase(greptime_region_balancer_gate_stop_total[$__rate_interval]))` | `timeseries` | Region balancer gate stop count by gate and reason | `prometheus` | `short` | `{{gate}} / {{reason}}` |
| Region Balancer Datanodes | `sum by (state) (greptime_region_balancer_datanodes)` | `stat` | Region balancer datanode count by state | `prometheus` | `short` | `{{state}}` |
| Region Balancer Regions | `sum by (state) (greptime_region_balancer_regions)` | `stat` | Region balancer region count by state | `prometheus` | `short` | `{{state}}` |
| Region Balancer Datanode Stability | `sum by (state) (greptime_region_balancer_datanode_stability)` | `stat` | Region balancer datanode stability statistics by state | `prometheus` | `binBps` | `{{state}}` |
-| Auto Repartition Actions | `sum by (result) (changes(greptime_auto_repartition_actions_total[$__rate_interval]))` | `timeseries` | Auto repartition action count by result | `prometheus` | `short` | `{{result}}` |
-| Auto Repartition Gate Stops | `sum by (gate, reason) (changes(greptime_auto_repartition_gate_stop_total[$__rate_interval]))` | `timeseries` | Auto repartition gate stop count by gate and reason | `prometheus` | `short` | `{{gate}} / {{reason}}` |
+| Auto Repartition Actions | `sum by (result) (increase(greptime_auto_repartition_actions_total[$__rate_interval]))` | `timeseries` | Auto repartition action count by result | `prometheus` | `short` | `{{result}}` |
+| Auto Repartition Gate Stops | `sum by (gate, reason) (
+ increase(greptime_auto_repartition_gate_stop_total{reason!="invalid_baseline"}[$__rate_interval])
+ or
+ (increase(greptime_auto_repartition_gate_stop_total{reason="invalid_baseline"}[$__rate_interval])
+ unless ignoring (gate, reason)
+ increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))
+)` `sum by (reason) (increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))` | `timeseries` | Repartition gate stop increments. Baseline failures show detailed reasons when available; otherwise the aggregate invalid_baseline series is retained. Fallback is matched per source before aggregation to avoid double counting across mixed versions. | `prometheus` | `short` | `{{gate}} / {{reason}}` |
| Auto Repartition Sampling P99 | `histogram_quantile(0.99, sum by (le, stage) (rate(greptime_auto_repartition_sampling_elapsed_bucket[$__rate_interval])))` | `timeseries` | Auto repartition sampling elapsed time by stage | `prometheus` | `s` | `{{stage}}` |
| Auto Repartition Executor P99 | `histogram_quantile(0.99, sum by (le, stage) (rate(greptime_auto_repartition_executor_elapsed_bucket[$__rate_interval])))` | `timeseries` | Auto repartition executor elapsed time by stage | `prometheus` | `s` | `{{stage}}` |
# Object Store
diff --git a/grafana/dashboards/metrics/standalone/dashboard.yaml b/grafana/dashboards/metrics/standalone/dashboard.yaml
index 7f70dba0364..308320ab568 100644
--- a/grafana/dashboards/metrics/standalone/dashboard.yaml
+++ b/grafana/dashboards/metrics/standalone/dashboard.yaml
@@ -1904,7 +1904,7 @@ groups:
queries:
- expr: |-
sum by (result) (
- changes(greptime_region_balancer_actions_total[$__rate_interval])
+ increase(greptime_region_balancer_actions_total[$__rate_interval])
)
datasource:
type: prometheus
@@ -1915,7 +1915,7 @@ groups:
description: Region balancer gate stop count by gate and reason
unit: short
queries:
- - expr: sum by (gate, reason) (changes(greptime_region_balancer_gate_stop_total[$__rate_interval]))
+ - expr: sum by (gate, reason) (increase(greptime_region_balancer_gate_stop_total[$__rate_interval]))
datasource:
type: prometheus
uid: ${metrics}
@@ -1955,21 +1955,33 @@ groups:
description: Auto repartition action count by result
unit: short
queries:
- - expr: sum by (result) (changes(greptime_auto_repartition_actions_total[$__rate_interval]))
+ - expr: sum by (result) (increase(greptime_auto_repartition_actions_total[$__rate_interval]))
datasource:
type: prometheus
uid: ${metrics}
legendFormat: '{{result}}'
- title: Auto Repartition Gate Stops
type: timeseries
- description: Auto repartition gate stop count by gate and reason
+ description: Repartition gate stop increments. Baseline failures show detailed reasons when available; otherwise the aggregate invalid_baseline series is retained. Fallback is matched per source before aggregation to avoid double counting across mixed versions.
unit: short
queries:
- - expr: sum by (gate, reason) (changes(greptime_auto_repartition_gate_stop_total[$__rate_interval]))
+ - expr: |-
+ sum by (gate, reason) (
+ increase(greptime_auto_repartition_gate_stop_total{reason!="invalid_baseline"}[$__rate_interval])
+ or
+ (increase(greptime_auto_repartition_gate_stop_total{reason="invalid_baseline"}[$__rate_interval])
+ unless ignoring (gate, reason)
+ increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))
+ )
datasource:
type: prometheus
uid: ${metrics}
legendFormat: '{{gate}} / {{reason}}'
+ - expr: sum by (reason) (increase(greptime_auto_repartition_invalid_baseline_total[$__rate_interval]))
+ datasource:
+ type: prometheus
+ uid: ${metrics}
+ legendFormat: baseline / {{reason}}
- title: Auto Repartition Sampling P99
type: timeseries
description: Auto repartition sampling elapsed time by stage
diff --git a/licenserc-enterprise.toml b/licenserc-enterprise.toml
index d11d344b64d..939346f5cba 100644
--- a/licenserc-enterprise.toml
+++ b/licenserc-enterprise.toml
@@ -15,6 +15,7 @@ headerPath = "licenses/enterprise-header.txt"
# with the "# enterprise" block in `licenserc.toml`'s `excludes` — both are
# enforced by `make check-enterprise-license`.
includes = [
+ "src/datatypes/src/schema/sketch.rs",
"src/common/meta/src/rpc/ddl/trigger.rs",
"src/operator/src/expr_helper/trigger.rs",
"src/sql/src/statements/alter/trigger.rs",
@@ -25,6 +26,12 @@ includes = [
"src/sql/src/parsers/create_parser/trigger.rs",
"src/sql/src/parsers/show_parser/trigger.rs",
"src/mito2/src/extension.rs",
+ "src/mito2/src/compaction/multi_region.rs",
+ "src/mito2/src/compaction/multi_region/source.rs",
+ "src/mito2/src/compaction/multi_region/memory.rs",
+ "src/mito2/src/compaction/multi_region/worker.rs",
+ "src/mito2/src/compaction/multi_region/writer.rs",
+ "src/mito2/src/compaction/multi_region/tests.rs",
"src/common/function/src/admin/purge_table.rs",
"src/catalog/src/system_schema/information_schema/recycle_bin.rs",
"src/common/meta/src/ddl/purge_dropped_table.rs",
diff --git a/licenserc.toml b/licenserc.toml
index 42e6464017c..e601ca6f7c1 100644
--- a/licenserc.toml
+++ b/licenserc.toml
@@ -31,6 +31,7 @@ excludes = [
# Keep this list in sync with that file's `includes`; enforced by
# `make check-enterprise-license`.
# enterprise:start
+ "src/datatypes/src/schema/sketch.rs",
"src/common/meta/src/rpc/ddl/trigger.rs",
"src/operator/src/expr_helper/trigger.rs",
"src/sql/src/statements/alter/trigger.rs",
@@ -41,6 +42,12 @@ excludes = [
"src/sql/src/parsers/create_parser/trigger.rs",
"src/sql/src/parsers/show_parser/trigger.rs",
"src/mito2/src/extension.rs",
+ "src/mito2/src/compaction/multi_region.rs",
+ "src/mito2/src/compaction/multi_region/source.rs",
+ "src/mito2/src/compaction/multi_region/memory.rs",
+ "src/mito2/src/compaction/multi_region/worker.rs",
+ "src/mito2/src/compaction/multi_region/writer.rs",
+ "src/mito2/src/compaction/multi_region/tests.rs",
"src/common/function/src/admin/purge_table.rs",
"src/catalog/src/system_schema/information_schema/recycle_bin.rs",
"src/common/meta/src/ddl/purge_dropped_table.rs",
diff --git a/src/api/src/v1/column_def.rs b/src/api/src/v1/column_def.rs
index b1d2f0841d5..a7fd7fe4ad4 100644
--- a/src/api/src/v1/column_def.rs
+++ b/src/api/src/v1/column_def.rs
@@ -280,6 +280,52 @@ pub fn as_skipping_index_type(skipping_index_type: PbSkippingIndexType) -> Skipp
}
}
+/// Converts fulltext options for a JSON2 type hint to the wire representation.
+pub fn json_fulltext_options_to_proto(
+ options: FulltextOptions,
+) -> crate::v1::JsonFulltextIndexOptions {
+ crate::v1::JsonFulltextIndexOptions {
+ analyzer: match options.analyzer {
+ FulltextAnalyzer::English => Analyzer::English.into(),
+ FulltextAnalyzer::Chinese => Analyzer::Chinese.into(),
+ },
+ case_sensitive: options.case_sensitive,
+ backend: match options.backend {
+ FulltextBackend::Bloom => PbFulltextBackend::Bloom.into(),
+ FulltextBackend::Tantivy => PbFulltextBackend::Tantivy.into(),
+ },
+ granularity: options.granularity,
+ false_positive_rate: options.false_positive_rate(),
+ }
+}
+
+/// Validates fulltext options received for a JSON2 type hint.
+/// The presence of these options enables the fulltext index.
+pub fn json_fulltext_options_from_proto(
+ options: crate::v1::JsonFulltextIndexOptions,
+) -> datatypes::error::Result {
+ let analyzer = Analyzer::try_from(options.analyzer).map_err(|_| {
+ datatypes::error::InvalidFulltextOptionSnafu {
+ msg: format!("Unknown fulltext analyzer: {}", options.analyzer),
+ }
+ .build()
+ })?;
+ let backend = PbFulltextBackend::try_from(options.backend).map_err(|_| {
+ datatypes::error::InvalidFulltextOptionSnafu {
+ msg: format!("Unknown fulltext backend: {}", options.backend),
+ }
+ .build()
+ })?;
+ FulltextOptions::new(
+ true,
+ as_fulltext_option_analyzer(analyzer),
+ options.case_sensitive,
+ as_fulltext_option_backend(backend),
+ options.granularity,
+ options.false_positive_rate,
+ )
+}
+
/// Validates skipping options received for a JSON2 type hint.
pub fn json_skipping_options_from_proto(
options: crate::v1::JsonSkippingIndexOptions,
@@ -299,7 +345,6 @@ pub fn json_skipping_options_from_proto(
#[cfg(test)]
mod tests {
-
use common_base::readable_size::ReadableSize;
use datatypes::data_type::ConcreteDataType;
use datatypes::schema::{CompressionOptions, FulltextAnalyzer, FulltextBackend};
@@ -307,6 +352,26 @@ mod tests {
use super::*;
use crate::v1::ColumnDataType;
+ #[test]
+ fn json_fulltext_options_roundtrip() {
+ for backend in [FulltextBackend::Bloom, FulltextBackend::Tantivy] {
+ let options =
+ FulltextOptions::new(true, FulltextAnalyzer::Chinese, true, backend, 8, 0.05)
+ .unwrap();
+ let wire = json_fulltext_options_to_proto(options.clone());
+ assert_eq!(options, json_fulltext_options_from_proto(wire).unwrap());
+ let mut invalid = wire;
+ invalid.backend = 99;
+ assert!(json_fulltext_options_from_proto(invalid).is_err());
+ let mut invalid = wire;
+ invalid.analyzer = 99;
+ assert!(json_fulltext_options_from_proto(invalid).is_err());
+ let mut invalid = wire;
+ invalid.granularity = 0;
+ assert!(json_fulltext_options_from_proto(invalid).is_err());
+ }
+ }
+
#[test]
fn test_try_as_column_schema() {
let column_def = ColumnDef {
diff --git a/src/catalog/src/information_extension.rs b/src/catalog/src/information_extension.rs
index 0c572eac562..259e98e70e7 100644
--- a/src/catalog/src/information_extension.rs
+++ b/src/catalog/src/information_extension.rs
@@ -25,11 +25,15 @@ use common_meta::rpc::procedure;
use common_procedure::{ProcedureInfo, ProcedureState};
use common_query::request::QueryRequest;
use common_recordbatch::adapter::{AsyncRecordBatchStreamAdapter, DfRecordBatchStreamAdapter};
+use common_recordbatch::filter::MetadataFilter;
use common_recordbatch::util::{ChainedRecordBatchStream, LimitedRecordBatchStream};
-use common_recordbatch::{DfSendableRecordBatchStream, SendableRecordBatchStream};
-use datafusion::common::Result;
+use common_recordbatch::{
+ DfSendableRecordBatchStream, EmptyRecordBatchStream, SendableRecordBatchStream,
+};
use datafusion::common::tree_node::TreeNodeRecursion;
+use datafusion::common::{Result, ScalarValue};
use datafusion::execution::TaskContext;
+use datafusion::logical_expr::LogicalPlan;
use datafusion::physical_expr::{EquivalenceProperties, Partitioning, PhysicalExpr};
use datafusion::physical_plan::execution_plan::{Boundedness, EmissionType};
use datafusion::physical_plan::{DisplayAs, DisplayFormatType, ExecutionPlan, PlanProperties};
@@ -38,10 +42,13 @@ use datatypes::schema::SchemaRef;
use futures_util::future::try_join_all;
use meta_client::MetaClientRef;
use snafu::ResultExt;
+use store_api::compaction_task;
use store_api::storage::RegionId;
use crate::error;
-use crate::information_schema::{DatanodeInspectRequest, InformationExtension};
+use crate::information_schema::{
+ DatanodeInspectKind, DatanodeInspectRequest, InformationExtension,
+};
pub struct DistributedInformationExtension {
meta_client: MetaClientRef,
@@ -60,18 +67,53 @@ impl DistributedInformationExtension {
meta_client: MetaClientRef,
datanode_manager: DatanodeManagerRef,
request: DatanodeInspectRequest,
- ) -> std::result::Result {
+ ) -> crate::error::Result {
let nodes = meta_client
.list_nodes(Some(Role::Datanode))
.await
.map_err(BoxedError::new)
.context(crate::error::ListNodesSnafu)?;
+ Self::inspect_nodes(datanode_manager, request, nodes).await
+ }
+ /// Executes inspection against discovered nodes after applying safe node pruning.
+ async fn inspect_nodes(
+ datanode_manager: DatanodeManagerRef,
+ request: DatanodeInspectRequest,
+ nodes: Vec,
+ ) -> crate::error::Result {
+ let nodes = prune_compaction_nodes(&request, nodes);
let limit = request.scan.limit;
let plan = request
.build_plan()
.context(crate::error::DatafusionSnafu)?;
+ let stream = Self::inspect_query_nodes(datanode_manager, plan, nodes).await?;
+ match limit {
+ Some(limit) => Ok(Box::pin(LimitedRecordBatchStream::new(stream, limit))),
+ None => Ok(stream),
+ }
+ }
+ async fn inspect_query_stream(
+ meta_client: MetaClientRef,
+ datanode_manager: DatanodeManagerRef,
+ plan: LogicalPlan,
+ ) -> crate::error::Result {
+ let nodes = meta_client
+ .list_nodes(Some(Role::Datanode))
+ .await
+ .map_err(BoxedError::new)
+ .context(crate::error::ListNodesSnafu)?;
+ Self::inspect_query_nodes(datanode_manager, plan, nodes).await
+ }
+
+ /// Shares query dispatch and empty-stream schema handling for scans and query plans.
+ async fn inspect_query_nodes(
+ datanode_manager: DatanodeManagerRef,
+ plan: LogicalPlan,
+ nodes: Vec,
+ ) -> crate::error::Result {
+ let schema = inspection_query_schema(&plan)?;
let streams = try_join_all(nodes.into_iter().map(|node| {
let datanode_manager = datanode_manager.clone();
let plan = plan.clone();
@@ -91,20 +133,55 @@ impl DistributedInformationExtension {
}))
.await?;
- let chained =
- ChainedRecordBatchStream::new(streams).context(crate::error::CreateRecordBatchSnafu)?;
- match limit {
- Some(limit) => Ok(Box::pin(LimitedRecordBatchStream::new(
- Box::pin(chained),
- limit,
- ))),
- None => Ok(Box::pin(chained)),
- }
+ chain_inspection_streams(streams, schema)
}
}
+fn inspection_query_schema(plan: &LogicalPlan) -> crate::error::Result {
+ datatypes::schema::Schema::try_from(plan.schema().clone())
+ .map(Arc::new)
+ .map_err(|error| datafusion::common::DataFusionError::External(Box::new(error)))
+ .context(crate::error::DatafusionSnafu)
+}
+
+fn chain_inspection_streams(
+ streams: Vec,
+ schema: SchemaRef,
+) -> crate::error::Result {
+ if streams.is_empty() {
+ return Ok(Box::pin(EmptyRecordBatchStream::new(schema)));
+ }
+ Ok(Box::pin(
+ ChainedRecordBatchStream::new(streams).context(crate::error::CreateRecordBatchSnafu)?,
+ ))
+}
+
+#[derive(Debug, Clone)]
+enum InspectPlan {
+ Scan(DatanodeInspectRequest),
+ Query(LogicalPlan),
+}
+
+/// Prunes reporting nodes only for live compaction inspection. Region routes cannot
+/// locate tasks left on a former owner, so only known node IDs can exclude nodes.
+fn prune_compaction_nodes(request: &DatanodeInspectRequest, nodes: Vec) -> Vec {
+ if request.kind != DatanodeInspectKind::CompactionTasks {
+ return nodes;
+ }
+ let filter = MetadataFilter::new(&request.scan.filters);
+ nodes
+ .into_iter()
+ .filter(|node| {
+ filter.matches(|name| {
+ (name == compaction_task::NODE_ID)
+ .then_some(ScalarValue::UInt64(Some(node.peer.id)))
+ })
+ })
+ .collect()
+}
+
struct DistributedInspectExec {
- request: DatanodeInspectRequest,
+ plan: InspectPlan,
meta_client: MetaClientRef,
datanode_manager: DatanodeManagerRef,
schema: SchemaRef,
@@ -115,7 +192,7 @@ struct DistributedInspectExec {
impl std::fmt::Debug for DistributedInspectExec {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("DistributedInspectExec")
- .field("request", &self.request)
+ .field("plan", &self.plan)
.field("schema", &self.schema)
.finish_non_exhaustive()
}
@@ -127,6 +204,20 @@ impl DistributedInspectExec {
schema: SchemaRef,
meta_client: MetaClientRef,
datanode_manager: DatanodeManagerRef,
+ ) -> Self {
+ Self::with_plan(
+ InspectPlan::Scan(request),
+ schema,
+ meta_client,
+ datanode_manager,
+ )
+ }
+
+ fn with_plan(
+ plan: InspectPlan,
+ schema: SchemaRef,
+ meta_client: MetaClientRef,
+ datanode_manager: DatanodeManagerRef,
) -> Self {
let arrow_schema = schema.arrow_schema().clone();
let properties = Arc::new(PlanProperties::new(
@@ -136,7 +227,7 @@ impl DistributedInspectExec {
Boundedness::Bounded,
));
Self {
- request,
+ plan,
meta_client,
datanode_manager,
schema,
@@ -148,11 +239,19 @@ impl DistributedInspectExec {
impl DisplayAs for DistributedInspectExec {
fn fmt_as(&self, _t: DisplayFormatType, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(
- f,
- "DistributedInspectExec: kind={:?}, scan={}, schema={:?}",
- self.request.kind, self.request.scan, self.arrow_schema
- )
+ match &self.plan {
+ InspectPlan::Scan(request) => write!(
+ f,
+ "DistributedInspectExec: kind={:?}, scan={}, schema={:?}",
+ request.kind, request.scan, self.arrow_schema
+ ),
+ InspectPlan::Query(plan) => write!(
+ f,
+ "DistributedInspectExec: query={}, schema={:?}",
+ plan.display_indent(),
+ self.arrow_schema
+ ),
+ }
}
}
@@ -207,15 +306,27 @@ impl ExecutionPlan for DistributedInspectExec {
let meta_client = self.meta_client.clone();
let datanode_manager = self.datanode_manager.clone();
- let request = self.request.clone();
+ let plan = self.plan.clone();
let schema = self.schema.clone();
let future = async move {
- DistributedInformationExtension::inspect_datanode_stream(
- meta_client,
- datanode_manager,
- request,
- )
- .await
+ match plan {
+ InspectPlan::Scan(request) => {
+ DistributedInformationExtension::inspect_datanode_stream(
+ meta_client,
+ datanode_manager,
+ request,
+ )
+ .await
+ }
+ InspectPlan::Query(plan) => {
+ DistributedInformationExtension::inspect_query_stream(
+ meta_client,
+ datanode_manager,
+ plan,
+ )
+ .await
+ }
+ }
.map_err(BoxedError::new)
.context(common_recordbatch::error::ExternalSnafu)
};
@@ -299,6 +410,23 @@ impl InformationExtension for DistributedInformationExtension {
.await
}
+ fn supports_inspect_query_plan(&self) -> bool {
+ true
+ }
+
+ fn inspect_datanode_query_plan(
+ &self,
+ plan: LogicalPlan,
+ ) -> crate::error::Result