diff options
author | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2018-12-11 18:19:10 -0500 |
---|---|---|
committer | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2019-01-07 21:20:54 -0500 |
commit | c2892222a633609fd14706062d8ed6086352004d (patch) | |
tree | 7693f9400cdb027fab872fa9073b61b038cf9d86 /src/mongo/db/transaction_participant.h | |
parent | 327a6bd87961eb7d3cd2a4cd90170e868adf2112 (diff) | |
download | mongo-c2892222a633609fd14706062d8ed6086352004d.tar.gz |
SERVER-38282 Step-up reacquires locks for prepared transactions
Diffstat (limited to 'src/mongo/db/transaction_participant.h')
-rw-r--r-- | src/mongo/db/transaction_participant.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/transaction_participant.h b/src/mongo/db/transaction_participant.h index 6334090f4a0..67aadb20aa1 100644 --- a/src/mongo/db/transaction_participant.h +++ b/src/mongo/db/transaction_participant.h @@ -87,11 +87,13 @@ public: */ class TxnResources { public: + enum class StashStyle { kPrimary, kSecondary, kSideTransaction }; + /** * Stashes transaction state from 'opCtx' in the newly constructed TxnResources. * Ephemerally holds the Client lock associated with opCtx. */ - TxnResources(OperationContext* opCtx, bool keepTicket = false); + TxnResources(OperationContext* opCtx, StashStyle stashStyle); ~TxnResources(); // Rule of 5: because we have a class-defined destructor, we need to explictly specify @@ -290,6 +292,11 @@ public: std::vector<repl::ReplOperation> endTransactionAndRetrieveOperations(OperationContext* opCtx); /** + * Yield or reacquire locks for prepared transacitons, used on replication state transition. + */ + void refreshLocksForPreparedTransaction(OperationContext* opCtx, bool yieldLocks); + + /** * May only be called while a multi-document transaction is not committed and adds the multi-key * path info to the set of path infos to be updated at commit time. */ |