Skip to content

chore(deps): update redb to v5 - #6486

Merged
greenhat616 merged 2 commits into
mainfrom
chore/redb-5
Nov 20, 2026
Merged

greenhat616 merged 2 commits into
mainfrom
chore/redb-5

Conversation

@greenhat616

Copy link
Copy Markdown
Collaborator

Summary

Updates redb to v5 and adapts to its API changes:

  • ReadOnlyTable lost its inherent get/range; the legacy v3 traffic import and the startup recovery tests now call them through ReadableTable.
  • range takes a key range without a type parameter; the turbofish is dropped in the legacy traffic import and tsdb.
  • Database::compact takes a CompactionMode; tsdb uses CompactionMode::Balanced, the previous behaviour.
  • StorageBackend I/O returns BackendError and FileBackend::new is infallible; the four test and benchmark backends in tsdb follow.
  • The storage error contract tests expect v5's wording of a table type mismatch.

Compatibility

No table uses the Option<&str/String/bool/char> encodings that v5 changed, and nothing implements Value or Key. Files written by redb 4 open unchanged: storage, sync state, core logs, the jobs journal, tsdb and the legacy v3 traffic file.

Notes for review

  • Depends on chore(deps): update redb to v5 nyanpasu-runtime#502, which depends on chore(deps): update redb to v5 nyanpasu-utils#227. The runtime gitlink points at that PR's branch commit and will be re-pinned after it merges.
  • The tsdb comments that cite redb-4.4.0/src/... line numbers are left as they are. They name the version they refer to.
  • Supersedes fix(deps): update rust crate redb to v5 #6465, which only bumps the version.
  • Local checks: workspace clippy with all targets and features, and the tests of tsdb, traffic, observers, core, rpc, and the tauri setup/startup-failure tests. client::profiles::tests::deleting_a_profile_removes_its_proxy_group_layout failed once with a Windows access-denied error and passed on three reruns; it does not touch redb.

redb 5 removes the inherent get/range of ReadOnlyTable, takes a key range
without a type parameter, requires a CompactionMode for compact(), returns
BackendError from StorageBackend I/O, and makes FileBackend::new
infallible. Compaction keeps the previous behaviour with
CompactionMode::Balanced.

None of our tables use the Option<&str/String/bool/char> encodings that v5
changed, and none implement Value or Key, so files written by redb 4
(storage, sync state, core logs, the jobs journal, tsdb and the legacy v3
traffic file) open unchanged. The storage error contract test now expects
v5's wording of a table type mismatch.

The runtime pin moves to the matching redb 5 update, since nyanpasu-utils
classifies redb errors by downcasting and every crate must link the same
redb.
@semanticdiff-com

semanticdiff-com Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  backend/nyanpasu-traffic/src/store/legacy.rs  96% smaller
  backend/nyanpasu-tsdb/src/storage/redb/tests/schedules.rs  61% smaller
  backend/nyanpasu-tsdb/benches/support/disk.rs  58% smaller
  backend/nyanpasu-tsdb/src/storage/redb.rs  46% smaller
  backend/nyanpasu-tsdb/src/storage/redb/disk.rs  43% smaller
  backend/nyanpasu-tsdb/src/lifecycle/tests/support.rs  40% smaller
  backend/Cargo.lock Unsupported file format
  backend/nyanpasu-core/Cargo.toml Unsupported file format
  backend/nyanpasu-core/src/client/startup_recovery_tests.rs  0% smaller
  backend/nyanpasu-core/src/storage.rs  0% smaller
  backend/nyanpasu-rpc/Cargo.toml Unsupported file format
  backend/nyanpasu-runtime  0% smaller
  backend/nyanpasu-traffic/Cargo.toml Unsupported file format
  backend/nyanpasu-tsdb/Cargo.toml Unsupported file format
  backend/tauri/Cargo.toml Unsupported file format

@greenhat616
greenhat616 merged commit 3894bff into main Nov 20, 2026
1 of 2 checks passed
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