You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.
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?
The text was updated successfully, but these errors were encountered:
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
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?
The text was updated successfully, but these errors were encountered: