diff options
author | Alex Auvolat <alex@adnab.me> | 2020-04-17 15:36:16 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-04-17 15:40:13 +0200 |
commit | e41ce4d81528388f043c1c5e6608df45347ea70d (patch) | |
tree | ee25f06b6f7da356c53d5f0a8fc8ec9e81d4bb23 /src/server.rs | |
parent | 867646093b24a9bb7e4b24a7f2248615c6e03fde (diff) | |
download | garage-e41ce4d81528388f043c1c5e6608df45347ea70d.tar.gz garage-e41ce4d81528388f043c1c5e6608df45347ea70d.zip |
Implement getting missing blocks when RC increases
Issue: RC increases also when the block ref entry is first put by the actual client.
At that point the client is probably already sending us the block content,
so we don't need to do a get...
We should add a delay before the task is added or find something to do.
Diffstat (limited to 'src/server.rs')
-rw-r--r-- | src/server.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server.rs b/src/server.rs index 78b992f5..287b4386 100644 --- a/src/server.rs +++ b/src/server.rs @@ -17,7 +17,7 @@ use crate::proto::*; use crate::rpc_server; use crate::table::*; -#[derive(Deserialize, Debug)] +#[derive(Deserialize, Debug, Clone)] pub struct Config { pub metadata_dir: PathBuf, pub data_dir: PathBuf, @@ -39,7 +39,7 @@ pub struct Config { pub rpc_tls: Option<TlsConfig>, } -#[derive(Deserialize, Debug)] +#[derive(Deserialize, Debug, Clone)] pub struct TlsConfig { pub ca_cert: String, pub node_cert: String, @@ -48,9 +48,9 @@ pub struct TlsConfig { pub struct Garage { pub db: sled::Db, + pub background: Arc<BackgroundRunner>, pub system: Arc<System>, pub block_manager: Arc<BlockManager>, - pub background: Arc<BackgroundRunner>, pub table_rpc_handlers: HashMap<String, Box<dyn TableRpcHandler + Sync + Send>>, @@ -66,9 +66,9 @@ impl Garage { db: sled::Db, background: Arc<BackgroundRunner>, ) -> Arc<Self> { - let block_manager = Arc::new(BlockManager::new(&db, config.data_dir.clone())); + let system = Arc::new(System::new(config.clone(), id, background.clone())); - let system = Arc::new(System::new(config, id, background.clone())); + let block_manager = BlockManager::new(&db, config.data_dir.clone(), system.clone()).await; let data_rep_param = TableReplicationParams { replication_factor: system.config.data_replication_factor, |