Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Valid operation orders

Sumit Rawal answered on May 21, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers


Valid operation orders

0

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.

Popularity 1/10 Helpfulness 1/10 Language whatever
Source: Grepper
Link to this answer
Share Copy Link
Contributed on May 21 2023
Sumit Rawal
0 Answers  Avg Quality 2/10


X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
X
Grepper Account Login Required

Oops, You will need to install Grepper and log-in to perform this action.