The current ACM state machine works but it is incosistent in the way it handles error states or failed transitions. A composition and its elements can get "stuck" in transition states.
We need to
- Specify what the current state machine is for both compositions and elements and describe what the state machine for both should be
- Specify what the behaviour of the runtime and participants should be in each state
- Specify what the behaviour should be for the runtime and participants should be in transitions
Specifically we need to clarify:
- State of the composition elements
- State of the overall composition is derived from the composition element states
- Admin state/Running state
- When all the elements are fully up and configured, the go to state Passive, when all elements are in Passive, the full composition goes to Passive
- Error states: Are they parallel sates or part of the same state?
- There should “it didn’t work” states like “Passive-Error” or “Run_Error” (names to be decided later)
- Describe what the “Running” state means and what the participant should do in Passive->Running and Running->Passive transitions.
- Say a K8S service crashes, how do we feed that back? Running_Error. The state of the POD is only checked during startup. It is not periodically checked. There should be supervision.
Discuss priming and what the relationship is with this.
What does PASSIVE and RUNNING mean?
UNINITIALIZED: The participant knows about the AC Element and it's values and definition are in the participant but it hasn't started it yet. For example, in the K8S participant, the K8S participant knows the helm charts to use, the aprameter vales for config, but it hasn't called HELM yet to start the microservice
PASSIVE: The participant has started the AC Element. EG in the K8s PPNT, thelm has started the microservice, the micorservice is up and running but it is not doing anything yet.
ACTIVE: The participant has decided that the AC Element is working doing "Application" work. The state ACTIVE is controlled by the participant.
Indicate in each state, what is the expectation of the participants in each state.
ACM Element States in Participants
This section describes the state handling in ACM Elements in Participants
The following states are the only states in participants:
PlantUML Macro | ||||
---|---|---|---|---|
| ||||
@startuml
[*] --> UNINITIALIZED: Created by\nACM Runtime
UNINITIALIZED --> PASSIVE: Initialize (Success)
UNINITIALIZED --> UNINITIALIZED_ERROR: Initialize (Error)
PASSIVE --> UNINITIALIZED: Uninitialize (Success)
PASSIVE --> PASSIVE_ERROR: Uninitialize (Error)
PASSIVE_ERROR --> UNINITIALIZED: Uninitialize (Success)
PASSIVE_ERROR --> PASSIVE_ERROR: Uninitialize (Error)
UNINITIALIZED_ERROR --> UNINITIALIZED: UnitializeReset (Success)
UNINITIALIZED_ERROR --> UNINITIALIZED_ERROR: UnitializeReset (Error)
PASSIVE --> RUNNING: Activate (Success)
PASSIVE --> PASSIVE_ERROR: Activate (Failure)
PASSIVE_ERROR --> PASSIVE: PassiveReset (Success)
PASSIVE_ERROR --> PASSIVE_ERROR: PassiveReset (Failure)
PASSIVE_ERROR --> UNINITIALIZED_ERROR: ForceUninitialize
RUNNING --> PASSIVE: Passivate (Success)
RUNNING --> RUNNING_ERROR: Passivate (Error)
RUNNING_ERROR --> PASSIVE: Passivate (Success)
RUNNING_ERROR --> RUNNING_ERROR: Passivate (Error)
RUNNING --> RUNNING_ERROR: RuntimeError
RUNNING_ERROR --> RUNNING: ClearRuntimeError
RUNNING_ERROR --> RUNNING: RuntimeReset
RUNNING_ERROR --> PASSIVE_ERROR: ForcePassive
@enduml |
Then, a Control Loop Element can be running a number of operations, each of which has an operational state:
...
To
State
...
Triggered
By
...
UNINITIALIZED
UNINITIALIZED
...
PASSIVE
UNINITIALIZED_ERROR
...
Success
Fail
...
PASSIVE
PASSIVE
PASSIVE_ERROR
PASSIVE_ERROR
...
UNINITIALIZED
PASSIVE_ERROR
UNINITIALIZED
PASSIVE_ERROR
...
Success
Fail
Success
Fail
...
ACM Runtime
...
UNINITIALIZED_ERROR
UNINITIALIZED_ERROR
...
UNINITIALIZED
UNINITIALIZED_ERROR
...
Success
Fail
...
ACM Runtime
...
PASSIVE
PASSIVE
...
RUNNING
PASSIVE_ERROR
...
Success
Fail
...
PASSIVE_ERROR
PASSIVE_ERROR
...
PASSIVE
PASSIVE_ERROR
...
Success
Fail
...
ACM Runtime
Participant
...
RUNNING
RUNNING
RUNNING_ERROR
RUNNING_ERROR
...
PASSIVE
RUNNING_ERROR
PASSIVE
RUNNING_ERROR
...
Success
Fail
...
ACM Runtime
Participant
...
A Control Loop Element has a status indicator
...
Each participant also records a log of all operations that occur, recording the information below:
...
To
State
...