diff options
author | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2019-06-10 17:28:54 -0400 |
---|---|---|
committer | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2019-06-12 15:19:30 -0400 |
commit | 25f11192a656ff72a2fe54e8b5e1373f84381953 (patch) | |
tree | 622738d0920b5de9a6778869eaa785508c46647e /src/mongo/db/repl/sync_tail.cpp | |
parent | 259bd089d0265ac510acbe4512eb706cd553562b (diff) | |
download | mongo-25f11192a656ff72a2fe54e8b5e1373f84381953.tar.gz |
SERVER-36570: make OplogEntryBase mutable but keep OplogEntry immutable
Also make OplogEntry.raw private
Diffstat (limited to 'src/mongo/db/repl/sync_tail.cpp')
-rw-r--r-- | src/mongo/db/repl/sync_tail.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp index 0ee0ad3382f..5d932382bdb 100644 --- a/src/mongo/db/repl/sync_tail.cpp +++ b/src/mongo/db/repl/sync_tail.cpp @@ -431,8 +431,9 @@ void scheduleWritesToOplog(OperationContext* opCtx, 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].raw, ops[i].getOpTime().getTimestamp(), ops[i].getOpTime().getTerm()}); + docs.emplace_back(InsertStatement{ops[i].getRaw(), + ops[i].getOpTime().getTimestamp(), + ops[i].getOpTime().getTerm()}); } fassert(40141, @@ -653,7 +654,7 @@ private: auto oplogEntries = fassertNoTrace(31004, _getNextApplierBatchFn(opCtx.get(), batchLimits)); for (const auto& oplogEntry : oplogEntries) { - ops.emplace_back(oplogEntry.raw); + ops.emplace_back(oplogEntry.getRaw()); } // If we don't have anything in the queue, wait a bit for something to appear. @@ -1052,7 +1053,7 @@ Status multiSyncApply(OperationContext* opCtx, try { auto stableTimestampForRecovery = st->getOptions().stableTimestampForRecovery; const Status status = SyncTail::syncApply( - opCtx, entry.raw, oplogApplicationMode, stableTimestampForRecovery); + opCtx, entry.getRaw(), oplogApplicationMode, stableTimestampForRecovery); if (!status.isOK()) { // In initial sync, update operations can cause documents to be missed during |