Serialize every order state transition under a row lock

Merge request for #3611850.

Routes lockTransaction/placeTransaction/unlockTransaction and the cancel terminal stamp through the same SELECT ... FOR UPDATE row lock recomputeState already used, so concurrent transitions on one order serialize (compare-and-set) instead of racing on a stale read.

Merge request reports

Loading