Skip to content

Commit

Permalink
update flowchart
Browse files Browse the repository at this point in the history
  • Loading branch information
lllamnyp committed May 7, 2024
1 parent 246ba85 commit b81595b
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,37 @@ flowchart TD
A0 --> A1[Connect to the cluster\nand fetch all statuses]
A1 --> |Got some response| AA{Is cluster\nin quorum?}
AA -->|Yes| AAA{All reachable\nmembers have the\nsame cluster ID?}
AAA -->|Yes| AAAA{Are the\nmember ordinals\ncontiguous?}
AAAA -->|Yes| AAAAA{Have all\nmembers been\nreached?}
AAAAA -->|Yes| AAAAAA{Is the\nStatefulSet\npresent?}
AAAAAA -->|Yes| AAAAAAA{Is it\nready?}
AAAAAAA -->|Yes| AAAAAAAA{Is its size\nequal to the\nnumber of\n members?}
AAAAAAAA -->|Yes| AAAAAAAAA{Is the\nEtcdCluster\nsize equal to the\nStatefulSet\nsize?}
AAAAAAAAA -->|Yes| AAAAAAAAAA[Set cluster\nstatus to ready.]
AAAAAAAAAA --> HappyStop([Stop])
AAA -->|Yes| AAAA[Promote any learners.]
AAAA -->|OK| AAAA0[Ensure configmap with initial cluster\nmatching existing members and\ncluster state=existing]
AAAA0 -->|OK| AAAA1[Ensure StatefulSet with\nreplicas = max member ordinal + 1]
AAAA1 -->|OK| AAAAA{Have all members\nbeen reached?}
AAAAA -->|Yes| AAAAAA{Is it\nready?}
AAAAAA -->|Yes| AAAAAAA{Is its size\nequal to the\nnumber of\n members?}
AAAAAAA -->|Yes| AAAAAAAA{Is the\nEtcdCluster\nsize equal to the\nStatefulSet\nsize?}
AAAAAAAA -->|Yes| AAAAAAAAA[Set cluster\nstatus to ready.]
AAAAAAAAA --> HappyStop([Stop])
AAAAAAAAA --> |No, desired\nsize larger|AAAAAAAAAB[Ensure ConfigMap with\ninitial cluster state existing\nand initial cluster URLs\nequal to current cluster\nplus one member, do\n'member add' API call and\nincrement StatefulSet size.]
AAAAAAAAAB --> ScaleUpStop([Stop])
AAAAAAAA --> |No, desired\nsize larger| AAAAAAAAB[Ensure ConfigMap with\ninitial cluster state existing\nand initial cluster URLs\nequal to current cluster\nplus one member, do\n'member add' API call and\nincrement StatefulSet size.]
AAAAAAAAB --> ScaleUpStop([Stop])
AAAAAAAAA --> |No, desired\nsize smaller|AAAAAAAAAC[Member remove API\ncall, then decrement\nStatefulSet size.]
AAAAAAAAAC --> ScaleDownStop([Stop])
AAAAAAAA --> |No, desired\nsize smaller| AAAAAAAAC[Member remove API\ncall, then decrement\nStatefulSet size\nthen delete PVC.]
AAAAAAAAC --> ScaleDownStop([Stop])
AAAAAAAA -->|No,\ngreater| AAAAAAAAB([This is 146%\nsplitbrain, stop.])
AAAAAAAA --> |Etcd replicas=0\nSTS replicas=1| AAAAAAAAD[Decrement\nSTS to zero]
AAAAAAAAD --> ScaleToZeroStop([Stop])
AAAAAAAA -->|No,\nsmaller| AAAAAAAAC([StatefulSetController\nis not working as\nit should, stop.])
AAAAAAA -->|No,\ngreater| AAAAAAAB([This is 146%\nsplitbrain, stop.])
AAAAAAA -->|No| AAAAAAAB[The non-ready replicas\nare evicted members,\nthey should be removed.]
AAAAAAA -->|No,\nsmaller| AAAAAAAC([StatefulSetController\nis not working as\nit should, stop.])
AAAAAA -->|No| AAAAAAB[The non-ready replicas\nare evicted members,\nthey should be removed.]
AAAAA -->|No| AAAAAB{asd}
AAAA -->|Error| AAAAB([Requeue])
AAAA0 -->|Error| AAAAB([Requeue])
AAAA1 -->|Error| AAAAB([Requeue])
AAA -->|No| AAAB[Cluster is in\nsplit-brain. Set\nerror status.]
AAAB --> AAABStop([Stop])
Expand Down

0 comments on commit b81595b

Please sign in to comment.