From c46618e256e1c72b5e0281c9b009ed464d861b38 Mon Sep 17 00:00:00 2001 From: "C. Titus Brown" Date: Mon, 26 Aug 2024 11:46:44 -0700 Subject: [PATCH 1/3] MRG: propagate error from `RocksDB::open` on bad directory (#3306) Extracted from https://github.com/sourmash-bio/sourmash/pull/3305 This PR adjusts `RevIndex::open` to propagate a `RocksDBError` when opening a non-RocksDB directory. It also modifies the creation printout in `RevIndex::create` to distinguish index completion from interim output, for slightly easier debugging. --- src/core/src/index/revindex/disk_revindex.rs | 2 +- src/core/src/index/revindex/mod.rs | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/core/src/index/revindex/disk_revindex.rs b/src/core/src/index/revindex/disk_revindex.rs index 511bdbcc4c..ac36c5b626 100644 --- a/src/core/src/index/revindex/disk_revindex.rs +++ b/src/core/src/index/revindex/disk_revindex.rs @@ -114,7 +114,7 @@ impl RevIndex { info!("Compact SSTs"); index.compact(); - info!("Processed {} reference sigs", processed_sigs.into_inner()); + info!("Done! Processed {} reference sigs", processed_sigs.into_inner()); Ok(module::RevIndex::Plain(index)) } diff --git a/src/core/src/index/revindex/mod.rs b/src/core/src/index/revindex/mod.rs index aac0d47c14..013c17081b 100644 --- a/src/core/src/index/revindex/mod.rs +++ b/src/core/src/index/revindex/mod.rs @@ -186,7 +186,7 @@ impl RevIndex { pub fn open>(index: P, read_only: bool, spec: Option<&str>) -> Result { let opts = db_options(); - let cfs = DB::list_cf(&opts, index.as_ref()).unwrap(); + let cfs = DB::list_cf(&opts, index.as_ref())?; if cfs.into_iter().any(|c| c == COLORS) { // TODO: ColorRevIndex can't be read-only for now, @@ -1020,4 +1020,14 @@ mod test { Ok(()) } + + #[test] + fn rocksdb_storage_fail_bad_directory() -> Result<()> { + let testdir = TempDir::new()?; + + match RevIndex::open(testdir, true, None) { + Err(_) => Ok(()), + Ok(_) => panic!("test should not reach here"), + } + } } From f5cd49e949e736cd5dccec6b75098b7052553144 Mon Sep 17 00:00:00 2001 From: "C. Titus Brown" Date: Mon, 26 Aug 2024 12:28:26 -0700 Subject: [PATCH 2/3] MRG: fix formatting from #3306 (#3307) `cargo fmt` --- src/core/src/index/revindex/disk_revindex.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/src/index/revindex/disk_revindex.rs b/src/core/src/index/revindex/disk_revindex.rs index ac36c5b626..7aba74fead 100644 --- a/src/core/src/index/revindex/disk_revindex.rs +++ b/src/core/src/index/revindex/disk_revindex.rs @@ -114,7 +114,10 @@ impl RevIndex { info!("Compact SSTs"); index.compact(); - info!("Done! Processed {} reference sigs", processed_sigs.into_inner()); + info!( + "Done! Processed {} reference sigs", + processed_sigs.into_inner() + ); Ok(module::RevIndex::Plain(index)) } From 12b1a4bbb43f77fde9983f747d6c062544e7dc15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 06:21:53 -0700 Subject: [PATCH 3/3] Bump serde_json from 1.0.125 to 1.0.127 (#3309) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.125 to 1.0.127.
Release notes

Sourced from serde_json's releases.

1.0.127

1.0.126

  • Improve string parsing on targets that use 32-bit pointers but also have fast 64-bit integer arithmetic, such as aarch64-unknown-linux-gnu_ilp32 and x86_64-unknown-linux-gnux32 (#1182, thanks @​CryZe)
Commits
  • 5ebf65c Release 1.0.127
  • f287a3b Merge pull request 1179 from GREsau/patch-1
  • ec980b0 Release 1.0.126
  • e6282b0 Merge pull request #1184 from serde-rs/fastarithmetic
  • ffc4a43 Improve cfg names for fast arithmetic
  • 4b1048d Merge pull request #1183 from serde-rs/arithmetic
  • f268173 Unify chunk size choice between float and string parsing
  • fec0376 Merge pull request #1182 from CryZe/chunk-64bit
  • 3d837e1 Ensure the SWAR chunks are 64-bit in more cases
  • 11fc61c Add OccupiedEntry::shift_remove() and swap_remove()
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.125&new-version=1.0.127)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- src/core/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf9d7ee601..2e9c8d06ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1599,9 +1599,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", diff --git a/src/core/Cargo.toml b/src/core/Cargo.toml index 789cff2e72..b29f0b8914 100644 --- a/src/core/Cargo.toml +++ b/src/core/Cargo.toml @@ -56,7 +56,7 @@ rkyv = { version = "0.7.44", optional = true } roaring = "0.10.6" roots = "0.0.8" serde = { version = "1.0.208", features = ["derive"] } -serde_json = "1.0.125" +serde_json = "1.0.127" statrs = "0.17.1" streaming-stats = "0.2.3" thiserror = "1.0"