Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

twim should get into aborted state on action onAbort when it is in InProgressPIPAborted state or not #227

Open
zsStrike opened this issue Sep 22, 2021 · 0 comments

Comments

@zsStrike
Copy link
Contributor

zsStrike commented Sep 22, 2021

I have modified writeRow method(in tpcc/schema.h) to send the async write request. Here comes the problem when I run the tpcc script. I have analyzed the output of the test and I found that it is because of the async flush and finalization in advance. The following is exzacly how it happen.

Supposing there are two transactions(T1, T2) writing the same key. T1 firstly writes the key, and T2 writes the same key. Then k2node will make a push operation, and T2 wins. In this very scene, we assue that T1's twim has not been persisted yet when performing a push, so T1's twim state changes from inProgressPIP to inProgressPIPAborted, and T1's state changes from inProgress to ForceAborted. In the optimized design, we konw that performing the finalization task asyncly in ForceAborted. If the finalization task finshed before any flush which drives T1 twim's state from inProgressPIP to Aborted(only on action onPersistSucceed and onPersistFail), then we get the problem. According to the handleTxnFinalize method, it first call endTxn, then finalizingWIs methods to drive the T1's twim state. T1's twim state changed from inProgressPIP to inProgressPIP(onAbort in endTxn), then return S500 error in inProgressPIP since it recieves the onFinalize action(in finalizingWIs).

So, that's the problem. I have tried to make a unit test to reproduce the scenario, but unfortunately, during my test, seastar will call the flush task before the finalization task, which makes T1's twim state get into Aborted state from inProgressPIPAborted and thus not produce the same scenario talked before.

I now only change the transition(step into Aborted state onAbort action in inProgerssPIPAborted) to make the whole thing works, any better options?

@zsStrike zsStrike changed the title twim should get into aborted state on action onAbort when it is in InProgressPIPAborted state twim should get into aborted state on action onAbort when it is in InProgressPIPAborted state or not Sep 22, 2021
@zsStrike zsStrike reopened this Sep 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant