mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-21 18:36:35 +00:00
Merge branch 'main' into next
This commit is contained in:
+5
-5
@@ -14,11 +14,11 @@ path = "lib.rs"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
garage_model = { version = "0.8.2", path = "../model" }
|
||||
garage_table = { version = "0.8.2", path = "../table" }
|
||||
garage_block = { version = "0.8.2", path = "../block" }
|
||||
garage_util = { version = "0.8.2", path = "../util" }
|
||||
garage_rpc = { version = "0.8.2", path = "../rpc" }
|
||||
garage_model.workspace = true
|
||||
garage_table.workspace = true
|
||||
garage_block.workspace = true
|
||||
garage_util.workspace = true
|
||||
garage_rpc.workspace = true
|
||||
|
||||
async-trait = "0.1.7"
|
||||
base64 = "0.21"
|
||||
|
||||
@@ -14,10 +14,10 @@ path = "lib.rs"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
garage_db = { version = "0.8.2", path = "../db" }
|
||||
garage_rpc = { version = "0.8.2", path = "../rpc" }
|
||||
garage_util = { version = "0.8.2", path = "../util" }
|
||||
garage_table = { version = "0.8.2", path = "../table" }
|
||||
garage_db.workspace = true
|
||||
garage_rpc.workspace = true
|
||||
garage_util.workspace = true
|
||||
garage_table.workspace = true
|
||||
|
||||
opentelemetry = "0.17"
|
||||
|
||||
|
||||
+25
-5
@@ -600,12 +600,32 @@ impl BlockManager {
|
||||
/// Utility: check if block is stored compressed. Error if block is not stored
|
||||
async fn is_block_compressed(&self, hash: &Hash) -> Result<bool, Error> {
|
||||
let mut path = self.block_path(hash);
|
||||
path.set_extension("zst");
|
||||
if fs::metadata(&path).await.is_ok() {
|
||||
return Ok(true);
|
||||
|
||||
// If compression is disabled on node - check for the raw block
|
||||
// first and then a compressed one (as compression may have been
|
||||
// previously enabled).
|
||||
match self.compression_level {
|
||||
None => {
|
||||
if fs::metadata(&path).await.is_ok() {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
path.set_extension("zst");
|
||||
|
||||
fs::metadata(&path).await.map(|_| true).map_err(Into::into)
|
||||
}
|
||||
_ => {
|
||||
path.set_extension("zst");
|
||||
|
||||
if fs::metadata(&path).await.is_ok() {
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
path.set_extension("");
|
||||
|
||||
fs::metadata(&path).await.map(|_| false).map_err(Into::into)
|
||||
}
|
||||
}
|
||||
path.set_extension("");
|
||||
fs::metadata(&path).await.map(|_| false).map_err(Into::into)
|
||||
}
|
||||
|
||||
async fn lock_mutate(&self, hash: &Hash) -> MutexGuard<'_, BlockManagerLocked> {
|
||||
|
||||
@@ -349,6 +349,6 @@ pub fn recommended_map_size() -> usize {
|
||||
|
||||
#[cfg(target_pointer_width = "32")]
|
||||
pub fn recommended_map_size() -> usize {
|
||||
warn!("LMDB is not recommended on 32-bit systems, database size will be limited");
|
||||
tracing::warn!("LMDB is not recommended on 32-bit systems, database size will be limited");
|
||||
1usize << 30
|
||||
}
|
||||
|
||||
+10
-9
@@ -21,19 +21,19 @@ path = "tests/lib.rs"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
garage_db = { version = "0.8.2", path = "../db" }
|
||||
garage_api = { version = "0.8.2", path = "../api" }
|
||||
garage_block = { version = "0.8.2", path = "../block" }
|
||||
garage_model = { version = "0.8.2", path = "../model" }
|
||||
garage_rpc = { version = "0.8.2", path = "../rpc" }
|
||||
garage_table = { version = "0.8.2", path = "../table" }
|
||||
garage_util = { version = "0.8.2", path = "../util" }
|
||||
garage_web = { version = "0.8.2", path = "../web" }
|
||||
garage_db.workspace = true
|
||||
garage_api.workspace = true
|
||||
garage_block.workspace = true
|
||||
garage_model.workspace = true
|
||||
garage_rpc.workspace = true
|
||||
garage_table.workspace = true
|
||||
garage_util.workspace = true
|
||||
garage_web.workspace = true
|
||||
|
||||
backtrace = "0.3"
|
||||
bytes = "1.0"
|
||||
bytesize = "1.1"
|
||||
timeago = "0.4"
|
||||
timeago = { version = "0.4", default-features = false }
|
||||
parse_duration = "2.1"
|
||||
hex = "0.4"
|
||||
tracing = { version = "0.1" }
|
||||
@@ -41,6 +41,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
rand = "0.8"
|
||||
async-trait = "0.1.7"
|
||||
sodiumoxide = { version = "0.2.5-0", package = "kuska-sodiumoxide" }
|
||||
git-version = "0.3.4"
|
||||
|
||||
serde = { version = "1.0", default-features = false, features = ["derive", "rc"] }
|
||||
serde_bytes = "0.11"
|
||||
|
||||
@@ -111,6 +111,12 @@ async fn main() {
|
||||
][..];
|
||||
if let Some(git_version) = option_env!("GIT_VERSION") {
|
||||
garage_util::version::init_version(git_version);
|
||||
} else {
|
||||
garage_util::version::init_version(git_version::git_version!(
|
||||
prefix = "git:",
|
||||
cargo_prefix = "cargo:",
|
||||
fallback = "unknown"
|
||||
));
|
||||
}
|
||||
garage_util::version::init_features(features);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ tokio = "1.24"
|
||||
|
||||
# cli deps
|
||||
clap = { version = "4.1", optional = true, features = ["derive", "env"] }
|
||||
garage_util = { version = "0.8.2", path = "../util", optional = true }
|
||||
garage_util = { workspace = true, optional = true }
|
||||
|
||||
|
||||
[features]
|
||||
|
||||
@@ -14,11 +14,11 @@ path = "lib.rs"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
garage_db = { version = "0.8.2", default-features = false, path = "../db" }
|
||||
garage_rpc = { version = "0.8.2", path = "../rpc" }
|
||||
garage_table = { version = "0.8.2", path = "../table" }
|
||||
garage_block = { version = "0.8.2", path = "../block" }
|
||||
garage_util = { version = "0.8.2", path = "../util" }
|
||||
garage_db.workspace = true
|
||||
garage_rpc.workspace = true
|
||||
garage_table.workspace = true
|
||||
garage_block.workspace = true
|
||||
garage_util.workspace = true
|
||||
|
||||
async-trait = "0.1.7"
|
||||
arc-swap = "1.0"
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ path = "lib.rs"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
garage_util = { version = "0.8.2", path = "../util" }
|
||||
garage_util.workspace = true
|
||||
|
||||
arc-swap = "1.0"
|
||||
bytes = "1.0"
|
||||
|
||||
@@ -14,9 +14,9 @@ path = "lib.rs"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
garage_db = { version = "0.8.2", path = "../db" }
|
||||
garage_rpc = { version = "0.8.2", path = "../rpc" }
|
||||
garage_util = { version = "0.8.2", path = "../util" }
|
||||
garage_db.workspace = true
|
||||
garage_rpc.workspace = true
|
||||
garage_util.workspace = true
|
||||
|
||||
opentelemetry = "0.17"
|
||||
|
||||
|
||||
+1
-2
@@ -14,7 +14,7 @@ path = "lib.rs"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
garage_db = { version = "0.8.2", path = "../db" }
|
||||
garage_db.workspace = true
|
||||
|
||||
arc-swap = "1.0"
|
||||
async-trait = "0.1"
|
||||
@@ -22,7 +22,6 @@ blake2 = "0.10"
|
||||
bytes = "1.0"
|
||||
digest = "0.10"
|
||||
err-derive = "0.3"
|
||||
git-version = "0.3.4"
|
||||
hexdump = "0.1"
|
||||
xxhash-rust = { version = "0.8", default-features = false, features = ["xxh3"] }
|
||||
hex = "0.4"
|
||||
|
||||
+4
-8
@@ -1,18 +1,14 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use arc_swap::{ArcSwap, ArcSwapOption};
|
||||
use arc_swap::ArcSwapOption;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref VERSION: ArcSwap<&'static str> = ArcSwap::new(Arc::new(git_version::git_version!(
|
||||
prefix = "git:",
|
||||
cargo_prefix = "cargo:",
|
||||
fallback = "unknown"
|
||||
)));
|
||||
static ref VERSION: ArcSwapOption<&'static str> = ArcSwapOption::new(None);
|
||||
static ref FEATURES: ArcSwapOption<&'static [&'static str]> = ArcSwapOption::new(None);
|
||||
}
|
||||
|
||||
pub fn garage_version() -> &'static str {
|
||||
&VERSION.load()
|
||||
VERSION.load().as_ref().unwrap()
|
||||
}
|
||||
|
||||
pub fn garage_features() -> Option<&'static [&'static str]> {
|
||||
@@ -20,7 +16,7 @@ pub fn garage_features() -> Option<&'static [&'static str]> {
|
||||
}
|
||||
|
||||
pub fn init_version(version: &'static str) {
|
||||
VERSION.store(Arc::new(version));
|
||||
VERSION.store(Some(Arc::new(version)));
|
||||
}
|
||||
|
||||
pub fn init_features(features: &'static [&'static str]) {
|
||||
|
||||
+4
-4
@@ -14,10 +14,10 @@ path = "lib.rs"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
garage_api = { version = "0.8.2", path = "../api" }
|
||||
garage_model = { version = "0.8.2", path = "../model" }
|
||||
garage_util = { version = "0.8.2", path = "../util" }
|
||||
garage_table = { version = "0.8.2", path = "../table" }
|
||||
garage_api.workspace = true
|
||||
garage_model.workspace = true
|
||||
garage_util.workspace = true
|
||||
garage_table.workspace = true
|
||||
|
||||
err-derive = "0.3"
|
||||
tracing = "0.1"
|
||||
|
||||
Reference in New Issue
Block a user