summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/oplog.cpp
diff options
context:
space:
mode:
authorJason Chan <jason.chan@10gen.com>2019-05-15 14:12:31 -0400
committerJason Chan <jason.chan@10gen.com>2019-05-15 14:12:31 -0400
commitdeac75e585f0c21d0a4bdf888e249bd9bdc374c3 (patch)
treed540f37f62ff16f9c5fe2b2685a832a1a0e820ff /src/mongo/db/repl/oplog.cpp
parent2ca37502214304dddeb90ddac0c24b301ca1518b (diff)
downloadmongo-deac75e585f0c21d0a4bdf888e249bd9bdc374c3.tar.gz
SERVER-40763 Remove the inTxn field from oplog entries
Diffstat (limited to 'src/mongo/db/repl/oplog.cpp')
-rw-r--r--src/mongo/db/repl/oplog.cpp25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index 4bc58c29f1c..3d3abf0afb2 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -377,8 +377,7 @@ OplogDocWriter _logOpWriter(OperationContext* opCtx,
const OperationSessionInfo& sessionInfo,
StmtId statementId,
const OplogLink& oplogLink,
- bool prepare,
- bool inTxn) {
+ bool prepare) {
BSONObjBuilder b(256);
b.append("ts", optime.getTimestamp());
@@ -409,10 +408,6 @@ OplogDocWriter _logOpWriter(OperationContext* opCtx,
b.appendBool(OplogEntryBase::kPrepareFieldName, true);
}
- if (inTxn) {
- b.appendBool(OplogEntryBase::kInTxnFieldName, true);
- }
-
return OplogDocWriter(OplogDocWriter(b.obj(), obj));
}
} // end anon namespace
@@ -498,7 +493,6 @@ OpTime logOp(OperationContext* opCtx,
StmtId statementId,
const OplogLink& oplogLink,
bool prepare,
- bool inTxn,
const OplogSlot& oplogSlot) {
// All collections should have UUIDs now, so all insert, update, and delete oplog entries should
// also have uuids. Some no-op (n) and command (c) entries may still elide the uuid field.
@@ -552,8 +546,7 @@ OpTime logOp(OperationContext* opCtx,
sessionInfo,
statementId,
oplogLink,
- prepare,
- inTxn);
+ prepare);
const DocWriter* basePtr = &writer;
auto timestamp = slot.getTimestamp();
_logOpsInner(opCtx, nss, &basePtr, &timestamp, 1, oplog, slot, wallClockTime);
@@ -627,8 +620,7 @@ std::vector<OpTime> logInsertOps(OperationContext* opCtx,
sessionInfo,
begin[i].stmtId,
oplogLink,
- prepare,
- false /* inTxn */));
+ prepare));
oplogLink.prevOpTime = insertStatementOplogSlot;
timestamps[i] = oplogLink.prevOpTime.getTimestamp();
opTimes.push_back(insertStatementOplogSlot);
@@ -1330,9 +1322,8 @@ Status applyOperation_inlock(OperationContext* opCtx,
mode == repl::OplogApplication::Mode::kApplyOpsCmd || opCtx->writesAreReplicated();
OpCounters* opCounters = shouldUseGlobalOpCounters ? &globalOpCounters : &replOpCounters;
- // TODO(SERVER-40763): Remove "inTxn" entirely.
- std::array<StringData, 9> names = {"ts", "t", "o", "ui", "ns", "op", "b", "o2", "inTxn"};
- std::array<BSONElement, 9> fields;
+ std::array<StringData, 8> names = {"ts", "t", "o", "ui", "ns", "op", "b", "o2"};
+ std::array<BSONElement, 8> fields;
op.getFields(names, &fields);
BSONElement& fieldTs = fields[0];
BSONElement& fieldT = fields[1];
@@ -1342,17 +1333,11 @@ Status applyOperation_inlock(OperationContext* opCtx,
BSONElement& fieldOp = fields[5];
BSONElement& fieldB = fields[6];
BSONElement& fieldO2 = fields[7];
- BSONElement& fieldInTxn = fields[8];
BSONObj o;
if (fieldO.isABSONObj())
o = fieldO.embeddedObject();
- // Make sure we don't apply partial transactions through applyOps.
- uassert(51117,
- "Operations with 'inTxn' set are only used internally by secondaries.",
- fieldInTxn.eoo());
-
// operation type -- see logOp() comments for types
const char* opType = fieldOp.valuestrsafe();