Affects Version/s: None
Fix Version/s: 4.2.0
StatusTransitService doesn't acquire lock while updating DB.
We noticed one such issue while doing HA testing, thanks to [~mchiang]
We issue a change command to change pause time, which got executed on one server. While change command was running on one server, other server started executing StatusTransitService.
Server 1 log
Server 2 log
CoordMaterializeTransitionXCommand has created all actions( few were in waiting and few were in running state) and set doneMaterialization to true.
Change command deletes all waiting coords, except 3 running/SUCCEEDED action and reset doneMaterialization.
StatusTransitService first loads a set of pending jobs and for each job it make DB calls to check coord action status. Coord jobs are loaded only once in beginning.
This is what happened.
1.StatusTransitService loads the coord job which doneMaterialization is set to true at 17:28:05,268 (server 1)
2.Change command deletes waiting cation and reset doneMaterialization at 17:28:06,508 (server 2)
3.StatusTransitService load actions for job, only 3 and in SUCCEEDED status. It never reload the doneMaterialization at 17:28:09,694 (server 1)
StatusTransitService overrides set job status to SUCCEEDED, bcz it's doneMaterialization and all action are SUCCEEDED.