fix(universaldb): enforce fdb transaction limits#4995
fix(universaldb): enforce fdb transaction limits#4995NathanFlurry wants to merge 1 commit intosqlite-logs/downgrade-fresh-db-missfrom
Conversation
|
🚅 Deployed to the rivet-pr-4995 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Code ReviewOverviewThis PR enforces FDB-equivalent transaction limits (10 MB total, 10 KB keys, 100 KB values) in the RocksDB and Postgres UDB drivers, which previously had no such enforcement. It also maps Issues
In both self.committed.store(true, Ordering::SeqCst); // ← marks as committed
let (operations, conflict_ranges) = self.operations.consume();
validate_commit_limits(&operations, &conflict_ranges)?; // ← may fail hereIf
In Observations and Minor Points
fn add_size(size: &mut usize, amount: usize) -> Result<()> {
*size = size.saturating_add(amount);
if *size > MAX_TRANSACTION_SIZE { ... }
Test function names still carry the The renamed tests (
If multiple commits raced concurrently the stored count would be last-write-wins rather than the triggering value. This is fine for the current single-threaded test, but worth noting in case the transport is reused in a concurrent context.
The previous stub ( Test CoverageThe new SummaryThe core logic is correct and the motivation is important — production/local parity on transaction limits is a real gap. The main actionable items before landing:
|

Stack Context
This stack fixes SQLite oversized transaction handling by making UniversalDB enforce the same core transaction payload limits expected from FoundationDB-backed commits.
What?
Why?
Local RocksDB-backed UDB previously allowed SQLite transactions that production FDB would reject with transaction_too_large. That meant local tests could pass while production failed later as an internal SQLite/FDB commit error.