Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements an embedded RocksDB storage backend for the Ray GCS as part of the REP-64 proof of concept, including Bazel build updates, the RocksDbStoreClient class, and various test harnesses. The review feedback highlights critical performance concerns regarding synchronous I/O operations blocking the main event loop and suggests offloading these tasks to a background thread pool. Other recommendations include using MultiGet in AsyncBatchDelete for efficiency, improving the robustness of job counter recovery, and reducing mutex contention during column family creation.
a193a06 to
58e33f7
Compare
455be22 to
065a6ad
Compare
…concept
Proof of concept for REP-64 (Embedded GCS Storage Backend). Not a
feature merge — the dossier under rep-64-poc/ is the load-bearing
artifact: per-claim verdicts, reproducible evidence, and a
production-hardening backlog.
Core code changes (the bits that would land in a real merge):
bazel/BUILD.rocksdb (new)
Drives RocksDB's CMake build via rules_foreign_cc, all optional
features OFF, CMAKE_INSTALL_LIBDIR=lib for cross-distro portability.
bazel/ray_deps_setup.bzl
Adds @com_github_facebook_rocksdb (v9.11.2, SHA pinned, GitHub
release tarball).
src/ray/gcs/store_client/rocksdb_store_client.{h,cc} (new)
Full StoreClient implementation. All 9 methods. Mutex-RMW
GetNextJobID. Sync writes via WriteOptions::sync = true.
Cluster-ID marker plumbing (skipped when cluster_id is empty —
see Phase 3 report for the K8s deferral rationale).
src/ray/gcs/gcs_server.{h,cc}
Adds StorageType::ROCKSDB_PERSIST + kRocksDbStorage = "rocksdb",
new init paths in both gcs_table_storage construction and
InitKVManager. Passes empty cluster_id because Ray's GCS init
order makes a real cluster_id unavailable at this point —
fully written up in rep-64-poc/reports/phase-3-skeleton.md.
src/ray/common/ray_config_def.h
Adds RAY_CONFIG(std::string, gcs_storage_path, "") for the
RAY_GCS_STORAGE_PATH env var.
src/ray/gcs/BUILD.bazel + src/ray/gcs/store_client/BUILD.bazel
Adds rocksdb_store_client cc_library and wires it into the
gcs_server lib's deps.
src/ray/gcs/store_client/tests/{rocksdb_smoke_test.cc,
rocksdb_store_client_test.cc} (new)
Phase 2 + Phase 3 walking-skeleton tests: cluster-ID marker,
PutGet roundtrip, RecoverAcrossReopen, JobID monotonicity.
Verification on this VM (Bazel 7.5.0, GCC 11, ext4 on /dev/sda3):
bazel build //src/ray/gcs:gcs_server OK
bazel test //src/ray/gcs/store_client/tests:rocksdb_smoke_test PASS
bazel test //src/ray/gcs/store_client/tests:rocksdb_store_client_test PASS (4/4)
bazel test //rep-64-poc/harness/concurrency:concurrency_test PASS (4/4)
bazel test //rep-64-poc/harness/store_client_parity:rocksdb_parity_test PASS (StoreClientTestBase)
Binary size impact: gcs_server grows from 23.8 MB → 38.4 MB unstripped
(16.5 MB → 26.9 MB stripped). Well under the PLAN's 50 MB pivot.
POC dossier (rep-64-poc/):
EVIDENCE.md single-page claim-to-evidence map (read first)
README.md orientation
RISKS.md live risk register, end-of-POC status per row
PLAN.md the up-front 9-phase plan
reports/phase-N-*.md 9 phase reports: claim, method, result,
skepticism, repro, pivot decision
harness/ every test / benchmark / reproducer the POC
produced (docker-compose, durability/kill9,
concurrency, microbench, recovery, kind, cloud)
reproducers/README.md one-command repros for everything
Three findings highlighted up-front in EVIDENCE.md:
1. The REP's "0.01-0.1 ms RocksDB write" claim is misleading. That's
a memtable-only number; sync-on-write is fsync-bounded at
3.81 ms p50 on probe-verified ext4. Reads remain 0.01-0.1 ms class
as claimed.
2. The cluster-ID-mismatch fail-fast story (REP "Stale data
protection") cannot be implemented as drawn. Ray's GCS init order
has InitKVManager() before GetOrGenerateClusterId(), and the
persisted ID *is* the cluster ID — there's nothing to mismatch
against. PVC-mismatch detection requires an external authoritative
source (K8s downward API). Deferred to a follow-on PR with the
deferral honestly documented.
3. Binary size impact is well under the PLAN's 50 MB pivot trigger.
+6.6 MB stripped on gcs_server.
Pending follow-ons (not blockers for the POC; documented in
EVIDENCE.md and per-phase reports):
- Build a Ray container image from this branch to unblock the
actor-survival end-to-end test, K8s pod-delete recovery timing,
and full Redis-vs-RocksDB head-to-head.
- TSAN / ASAN runs of the test targets on a Ray-CI-toolchain host.
- Cloud-volume substrate sweep (EBS / GCE PD) via collaborator
running cloud_fsync_check.sh.
- drop_caches-equipped variants of Phase 4 / Phase 8 on a host
with sudo.
- Multi-threaded-writer microbench variant (Phase 7 v2) for
group-commit aggregate-throughput benefit.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: Santosh Jha <[email protected]>
…r counter parse Two fixes to RocksDbStoreClient based on the automated review on PR ray-project#63032: - AsyncBatchDelete: replace per-key Get with a single MultiGet so the existence probe runs in one I/O round instead of N. Mirrors the structure of AsyncMultiGet. - Constructor counter recovery: parse with std::stoll plus an explicit int-range check so an overflowed-or-corrupt counter on disk produces a clear FATAL instead of an unrecoverable std::out_of_range. Catch std::exception (not bare ...) for clearer diagnostics. Drop the redundant job_id_mutex_ lock — the constructor runs before any other thread can observe `this`. Verified locally: bazel test //src/ray/gcs/store_client/tests:rocksdb_store_client_test PASS (0.9s) bazel test //rep-64-poc/harness/store_client_parity:rocksdb_parity_test PASS (116.9s) bazel test //rep-64-poc/harness/concurrency:concurrency_test PASS (172.1s) Two other points from the same review (sync I/O on the GCS event loop; cf_mutex_ contention during CreateColumnFamily) are intentionally left as-is for the POC and discussed in the PR review-comment replies. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Santosh Jha <[email protected]>
Two failing checks on PR ray-project#63032: buildkite/microcheck — lint phase failing on three sub-jobs: * clang_format: ~10 of the new POC C++ files (in rep-64-poc/harness/ and src/ray/gcs/store_client/) had formatting drift from the project's clang-format style. Reformat in place; no semantic changes. * copyright_format: rocksdb_smoke_test.cc was missing the Apache 2.0 copyright header that ci/lint/copyright-format.sh requires for *.cc / *.h under src/. Header added. * pre_commit: black + ruff caught a few items in the Python harness scripts: - probe_fsync.py: 3x lambda-assignments (E731) -> def - run_recovery.py: unused `populate` variable (F841) - bench.py / test_rocksdb_recovery.py: unused imports (F401) - black reformat across 4 harness scripts Plus end-of-file-fixer added trailing newlines to three result JSON files. docs/readthedocs.com:anyscale-ray — RTD build failing because intersphinx fetch of pytorch.org/docs/stable/objects.inv now 404s, and Sphinx is run with -W (warning-as-error). Cherry-pick the fix applied upstream in ray-project#63038 (commit beea531): repoint torch's intersphinx mapping to docs.pytorch.org/docs/2.7/objects.inv, which matches Ray's runtime torch pin. Verified locally: ci/lint/copyright-format.sh -c PASS ci/lint/check-git-clang-format-output.sh PASS pre-commit run --files <touched> PASS (pydoclint skipped — local Python is 3.9 but pydoclint needs 3.10+; CI runs it on a 3.10+ image) ruff / buildifier / black PASS No production code logic changed. Diff is purely formatting + copyright + the doc-conf intersphinx-URL fix. Signed-off-by: Santosh Jha <[email protected]>
Addresses gemini-bot review comment id 3165761812 (high priority):
the inline path runs RocksDB ops (including the WAL fsync ~3.8 ms
on probe-verified ext4) on the GCS event loop, blocking other RPCs.
This change adds a *second* execution path, gated by a new config
flag, so maintainers can compare both modes empirically before
choosing one for production:
* gcs_rocksdb_async_offload (bool, default false)
false -> current behaviour: each Async* runs inline, callback
posts to io_service. Easiest to reason about; matches
InMemoryStoreClient.
true -> RocksDB work posts to a boost::asio::thread_pool;
callback still posts to io_service. RocksDB's group
commit aggregates concurrent writers into one fsync,
so aggregate write throughput scales with pool size.
* gcs_rocksdb_io_pool_size (uint32, default 4)
Worker count for the offload pool. Ignored when offload is off.
Clamped to >= 1 if a misconfigured 0 ever reaches us.
Implementation:
* RocksDbStoreClient ctor takes new offload_io + io_pool_size
args (defaulted so existing tests are source-compatible).
* Single private RunIo(work) helper centralises the dispatch
branch — every AsyncXxx wraps its body in RunIo so the
inline/offloaded fork lives in exactly one place.
* Destructor explicitly stops+joins the pool BEFORE walking the
cf-handle map, so an in-flight pool task can't dereference a
destroyed handle.
* gcs_server.cc passes the two config values through at both
construction sites.
* Tests:
OffloadPathRoundtripsAcrossPoolThreads — 64 Puts then 64
Gets through a 4-thread pool, all values verified.
OffloadPathDestructorJoinsBeforeDbClose — 16 Puts via pool,
immediate dtor, reopen + read confirms durability and
proves the join completes (would deadlock otherwise).
* BUILD: rocksdb_store_client now deps on @boost//:asio.
Phase 7 microbench updates and PR-comment reply with side-by-side
numbers come in follow-up commits.
Verified locally:
bazel test //src/ray/gcs/store_client/tests:rocksdb_store_client_test
-> 6/6 PASS in 1.1 s (4 original + 2 new offload tests)
bazel test //rep-64-poc/harness/store_client_parity:rocksdb_parity_test
-> StoreClientTestBase PASS in 113 s (inline path unchanged)
bazel test //rep-64-poc/harness/concurrency:concurrency_test
-> 4/4 PASS in 147 s (inline path unchanged)
bazel build //src/ray/gcs/store_client:rocksdb_store_client
-> compiles clean, no warnings
Signed-off-by: Santosh Jha <[email protected]>
Extends the microbench with --include-offload, --io-pool-size, and
--sequential flags so the two execution paths added in e710272d can
be measured side-by-side. Per-op timing now captures end-to-end
(issue -> callback) latency rather than issue-only, which is the only
fair comparison for the offload path (issue-only timing makes it
look ~5000x faster than it really is — that's just enqueue cost).
Two regimes, because they answer different questions:
Sequential (--sequential, one in-flight at a time):
rocksdb_inline 211.9 ops/s, p50 3.78 ms
rocksdb_offload 213.5 ops/s, p50 3.82 ms
-> Per-op latency identical within noise. Offload adds ~40 us
dispatch overhead, dwarfed by the 3.8 ms fsync.
Pipelined (default, issuer fires back-to-back):
rocksdb_inline 215.5 ops/s
rocksdb_offload 535.2 ops/s (2.5x throughput)
-> Group commit aggregates concurrent fsyncs once there are
multiple in-flight writers.
Phase 7 report (reports/phase-7-microbench.md) gains a section
"Inline vs offload-IO path" with both tables and the maintainer-
decision framing the gemini comment asks for. JSON files for both
runs land under results/ for reproducibility.
The pipelined-mode p50 of 9.2 s in the offload row is a queue-
saturation artifact (issuer >> drain rate), not a per-op cost;
explicitly called out in the report so a reader doesn't misread it
as a regression.
Followups (will address in a separate commit):
- multi-threaded-writer mode (Phase 7 v2) so we can measure the
group-commit benefit without the queue-saturation artifact
- bounded-inflight throttle so pipelined mode reports honest tail
latency
Verified locally:
bazel build -c opt //rep-64-poc/harness/microbench:storage_microbench
-> compiles clean
./storage_microbench --include-offload --sequential
-> see numbers above (reproducible)
Signed-off-by: Santosh Jha <[email protected]>
Three small lint fixes after rebasing onto upstream/master (this is
what was failing in microcheck build 44632):
clang-format (line-break before-vs-after `<<` differs):
src/ray/gcs/store_client/rocksdb_store_client.cc
rep-64-poc/harness/microbench/storage_microbench.cc
buildifier (trailing comma + visibility-attribute order):
bazel/ray_deps_setup.bzl
rep-64-poc/harness/durability/kill9/BUILD.bazel
No semantic changes. Verified locally:
ci/lint/git-clang-format --commit upstream/master --diff -> clean
buildifier --mode=check on changed files -> clean
python3 -m black --check (22.10.0, the pinned version) -> clean
python3 -m ruff check -> clean
Signed-off-by: Santosh Jha <[email protected]>
Signed-off-by: Santosh Jha <[email protected]>
Pre-commit clang-format (microcheck build 44683 step "pre_commit") flagged the AsyncGet call in OffloadPathRoundtripsAcrossPoolThreads. Local ci/lint/check-git-clang-format-output.sh missed it because that script only diffs against the parent commit; pre-commit runs on all files. This commit applies the exact diff suggested by the CI's clang-format hook. Verified locally: pre-commit run clang-format --all-files -> Passed Signed-off-by: Santosh Jha <[email protected]>
Runs every test script in sequence and aggregates results. Designed so test failures DO NOT abort the run — the harness exists to surface findings, so collecting partial signal is more useful than fail-fast. Infrastructure failures (00-setup, 10-deploy) DO abort, since downstream tests cannot run without a ready cluster. Usage: run-all.sh [--tier=k3d|remote] [--skip-setup] [--teardown] Tier selects env file (env/k3d.env or env/remote.env, default k3d). --skip-setup is for re-runs against an already-deployed cluster. --teardown calls 99-teardown.sh at the end (k3d-only — refuses on remote tier where cluster bring-down is the operator's responsibility). Per-step outcomes (ok / fail / skipped) print at the end so the operator can see at a glance which steps ran and which need attention. Exit status is 1 if any step failed, 0 otherwise — so CI can gate on it without parsing the markdown. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Santosh Jha <[email protected]>
…knobs Pragmatic README for collaborators who want to reproduce the rep-64 durability tests. Pairs with the deeper DESIGN.md and IMPLEMENTATION.md which already exist; this is the start-here doc. Sections: - Quickstart (k3d in 4 commands) - Tier model (k3d implemented, remote planned) - Why k3d not kind (Mariner cgroup-v1 incompatibility) - Scripts catalog with one-line purposes - How to read summary.md (Tests + Findings, with thresholds table) - Image story (the :nightly-rep64-fix patched build, ghcr public mirror) - Known issues: * cwd path footgun (RESULTS_DIR is relative) * Open finding: rocksdb 0–50% recovery (non-deterministic durability) * Substrate sweep skipped on k3d (only local-path available) - Customization (env knobs table) - Reproducing on a new cluster (sketches the planned Phase E flow) Honest about what's NOT yet built — calls out 00-check-remote.sh and env/remote.env.example as planned-not-done so external readers don't look for files that aren't there. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Santosh Jha <[email protected]>
…bugs Found while running run-all end-to-end for the canonical baseline. Two bugs fell out: 1. 30-pod-delete.sh's "restore rocksdb cluster" step at the end of the inmem-baseline path applied the rocksdb manifest but didn't tear down the existing memory cluster first. KubeRay reconciles the spec but does NOT recreate head pods on PodTemplate changes — so the running pod stayed on memory backend, which 10-deploy-cluster.sh correctly refuses to use on the next run. Fix: call teardown_cluster before re-applying so KubeRay gets a fresh shot at materializing the spec. 2. run-all.sh's run_step() captured `$?` after `if "$@"; then ... fi`, which in bash returns the if-statement's exit (0 when the test fell through), not the failed command's actual rc. Symptom: log line said "FAILED (rc=0)" which is nonsense and would confuse anyone tailing. Fix: capture rc directly via `"$@" || rc=$?`. The run-all orchestrator's overall behavior was correct — required-step abort propagated and exited cleanly. Only the cosmetic rc display was broken, but worth fixing for log readability. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Santosh Jha <[email protected]>
Found while running the canonical baseline. Aggregate step at the end of run-all references \$RESULTS_DIR but the orchestrator never sourced the env file — the individual test scripts each call load_env themselves, so none of those env vars were in run-all's own shell. Symptom: ./run-all.sh: line 114: RESULTS_DIR: unbound variable Fix: call load_env() right after sourcing lib.sh. Also sets the kubectl context once up front rather than relying on each test script to do it. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Santosh Jha <[email protected]>
…ds run independently When the rocksdb backend run hit the 300s pod_restart timeout, abort() exited the script before the inmem baseline ran — the two paths were sequential rather than independent. Worse, the failed rocksdb run wrote no result JSON, so aggregate.py couldn't even surface the failure: the test silently disappeared from summary.md. Two pieces: 1. run_backend_with_fallback wraps run_backend in a subshell, so an abort inside (head pod won't ready, no SNAPSHOT_JSON, etc.) only exits the subshell. When that happens, write a fail-stub result with status=fail + aborted=true so aggregate.py has a row to hang the failure off of. 2. Both backends now invoked via `... || true` so failure of either doesn't block the other. The post-baseline rocksdb-restore step's abort-on-failure also relaxed to a WARN: leaving the cluster in a broken state is operator-noise, not script-fatal. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Santosh Jha <[email protected]>
Captured by run-all.sh against the rep64 k3d cluster on commit cbea070f. Each *.committed.json is the latest result from that test in results/k3d/, copied (gitignore policy already keeps results/canonical/ committed and results/k3d/* local-only). Headline outcomes: | test | status | what it surfaces | |---------------------|---------|----------------------------------------------| | 20-actor-survival | pass | 10/10 detached actors survive disconnect | | 30-pod-delete | fail | rocksdb: pod_restart 138 s, state 40 % | | 30-pod-delete.inmem | fail | memory baseline: pod_restart 10 s, state 0 % | | 40-substrate-sweep | skipped | SUBSTRATE_SWEEP_CLASSES empty on k3d | | 50-fast-storage | skipped | FAST_NVME_CLASS empty on k3d | Three findings surface in summary.md (rocksdb pod_restart > 30 s, rocksdb state_preserved < 95 %, memory state_preserved < 95 %). Open POC bugs visible in this baseline (deferred per the "build harness, find bugs, fix later" directive): 1. rocksdb state_preserved_pct is non-deterministic across runs (0%, 40%, 50% observed in this session). Actor manager writes are not durably committed before pod kill — the 2 s flush sleep at pod_delete_workload.py:65-66 is insufficient. 2. rocksdb head-pod cold-start exceeds the readiness/liveness probe window. On a cold cluster (fresh PVC + first head-pod restart), Ray takes 138 s to bring up GCS+raylet; the kubelet liveness probe kills the container before Ray finishes, triggering a CrashLoop. Eventual recovery happens via repeated container restarts within the 300 s harness timeout. On a warm cluster the same path takes ~10 s, so the bug only manifests for the first restart of a fresh deployment — but that's exactly the production-relevant case. These are the canonical "current state" baseline. Update this baseline once either bug is fixed (re-run run-all, copy fresh JSONs over). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Santosh Jha <[email protected]>
…cold-start finding Two README updates after capturing the canonical baseline: 1. Document the second open finding: rocksdb head-pod cold-start exceeds the kubelet liveness probe window. Symptom: CrashLoop on the first restart of a fresh deployment; ~138 s observed. On warm clusters the same path is ~10 s, so the bug only shows on the production-relevant first-restart case. 2. Add a "Canonical baseline" section pointing readers at results/canonical/ as the committed reference snapshot, with instructions to refresh by running run-all and copying the latest results over. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Santosh Jha <[email protected]>
…g artifacts) These were how-we-planned-the-work documents from earlier in the POC's build-out and aren't needed alongside the shipped harness. The README already covers what a consumer needs: how to run the harness and what to expect from the results. Anyone curious about the design trail can read the git history of the harness files. Also removes the references to these files that lived in: - README.md (intro paragraph + the "Why k3d, not kind" diagnostic note) - env/k3d.env (the cgroup-pivot comment) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Santosh Jha <[email protected]>
…y" finding
The 30-pod-delete recovery test was reporting non-deterministic
0-50% recovery on rocksdb (observed 0%, 40%, 50%, 70% across runs)
and the canonical baseline attributed this to async-write durability
gaps masked by an insufficient 2s flush sleep. That attribution was
wrong.
Code-path trace + substrate-fsync probe (verdict=honest, p50=4015 us
on /data/gcs) + post-kill `ray list actors` showed the actual cause:
Ray's head pod runs a worker process by default, so any actors K8s
scheduled onto the head pod's worker died with the pod when SIGKILL
hit. The variance was just K8s scheduling roulette: which fraction
of the 10 actors happened to land on the head pod's worker that run.
Fix: HEAD_RAY_CPU=0 in env files, plumbed into the manifest's
headGroupSpec.rayStartParams.num-cpus. The head's raylet advertises
0 CPUs to the Ray scheduler, so user actors only land on worker
pods. The K8s container request/limit stays at HEAD_CPU (the head
still needs real CPU for gcs_server + raylet).
The 2s sleep at pod_delete_workload.py:65-66 and the 3s sleep at
30-pod-delete.sh:74 are removed. Both were based on the now-disproven
async-write hypothesis. AsyncPut runs db_->Put with wo.sync=true so
every write fsyncs the WAL before its callback fires; the chain
RegisterActor -> ALIVE Put -> gcs_publisher.PublishActor -> driver
ConnectActor -> SubmitTask dispatch enforces durability before
ray.get() returns from the actor's first method call.
After the fix, 30-pod-delete reports 100% recovery on rocksdb across
runs; inmem baseline still correctly reports 0%. Canonical baseline
files refreshed; the only remaining finding is the inmem 0% (the
expected contrast against rocksdb's 100% — exactly the point of
running both backends).
README "Open finding 1" rewritten to document the correct
attribution and the fix. The cold-start liveness-probe issue
("Open finding 2") is independent and unaffected.
Signed-off-by: Santosh Jha <[email protected]>
Adds two sections users were asking for: - "Cleaning up" — soft reset (kubectl delete raycluster + pvc), full teardown via 99-teardown.sh or run-all.sh --teardown, and the manual k3d cluster delete fallback. Notes 99-teardown.sh's per-tier branch. - "Switching between tiers" — HARNESS_ENV_FILE selects the profile, and lib.sh::load_env auto-flips kubectl context as a side effect (the gotcha worth flagging). Includes the workable path against a remote cluster today, before the Phase E scripts land. Signed-off-by: Santosh Jha <[email protected]>
Concrete remote env files contain cluster-specific URLs and namespaces. Keep them local; the .example template is the committed shape. Signed-off-by: Santosh Jha <[email protected]>
Mirror env/k3d.env's shape so the remote env diff tells contributors what to change. Defaults differ from k3d where remote semantics demand it: IMAGE_PULL_POLICY=IfNotPresent (not Never), STORAGE_CLASS empty (the preflight rejects empty so we never silently pick the cluster default), BASELINE_INMEM=0 (k3d canonical baseline already has the contrast), RESULTS_DIR points at results/remote/. Signed-off-by: Santosh Jha <[email protected]>
Verifies kubectl reach, namespace existence, RBAC the harness needs
({get,create,delete} of rayclusters/PVCs/configmaps/jobs.batch, plus
{get,delete} pods, create pods/exec, get pods/log), KubeRay CRDs, and
the configured StorageClass(es). The KubeRay-operator-cluster-wide
check is downgraded to optional since most managed-cluster SAs lack
list-deploy-cluster-wide perms — CRDs presence is the load-bearing
signal there. check() surfaces stderr on required failure to make
RBAC denials self-debuggable. Never mutates cluster state.
Required failures abort with rc=1; optional substrate-sweep / fast-NVMe
classes warn-only when missing. Wired into run-all.sh in a follow-up.
Signed-off-by: Santosh Jha <[email protected]>
…e tier Replaces the previous skip_step stub with a required run_step. Mirrors the k3d setup branch — failed preflight aborts the run before deploy/ tests, since downstream scripts assume the cluster is reachable and properly configured. Signed-off-by: Santosh Jha <[email protected]>
Drops "(planned)" qualifiers from the tier table and the reproducing- on-a-different-cluster section. Replaces the old Phase-E placeholder with the actual workflow (cp .example, edit, run-all --tier=remote). Adds an "Image registry & pull secrets" subsection covering the namespace default-ServiceAccount workaround for private registries. Signed-off-by: Santosh Jha <[email protected]>
Both 00-check-remote.sh and lib.sh::write_result used app.kubernetes.io/component=kuberay-operator to find the operator Deployment. The KubeRay v1.6.0 Helm chart doesn't apply component=kuberay-operator; it uses name=kuberay-operator. Result: the optional operator-presence check always emitted a warning, and every result JSON's cluster.kuberay_operator_version was "unknown" even on clusters that did have the operator installed. Surface: discovered while smoke-testing 00-check-remote.sh against the running k3d cluster, which has the operator but reported the optional warning anyway. Fix is one selector swap, applied in both places where the same selector was used. Signed-off-by: Santosh Jha <[email protected]>
…ksDB GCS Cursor Bugbot flagged that the previous unconditional default of 60s (raised from upstream's 30s) doubles the startup-failure surfacing time for ALL Ray deployments, not just RocksDB-backed ones. The justification (GCS replaying state from the persisted store on cold-start) only applies when RAY_gcs_storage=rocksdb, so gate the higher default on the backend and leave the upstream 30s default in place for everyone else. The RAY_raylet_start_wait_time_s env knob still overrides both. Signed-off-by: Santosh Jha <[email protected]>
… REP POC-driven corrections (from ray-project/ray#63032): - Performance table: replace memtable-only 0.01-0.1 ms write number with fsync-bounded 3-5 ms (POC ext4: 3.81 ms p50); add non-durable row; add Redis appendfsync-always note so the comparison is apples-to-apples. - New "Concurrency and Ordering Semantics" section documenting the thread-pool offload path, per-key boost::asio::strand bucketing for ordering preservation, opt-in default pending backpressure design, and measured 2.5x pipelined throughput. - Three new env vars in the user-configurable table: RAY_GCS_ROCKSDB_ASYNC_OFFLOAD, RAY_GCS_ROCKSDB_IO_POOL_SIZE, RAY_GCS_ROCKSDB_STRAND_BUCKETS. - New "Binary Size Impact" section with POC-measured deltas across gcs_server, ray wheel, and Docker image. - Rewrite stale-data-protection bullet honestly: naive cluster-ID marker is unimplementable as drawn (InitKVManager runs before GetOrGenerateClusterId); propose operator-injected RAY_CLUSTER_ID via K8s downward API as the production design. Reviewer feedback (from PR ray-project#64): - Rewrite training-resilience paragraph to state plainly that this REP alone does not improve in-flight training resilience -- NCCL still breaks, driver still restarts, app still resumes from last checkpoint. Frame the win as faster cluster recovery + foundation for detached jobs / checkpointable drivers (per @andrewsykim, @edoakes). - Add RayService caveat to PVC Lifecycle: ownerReferences must point to RayService not RayCluster so zero-downtime upgrades don't garbage-collect the GCS PVC (per @andrewsykim). - Clarify "What the Operator Does" that env-var injection on the head pod happens regardless of operator-managed vs existingClaim path (per @andrewsykim). Signed-off-by: Santosh Jha <[email protected]>
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
|
Commenting to keep this pr from closing |
…nce (REP-64) (#63657) Implements the embedded RocksDB storage backend for GCS fault tolerance proposed in [REP-64](ray-project/enhancements#64). Today, GCS fault tolerance requires an external Redis instance. This PR adds RocksDB as a second backend, selected via `RAY_gcs_storage=rocksdb` and `RAY_gcs_storage_path=<path-on-pvc>`. The recovery model is identical to Redis-backed FT — GCS restarts, reads state from local disk, workers reconnect — only the location of persisted state differs. KubeRay operator changes (the `gcsFaultToleranceOptions.backend: rocksdb` field that auto-manages PVCs) are explicitly out of scope here and will land in `ray-project/kuberay`. ## Why a new PR This is a streamlined version of the POC at #63032. That PR carries the full evidence dossier (phase reports, kill-9 harness, k8s test harness, microbench results — ~10K lines of supporting material) which served its purpose during design review. For the merge PR, only the production code is included; #63032 remains the reference for per-claim reproducibility evidence and the @andrewsykim review thread. ## What's in this PR | Commit | What | |---|---| | 1 | `bazel/rocksdb.BUILD` + `bazel/ray_deps_setup.bzl` — add RocksDB 9.11.2 as a third-party dependency (static-only, no compression / jemalloc / tools, built via `rules_foreign_cc`). | | 2 | `src/ray/gcs/store_client/rocksdb_store_client.{h,cc}` + 4 tests + `storage_microbench` binary. RocksDB I/O runs on a `boost::asio::thread_pool` (keeping the WAL fsync off the GCS event loop) with per-key `boost::asio::strand`s bucketed by `hash(table, key)` for submission-order ordering. `WriteOptions::sync = true` on every mutating call. | | 3 | Wire it into `GcsServer` (factory dispatch in `InitClusterStorageBackend` + `InitKVManager`, 3 new config flags, `node.py` session-name sidecar for restart recovery, raylet startup wait bumped 30 → 60s on rocksdb). | | 4 | `TEST_GCS_ROCKSDB=1` fixture toggle in `python/ray/tests/conftest.py` — existing cluster fixtures auto-dispatch. | | 5 | New postmerge buildkite jobs `:ray: core: rocksdb tests` + `:ray: core: out of disk rocksdb tests`, mirroring the Redis FT jobs. | | 6 | Docs: new K8s setup page (`kuberay-gcs-rocksdb-ft.md`) + an "Embedded RocksDB backend" section in `gcs.rst`. | | 7 | Review follow-ups: remove the inline execution path and the `gcs_rocksdb_async_offload` toggle so RocksDB I/O always offloads; make `GetNextJobIDSync` private (tests drive it through the public `AsyncGetNextJobID`); extract the rocksdb session-name marker logic in `node.py` into its own helper; collapse `storage_microbench` to a single `rocksdb` backend; make the soft-durable table set a hardcoded, documented constant (`SoftDurableTables()`) instead of the `gcs_rocksdb_soft_durability_tables` config flag, since it's a fixed design property rather than an operator knob. | Aggregate: **+2,973 / -20 across 26 files**. All commits signed off (DCO). ## REP-64 acceptance criteria 1. Release tests pass with `RAY_gcs_storage=rocksdb` — the new postmerge job runs the standard test suite under the rocksdb backend. 2. New postmerge CI job mirroring Redis GCS FT — ✓ commit 5. 3. Scale tests at parity with Redis — covered by the postmerge job's `//python/ray/tests/...` target set (includes `test_many_actors.py`). 4. Serve chaos passes — covered by the postmerge job. ## Tests C++ unit tests under `src/ray/gcs/store_client/tests/`: - `rocksdb_smoke_test` — Bazel-integration sanity (open / put / get). - `rocksdb_store_client_test` — RocksDb-specific scenarios: recovery across close+reopen, cluster-id marker fail-fast, pool-thread write roundtrip. - `rocksdb_parity_test` — runs the full `StoreClientTestBase` suite (same fixture as `in_memory_store_client_test` and `redis_store_client_test`). - `rocksdb_concurrency_test` — per-key strand correctness + JobID-counter atomicity under N-thread contention. Python integration coverage: the existing `//python/ray/tests/...` / `//python/ray/dag/...` / `//python/ray/autoscaler/v2/...` suites run under `TEST_GCS_ROCKSDB=1` via the new buildkite jobs. > The local k3d cluster recovery test harness from the POC branch was repeated on this branch. Results and reproduction instructions are in doc [REP-64 RocksDB GCS — Kubernetes Recovery: Evidence of Correctness & Reproduction Guide](https://docs.google.com/document/d/1sd6S1E5-kgOSbMjefjIkvkZztwsMeUikscOqbZHmUSA/edit?usp=sharing) ## Out of scope (follow-ons) - KubeRay operator support for `gcsFaultToleranceOptions.backend: rocksdb` — separate `ray-project/kuberay` PR. - PVC stale-data fail-fast via K8s downward API (`RAY_CLUSTER_ID` env-injected cluster-id marker) — `RocksDbStoreClient` already supports the check; needs the KubeRay-side plumbing. - Remove the soft-durability workaround. The soft-durability relaxation added here (skipping the per-write WAL fsync on the NODE/ACTOR death-notification tables, now a hardcoded `SoftDurableTables()` constant) works around a GCS-core object-reconstruction / task-resubmission race that RocksDB's fsync latency widens. That race was proven to be rooted in the GCS code (see #64187). A follow-on PR will fix the root cause in GCS and remove this workaround so every table keeps strict per-write fsync. - macOS / Windows support (targets currently gated on `@platforms//os:linux`). ## References - REP-64: ray-project/enhancements#64 - POC PR with full evidence dossier and design-review history: #63032 - Bug provenance: #64187 --------- Signed-off-by: Santosh Jha <[email protected]> Signed-off-by: Rueian <[email protected]> Signed-off-by: Edward Oakes <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Co-authored-by: Rueian <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Edward Oakes <[email protected]>
|
The production-ready version of this has been merged. |
…nce (REP-64) (ray-project#63657) Implements the embedded RocksDB storage backend for GCS fault tolerance proposed in [REP-64](ray-project/enhancements#64). Today, GCS fault tolerance requires an external Redis instance. This PR adds RocksDB as a second backend, selected via `RAY_gcs_storage=rocksdb` and `RAY_gcs_storage_path=<path-on-pvc>`. The recovery model is identical to Redis-backed FT — GCS restarts, reads state from local disk, workers reconnect — only the location of persisted state differs. KubeRay operator changes (the `gcsFaultToleranceOptions.backend: rocksdb` field that auto-manages PVCs) are explicitly out of scope here and will land in `ray-project/kuberay`. ## Why a new PR This is a streamlined version of the POC at ray-project#63032. That PR carries the full evidence dossier (phase reports, kill-9 harness, k8s test harness, microbench results — ~10K lines of supporting material) which served its purpose during design review. For the merge PR, only the production code is included; ray-project#63032 remains the reference for per-claim reproducibility evidence and the @andrewsykim review thread. ## What's in this PR | Commit | What | |---|---| | 1 | `bazel/rocksdb.BUILD` + `bazel/ray_deps_setup.bzl` — add RocksDB 9.11.2 as a third-party dependency (static-only, no compression / jemalloc / tools, built via `rules_foreign_cc`). | | 2 | `src/ray/gcs/store_client/rocksdb_store_client.{h,cc}` + 4 tests + `storage_microbench` binary. RocksDB I/O runs on a `boost::asio::thread_pool` (keeping the WAL fsync off the GCS event loop) with per-key `boost::asio::strand`s bucketed by `hash(table, key)` for submission-order ordering. `WriteOptions::sync = true` on every mutating call. | | 3 | Wire it into `GcsServer` (factory dispatch in `InitClusterStorageBackend` + `InitKVManager`, 3 new config flags, `node.py` session-name sidecar for restart recovery, raylet startup wait bumped 30 → 60s on rocksdb). | | 4 | `TEST_GCS_ROCKSDB=1` fixture toggle in `python/ray/tests/conftest.py` — existing cluster fixtures auto-dispatch. | | 5 | New postmerge buildkite jobs `:ray: core: rocksdb tests` + `:ray: core: out of disk rocksdb tests`, mirroring the Redis FT jobs. | | 6 | Docs: new K8s setup page (`kuberay-gcs-rocksdb-ft.md`) + an "Embedded RocksDB backend" section in `gcs.rst`. | | 7 | Review follow-ups: remove the inline execution path and the `gcs_rocksdb_async_offload` toggle so RocksDB I/O always offloads; make `GetNextJobIDSync` private (tests drive it through the public `AsyncGetNextJobID`); extract the rocksdb session-name marker logic in `node.py` into its own helper; collapse `storage_microbench` to a single `rocksdb` backend; make the soft-durable table set a hardcoded, documented constant (`SoftDurableTables()`) instead of the `gcs_rocksdb_soft_durability_tables` config flag, since it's a fixed design property rather than an operator knob. | Aggregate: **+2,973 / -20 across 26 files**. All commits signed off (DCO). ## REP-64 acceptance criteria 1. Release tests pass with `RAY_gcs_storage=rocksdb` — the new postmerge job runs the standard test suite under the rocksdb backend. 2. New postmerge CI job mirroring Redis GCS FT — ✓ commit 5. 3. Scale tests at parity with Redis — covered by the postmerge job's `//python/ray/tests/...` target set (includes `test_many_actors.py`). 4. Serve chaos passes — covered by the postmerge job. ## Tests C++ unit tests under `src/ray/gcs/store_client/tests/`: - `rocksdb_smoke_test` — Bazel-integration sanity (open / put / get). - `rocksdb_store_client_test` — RocksDb-specific scenarios: recovery across close+reopen, cluster-id marker fail-fast, pool-thread write roundtrip. - `rocksdb_parity_test` — runs the full `StoreClientTestBase` suite (same fixture as `in_memory_store_client_test` and `redis_store_client_test`). - `rocksdb_concurrency_test` — per-key strand correctness + JobID-counter atomicity under N-thread contention. Python integration coverage: the existing `//python/ray/tests/...` / `//python/ray/dag/...` / `//python/ray/autoscaler/v2/...` suites run under `TEST_GCS_ROCKSDB=1` via the new buildkite jobs. > The local k3d cluster recovery test harness from the POC branch was repeated on this branch. Results and reproduction instructions are in doc [REP-64 RocksDB GCS — Kubernetes Recovery: Evidence of Correctness & Reproduction Guide](https://docs.google.com/document/d/1sd6S1E5-kgOSbMjefjIkvkZztwsMeUikscOqbZHmUSA/edit?usp=sharing) ## Out of scope (follow-ons) - KubeRay operator support for `gcsFaultToleranceOptions.backend: rocksdb` — separate `ray-project/kuberay` PR. - PVC stale-data fail-fast via K8s downward API (`RAY_CLUSTER_ID` env-injected cluster-id marker) — `RocksDbStoreClient` already supports the check; needs the KubeRay-side plumbing. - Remove the soft-durability workaround. The soft-durability relaxation added here (skipping the per-write WAL fsync on the NODE/ACTOR death-notification tables, now a hardcoded `SoftDurableTables()` constant) works around a GCS-core object-reconstruction / task-resubmission race that RocksDB's fsync latency widens. That race was proven to be rooted in the GCS code (see ray-project#64187). A follow-on PR will fix the root cause in GCS and remove this workaround so every table keeps strict per-write fsync. - macOS / Windows support (targets currently gated on `@platforms//os:linux`). ## References - REP-64: ray-project/enhancements#64 - POC PR with full evidence dossier and design-review history: ray-project#63032 - Bug provenance: ray-project#64187 --------- Signed-off-by: Santosh Jha <[email protected]> Signed-off-by: Rueian <[email protected]> Signed-off-by: Edward Oakes <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Co-authored-by: Rueian <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Edward Oakes <[email protected]> Signed-off-by: 400Ping <[email protected]>
Summary
This PR is a proof of concept for REP-64 (Embedded GCS Storage Backend), not a feature merge. It is here to prove the design works, surface its risks, and produce reproducible evidence for every concrete claim in the REP — before anyone sinks weeks into production hardening.
The dossier this PR ships under
rep-64-poc/is the load-bearing artifact. Per-claim verdicts and one-command repros are inrep-64-poc/EVIDENCE.md.Want to help validate? The POC was developed on a single Linux ext4 VM. Everything that needs a different filesystem, cloud volume, K8s cluster, arm64, or LLVM toolchain with sanitizers is gated on collaborators.
rep-64-poc/COLLABORATORS.mdis a triage queue: pick one based on what you have access to, run the listed commands, drop the JSON output here. Each item lists what to test, why it matters, exact commands, and what success looks like.TL;DR
The REP's design works on the substrates we can test rigorously here, with five findings that warrant maintainer attention before merge:
sync=falsenumber. The durable-write path the REP requires is fsync-bounded: 3.81 ms p50 on probe-verified ext4. The per-call cost is physics — no software path can reduce it. (Reads remain 0.01–0.1 ms class as claimed.)Async*calls block the GCS event loop for the full 3.8 ms fsync. Added an opt-in offload path (gcs_rocksdb_async_offload) that posts each call to aboost::asio::thread_pool; the event loop returns in ~40 µs. Same per-call latency, but 2.5× aggregate throughput under pipelined writers (215 → 593 ops/s after the strand-correctness fix below) thanks to RocksDB group commit. Currently default-off; see Open Question 6.boost::asio::strandbucketing. The first offload commit (e710272d) routed everyAsync*call to the bare pool, which lets twoAsyncPut(K, !overwrite)calls both observe "not found" and both write — and three other manifestations of the same bug (LWW, Delete-then-Put, read-your-writes). Single-key ops now dispatch throughRunIoForKey(table, key, work)→ strand bucket ofhash(table, key) % gcs_rocksdb_strand_buckets(default 64). Multi-key/scan ops useRunIoUnordered(bare pool; semantics match Redis pipelining andInMemoryStoreClientunder concurrent callers). Zero measurable perf cost — pipelined offload throughput went 535 → 593 ops/s (within run-to-run noise). Full audit inrep-64-poc/POC_AUDIT.md.OptimisticTransactionDB) is the production pattern you want; sanity-check the bucket-count default.InitKVManager()beforeGetOrGenerateClusterId()and the persisted ID is the cluster ID. PVC-mismatch detection requires an external authoritative source (K8s downward API). Deferred to Phase 8 with an honest write-up.@boostURL (jfrog → archives.boost.io);BUILD.rocksdblib path. Either could be split into a separate small PR if the maintainers prefer.Phases 1–8 each produced a written report with claim addressed / method / result / skepticism / pivot decision. Verdicts:
StoreClientTestBasePASSES unmodifiedFull evidence dossier:
rep-64-poc/EVIDENCE.md.Size comparison after building image and wheel locally:
What's in this PR
Production-bound code (would land in a real merge)
bazel/BUILD.rocksdb(new) — drives RocksDB's CMake build viarules_foreign_cc, all optional features OFF,CMAKE_INSTALL_LIBDIR=libfor portability.bazel/ray_deps_setup.bzl— adds@com_github_facebook_rocksdb; switches@boostURL toarchives.boost.io(Ray-core regression fix, independent of REP-64).src/ray/gcs/store_client/rocksdb_store_client.{h,cc}(new) — fullStoreClientimplementation. All 9 methods. Mutex-RMWGetNextJobID. Sync writes viaWriteOptions::sync = true.AsyncBatchDeleteusesMultiGetfor the existence probe and skips tombstone writes for keys the probe found absent.AsyncDeletesimilarly skips the sync delete (and its fsync) when the key was not present. Cluster-ID marker plumbing (skipped when cluster_id is empty — see below). TwoAsync*execution paths: inline (default; runs on the caller's thread, matchesInMemoryStoreClientsemantics) and offload (gated bygcs_rocksdb_async_offload; posts work to aboost::asio::thread_poolso the event loop returns in ~40 µs, with the user callback re-posted toio_service). On the offload path, single-key ops (Put/Get/Delete/Exists) dispatch through aboost::asio::strandbucketed byhash(table, key) % gcs_rocksdb_strand_bucketsso per-key submission order is preserved; multi-key/scan ops use the bare pool. Destructor useswait()(notstop()+join()) to drain queued offload work without abandoning callbacks.src/ray/gcs/store_client/tests/rocksdb_store_client_test.cc(new) — Phase 3 walking-skeleton unit tests (PutGet, RecoverAcrossReopen, JobIdMonotonicAndPersists, ClusterIdMarkerWritesOnFirstOpen) plus offload-path tests (OffloadPathRoundtripsAcrossPoolThreads, OffloadPathDestructorJoinsBeforeDbClose) plus four strand-correctness tests (OffloadStrandSerializesOverwriteFalseRace, OffloadStrandPreservesLastWriterWinsForSameKey, OffloadStrandPreservesDeleteThenPut, OffloadStrandPreservesCrossKeyParallelism).src/ray/gcs/store_client/tests/rocksdb_smoke_test.cc(new) — Phase 2 link-and-run smoke test for the RocksDB dep.src/ray/gcs/store_client/BUILD.bazel— newgcs_rocksdb_store_clientlibrary wired intogcs_store_client_lib.src/ray/gcs/store_client/tests/BUILD.bazel— newrocksdb_smoke_testandrocksdb_store_client_testcc_test targets.src/ray/gcs/BUILD.bazel— wires the new lib intogcs_server_lib.src/ray/gcs/gcs_server.{h,cc}— addsStorageType::ROCKSDB_PERSIST+kRocksDbStorage = "rocksdb"; newInitKVManagerbranch. Passes empty cluster_id toRocksDbStoreClientbecause Ray's init order makes a real cluster_id unavailable at this point (fully written up inreports/phase-3-skeleton.md). Threadsgcs_rocksdb_async_offload,gcs_rocksdb_io_pool_size, andgcs_rocksdb_strand_bucketsfromRayConfiginto theRocksDbStoreClientctor.src/ray/common/ray_config_def.h— adds four knobs:gcs_storage_path(filesystem path for the RocksDB instance, required whengcs_storage=rocksdb),gcs_rocksdb_async_offload(defaultfalse, opt-in offload-IO path),gcs_rocksdb_io_pool_size(default4, only meaningful when offload is on),gcs_rocksdb_strand_buckets(default64, controls per-key ordering granularity on the offload path).POC harness (lives entirely in
rep-64-poc/, not on the production path)Each phase ships a self-contained harness:
harness/durability/probe_fsync.py(fsync-honesty probe),harness/docker-compose/(Redis baseline).harness/durability/kill9/{writer.cc, verifier.cc, run_kill9.py}. Includes a deliberately-broken--ghost-writesmode that proves the harness has fault sensitivity.harness/concurrency/concurrency_test.cc. 16-thread × 1000-call stress onGetNextJobID+ parallel-write linearizability + post-restart counter monotonicity. Caught + drove a real TOCTOU bug fix inGetOrCreateColumnFamily.harness/store_client_parity/rocksdb_parity_test.cc. Subclasses Ray's existingStoreClientTestBase(the same one the in-memory and Redis backends use). PASSES unmodified.harness/microbench/storage_microbench.cc. C++ side-by-side latency benchmark, p50/p95/p99/throughput. Default working dir is$HOME/.cache/...not/tmp— see methodology note about tmpfs masking fsync. Phase 7 addendum (commite710272d) extends the bench with--include-offload,--io-pool-size, and--sequentialflags so inline vs offload can be compared head-to-head; results inphase7-{sequential,pipelined}-offload-vs-inline.json. Second addendum (commit31adefb2a0) adds--strand-bucketsand re-runs the full matrix to confirm the strand layer doesn't regress throughput; results inphase7-strand-{sequential,pipelined}.json.harness/recovery/recovery_bench.cc(storage-layer cold-open + scan);harness/kind/ray-head-rocksdb.yaml(reference K8s manifest with annotated failure modes);harness/cloud/cloud_fsync_check.sh(collaborator-runnable cloud-volume wrapper).Dossier (/rep-64-poc/)
rep-64-poc/README.md— orientation for reviewers.rep-64-poc/EVIDENCE.md— claim-to-evidence map. Read first.rep-64-poc/RISKS.md— live risk register with end-of-POC status per row.rep-64-poc/POC_AUDIT.md— post-strand walkthrough of the fullRocksDbStoreClientsurface (what was checked for the same class of ordering bug, what changed, what was verified correct as-is, intentional design choices flagged for reviewer pushback).rep-64-poc/reports/phase-N-*.md— eight phase reports with claim / method / result / skepticism / repro / pivot.rep-64-poc/reproducers/README.md— one-command repros for everything that runs on the dev VM.rep-64-poc/COLLABORATORS.md— per-task help queue for things that need other environments (different FS, cloud volume, K8s, arm64, sanitizers).rep-64-poc/PLAN.md— the up-front plan, kept for the audit trail.Test plan
bazel build //src/ray/gcs/store_client/tests:rocksdb_smoke_test— green, 8.3 MB binarybazel test //src/ray/gcs/store_client/tests:rocksdb_smoke_test— 64 ms PASSbazel test //src/ray/gcs/store_client/tests:rocksdb_store_client_test— 10/10 PASS (~7.4 s) covering Phase 3 baseline (4) + offload roundtrip + dtor (2) + strand correctness (4: !overwrite race with 128 issuer threads, LWW × 32 trials, Delete-Put × 64 trials, cross-key 1024 keys)bazel test //rep-64-poc/harness/concurrency:concurrency_test --runs_per_test=10— 40/40 PASS, no flakebazel test //rep-64-poc/harness/store_client_parity:rocksdb_parity_test—StoreClientTestBasePASSbazel build //:gcs_serverwith the new code path — 32 MB unstripped / 24 MB stripped,--helpexits 0Pending — collaborator-runnable (see
rep-64-poc/COLLABORATORS.mdfor what to do, exact commands, and where to put results):harness/integration/test_rocksdb_recovery.py) — needs a Ray container image built from this branchcloud_fsync_check.sh@boost/rules_foreign_ccregressions)chaos_rocksdb_store_client_test.ccmirroringchaos_redis_store_client_test.ccThe POC stops short of running these because each requires hardware, cloud, or toolchain that the dev VM doesn't have. The reproducers and per-task instructions are shipped so collaborators can pick whichever matches their environment.
Open questions for maintainers
@boostURL change (jfrog → archives.boost.io) is independent of REP-64 and would unblock every Ray master build today. Bundle here, or split into a separate small PR?RocksDbStoreClientand skips the marker check (Phase 3 report). Is the K8s-downward-API plumbing path acceptable as the way forward, or is a different design preferred?//src/ray/gcs/store_client/tests:rocksdb_store_client_test. POC-specific tests sit under//rep-64-poc/harness/...to keep production trees minimal. Is the split right?gcs_rocksdb_async_offload = false(inline path) so behavior matchesInMemoryStoreClientand the code is the simplest to reason about. But inline blocks the GCS event loop for the full 3.8 ms fsync per call, which is almost certainly unacceptable at any non-trivial write rate; offload returns the loop in ~40 µs and yields 2.5× pipelined throughput, with per-key strand bucketing now closing the ordering gap that the bare-pool offload had. Three live options: keep opt-in, flip default to offload, or remove the inline path entirely. Phase 7 addenda have the comparative numbers; this is a maintainer judgment call. Caveat: queue-fill backpressure under saturation is a real production concern that's not yet plumbed (the bench's pipelined p50 of 9 s is queue-wait, not fsync — would need congestion control before flipping default).RunIoForKey(table, key, work)→ strand bucket ofhash(table, key) % gcs_rocksdb_strand_buckets(default 64; ~16× headroom over default pool size of 4). The alternative is RocksDB'sOptimisticTransactionDB, which only closes the!overwriteTOCTOU and leaves the other three same-key ordering manifestations (LWW, Delete-then-Put, read-your-writes) broken.POC_AUDIT.mdhas the full reasoning; multi-key/scan ops intentionally use the bare pool with looser semantics matching Redis pipelining andInMemoryStoreClientunder concurrent callers. Confirm the strand approach is what you want, and sanity-check the bucket-count default.Migration / risk
This branch does not change behavior for existing Redis-backed Ray clusters.
RAY_GCS_STORAGEdefaults to its current value; the new"rocksdb"value is opt-in.RAY_GCS_STORAGE_PATHdefaults to empty and only matters whenRAY_GCS_STORAGE=rocksdb.RAY_GCS_ROCKSDB_ASYNC_OFFLOADdefaults tofalse(inline path); flipping it on for production needs the backpressure follow-on noted in Open Question 6.RAY_GCS_ROCKSDB_STRAND_BUCKETSdefaults to64and is only meaningful when offload is on; tuning is documented inPOC_AUDIT.md.The boost URL fix changes the upstream URL for the
@boostarchive. The pinned SHA256 is unchanged; the new URL serves the same archive content (verified manually withcurl + sha256sum). Builds that previously failed will now succeed; no other change.How to review
Reviewing only the core integration (C++ path)
If you only care about the RocksDB-backed StoreClient itself and not the POC dossier / harness /
reports, the change is a small, contained surface. The list below is everything you need to read and
the only commands you need to run.
Files to read (in this order, ~600 lines total of new C++):
methods, mutex-RMW GetNextJobID, sync writes (WriteOptions::sync = true), inline vs.
boost::asio::thread_pool offload paths, per-key boost::asio::strand bucketing on the offload path,
destructor wait() (not stop()+join()).
into InitKVManager; threads the three config knobs into the ctor.
(default false), gcs_rocksdb_io_pool_size (default 4), gcs_rocksdb_strand_buckets (default 64).
src/ray/gcs/BUILD.bazel — Bazel wiring; no logic.
Time-boxed:
rep-64-poc/EVIDENCE.md, then skimrep-64-poc/RISKS.md.rep-64-poc/POC_AUDIT.md. Skip method bodies.rep-64-poc/reproducers/README.md.All numerical claims are reproducible from the bench harnesses; please run them rather than taking the numbers on faith.