-
Nodes A, B, and C fully in the cluster
-
Local state before (1):
{:pairs {:a :b, :b :c, :c :a}}
-
D wants to join
-
D sends
prepare-join-cluster
(1) -
A, B, C, and D play the log
-
D encounters (1)
- Pre:
{:pairs {:a :b, :b :c, :c :a}}
- Post:
{:pairs {:a :b, :b :c, :c :a} :prepared {:d :a}}
- determines D will attach to A. Records this in the local state.
- adds watch to A
- sends
notify-join-cluster
(2) - D dies. No peer is watching, so this isn't reported
- Pre:
-
A, B, C encounter (1)
- Pre:
{:pairs {:a :b, :b :c, :c :a}}
- Post:
{:pairs {:a :b, :b :c, :c :a} :prepared {:d :a}}
- ignore
- Pre:
-
A, B encounter (2):
- Pre:
{:pairs {:a :b, :b :c, :c :a} :prepared {:d :a}}
- Post:
{:pairs {:a :b, :b :c, :c :a} :accepted {:d :a}
- ignore
- Pre:
-
C encounters (2):
- Pre:
{:pairs {:a :b, :b :c, :c :a} :prepared {:d :a}}
- Post:
{:pairs {:a :b, :b :c, :c :a} :accepted {:d :a}
- tries to add a watch to D, notices its dead
- sends
abort-join-cluster
(3)
- Pre:
A, B, C encounter (3):
- Pre:
{:pairs {:a :b, :b :c, :c :a} :accepted {:d :a}
- Post:
{:pairs {:a :b, :b :c, :c :a}
- rollback accepted peer