Skip to content

Commit

Permalink
WIP: updates to flowchart
Browse files Browse the repository at this point in the history
  • Loading branch information
lllamnyp committed Jun 17, 2024
1 parent 9509c1e commit 2be5501
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ primitives and gives an overview of the underlying implementation.
```mermaid
flowchart TD
Start(Start) --> A0[Ensure service.]
A0 --> A1[Connect to the cluster\nand fetch all statuses.]
A1 --> |Got some response| AA{All reachable\nmembers have the\nsame cluster ID?}
A0 --> A1{Are there any\nendpoints?}
A1 --> |Yes| A2[Connect to the cluster\nand fetch all statuses.]
A2 --> |Got some response| AA{All reachable\nmembers have the\nsame cluster ID?}
AA --> |Yes| AAA{Is cluster\nin quorum?}
AAA --> |Yes| AAAA{Are all members \nmanaged by the operator?}
AAAA --> |Yes| AAAAA0[Promote any learners.]
Expand Down Expand Up @@ -46,8 +47,15 @@ flowchart TD
AA --> |No| AAB[Cluster is in\nsplit-brain. Set\nerror status.]
AAB --> AABStop([Stop])
A1 --> |No members\nreached| AB{Is the correct\nzero-replica STS\npresent?}
AB --> |Yes| ABA{EtcdCluster\n.spec.replicas==0?}
A1 --> |No| A1B{Is the STS\npresent?}
A1B --> |Yes| A1BA{Does it have the\ncorrect pod spec?}
A1BA --> |Yes| A1BAA{Is it\nready?}
A1BAA --> |Yes| ABA{Then it must have\nspec.replicas==0\n Is EtcdCluster\n.spec.replicas==0?}
A1BAA --> |No| A1BAAB([Stop and wait, either\nit will turn ready soon\nand the next reconcile\nwill move things along,\nor user intervention is\nneeded])
A1BA --> |No| A1BAB[Patch the podspec]
A1B --> |No| A1BB[Create configmap, initial state new\ninitial cluster according to spec.\nreplicas, create statefulset.]
A2 --> |No members\nreached| AB{Is the correct\nzero-replica STS\npresent?}
AB --> |Yes|abc
ABA --> |Yes| ABAA([Cluster successfully\nscaled to zero, stop.])
ABA --> |No| ABAB[Ensure ConfigMap with\ninitial cluster = new,\ninitial cluster peers with\nsingle member `name`-0]
ABAB --> |OK| ABABA[Increment STS size.]
Expand All @@ -64,7 +72,4 @@ flowchart TD
ABB --> |No| ABBB[Create a zero-\nreplica STS]
ABBB --> |OK| ABBBA([Stop])
ABBB --> |Error| ABBBB([Requeue])
A0 --> |Unexpected\nerror| AC(Requeue)
A1 --> |Unexpected\nerror| AC(Requeue)
```

0 comments on commit 2be5501

Please sign in to comment.