From 00028db7719794c5df32190fd1eea9cd353ad999 Mon Sep 17 00:00:00 2001 From: Frando Date: Tue, 30 Sep 2025 09:21:48 +0200 Subject: [PATCH 1/2] feat: upgrade database to redb v3 compatible format --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/store/fs/meta.rs | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 23e65b2d1..6a54cff22 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3108,9 +3108,9 @@ dependencies = [ [[package]] name = "redb" -version = "2.4.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0a72cd7140de9fc3e318823b883abf819c20d478ec89ce880466dc2ef263c6" +checksum = "8eca1e9d98d5a7e9002d0013e18d5a9b000aee942eb134883a82f06ebffb6c01" dependencies = [ "libc", ] diff --git a/Cargo.toml b/Cargo.toml index 70eb73a21..764970a8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ genawaiter = { version = "0.99.1", features = ["futures03"] } iroh-base = "0.92" irpc = { version = "0.8.0", features = ["rpc", "quinn_endpoint_setup", "spans", "stream", "derive"], default-features = false } iroh-metrics = { version = "0.35" } -redb = { version = "=2.4", optional = true } +redb = { version = "2.6.3", optional = true } reflink-copy = { version = "0.1.24", optional = true } [dev-dependencies] diff --git a/src/store/fs/meta.rs b/src/store/fs/meta.rs index d71f15c20..5f76b7fff 100644 --- a/src/store/fs/meta.rs +++ b/src/store/fs/meta.rs @@ -36,7 +36,7 @@ mod proto; pub use proto::*; pub(crate) mod tables; use tables::{ReadOnlyTables, ReadableTables, Tables}; -use tracing::{debug, error, info_span, trace, Span}; +use tracing::{debug, error, info, info_span, trace, warn, Span}; use super::{ delete_set::DeleteHandle, @@ -475,13 +475,18 @@ impl Actor { options: BatchOptions, ) -> anyhow::Result { debug!("creating or opening meta database at {}", db_path.display()); - let db = match redb::Database::create(db_path) { + let mut db = match redb::Database::create(db_path) { Ok(db) => db, Err(DatabaseError::UpgradeRequired(1)) => { return Err(anyhow::anyhow!("migration from v1 no longer supported")); } Err(err) => return Err(err.into()), }; + match db.upgrade() { + Ok(true) => info!("Database was upgraded to redb v3 compatible format"), + Ok(false) => {} + Err(err) => warn!("Database upgrade to redb v3 compatible format failed: {err:#}"), + } let tx = db.begin_write()?; let ftx = ds.begin_write(); Tables::new(&tx, &ftx)?; From 10d8d40c14af6aae70a950dfe2610d44ce9d4ee4 Mon Sep 17 00:00:00 2001 From: Frando Date: Tue, 30 Sep 2025 09:35:37 +0200 Subject: [PATCH 2/2] chore: update nightly toolchain used in CI --- .github/workflows/ci.yaml | 2 +- .github/workflows/docs.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1fc4a1cfa..b2a48b5e4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -204,7 +204,7 @@ jobs: - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2024-11-30 + toolchain: nightly-2025-09-28 - name: Install sccache uses: mozilla-actions/sccache-action@v0.0.9 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 882d53656..84f0a21be 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2024-11-30 + toolchain: nightly-2025-09-28 - name: Install sccache uses: mozilla-actions/sccache-action@v0.0.9