Skip to content

feat(kitchen-sink): add churnDb actor and seed driver for compaction read-hotshard repro - #5398

Open
MasterPtato wants to merge 1 commit into
stack/chore-clean-up-mnloxsnmfrom
stack/feat-kitchen-sink-add-churndb-actor-and-seed-driver-for-compaction-read-hotshard-repro-yluvtyol
Open

feat(kitchen-sink): add churnDb actor and seed driver for compaction read-hotshard repro#5398
MasterPtato wants to merge 1 commit into
stack/chore-clean-up-mnloxsnmfrom
stack/feat-kitchen-sink-add-churndb-actor-and-seed-driver-for-compaction-read-hotshard-repro-yluvtyol

Conversation

@MasterPtato

@MasterPtato MasterPtato commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@MasterPtato

MasterPtato commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Stack for rivet-dev/rivet

Get stack: forklift get 5398
Push local edits: forklift submit
Merge when ready: forklift merge 5398

change yluvtyol

@claude

claude Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review

Scope note: this diff (as computed against the current base) also carries roughly 600 lines of unrelated changes: three small Rust edits and a large self-host/dev* to self-host/compose/dev* rename with zero content diff. The rename is almost certainly diff noise from the branch being behind main rather than something this PR intentionally did, so it is worth rebasing before merge so reviewers and CI see only the real diff. The three Rust edits do look intentional, but they are unrelated to the stated "add churnDb actor" purpose:

  • engine/packages/gasoline/src/db/kv/mod.rs: drops an unused started_at in publish_signal (harmless cleanup).
  • engine/packages/util/src/serde.rs: fixes json_from_slice!/bare_from_slice! to deserialize from the length-observed __bind instead of re-evaluating $value. This is a legitimate bug fix since the whole point of the macro was to bind once, though at current call sites $value is always a plain reference or variable so the bug was latent rather than actively wrong.
  • engine/packages/universaldb/src/driver/postgres/database.rs: doubles DEDUP_ROW_MAX_AGE_SECS from 60s to 120s. This gates how long failover dedup rows are kept before GC and is a real production-behavior change (per the adjacent doc comment, it must stay well beyond the longest a follower could spend resending a commit across a leader failover). There is no comment or changelog explaining why 120s was chosen or what prompted the change. If this is fixing an observed failover timeout, it deserves its own PR with that context so it does not get lost bundled into a test-tooling PR.

Recommend splitting these three into a separate PR, or at least calling them out explicitly in the description, so the dedup-window change gets reviewed on its own merits.

examples/kitchen-sink/src/actors/testing/churn-db.ts

  • Solid mirror of the existing grow-db.ts pattern (budget-limited resumable action, storage stats, BEGIN/COMMIT with rollback-on-error). Comments do a good job explaining the non-obvious "why" (single-shard DELTA shape).
  • Minor correctness gap: ensureWorkingSet only grows the working set (returns early once existing.n >= workingSetRows) and never shrinks it. If churn() is invoked again later, for example a manual "bump" call per the doc comments, with a smaller workingSetRows than a prior call used, the extra old rows are silently left in place and every subsequent UPDATE churn_rows SET ... (no WHERE clause) keeps touching all of them. That quietly grows the per-commit DELTA size beyond what the caller asked for, which is exactly the invariant this tool exists to keep bounded to a single FDB shard. The seed script always calls with one fixed config per run so this will not bite that path, but it is a footgun for the "bump the target later" workflow the comments describe. Worth validating or erroring on a shrink, or documenting that workingSetRows and rowBytes must stay constant for a given actor key once seeded.

examples/kitchen-sink/scripts/seed-churn-dbs.ts

  • Good practice redacting the endpoint credentials before logging (endpointForLog).
  • The pattern Number(flag(argv, "--count")) || envNum("CHURN_COUNT", 3), repeated for targetTxids, workingSetRows, rowBytes, concurrency, and maxCalls, means an explicit 0 passed via CLI flag is falsy and silently falls through to the env or default value instead of being honored. Low severity since 0 is not a very meaningful value for most of these knobs, but worth a Number.isFinite check instead of || if an explicit zero should ever be respected.
  • The bookkeeping variables (next, completed, totalTxids, outcomes) are plain shared mutable state read and written across the worker() promises, which is fine since JS execution is single-threaded and there is no await between the read and write of next.

No automated test coverage was added for churnDb, but that matches the existing growDb fixture, which also has none. This is consistent with precedent for this kind of manual load-testing actor, not a new gap introduced here.

Summary

The core feature (churnDb actor plus seed script) is well-structured and consistent with the existing growDb precedent. Main asks: split out or explain the unrelated Rust changes, especially the dedup-window bump, and consider hardening ensureWorkingSet against a shrinking workingSetRows across resumed calls.

@MasterPtato
MasterPtato force-pushed the stack/feat-kitchen-sink-add-churndb-actor-and-seed-driver-for-compaction-read-hotshard-repro-yluvtyol branch from d75b5fc to 4411342 Compare July 21, 2026 19:23
@MasterPtato
MasterPtato force-pushed the stack/feat-kitchen-sink-add-churndb-actor-and-seed-driver-for-compaction-read-hotshard-repro-yluvtyol branch from 4411342 to 65314cc Compare August 6, 2026 23:15
@MasterPtato
MasterPtato changed the base branch from stack/chore-clean-up-mnloxsnm to main August 7, 2026 00:39
@MasterPtato
MasterPtato force-pushed the stack/feat-kitchen-sink-add-churndb-actor-and-seed-driver-for-compaction-read-hotshard-repro-yluvtyol branch from 65314cc to 74c27c0 Compare August 7, 2026 01:27
@MasterPtato
MasterPtato changed the base branch from main to stack/chore-clean-up-mnloxsnm August 7, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant