summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/oplog.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/repl/oplog.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/repl/oplog.h')
-rw-r--r--src/mongo/db/repl/oplog.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/mongo/db/repl/oplog.h b/src/mongo/db/repl/oplog.h
index 86be44cc30d..d04dab93a78 100644
--- a/src/mongo/db/repl/oplog.h
+++ b/src/mongo/db/repl/oplog.h
@@ -267,21 +267,15 @@ void createIndexForApplyOps(OperationContext* opCtx,
// workaround.
struct GetNextOpTimeClass {
/**
- * Allocates optimes for new entries in the oplog. Returns a vector of OplogSlots, which
- * contain the new optimes along with their terms and newly calculated hash fields.
+ * Allocates optimes for new entries in the oplog. Returns an OplogSlot or a vector of
+ * OplogSlots, which contain the new optimes along with their terms and newly calculated hash
+ * fields.
*/
- static MONGO_DECLARE_SHIM((OperationContext * opCtx, std::size_t count)->std::vector<OplogSlot>)
- getNextOpTimes;
-};
-
-inline std::vector<OplogSlot> getNextOpTimes(OperationContext* opCtx, std::size_t count) {
- return GetNextOpTimeClass::getNextOpTimes(opCtx, count);
+ static MONGO_DECLARE_SHIM((OperationContext * opCtx)->OplogSlot) getNextOpTime;
};
inline OplogSlot getNextOpTime(OperationContext* opCtx) {
- auto slots = getNextOpTimes(opCtx, 1);
- invariant(slots.size() == 1);
- return slots.back();
+ return GetNextOpTimeClass::getNextOpTime(opCtx);
}
/**
@@ -296,6 +290,7 @@ inline OplogSlot getNextOpTime(OperationContext* opCtx) {
* prepare generates an oplog entry in a separate unit of work.
*/
OplogSlot getNextOpTimeNoPersistForTesting(OperationContext* opCtx);
+std::vector<OplogSlot> getNextOpTimes(OperationContext* opCtx, std::size_t count);
} // namespace repl
} // namespace mongo