aboutsummaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
Diffstat (limited to 'src/table')
-rw-r--r--src/table/table_sharded.rs1
-rw-r--r--src/table/table_sync.rs12
2 files changed, 11 insertions, 2 deletions
diff --git a/src/table/table_sharded.rs b/src/table/table_sharded.rs
index 098637dd..47bdfeaf 100644
--- a/src/table/table_sharded.rs
+++ b/src/table/table_sharded.rs
@@ -44,6 +44,7 @@ impl TableReplication for TableShardedReplication {
fn split_points(&self, ring: &Ring) -> Vec<Hash> {
let mut ret = vec![];
+ ret.push([0u8; 32].into());
for entry in ring.ring.iter() {
ret.push(entry.location);
}
diff --git a/src/table/table_sync.rs b/src/table/table_sync.rs
index 5fa6793b..c38b6bd5 100644
--- a/src/table/table_sync.rs
+++ b/src/table/table_sync.rs
@@ -18,10 +18,14 @@ use garage_util::error::Error;
use crate::*;
const MAX_DEPTH: usize = 16;
-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);
+// Scan & sync every 12 hours
+const SCAN_INTERVAL: Duration = Duration::from_secs(12 * 60 * 60);
+
+// Expire cache after 30 minutes
+const CHECKSUM_CACHE_TIMEOUT: Duration = Duration::from_secs(30 * 60);
+
pub struct TableSyncer<F: TableSchema, R: TableReplication> {
table: Arc<Table<F, R>>,
todo: Mutex<SyncTodo>,
@@ -797,6 +801,10 @@ impl SyncTodo {
for i in 0..split_points.len() - 1 {
let begin = split_points[i];
let end = split_points[i + 1];
+ if begin == end {
+ continue;
+ }
+
let nodes = table.replication.replication_nodes(&begin, &ring);
let retain = nodes.contains(&my_id);