Skip to content

Commit 041b653

Browse files
committed
Add state diagram for compute
Models a compute's lifetime.
1 parent 55c4ef4 commit 041b653

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

compute_tools/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,29 @@ compute_ctl -D /var/db/postgres/compute \
3232
-b /usr/local/bin/postgres
3333
```
3434

35+
## State Diagram
36+
37+
Computes can be in various states. Below is a diagram that details how a
38+
compute moves between states.
39+
40+
```mermaid
41+
%% https://mermaid.js.org/syntax/stateDiagram.html
42+
stateDiagram-v2
43+
[*] --> Empty : Compute spawned
44+
Empty --> ConfigurationPending : Waiting for compute spec
45+
ConfigurationPending --> Configuration : Received compute spec
46+
Configuration --> Failed : Failed to configure the compute
47+
Configuration --> Running : Compute has been configured
48+
Empty --> Init : Compute spec is immediately available
49+
Empty --> TerminationPending : Requested termination
50+
Init --> Failed : Failed to start Postgres
51+
Init --> Running : Started Postgres
52+
Running --> TerminationPending : Requested termination
53+
TerminationPending --> Terminated : Terminated compute
54+
Failed --> [*] : Compute exited
55+
Terminated --> [*] : Compute exited
56+
```
57+
3558
## Tests
3659

3760
Cargo formatter:

0 commit comments

Comments
 (0)