There are three choices for the Try phase:
Try phase choices Account A Account C
Choice 1 -$1 NOP
Choice 2 NOP +$1
Choice 3 -$1 +$1
Table 4 Try phase choices
All three choices look plausible, but some are not valid.
For choice 2, if the Try phase on account C is successful, but has failed on account A (NOP), the wallet service needs to enter the Cancel phase. There is a chance that somebody else may jump in and move the
1awayfromaccountC.Laterwhenthewalletservicetriestodeduct1 from account C, it finds nothing is left, which violates the transactional guarantee of a distributed transaction.
For choice 3, if
1isdeductedfromaccountAandaddedtoaccountCconcurrently,itintroduceslotsofcomplications.Forexample,1 is added to account C, but it fails to deduct the money from account A. What should we do in this case?
Therefore, choice 2 and choice 3 are flawed choices and only choice 1 is valid.