Assumptions
- State change message will be sent after action is performed successfully (so that the action timestamp < message timestamp)
- No out of order messages
- STARTING is safe state change -> no multiple messages, no missed messages, no out of order messages
Changes required
- Store the latest message timestamp along with the run record during update
- Ignore a message if message timestamp is equal or less than what is recorded
- Run record corrector will only process run records before the last processed message time
- Make scheduler listen to the changes published by AppMetadataStore
- AppMetadataStore will publish the finally resolved state message transactionally along with the store update
- Update code to match the new states in the state diagram
State Transition Diagram