summaryrefslogtreecommitdiff
path: root/src/mongo/db/transaction_participant.h
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2019-03-07 19:01:36 -0500
committerBenety Goh <benety@mongodb.com>2019-03-07 19:01:36 -0500
commita76788e89bf54abacccefeba62d4e3775f20c555 (patch)
tree3340c1e46d58dae65c45d8f73a611b58127c0dea /src/mongo/db/transaction_participant.h
parent5a7ccd5f073341f5f98e0ced39a80416869c181b (diff)
downloadmongo-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.h19
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) {