summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2019-06-10 17:28:54 -0400
committerLingzhi Deng <lingzhi.deng@mongodb.com>2019-06-12 15:19:30 -0400
commit25f11192a656ff72a2fe54e8b5e1373f84381953 (patch)
tree622738d0920b5de9a6778869eaa785508c46647e /src
parent259bd089d0265ac510acbe4512eb706cd553562b (diff)
downloadmongo-25f11192a656ff72a2fe54e8b5e1373f84381953.tar.gz
SERVER-36570: make OplogEntryBase mutable but keep OplogEntry immutable
Also make OplogEntry.raw private
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/repl/applier_helpers.cpp4
-rw-r--r--src/mongo/db/repl/multiapplier_test.cpp2
-rw-r--r--src/mongo/db/repl/oplog_applier.cpp2
-rw-r--r--src/mongo/db/repl/oplog_entry.cpp10
-rw-r--r--src/mongo/db/repl/oplog_entry.h66
-rw-r--r--src/mongo/db/repl/oplog_entry.idl1
-rw-r--r--src/mongo/db/repl/replication_recovery.cpp2
-rw-r--r--src/mongo/db/repl/sync_tail.cpp9
-rw-r--r--src/mongo/db/repl/sync_tail_test.cpp38
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 ef92ed6c52d..0113057b57a 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 {
@@ -197,7 +197,7 @@ StatusWith<InsertGroup::ConstIterator> InsertGroup::groupAndApplyInserts(ConstIt
auto status = exceptionToStatus().withContext(
str::stream() << "Error applying inserts in bulk: " << redact(groupedInsertObj)
<< ". Trying first insert as a lone insert: "
- << redact(entry.raw));
+ << 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 f6d249d1182..61b5d790bf5 100644
--- a/src/mongo/db/repl/oplog_applier.cpp
+++ b/src/mongo/db/repl/oplog_applier.cpp
@@ -123,7 +123,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 6d549dd1965..6903a1a029b 100644
--- a/src/mongo/db/repl/oplog_entry.cpp
+++ b/src/mongo/db/repl/oplog_entry.cpp
@@ -205,10 +205,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()) {
@@ -307,7 +307,7 @@ OplogEntry::CommandType OplogEntry::getCommandType() const {
}
int OplogEntry::getRawObjSizeBytes() const {
- return raw.objsize();
+ return _raw.objsize();
}
OpTime OplogEntry::getOpTime() const {
@@ -319,7 +319,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..8a07c462325 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::kDurableReplOperationFieldName;
+ using OplogEntryBase::kOperationSessionInfoFieldName;
+ using OplogEntryBase::k_idFieldName;
+ using OplogEntryBase::kFromMigrateFieldName;
+ using OplogEntryBase::kHashFieldName;
+ using OplogEntryBase::kNssFieldName;
+ using OplogEntryBase::kObjectFieldName;
+ using OplogEntryBase::kObject2FieldName;
+ 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::serialize;
+ using OplogEntryBase::toBSON;
+ using OplogEntryBase::getOperationSessionInfo;
+ using OplogEntryBase::getSessionId;
+ using OplogEntryBase::getTxnNumber;
+ using OplogEntryBase::getDurableReplOperation;
+ using OplogEntryBase::getOpType;
+ using OplogEntryBase::getNss;
+ using OplogEntryBase::getUuid;
+ using OplogEntryBase::getObject;
+ using OplogEntryBase::getObject2;
+ using OplogEntryBase::getUpsert;
+ using OplogEntryBase::getTimestamp;
+ using OplogEntryBase::getTerm;
+ using OplogEntryBase::getHash;
+ using OplogEntryBase::getVersion;
+ using OplogEntryBase::getFromMigrate;
+ using OplogEntryBase::get_id;
+ using OplogEntryBase::getWallClockTime;
+ using OplogEntryBase::getStatementId;
+ using OplogEntryBase::getPrevWriteOpTimeInTransaction;
+ using OplogEntryBase::getPreImageOpTime;
+ using OplogEntryBase::getPostImageOpTime;
+
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 3232e7480f8..2e8890ddaa4 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 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
diff --git a/src/mongo/db/repl/sync_tail_test.cpp b/src/mongo/db/repl/sync_tail_test.cpp
index f63d49d4c31..514192587ba 100644
--- a/src/mongo/db/repl/sync_tail_test.cpp
+++ b/src/mongo/db/repl/sync_tail_test.cpp
@@ -600,7 +600,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,
@@ -615,7 +615,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
@@ -633,7 +633,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(),
@@ -958,8 +958,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,
@@ -974,7 +974,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,
@@ -987,7 +987,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,
@@ -1028,7 +1028,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,
@@ -1053,8 +1053,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,
@@ -1068,7 +1068,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,
@@ -1081,7 +1081,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,
@@ -1163,7 +1163,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,
@@ -1175,7 +1175,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,
@@ -1204,7 +1204,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,
@@ -1216,7 +1216,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,
@@ -1245,7 +1245,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,
@@ -1271,7 +1271,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,
@@ -1284,7 +1284,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,