diff options
author | Alex Auvolat <alex@adnab.me> | 2021-02-23 18:14:37 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-02-23 18:14:37 +0100 |
commit | 6e6f7e8555ad488a8b4d67ba640ddad933aa2654 (patch) | |
tree | e389f2238c0516c01a1b468e4b1c884176680d40 /src/table/table_fullcopy.rs | |
parent | e8e4418ca7c0b1156d5bc103b164aa72ecb748b9 (diff) | |
download | garage-6e6f7e8555ad488a8b4d67ba640ddad933aa2654.tar.gz garage-6e6f7e8555ad488a8b4d67ba640ddad933aa2654.zip |
Replace some checksums where it makes sense
Diffstat (limited to 'src/table/table_fullcopy.rs')
-rw-r--r-- | src/table/table_fullcopy.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/table/table_fullcopy.rs b/src/table/table_fullcopy.rs index e6f2c5fc..64ac89ee 100644 --- a/src/table/table_fullcopy.rs +++ b/src/table/table_fullcopy.rs @@ -44,7 +44,7 @@ impl TableFullReplication { let mut nodes = vec![]; for (node, _) in ring.config.members.iter() { - let node_ranking = sha256sum(&[node.as_slice(), my_id.as_slice()].concat()); + let node_ranking = fasthash(&[node.as_slice(), my_id.as_slice()].concat()); nodes.push((*node, node_ranking)); } nodes.sort_by(|(_, rank1), (_, rank2)| rank1.cmp(rank2)); @@ -54,6 +54,7 @@ impl TableFullReplication { .filter(|node| *node != my_id) .take(self.write_factor) .collect::<Vec<_>>(); + neighbors.push(my_id); self.neighbors.swap(Some(Arc::new(Neighbors { ring, |