fix(pegboard): skip protocol version keys in runner pool backfill#4620
Conversation
|
PR Review: fix(pegboard): skip protocol version keys in runner pool backfill Summary This PR fixes a bug in runner_pool_backfill.rs where a range scan over the runner_config_subspace was inadvertently pulling in ProtocolVersionKey entries alongside the intended DataKey entries. Without the fix, the backfill would attempt to deserialize a ProtocolVersionKey value (a u16) as a RunnerConfig, causing the activity to fail. Correctness runner_config.rs - ProtocolVersionKey unpack validation The new validation is correct. DataKey packs as a 5-element tuple (RUNNER, CONFIG, DATA, namespace_id, name) while ProtocolVersionKey packs as a 6-element tuple with the additional PROTOCOL_VERSION constant appended. Because of the length difference:
No false positives or false negatives appear possible. runner_pool_backfill.rs - skip ordering The new_last_key is updated before the skip check (line 101 vs lines 103-108). This is correct. Pagination must advance past the current entry regardless of whether it is processed or skipped. If new_last_key were only set for non-skipped entries, a chunk full of protocol-version keys could loop infinitely. Minor observations Error message could include context (runner_config.rs line 274) The current message is a static string. Including the actual vs expected value would make debugging easier if the constant ever changes. Unrelated formatting changes in database.rs The database.rs diff is purely cosmetic: reordered imports and collapsed multi-line expressions. Per CLAUDE.md, cargo fmt should not be run automatically, and mixing formatting-only changes into a bug-fix PR adds diff noise. Consider omitting these or landing them as a separate commit. Overall The fix is correct, well-scoped, and addresses the root cause. The two observations above are minor. Generated with Claude Code (https://claude.com/claude-code) |
412eec8 to
0aff89a
Compare
5c3d2c5 to
a142b3e
Compare
0aff89a to
f99981c
Compare
Preview packages published to npmInstall with: npm install rivetkit@pr-4620All packages published as Engine binary is shipped via Docker images: docker pull rivetdev/engine:slim-0ecee0c
docker pull rivetdev/engine:full-0ecee0cIndividual packagesnpm install rivetkit@pr-4620
npm install @rivetkit/react@pr-4620
npm install @rivetkit/rivetkit-native@pr-4620
npm install @rivetkit/sqlite-wasm@pr-4620
npm install @rivetkit/workflow-engine@pr-4620 |
Merge activity
|
f99981c to
2573bfc
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: