tidaldb/tidalctl/Cargo.toml
jx12n a946c6128c fix(m12-rc13): read-SLA collapse + WAL_RETENTION_SEGMENTS 16 + tidalctl S3 DR
Read-SLA fix (rc12→rc13 — cpu-cgroup starvation → multi-second p99 + churning
elections):
- offload.rs: add SEARCH_GATE semaphore (core_count+1 permits, 50ms shed to 429)
  so per-shard searches gate on CPU, not reactor threads; concurrent scatter_merge
  fan-out (join_all) replaces the serial blocking offload_region_read loop
- node.rs: scatter_merge → async; per-shard futures run via offload_search
  (each acquires one SEARCH_GATE permit, moves it into spawn_blocking so the
  permit is held for the search's full CPU lifetime)
- main.rs: explicit tokio runtime with worker_threads floored at 4, independent
  of the cgroup quota — keeps the control plane (heartbeat/election/apply) on its
  own workers even when quota < 4
- k8s statefulset: CPU limit 2→3 (was: available_parallelism()=2 → only 2 async
  workers; search burst starved the reactor)
- tidal/wal/compaction.rs: WAL_RETENTION_SEGMENTS 4→16 (64 MiB→256 MiB per-shard
  catch-up window; a briefly-down follower across a rolling restart streams up
  instead of forcing snapshot reseed; disk floor 768 MiB/pod, self-trimming)
- cluster_reseed.rs: OFFLINE_ITEMS 1800→5600 to exceed the new 16-segment
  retention window (19 segs > 17); fix sequential quarantine/reseed race via
  await_status_bool

tidalctl S3/R2 backup DR:
- tidalctl/Cargo.toml: aws-config, aws-sdk-s3, aws-credential-types, tokio, tempfile
- commands/s3.rs: S3Target + export_dir (upload every file, manifest last as
  atomicity marker) + import_to_dir (download prefix into temp staging dir)
- commands/backup.rs: run_backup/run_restore accept Option<&S3Target>; S3 export
  is additive after local fsync barrier; S3 import stages into TempDir then runs
  the unchanged verified restore on it
- main.rs: --s3-endpoint / --s3-bucket / --s3-prefix flags; all-or-nothing
  endpoint+bucket validation; usage updated

tidal-stress/k8s: recall-rc12-spread-job, soak-nightly-cronjob, soak-monitor,
soak-results-pvc, t5-readtput-job manifests
2026-06-17 15:47:37 -06:00

65 lines
3.2 KiB
TOML

[package]
name = "tidalctl"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
description = "Command-line inspector for embedded tidalDB instances"
license.workspace = true
# ── tidal-crate lint posture (single source of truth) ──────────────────────
# IDENTICAL block across tidaldb / tidal-net / tidal-server / tidalctl. These
# crates deliberately DO NOT inherit `[workspace.lints]`; they hold the embedded
# recommendation DB + its transport/server/CLI to a stricter correctness bar
# (`unsafe_code = forbid`, `clippy::all = deny`, `unwrap_used = deny`).
# `unwrap_used = "deny"` is kept per-crate rather than in `[workspace.lints]`
# because the workspace also hosts the example/consumer crates under
# `applications/` (not held to the engine's bar). Keep these four blocks BYTE-IDENTICAL.
[lints.rust]
unsafe_code = "forbid"
[lints.clippy]
all = { level = "deny", priority = -1 }
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
# Justified allows (lossy numeric casts are pervasive + intentional in the
# ranking/scoring math; module_name_repetitions is idiomatic for the flat
# module layout documented in CLAUDE.md):
cast_possible_truncation = "allow"
module_name_repetitions = "allow"
unwrap_used = "deny"
[dependencies]
tidaldb = { path = "../tidal" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# Backup/restore manifest integrity (m11p8) — the same hash the engine verifies
# WAL segments and snapshot artifacts with, so a tidalctl-written manifest and an
# engine-verified one agree.
blake3 = "1"
# Object-store (S3-compatible) export/import for the DR gate (m11p8 R2). Chosen
# over `rust-s3` because the AWS SDK shares the workspace's existing
# hyper/rustls/tokio tree (no native-tls / second TLS stack), and R2 is handled
# with `.endpoint_url(<account>.r2.cloudflarestorage.com)` + `.force_path_style`.
# `default-features = false` + `rustls` keeps the TLS stack aligned with the rest
# of the workspace (reqwest is already `rustls-tls`); `behavior-version-latest`
# pins the SDK behavior contract so an SDK minor bump can't silently change it.
aws-config = { version = "1.8", default-features = false, features = ["behavior-version-latest", "rustls"] }
# `rt-tokio` exposes `ByteStream::from_path` (stream a file body straight off
# disk on `put_object` — no whole-file read into memory).
aws-sdk-s3 = { version = "1.137", default-features = false, features = ["behavior-version-latest", "rustls", "rt-tokio"] }
# `hardcoded-credentials` exposes `Credentials::from_keys` so the env-var creds
# (AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY) become a static SigV4 provider.
aws-credential-types = { version = "1.2", features = ["hardcoded-credentials"] }
# S3 transfers run on a locally-built current-thread runtime ONLY when an --s3-*
# flag is given; the local-dir backup/restore path stays fully synchronous.
tokio = { version = "1", default-features = false, features = ["rt", "macros"] }
# Fresh staging dir for an S3 import (downloaded prefix -> temp dir -> the
# UNCHANGED verified restore reads it). Reaped when the restore returns.
tempfile = "3"
[dev-dependencies]
tidaldb = { path = "../tidal", features = ["test-utils"] }
[[test]]
name = "cli"