diff options
author | Alex Auvolat <alex@adnab.me> | 2020-04-21 16:15:32 +0000 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-04-21 16:15:32 +0000 |
commit | a04218047ece73aff8ef0647ae55d3f496f709f3 (patch) | |
tree | 13b32be794dac150e9fe4c05a081b5e29cbb1bc4 /src | |
parent | 2a84d965abc07e4438bd0936dd6cf3307a8a2024 (diff) | |
download | garage-a04218047ece73aff8ef0647ae55d3f496f709f3.tar.gz garage-a04218047ece73aff8ef0647ae55d3f496f709f3.zip |
Do full sync on node (re)start
Diffstat (limited to 'src')
-rw-r--r-- | src/table_sync.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/table_sync.rs b/src/table_sync.rs index bfbde285..aa0610e5 100644 --- a/src/table_sync.rs +++ b/src/table_sync.rs @@ -18,7 +18,7 @@ use crate::membership::Ring; use crate::table::*; const MAX_DEPTH: usize = 16; -const SCAN_INTERVAL: Duration = Duration::from_secs(1800); +const SCAN_INTERVAL: Duration = Duration::from_secs(3600); const CHECKSUM_CACHE_TIMEOUT: Duration = Duration::from_secs(1800); const TABLE_SYNC_RPC_TIMEOUT: Duration = Duration::from_secs(30); @@ -131,6 +131,13 @@ where ) .await; + let s3 = syncer.clone(); + table.system.background.spawn(async move { + tokio::time::delay_for(Duration::from_secs(20)).await; + s3.add_full_scan().await; + Ok(()) + }); + syncer } |