Nodes A, B, and C fully in the cluster
Local state before (1): {:pairs {:a :b, :b :c, :c :a}}
D and E want to join
D sends prepare-join-cluster
(1)
E sends prepare-join-cluster
(2)
A, B, C, D, and E play the log
A encounters (1)
{:pairs {:a :b, :b :c, :c :a}}
{:pairs {:a :b, :b :c, :c :a} :prepared {:a :d}}
notify-join-cluster
(3)B, C, D, and E encounter (1)
Pre: {:pairs {:a :b, :b :c, :c :a}}
Post: {:pairs {:a :b, :b :c, :c :a} :prepared {:a :d}}
determines A will attach to D. Records this in the local state.
no reactions
B encounters (2)
{:pairs {:a :b, :b :c, :c :a} :prepared {:a :d}}
{:pairs {:a :b, :b :c, :c :a} :prepared {:a :d, :b :e}}
notify-join-cluster
(4)A, C, D, and E encounter (2)
{:pairs {:a :b, :b :c, :c :a} :prepared {:a :d}}
{:pairs {:a :b, :b :c, :c :a} :prepared {:a :d, :b :e}}
D encounters (3)
{:pairs {:a :b, :b :c, :c :a} :prepared {:a :d, :b :e}}
{:pairs {:a :b, :b :c, :c :a} :prepared {:b :e} :accepted {:a :d}}
accept-join-cluster
(5)A, B, C, E encounter (3)
{:pairs {:a :b, :b :c, :c :a} :prepared {:a :d, :b :e}}
{:pairs {:a :b, :b :c, :c :a} :prepared {:b :e} :accepted {:a :d}}
E encounters (4)
{:pairs {:a :b, :b :c, :c :a} :prepared {:b :e} :accepted {:a :d}}
{:pairs {:a :b, :b :c, :c :a} :accepted {:a :d, :b :e}}
accept-join-cluster
(6)A, B, C, D encounter (4)
{:pairs {:a :b, :b :c, :c :a} :prepared {:b :e} :accepted {:a :d}}
{:pairs {:a :b, :b :c, :c :a} :accepted {:a :d, :b :e}}
A encounters (5)
{:pairs {:a :b, :b :c, :c :a} :accepted {:a :d, :b :e}}
{:pairs {:a :d, :d :b, :b :c, :c :a} :accepted {:b :e}}
B, C, D, E encounter (5)
{:pairs {:a :b, :b :c, :c :a} :accepted {:a :d, :b :e}}
{:pairs {:a :d, :d :b, :b :c, :c :a} :accepted {:b :e}}
B encounters (6)
{:pairs {:a :d, :d :b, :b :c, :c :a} :accepted {:b :e}}
{:pairs {:a :d, :d :b, :b :e, :e :c, :c :a}}
A, C, D, E encounter (6)
{:pairs {:a :d, :d :b, :b :c, :c :a} :accepted {:b :e}}
{:pairs {:a :d, :d :b, :b :e, :e :c, :c :a}}
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close