Relationships
#3756 Datastore rework Phase 4 I: dogfood and benchmark solo v3 (filesystem, S3, GCS) in a throwaway repo with the released binary, check the kill criteria, and decide whether to announce
Opened by stack72 · 10/21/2026· Shipped 10/24/2026
Background
swamp's datastore rework (tracking: swamp-club#2865) has finished its solo-mode code (Phase 4):
- v3 on filesystem and on S3/GCS (#3534);
- the fenced writer lease, Litestream replication and restore;
- and every bug-hunt fix: #3564, #3565, #3586, #3587, #3617, #3690, #3691, #3693, #3696, #3736, #3737, and #3642–#3644 from swamp-uat#715.
The Datastore UAT is green on s3-v3 and gcs-v3.
This is the last Phase 4 item, I · Dogfood and benchmark: use solo v3 the way a team would, measure it against v2 and the kill criteria, and decide whether v3 on buckets can be announced. It changes no code in this issue. Problems it finds are filed as their own swamp-club issues.
Where it runs
- A new, throwaway swamp repo in a temp directory (
mktemp -d), never a real project. One repo per datastore under test, plus a second checkout of each (a copy of the repo without.swamp/, as a teammate's clone). - The released binary only, never a branch build. Use the newest release from
gh release list --repo swamp-club/swamp. It must contain #3736 (97a6e9c7f) and #3737 (9bc473d7e). If no published release does yet, wait for one; don't dogfood an older one. Record the exact version. swamp init --tool nonein the temp repo, so it never installs skills into~/.claude. Remove the temp directories, buckets and containers when done.
What to run
- The datastores, each set up with the released binary:
- v3 filesystem:
datastore setup filesystem --path <tmp>/ds --format 3; - v3 S3 and v3 GCS:
datastore setup extension @swamp/s3-datastore|@swamp/gcs-datastore --config … --format 3. Use real test buckets for timings, and the ministack/fake-gcs emulators for the functional pass; - a v2 datastore of each kind, as the baseline, run with the same binary and the same steps.
- v3 filesystem:
- Populate it with a realistic amount of data, through the CLI only:
- a few hundred models (
command/shelland a pulled extension type), definitions and workflows; - thousands of method runs and data versions, mixing inline records (< 8 KiB) and chunked content (KiBs to tens of MiB, including some > 16 MiB on GCS);
- outputs made executable and 0600;
- dot-named and non-ASCII data names;
- multi-step workflows, including one killed mid-run (SIGKILL), then
workflow recover; - deletes, renames,
data gc,run gcand retention; - a namespaced repo beside a solo one;
- managedConfig on and off;
swamp servefor a stretch, running workflows through it.
- a few hundred models (
- The second checkout:
- a fresh checkout catches up;
- both write in turn, with the lease handed over;
- a checkout killed mid-write recovers;
- a checkout holding v2 records is refused, and
doctor datastores --repairworks; - on buckets, a checkout whose
.swamp/is deleted restores from the replica.
What to measure
Against the v2 baseline on the same machine, and against the uat#496 benchmark lines. Report medians and p95, with an A/A control:
Per-command latency:
- a write (
model method run); - a workflow step;
- reads (
data list,data get,data query); - first clone (catch-up) of the populated repo.
- a write (
The solo part of the kill criteria (
design/enablers/datastore-commit-log.md, "Kill criteria", K2):- p95 flush (commit) latency, solo, at most 500 ms;
- the commit adds at most 10% to median step wall time, compared with v2's
pushChanged.
Record whether either fires.
Real-bucket timings (deferred from #3417), on real S3 and GCS:
- cold and warm forced sync;
- the idle sidecar's connection lifetime;
- GCS uploads over 16 MB;
- restore time and replica growth.
Storage: bytes in the datastore for v3 vs v2 after the same work, and after
data gcand compaction.macOS: the chunk barrier's cost after #3737, on an idle and a busy disk.
What to decide
Do the kill criteria fire? If one does, stop and report. Don't announce.
Confirm-before-output (9a): with
--json, a v3 command can print success and then exit 75 when replication fails at close. Choose one, with the reason:- fix it before announcing (a follow-up issue);
- or announce with it as a documented known limit.
Recommend: announce with it documented, unless dogfooding shows it in practice.
Announce v3 on buckets: yes, or no with what blocks it.
Deliverables
- A results write-up (numbers, findings, decisions), linked from this issue and summarised in
design/enablers/datastore-litestream.md(real-bucket timings) and the datastore rework plan. - A swamp-club issue for every bug found, linked here. Don't fix them in this issue.
- Any new benchmark line worth keeping (for example a v3 bucket write) proposed for swamp-uat's benchmark suite as a filed swamp-uat issue, not added here.
Done when: every measurement above is recorded, the kill-criteria check and the 9a decision are written down, and the announce/no-announce call is made.
Blocked by: a published release that contains #3736 and #3737.
Shipped
Click a lifecycle step above to view its details.
stack72 commented 10/22/2026, 1:56:52 AM
Note from swamp-club#3759: once that fix lands, a command on a v3 datastore prints its result only after its root has committed. In log mode, the status lines of non-streaming commands (data gc, data prune, run gc, datastore compact, datastore gc, model and workflow delete) then print together with the result instead of live. While dogfooding here, watch whether data gc or datastore compact runs long enough on a real v3 repository to look hung; if it does, those commands get live status lines in a follow-up.
stack72 commented 10/24/2026, 6:37:27 PM
Closing #3756 (Phase 4 I: dogfood and benchmark solo v3).
Results: the write-up is the "Real-bucket check" section of design/enablers/datastore-litestream.md, merged in swamp-club/swamp#3359:
https://github.com/swamp-club/swamp/blob/main/design/enablers/datastore-litestream.md#real-bucket-check
It covers what was run, the two kill criteria, outage outcomes and exit codes, first clone and restore, storage, the known limits, and what moved, was deferred or was not measured. In short:
- What was run: six populated repos (filesystem, S3 and GCS, each in v2 and v3), on ministack and fake-gcs 1.56.1 behind cut proxies, on one macOS host, using
bc388c720and release20261024.011325.0. - Kill criteria (K2): neither fires.
- K2a: the p95 commit bound is 221–255 ms on buckets.
- K2b: a workflow step costs 94–95% less than on v2.
- v3 filesystem is a known cost against v2 filesystem (a write +26%, a one-step workflow +27%), not a kill, because K2b is judged on buckets.
- Outage behaviour, as of #3802 and #3882: no write is lost after success is printed, no error is raw, and every failure exits within 8.3 s. One known limit: an S3 cut of only replication traffic waits about 60 s.
- First clone and restore: 1.55–1.90x v2 on S3 and 2.11–3.09x on GCS. The 1.5x target isn't met, and the cost grows with the history a clone replays.
- Storage: v3 stores 5–7x fewer objects than v2. Nothing is reclaimed the same day, because of the 24 h chunk grace period.
Issues this produced:
- Shipped: #3759, #3760, #3801, #3802, #3803 and #3882.
- Open, tracked on its own: #3860 (v2 S3 push collisions). The baseline is 3 of 150 serial workflow runs (2.0%) on
20261024.011325.0.
What moved, and why: on 2026-10-24 it was decided that v3 on buckets won't be announced until team mode (Phase 5) is in place. So:
- the real-bucket timings move to the team-mode dogfood: cold and warm sync, idle-connection lifetime, GCS uploads over 16 MB, and clone and restore on real S3 and GCS;
- the announce decision moves to Phase 5.
Deferred:
- the compaction-policy follow-up, which carries the clone and restore cost (Phase 5);
- the full-replay crash bug (Phase 7);
- lazy content, filed only if clones are still over target after the policy fix;
- the long silent waits: crash recovery after a writer is killed mid-method (F5, about 24 s),
data prune(6–10 s before any output), and the about-112 s read hang during a Litestream cut.
Not measured: real S3 and GCS, and SSO, instance and workload identity.
Sign in to post a ripple.