summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/oplog_applier_impl.cpp
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2020-12-15 18:41:14 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-12-17 21:16:53 +0000
commit6364c95692fbf3cd48c5ba13772eede90b61fe86 (patch)
treeea832087fea452fde6ca8678277147a958bad8b2 /src/mongo/db/repl/oplog_applier_impl.cpp
parentf6abb42a511110023ceb130e45787ff881e7a2e9 (diff)
downloadmongo-6364c95692fbf3cd48c5ba13772eede90b61fe86.tar.gz
SERVER-49904 Create new oplog type to attach metadata during runtime
Diffstat (limited to 'src/mongo/db/repl/oplog_applier_impl.cpp')
-rw-r--r--src/mongo/db/repl/oplog_applier_impl.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/db/repl/oplog_applier_impl.cpp b/src/mongo/db/repl/oplog_applier_impl.cpp
index 99593165130..013fca2fdc8 100644
--- a/src/mongo/db/repl/oplog_applier_impl.cpp
+++ b/src/mongo/db/repl/oplog_applier_impl.cpp
@@ -394,9 +394,7 @@ void scheduleWritesToOplog(OperationContext* opCtx,
std::vector<InsertStatement> docs;
docs.reserve(end - begin);
for (size_t i = begin; i < end; i++) {
- // Add as unowned BSON to avoid unnecessary ref-count bumps.
- // 'ops' will outlive 'docs' so the BSON lifetime will be guaranteed.
- docs.emplace_back(InsertStatement{ops[i].getRaw(),
+ docs.emplace_back(InsertStatement{ops[i].getEntry().getRaw(),
ops[i].getOpTime().getTimestamp(),
ops[i].getOpTime().getTerm()});
}
@@ -546,8 +544,8 @@ StatusWith<OpTime> OplogApplierImpl::_applyOplogBatch(OperationContext* opCtx,
"{failedWriterThread}: {error}",
"Failed to apply batch of operations",
"numOperationsInBatch"_attr = ops.size(),
- "firstOperation"_attr = redact(ops.front().toBSON()),
- "lastOperation"_attr = redact(ops.back().toBSON()),
+ "firstOperation"_attr = redact(ops.front().toBSONForLogging()),
+ "lastOperation"_attr = redact(ops.back().toBSONForLogging()),
"failedWriterThread"_attr = std::distance(statusVector.cbegin(), it),
"error"_attr = redact(status));
return status;