diff options
author | Benety Goh <benety@mongodb.com> | 2019-03-07 19:01:36 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2019-03-07 19:01:36 -0500 |
commit | a76788e89bf54abacccefeba62d4e3775f20c555 (patch) | |
tree | 3340c1e46d58dae65c45d8f73a611b58127c0dea /src/mongo/db/transaction_participant.h | |
parent | 5a7ccd5f073341f5f98e0ced39a80416869c181b (diff) | |
download | mongo-a76788e89bf54abacccefeba62d4e3775f20c555.tar.gz |
Revert "SERVER-39441 Write the new 'prepareTransaction' command on primary"
This reverts commit 86c1120002b6f28183f024f373ecc58123624a46.
Diffstat (limited to 'src/mongo/db/transaction_participant.h')
-rw-r--r-- | src/mongo/db/transaction_participant.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/mongo/db/transaction_participant.h b/src/mongo/db/transaction_participant.h index 6d05089b284..a3673ef544d 100644 --- a/src/mongo/db/transaction_participant.h +++ b/src/mongo/db/transaction_participant.h @@ -796,29 +796,22 @@ private: */ class OplogSlotReserver { public: - OplogSlotReserver(OperationContext* opCtx, int numSlotsToReserve = 1); + OplogSlotReserver(OperationContext* opCtx); ~OplogSlotReserver(); /** - * Returns the latest oplog slot reserved at construction. + * Returns the oplog slot reserved at construction. */ - OplogSlot getLastSlot() { - invariant(!_oplogSlots.empty()); - invariant(!_oplogSlots.back().opTime.isNull()); - return getSlots().back(); - } - - std::vector<OplogSlot>& getSlots() { - invariant(!_oplogSlots.empty()); - invariant(!_oplogSlots.back().opTime.isNull()); - return _oplogSlots; + OplogSlot getReservedOplogSlot() const { + invariant(!_oplogSlot.opTime.isNull()); + return _oplogSlot; } private: OperationContext* _opCtx; std::unique_ptr<Locker> _locker; std::unique_ptr<RecoveryUnit> _recoveryUnit; - std::vector<OplogSlot> _oplogSlots; + OplogSlot _oplogSlot; }; friend std::ostream& operator<<(std::ostream& s, TransactionState txnState) { |