aboutsummaryrefslogtreecommitdiff
path: root/src/garage/admin_rpc.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-05-28 12:36:22 +0200
committerAlex Auvolat <alex@adnab.me>2021-05-28 14:07:36 +0200
commitb490ebc7f6058719bd22c86fd0db95b09dc027d6 (patch)
treee1c59ce1c348c2c63e1b2604369997216ef554d1 /src/garage/admin_rpc.rs
parentc8aa1eb481c18b1a35ef45d37071ab1af804a382 (diff)
downloadgarage-b490ebc7f6058719bd22c86fd0db95b09dc027d6.tar.gz
garage-b490ebc7f6058719bd22c86fd0db95b09dc027d6.zip
Many improvements on ring/replication and its configuration:
- Explicit "replication_mode" configuration parameters that takes either "none", "2" or "3" as values, instead of letting user configure replication factor themselves. These are presets whose corresponding replication/quorum values can be found in replication/mode.rs - Explicit support for single-node and two-node deployments (number of nodes must be at least "replication_mode", with "none" we can have only one node) - Ring is now stored much more compactly with 256*8 + n*32 bytes, instead of 256*32 bytes - Support for gateway-only nodes that do not store data (these nodes still need a metadata_directory to store the list of bucket and keys since those are stored on all nodes; it also technically needs a data_directory to start but it will stay empty unless we have bugs)
Diffstat (limited to 'src/garage/admin_rpc.rs')
-rw-r--r--src/garage/admin_rpc.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/garage/admin_rpc.rs b/src/garage/admin_rpc.rs
index f2d11bb3..b1538a30 100644
--- a/src/garage/admin_rpc.rs
+++ b/src/garage/admin_rpc.rs
@@ -430,8 +430,8 @@ impl AdminRpcHandler {
// Gather ring statistics
let ring = self.garage.system.ring.borrow().clone();
let mut ring_nodes = HashMap::new();
- for r in ring.ring.iter() {
- for n in r.nodes.iter() {
+ for (_i, loc) in ring.partitions().iter() {
+ for n in ring.get_nodes(loc, ring.replication_factor).iter() {
if !ring_nodes.contains_key(n) {
ring_nodes.insert(*n, 0usize);
}