From 2be5501fcf784f2e7c6c952e4225abc50330e19c Mon Sep 17 00:00:00 2001 From: Timofei Larkin Date: Mon, 17 Jun 2024 23:04:43 +0300 Subject: [PATCH] WIP: updates to flowchart --- docs/DESIGN.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 547a732..5a2a2ac 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -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.] @@ -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.] @@ -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) ```