#2186 [BUG] Possible phase overwrite
Issue created by
katrogan
### Describe the bug
Currently when flyteadmin receives an execution event it first fetches the existing execution record and validates the event is making progress on a valid phase change. However, in the interim a subsequent event could be sent and a possible race condition occurs where one is recorded even though the first event could presumably be written last.
So you could get something likee
db: RUNNING
event 1: ABORTING
event 2: ABORTED
event 2 is written after event 1 validation succeeds but before event 1 is fully recorded. so the final state is incorrectly ABORTING.
### Expected behavior
Database writes should use transactions to guarantee phase transition constraints.
### Additional context to reproduce
No response
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flyte