diff --git a/design/reconciliation.md b/design/reconciliation.md index b0fc062..adcde18 100644 --- a/design/reconciliation.md +++ b/design/reconciliation.md @@ -1,27 +1,26 @@ # Cluster Membership Reconciliation -## Recovery +## Reconciliation Given a desired size S, we have two membership states: - running pods P in k8s cluster - membership M in controller knowledge -Recovery is the process to make these two states consistent. Assuming “len(M) = S” here. +Reconciliation is the process to make these two states consistent with the desired size S. For each reconciling cycle, we get P from k8s API. Comparing M and P, we have the following steps: 1. Remove all pods from set P that does not belong to set M 2. P’ consist of remaining pods of P -3. If P’ = M, the current state matches the membership state. END. +3. If P’ = M, the current state matches the membership state. GOTO Resize. 4. If len(P’) < len(M)/2 + 1, quorum lost. Go to recovery process (TODO). -5. Add one missing member. END. +5. Remove one member that in M but does not in P's. GOTO Resize. -## Resize - -Before resizing an etcd cluster, we need to ensure the running Pods set matches the membership knowledge. Or we need to do recovery first. +### Resize Given a desired size S and membership size M: -1. If S = M, then END. -2. If S > M, add one member. END. -3. If S < M, remove one member. END \ No newline at end of file +1. If P' != M, then END. +2. If S = M, then END. +3. If S > M, add one member. END. +4. If S < M, remove one member. END