Repository navigation
Bump redb to 4.4: fix integrity failure after compaction (main CI red since #136) - #140
Conversation
redb 4.1.0 left free regions after compact(), so the first commit after compact and repair made check_integrity() report a repair. That broke the recovery tests on main since #136, and would make backup_database refuse after an operator compacts and restarts. Also escape two raw NUL bytes in curve_store.rs that made git treat the file as binary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Main's
Testjob has failed since #136 merged:convex-ext-redb/tests/recovery.rspanics with "reconciled fixture must pass integrity without another repair". Every PR inherits the failure, including #139.Cause
The cause is redb 4.1.0, not our code:
convex-redb compactandrepairthe database checks clean.check_integrity()report a repair. Even an emptybegin_write().commit()does it.What triggered it: today the test passes at db1d144 and fails at 8803b4c, with the same toolchain. #136 changed the recovery fixture data in between, and I take that to have shifted the file layout; I haven't traced the exact mechanism. The test asserts integrity after reopening the storage, and
RedbRuntimeStore::newcommits on every open, so it fails.Operators would hit the same thing: compact, start the server once, and
backup_databaserefuses with "database required repair".redb 4.4.0 fixes it ("Fix
compact()leaving free regions at the end of the file, when the compaction emptied more of them than it made commits"). On 4.4.0 the empty-commit probe stays clean and all recovery tests pass.The upgrade also brings two fixes on the same backup and repair path:
check_integrity()had previously repaired the database.check_integrity()could report a false repair after an aborted transaction had grown the file.Change
Cargo.lock: redb 4.1.0 → 4.4.0. Its MSRV is 1.90; CI uses 1.97.1.redb = "4.4"in the workspace and crate manifests, so the fix is the minimum version.curve_store.rs: two string literals held raw NUL bytes, so git and GitHub showed the file as binary and its diffs were hidden in review. They are now\0escapes, with the same value.No
.redbfiles are checked in. A scratch program checked files written by 4.1.0:Verification (WSL)
cargo test -p convex-ext-redb -p convex-server --no-fail-fast: 34 test binaries, 0 failed. Before the bump,recoveryfailed locally exactly as in CI.cargo clippy -p convex-ext-redb --all-targets -D warnings: clean.cargo fmt --all --check: clean.rust-versionis 1.95 and redb 4.4 needs 1.90.#139 goes green once this merges and main is merged into it.
🤖 Generated with Claude Code
Summary by CodeRabbit