aboutsummaryrefslogtreecommitdiff
path: root/src/table_sync.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-21 16:15:32 +0000
committerAlex Auvolat <alex@adnab.me>2020-04-21 16:15:32 +0000
commita04218047ece73aff8ef0647ae55d3f496f709f3 (patch)
tree13b32be794dac150e9fe4c05a081b5e29cbb1bc4 /src/table_sync.rs
parent2a84d965abc07e4438bd0936dd6cf3307a8a2024 (diff)
downloadgarage-a04218047ece73aff8ef0647ae55d3f496f709f3.tar.gz
garage-a04218047ece73aff8ef0647ae55d3f496f709f3.zip
Do full sync on node (re)start
Diffstat (limited to 'src/table_sync.rs')
-rw-r--r--src/table_sync.rs9
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
}