feat(rivetkit): sqlite vfs v2#4673
feat(rivetkit): sqlite vfs v2#4673NathanFlurry wants to merge 1 commit into04-15-chore_rename_sandbox_-_kitchen_sinkfrom
Conversation
|
🚅 Deployed to the rivet-pr-4673 environment in rivet-frontend
|
27742e1 to
83bef30
Compare
95ee628 to
9f5f7b3
Compare
Preview packages published to npmInstall with: npm install rivetkit@pr-4673All packages published as Engine binary is shipped via Docker images: docker pull rivetdev/engine:slim-33edc3b
docker pull rivetdev/engine:full-33edc3bIndividual packagesnpm install rivetkit@pr-4673
npm install @rivetkit/react@pr-4673
npm install @rivetkit/rivetkit-native@pr-4673
npm install @rivetkit/workflow-engine@pr-4673 |
9f5f7b3 to
2aff233
Compare
2aff233 to
61589f3
Compare
SQLite VFS v2 — Code Review
OverviewThis PR introduces SQLite VFS v2: a new custom Virtual File System layer that stores SQLite data in Rivet's distributed key-value store (UniversalDB). It replaces the v1 journal approach with a structured LTX (Log-Structured Transaction) format, adding:
The architecture is well thought out. The generation-fencing mechanism, the two-path commit (fast-path vs. staged), and the PIDX cache are clean. The test coverage for concurrency, compaction, and latency is solid for a draft. A few specific issues worth addressing before merge: Bugs / Correctness1. Both the fast-path and staged-commit quota checks use a raw 2. Dead variable
3. Orphan count conflates chunks and txids (
Design Concerns4. Global static
5. The loop converges in practice (serde_bare encoding grows monotonically to a fixed point), but has no explicit iteration limit. If a serialization anomaly produced a non-monotone size it would loop forever. A simple assertion or bail after N iterations would make the invariant explicit. 6. Sequential source fetches in Preload sources are fetched one at a time in a for-loop. For actors preloading pages from multiple different shards or deltas, all fetches could be issued concurrently. This is on the hot path for actor startup latency. 7. Linear page scan inside decoded LTX blob ( After decoding a shard or delta blob, finding a specific page uses Code Quality8. Duplicated PIDX decode constants and functions (
9. Unbounded compaction channel ( Under high commit rates, actors continuously enqueue compaction signals. The Test Issues10. Calling 11.
Minor Notes
Overall, the design is solid and the core correctness guarantees (generation fencing, PIDX consistency, staged commit atomicity) look well-reasoned. The issues above are mostly polish and performance; the quota error typing (#1) and the unsafe env var in tests (#10) are the most important to address before merge. |
04be7d5 to
87f6d92
Compare
87f6d92 to
e7e0f75
Compare
ab492cd to
340d16c
Compare
83bef30 to
1bc8cd6
Compare
340d16c to
fb54be9
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: