aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/ring.rs
diff options
context:
space:
mode:
authorMendes <mendes.oulamara@pm.me>2022-09-21 14:39:59 +0200
committerMendes <mendes.oulamara@pm.me>2022-09-21 14:39:59 +0200
commit7f3249a23770fd4da981c2ecb1126da97e9b4ca5 (patch)
tree93d3dec24948a8dcd5cf42b2889f67c414a9bf42 /src/rpc/ring.rs
parentc4adbeed515c571369453d23c7f1d84b1db994ec (diff)
downloadgarage-7f3249a23770fd4da981c2ecb1126da97e9b4ca5.tar.gz
garage-7f3249a23770fd4da981c2ecb1126da97e9b4ca5.zip
New version of the algorithm that calculate the layout.
It takes as paramters the replication factor and the zone redundancy, computes the largest partition size reachable with these constraints, and among the possible assignation with this partition size, it computes the one that moves the least number of partitions compared to the previous assignation. This computation uses graph algorithms defined in graph_algo.rs
Diffstat (limited to 'src/rpc/ring.rs')
-rw-r--r--src/rpc/ring.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rpc/ring.rs b/src/rpc/ring.rs
index 73a126a2..743a5cba 100644
--- a/src/rpc/ring.rs
+++ b/src/rpc/ring.rs
@@ -40,6 +40,7 @@ pub struct Ring {
// Type to store compactly the id of a node in the system
// Change this to u16 the day we want to have more than 256 nodes in a cluster
pub type CompactNodeType = u8;
+pub const MAX_NODE_NUMBER: usize = 256;
// The maximum number of times an object might get replicated
// This must be at least 3 because Garage supports 3-way replication