diff options
author | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2019-08-30 21:44:14 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-08-30 21:44:14 +0000 |
commit | d046020279c3a1af2d9c05d40cdaef84610f611d (patch) | |
tree | 54f4b725f7912340f69c98815a7ef02599e59f03 /src/mongo | |
parent | 966f51fa210c9db0e4cfff18fe400c0b2433b263 (diff) | |
download | mongo-d046020279c3a1af2d9c05d40cdaef84610f611d.tar.gz |
SERVER-36570: make OplogEntryBase mutable but keep OplogEntry immutable
Also make OplogEntry.raw private
(cherry picked from commit 25f11192a656ff72a2fe54e8b5e1373f84381953)
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/repl/applier_helpers.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/repl/multiapplier_test.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/repl/oplog_applier.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/repl/oplog_entry.cpp | 10 | ||||
-rw-r--r-- | src/mongo/db/repl/oplog_entry.h | 66 | ||||
-rw-r--r-- | src/mongo/db/repl/oplog_entry.idl | 1 | ||||
-rw-r--r-- | src/mongo/db/repl/replication_recovery.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/repl/sync_tail.cpp | 9 | ||||
-rw-r--r-- | src/mongo/db/repl/sync_tail_test.cpp | 38 |
9 files changed, 93 insertions, 41 deletions
diff --git a/src/mongo/db/repl/applier_helpers.cpp b/src/mongo/db/repl/applier_helpers.cpp index 1672585a071..82a4cade0ed 100644 --- a/src/mongo/db/repl/applier_helpers.cpp +++ b/src/mongo/db/repl/applier_helpers.cpp @@ -182,7 +182,7 @@ StatusWith<InsertGroup::ConstIterator> InsertGroup::groupAndApplyInserts(ConstIt // Generate an op object of all elements except for "ts", "t", and "o", since we // need to make those fields arrays of all the ts's, t's, and o's. - groupedInsertBuilder.appendElementsUnique(entry.raw); + groupedInsertBuilder.appendElementsUnique(entry.getRaw()); auto groupedInsertObj = groupedInsertBuilder.done(); try { @@ -196,7 +196,7 @@ StatusWith<InsertGroup::ConstIterator> InsertGroup::groupAndApplyInserts(ConstIt // application of an individual op. auto status = exceptionToStatus().withContext( str::stream() << "Error applying inserts in bulk: " << redact(groupedInsertObj) - << ". Trying first insert as a lone insert: " << redact(entry.raw)); + << ". Trying first insert as a lone insert: " << redact(entry.getRaw())); // It's not an error during initial sync to encounter DuplicateKey errors. if (Mode::kInitialSync == _mode && ErrorCodes::DuplicateKey == status) { diff --git a/src/mongo/db/repl/multiapplier_test.cpp b/src/mongo/db/repl/multiapplier_test.cpp index bafa8eef774..0dc922945f6 100644 --- a/src/mongo/db/repl/multiapplier_test.cpp +++ b/src/mongo/db/repl/multiapplier_test.cpp @@ -258,7 +258,7 @@ TEST_F( ASSERT_TRUE(multiApplyTxn); ASSERT_EQUALS(1U, operationsToApply.size()); - ASSERT_BSONOBJ_EQ(operations[0].raw, operationsToApply[0].raw); + ASSERT_BSONOBJ_EQ(operations[0].getRaw(), operationsToApply[0].getRaw()); ASSERT_OK(callbackResult); ASSERT_FALSE(callbackTxn); diff --git a/src/mongo/db/repl/oplog_applier.cpp b/src/mongo/db/repl/oplog_applier.cpp index 6e97d38e348..2a1c71e9d77 100644 --- a/src/mongo/db/repl/oplog_applier.cpp +++ b/src/mongo/db/repl/oplog_applier.cpp @@ -124,7 +124,7 @@ void OplogApplier::enqueue(OperationContext* opCtx, Operations::const_iterator end) { OplogBuffer::Batch batch; for (auto i = begin; i != end; ++i) { - batch.push_back(i->raw); + batch.push_back(i->getRaw()); } enqueue(opCtx, batch.cbegin(), batch.cend()); } diff --git a/src/mongo/db/repl/oplog_entry.cpp b/src/mongo/db/repl/oplog_entry.cpp index 38a71114cf1..81a6c03d777 100644 --- a/src/mongo/db/repl/oplog_entry.cpp +++ b/src/mongo/db/repl/oplog_entry.cpp @@ -204,10 +204,10 @@ StatusWith<OplogEntry> OplogEntry::parse(const BSONObj& object) { MONGO_UNREACHABLE; } -OplogEntry::OplogEntry(BSONObj rawInput) : raw(std::move(rawInput)) { - raw = raw.getOwned(); +OplogEntry::OplogEntry(BSONObj rawInput) : _raw(std::move(rawInput)) { + _raw = _raw.getOwned(); - parseProtected(IDLParserErrorContext("OplogEntryBase"), raw); + parseProtected(IDLParserErrorContext("OplogEntryBase"), _raw); // Parse command type from 'o' and 'o2' fields. if (isCommand()) { @@ -306,7 +306,7 @@ OplogEntry::CommandType OplogEntry::getCommandType() const { } int OplogEntry::getRawObjSizeBytes() const { - return raw.objsize(); + return _raw.objsize(); } OpTime OplogEntry::getOpTime() const { @@ -318,7 +318,7 @@ OpTime OplogEntry::getOpTime() const { } std::string OplogEntry::toString() const { - return raw.toString(); + return _raw.toString(); } std::ostream& operator<<(std::ostream& s, const OplogEntry& o) { diff --git a/src/mongo/db/repl/oplog_entry.h b/src/mongo/db/repl/oplog_entry.h index 7337d79165e..0e222aa1bc8 100644 --- a/src/mongo/db/repl/oplog_entry.h +++ b/src/mongo/db/repl/oplog_entry.h @@ -66,11 +66,58 @@ private: }; /** - * A parsed oplog entry that inherits from the OplogEntryBase parsed by the IDL. - * This class is immutable. + * A parsed oplog entry that privately inherits from the OplogEntryBase parsed by the IDL. + * This class is immutable. All setters are hidden. */ -class OplogEntry : public OplogEntryBase { +class OplogEntry : private OplogEntryBase { public: + // Make field names accessible. + using OplogEntryBase::k_idFieldName; + using OplogEntryBase::kDurableReplOperationFieldName; + using OplogEntryBase::kFromMigrateFieldName; + using OplogEntryBase::kHashFieldName; + using OplogEntryBase::kNssFieldName; + using OplogEntryBase::kObject2FieldName; + using OplogEntryBase::kObjectFieldName; + using OplogEntryBase::kOperationSessionInfoFieldName; + using OplogEntryBase::kOpTypeFieldName; + using OplogEntryBase::kPostImageOpTimeFieldName; + using OplogEntryBase::kPreImageOpTimeFieldName; + using OplogEntryBase::kPrevWriteOpTimeInTransactionFieldName; + using OplogEntryBase::kSessionIdFieldName; + using OplogEntryBase::kStatementIdFieldName; + using OplogEntryBase::kTermFieldName; + using OplogEntryBase::kTimestampFieldName; + using OplogEntryBase::kTxnNumberFieldName; + using OplogEntryBase::kUpsertFieldName; + using OplogEntryBase::kUuidFieldName; + using OplogEntryBase::kVersionFieldName; + using OplogEntryBase::kWallClockTimeFieldName; + // Make serialize(), toBSON() and getters accessible. + using OplogEntryBase::get_id; + using OplogEntryBase::getDurableReplOperation; + using OplogEntryBase::getFromMigrate; + using OplogEntryBase::getHash; + using OplogEntryBase::getNss; + using OplogEntryBase::getObject; + using OplogEntryBase::getObject2; + using OplogEntryBase::getOperationSessionInfo; + using OplogEntryBase::getOpType; + using OplogEntryBase::getPostImageOpTime; + using OplogEntryBase::getPreImageOpTime; + using OplogEntryBase::getPrevWriteOpTimeInTransaction; + using OplogEntryBase::getSessionId; + using OplogEntryBase::getStatementId; + using OplogEntryBase::getTerm; + using OplogEntryBase::getTimestamp; + using OplogEntryBase::getTxnNumber; + using OplogEntryBase::getUpsert; + using OplogEntryBase::getUuid; + using OplogEntryBase::getVersion; + using OplogEntryBase::getWallClockTime; + using OplogEntryBase::serialize; + using OplogEntryBase::toBSON; + enum class CommandType { kNotCommand, kCreate, @@ -197,6 +244,13 @@ public: int getRawObjSizeBytes() const; /** + * Returns the original document used to create this OplogEntry. + */ + const BSONObj& getRaw() const { + return _raw; + } + + /** * Returns the OpTime of the oplog entry. */ OpTime getOpTime() const; @@ -206,17 +260,15 @@ public: */ std::string toString() const; - // TODO (SERVER-29200): make `raw` private. Do not add more direct uses of `raw`. - BSONObj raw; // Owned. - private: + BSONObj _raw; // Owned. CommandType _commandType = CommandType::kNotCommand; }; std::ostream& operator<<(std::ostream& s, const OplogEntry& o); inline bool operator==(const OplogEntry& lhs, const OplogEntry& rhs) { - return SimpleBSONObjComparator::kInstance.evaluate(lhs.raw == rhs.raw); + return SimpleBSONObjComparator::kInstance.evaluate(lhs.getRaw() == rhs.getRaw()); } std::ostream& operator<<(std::ostream& s, const ReplOperation& o); diff --git a/src/mongo/db/repl/oplog_entry.idl b/src/mongo/db/repl/oplog_entry.idl index aa11922f513..cfed4af41cf 100644 --- a/src/mongo/db/repl/oplog_entry.idl +++ b/src/mongo/db/repl/oplog_entry.idl @@ -83,7 +83,6 @@ structs: OplogEntryBase: description: A document in which the server stores an oplog entry. - immutable: true inline_chained_structs: true chained_structs: OperationSessionInfo : OperationSessionInfo diff --git a/src/mongo/db/repl/replication_recovery.cpp b/src/mongo/db/repl/replication_recovery.cpp index 596e64f365c..e67dd084a9e 100644 --- a/src/mongo/db/repl/replication_recovery.cpp +++ b/src/mongo/db/repl/replication_recovery.cpp @@ -81,7 +81,7 @@ public: i++; LOG_FOR_RECOVERY(kRecoveryOperationLogLevel) << "Applying op " << i << " of " << batch.size() << " (in batch " << _numBatches - << ") during replication recovery: " << redact(entry.raw); + << ") during replication recovery: " << redact(entry.getRaw()); } } } diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp index 405173d0db3..5f90645b8ba 100644 --- a/src/mongo/db/repl/sync_tail.cpp +++ b/src/mongo/db/repl/sync_tail.cpp @@ -425,8 +425,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, @@ -647,7 +648,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 diff --git a/src/mongo/db/repl/sync_tail_test.cpp b/src/mongo/db/repl/sync_tail_test.cpp index 8489d2fb045..95b3d791c14 100644 --- a/src/mongo/db/repl/sync_tail_test.cpp +++ b/src/mongo/db/repl/sync_tail_test.cpp @@ -590,7 +590,7 @@ TEST_F(MultiOplogEntrySyncTailTest, MultiApplyUnpreparedTransactionSeparate) { const auto expectedStartOpTime = _insertOp1->getOpTime(); ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_insertOp1})); ASSERT_EQ(1U, oplogDocs().size()); - ASSERT_BSONOBJ_EQ(oplogDocs().back(), _insertOp1->raw); + ASSERT_BSONOBJ_EQ(oplogDocs().back(), _insertOp1->getRaw()); ASSERT_TRUE(_insertedDocs[_nss1].empty()); ASSERT_TRUE(_insertedDocs[_nss2].empty()); checkTxnTable(_lsid, @@ -605,7 +605,7 @@ TEST_F(MultiOplogEntrySyncTailTest, MultiApplyUnpreparedTransactionSeparate) { // transaction. ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_insertOp2})); ASSERT_EQ(2U, oplogDocs().size()); - ASSERT_BSONOBJ_EQ(oplogDocs().back(), _insertOp2->raw); + ASSERT_BSONOBJ_EQ(oplogDocs().back(), _insertOp2->getRaw()); ASSERT_TRUE(_insertedDocs[_nss1].empty()); ASSERT_TRUE(_insertedDocs[_nss2].empty()); // The transaction table should not have been updated for partialTxn operations that are not the @@ -623,7 +623,7 @@ TEST_F(MultiOplogEntrySyncTailTest, MultiApplyUnpreparedTransactionSeparate) { ASSERT_EQ(3U, oplogDocs().size()); ASSERT_EQ(1U, _insertedDocs[_nss1].size()); ASSERT_EQ(2U, _insertedDocs[_nss2].size()); - ASSERT_BSONOBJ_EQ(oplogDocs().back(), _commitOp->raw); + ASSERT_BSONOBJ_EQ(oplogDocs().back(), _commitOp->getRaw()); checkTxnTable(_lsid, _txnNum, _commitOp->getOpTime(), @@ -926,8 +926,8 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplyPreparedTransactionStea const auto expectedStartOpTime = _insertOp1->getOpTime(); ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_insertOp1, *_insertOp2})); ASSERT_EQ(2U, oplogDocs().size()); - ASSERT_BSONOBJ_EQ(_insertOp1->raw, oplogDocs()[0]); - ASSERT_BSONOBJ_EQ(_insertOp2->raw, oplogDocs()[1]); + ASSERT_BSONOBJ_EQ(_insertOp1->getRaw(), oplogDocs()[0]); + ASSERT_BSONOBJ_EQ(_insertOp2->getRaw(), oplogDocs()[1]); ASSERT_TRUE(_insertedDocs[_nss1].empty()); ASSERT_TRUE(_insertedDocs[_nss2].empty()); checkTxnTable(_lsid, @@ -942,7 +942,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplyPreparedTransactionStea // nested insert in the prepare oplog entry. ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_prepareWithPrevOp})); ASSERT_EQ(3U, oplogDocs().size()); - ASSERT_BSONOBJ_EQ(_prepareWithPrevOp->raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(_prepareWithPrevOp->getRaw(), oplogDocs().back()); ASSERT_EQ(1U, _insertedDocs[_nss1].size()); ASSERT_EQ(2U, _insertedDocs[_nss2].size()); checkTxnTable(_lsid, @@ -955,7 +955,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplyPreparedTransactionStea // Apply a batch with only the commit. This should result in the commit being put in the // oplog, and the three previous entries being committed. ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_commitPrepareWithPrevOp})); - ASSERT_BSONOBJ_EQ(_commitPrepareWithPrevOp->raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(_commitPrepareWithPrevOp->getRaw(), oplogDocs().back()); ASSERT_EQ(1U, _insertedDocs[_nss1].size()); ASSERT_EQ(2U, _insertedDocs[_nss2].size()); checkTxnTable(_lsid, @@ -1000,7 +1000,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplyAbortPreparedTransactio // Apply a batch with only the abort. This should result in the abort being put in the // oplog and the transaction table being updated accordingly. ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_abortPrepareWithPrevOp})); - ASSERT_BSONOBJ_EQ(_abortPrepareWithPrevOp->raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(_abortPrepareWithPrevOp->getRaw(), oplogDocs().back()); ASSERT_EQ(1U, _insertedDocs[_nss1].size()); ASSERT_EQ(2U, _insertedDocs[_nss2].size()); checkTxnTable(_lsid, @@ -1025,8 +1025,8 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplyPreparedTransactionInit const auto expectedStartOpTime = _insertOp1->getOpTime(); ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_insertOp1, *_insertOp2})); ASSERT_EQ(2U, oplogDocs().size()); - ASSERT_BSONOBJ_EQ(_insertOp1->raw, oplogDocs()[0]); - ASSERT_BSONOBJ_EQ(_insertOp2->raw, oplogDocs()[1]); + ASSERT_BSONOBJ_EQ(_insertOp1->getRaw(), oplogDocs()[0]); + ASSERT_BSONOBJ_EQ(_insertOp2->getRaw(), oplogDocs()[1]); ASSERT_TRUE(_insertedDocs[_nss1].empty()); ASSERT_TRUE(_insertedDocs[_nss2].empty()); checkTxnTable(_lsid, @@ -1040,7 +1040,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplyPreparedTransactionInit // the oplog, but, since this is initial sync, nothing else. ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_prepareWithPrevOp})); ASSERT_EQ(3U, oplogDocs().size()); - ASSERT_BSONOBJ_EQ(_prepareWithPrevOp->raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(_prepareWithPrevOp->getRaw(), oplogDocs().back()); ASSERT_TRUE(_insertedDocs[_nss1].empty()); ASSERT_TRUE(_insertedDocs[_nss2].empty()); checkTxnTable(_lsid, @@ -1053,7 +1053,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplyPreparedTransactionInit // Apply a batch with only the commit. This should result in the commit being put in the // oplog, and the three previous entries being applied. ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_commitPrepareWithPrevOp})); - ASSERT_BSONOBJ_EQ(_commitPrepareWithPrevOp->raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(_commitPrepareWithPrevOp->getRaw(), oplogDocs().back()); ASSERT_EQ(1U, _insertedDocs[_nss1].size()); ASSERT_EQ(2U, _insertedDocs[_nss2].size()); checkTxnTable(_lsid, @@ -1139,7 +1139,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplySingleApplyOpsPreparedT // the oplog, and the nested insert being applied (but in a transaction). ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_singlePrepareApplyOp})); ASSERT_EQ(1U, oplogDocs().size()); - ASSERT_BSONOBJ_EQ(_singlePrepareApplyOp->raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(_singlePrepareApplyOp->getRaw(), oplogDocs().back()); ASSERT_EQ(1U, _insertedDocs[_nss1].size()); checkTxnTable(_lsid, _txnNum, @@ -1151,7 +1151,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplySingleApplyOpsPreparedT // Apply a batch with only the commit. This should result in the commit being put in the // oplog, and prepared insert being committed. ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_commitSinglePrepareApplyOp})); - ASSERT_BSONOBJ_EQ(_commitSinglePrepareApplyOp->raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(_commitSinglePrepareApplyOp->getRaw(), oplogDocs().back()); ASSERT_EQ(1U, _insertedDocs[_nss1].size()); ASSERT_TRUE(_insertedDocs[_nss2].empty()); checkTxnTable(_lsid, @@ -1184,7 +1184,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplyEmptyApplyOpsPreparedTr // the oplog, and the nested insert being applied (but in a transaction). ASSERT_OK(syncTail.multiApply(_opCtx.get(), {emptyPrepareApplyOp})); ASSERT_EQ(1U, oplogDocs().size()); - ASSERT_BSONOBJ_EQ(emptyPrepareApplyOp.raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(emptyPrepareApplyOp.getRaw(), oplogDocs().back()); ASSERT_TRUE(_insertedDocs[_nss1].empty()); checkTxnTable(_lsid, _txnNum, @@ -1196,7 +1196,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplyEmptyApplyOpsPreparedTr // Apply a batch with only the commit. This should result in the commit being put in the // oplog, and prepared insert being committed. ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_commitSinglePrepareApplyOp})); - ASSERT_BSONOBJ_EQ(_commitSinglePrepareApplyOp->raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(_commitSinglePrepareApplyOp->getRaw(), oplogDocs().back()); ASSERT_TRUE(_insertedDocs[_nss1].empty()); ASSERT_TRUE(_insertedDocs[_nss2].empty()); checkTxnTable(_lsid, @@ -1229,7 +1229,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, MultiApplyAbortSingleApplyOpsPrep // Apply a batch with only the abort. This should result in the abort being put in the // oplog and the transaction table being updated accordingly. ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_abortSinglePrepareApplyOp})); - ASSERT_BSONOBJ_EQ(_abortSinglePrepareApplyOp->raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(_abortSinglePrepareApplyOp->getRaw(), oplogDocs().back()); ASSERT_EQ(1U, _insertedDocs[_nss1].size()); ASSERT_TRUE(_insertedDocs[_nss2].empty()); checkTxnTable(_lsid, @@ -1255,7 +1255,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, // the oplog, but, since this is initial sync, nothing else. ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_singlePrepareApplyOp})); ASSERT_EQ(1U, oplogDocs().size()); - ASSERT_BSONOBJ_EQ(_singlePrepareApplyOp->raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(_singlePrepareApplyOp->getRaw(), oplogDocs().back()); ASSERT_TRUE(_insertedDocs[_nss1].empty()); ASSERT_TRUE(_insertedDocs[_nss2].empty()); checkTxnTable(_lsid, @@ -1268,7 +1268,7 @@ TEST_F(MultiOplogEntryPreparedTransactionTest, // Apply a batch with only the commit. This should result in the commit being put in the // oplog, and the previous entry being applied. ASSERT_OK(syncTail.multiApply(_opCtx.get(), {*_commitSinglePrepareApplyOp})); - ASSERT_BSONOBJ_EQ(_commitSinglePrepareApplyOp->raw, oplogDocs().back()); + ASSERT_BSONOBJ_EQ(_commitSinglePrepareApplyOp->getRaw(), oplogDocs().back()); ASSERT_EQ(1U, _insertedDocs[_nss1].size()); ASSERT_TRUE(_insertedDocs[_nss2].empty()); checkTxnTable(_lsid, |