summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/ops/write_ops_retryability_test.cpp1
-rw-r--r--src/mongo/db/pipeline/document_source_change_stream_test.cpp4
-rw-r--r--src/mongo/db/pipeline/document_source_find_and_modify_image_lookup_test.cpp1
-rw-r--r--src/mongo/db/repl/SConscript1
-rw-r--r--src/mongo/db/repl/apply_ops_test.cpp1
-rw-r--r--src/mongo/db/repl/initial_syncer_test.cpp1
-rw-r--r--src/mongo/db/repl/multiapplier_test.cpp1
-rw-r--r--src/mongo/db/repl/oplog_applier_impl_test.cpp2
-rw-r--r--src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp1
-rw-r--r--src/mongo/db/repl/oplog_batcher_test_fixture.cpp6
-rw-r--r--src/mongo/db/repl/oplog_entry.cpp14
-rw-r--r--src/mongo/db/repl/oplog_entry.h9
-rw-r--r--src/mongo/db/repl/oplog_entry.idl6
-rw-r--r--src/mongo/db/repl/oplog_entry_test_helpers.cpp1
-rw-r--r--src/mongo/db/repl/oplog_fetcher_test.cpp1
-rw-r--r--src/mongo/db/repl/replication_recovery_test.cpp1
-rw-r--r--src/mongo/db/repl/rollback_impl_test.cpp2
-rw-r--r--src/mongo/db/repl/session_update_tracker.cpp3
-rw-r--r--src/mongo/db/repl/sync_source_resolver_test.cpp1
-rw-r--r--src/mongo/db/repl/tenant_migration_recipient_service_test.cpp1
-rw-r--r--src/mongo/db/s/resharding/resharding_agg_test.cpp1
-rw-r--r--src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp1
-rw-r--r--src/mongo/db/s/session_catalog_migration_destination_test.cpp1
-rw-r--r--src/mongo/db/s/session_catalog_migration_source.cpp3
-rw-r--r--src/mongo/db/s/session_catalog_migration_source_test.cpp1
-rw-r--r--src/mongo/db/transaction_history_iterator_test.cpp1
-rw-r--r--src/mongo/db/transaction_participant_retryable_writes_test.cpp1
-rw-r--r--src/mongo/db/transaction_participant_test.cpp1
-rw-r--r--src/mongo/dbtests/repltests.cpp1
-rw-r--r--src/mongo/s/shard_key_pattern_test.cpp1
30 files changed, 68 insertions, 2 deletions
diff --git a/src/mongo/db/ops/write_ops_retryability_test.cpp b/src/mongo/db/ops/write_ops_retryability_test.cpp
index 6ffc04c66af..fb32a3b4254 100644
--- a/src/mongo/db/ops/write_ops_retryability_test.cpp
+++ b/src/mongo/db/ops/write_ops_retryability_test.cpp
@@ -70,6 +70,7 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime,
repl::DurableOplogEntry(opTime, // optime
boost::none, // hash
opType, // opType
+ boost::none, // tenant id
nss, // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/pipeline/document_source_change_stream_test.cpp b/src/mongo/db/pipeline/document_source_change_stream_test.cpp
index eaf44eb21aa..7b9788f2842 100644
--- a/src/mongo/db/pipeline/document_source_change_stream_test.cpp
+++ b/src/mongo/db/pipeline/document_source_change_stream_test.cpp
@@ -380,6 +380,7 @@ public:
repl::DurableOplogEntry(opTime ? *opTime : kDefaultOpTime, // optime
hash, // hash
opType, // opType
+ boost::none, // tenant id
nss, // namespace
uuid, // uuid
fromMigrate, // fromMigrate
@@ -1396,6 +1397,7 @@ TEST_F(ChangeStreamStageTest, CommitCommandReturnsOperationsFromPreparedTransact
repl::DurableOplogEntry(kDefaultOpTime, // optime
1LL, // hash
OpTypeEnum::kCommand, // opType
+ boost::none, // tenant id
nss.getCommandNS(), // namespace
boost::none, // uuid
boost::none, // fromMigrate
@@ -1823,6 +1825,7 @@ TEST_F(ChangeStreamStageTest, PreparedTransactionWithMultipleOplogEntries) {
kDefaultOpTime, // optime
1LL, // hash
OpTypeEnum::kCommand, // opType
+ boost::none, // tenant id
nss.getCommandNS(), // namespace
boost::none, // uuid
boost::none, // fromMigrate
@@ -1966,6 +1969,7 @@ TEST_F(ChangeStreamStageTest, PreparedTransactionEndingWithEmptyApplyOps) {
kDefaultOpTime, // optime
1LL, // hash
OpTypeEnum::kCommand, // opType
+ boost::none, // tenant id
nss.getCommandNS(), // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/pipeline/document_source_find_and_modify_image_lookup_test.cpp b/src/mongo/db/pipeline/document_source_find_and_modify_image_lookup_test.cpp
index 71c1f486c17..3c6fee87639 100644
--- a/src/mongo/db/pipeline/document_source_find_and_modify_image_lookup_test.cpp
+++ b/src/mongo/db/pipeline/document_source_find_and_modify_image_lookup_test.cpp
@@ -67,6 +67,7 @@ repl::OplogEntry makeOplogEntry(
repl::DurableOplogEntry(opTime, // optime
boost::none, // hash
opType, // opType
+ boost::none, // tenant id
nss, // namespace
*uuid, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript
index 8fa1d5e3598..b4c4fc98b68 100644
--- a/src/mongo/db/repl/SConscript
+++ b/src/mongo/db/repl/SConscript
@@ -522,6 +522,7 @@ env.Library(
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/catalog/collection_options',
'$BUILD_DIR/mongo/db/exec/document_value/document_value',
+ '$BUILD_DIR/mongo/db/multitenancy',
'$BUILD_DIR/mongo/idl/idl_parser',
'optime',
'optime_base',
diff --git a/src/mongo/db/repl/apply_ops_test.cpp b/src/mongo/db/repl/apply_ops_test.cpp
index 5fc6b9b0236..baf5a770d7a 100644
--- a/src/mongo/db/repl/apply_ops_test.cpp
+++ b/src/mongo/db/repl/apply_ops_test.cpp
@@ -342,6 +342,7 @@ OplogEntry makeOplogEntry(OpTypeEnum opType,
return {DurableOplogEntry(OpTime(Timestamp(1, 1), 1), // optime
boost::none, // hash
opType, // op type
+ boost::none, // tenant id
NamespaceString("a.a"), // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/repl/initial_syncer_test.cpp b/src/mongo/db/repl/initial_syncer_test.cpp
index 6f6d5d1e489..9420e749159 100644
--- a/src/mongo/db/repl/initial_syncer_test.cpp
+++ b/src/mongo/db/repl/initial_syncer_test.cpp
@@ -633,6 +633,7 @@ OplogEntry makeOplogEntry(int t,
return {DurableOplogEntry(OpTime(Timestamp(t, 1), 1), // optime
boost::none, // hash
opType, // op type
+ boost::none, // tenant id
NamespaceString("a.a"), // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/repl/multiapplier_test.cpp b/src/mongo/db/repl/multiapplier_test.cpp
index 60927962833..e49eff8992d 100644
--- a/src/mongo/db/repl/multiapplier_test.cpp
+++ b/src/mongo/db/repl/multiapplier_test.cpp
@@ -69,6 +69,7 @@ OplogEntry makeOplogEntry(int ts) {
return {DurableOplogEntry(OpTime(Timestamp(ts, 1), 1), // optime
boost::none, // hash
OpTypeEnum::kNoop, // op type
+ boost::none, // tenant id
NamespaceString("a.a"), // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/repl/oplog_applier_impl_test.cpp b/src/mongo/db/repl/oplog_applier_impl_test.cpp
index 93ea0fa1a8f..283482ac5c3 100644
--- a/src/mongo/db/repl/oplog_applier_impl_test.cpp
+++ b/src/mongo/db/repl/oplog_applier_impl_test.cpp
@@ -2681,6 +2681,7 @@ public:
opTime, // optime
boost::none, // hash
opType, // opType
+ boost::none, // tenant id
ns, // namespace
boost::none, // uuid
boost::none, // fromMigrate
@@ -2713,6 +2714,7 @@ public:
opTime, // optime
boost::none, // hash
opType, // opType
+ boost::none, // tenant id
ns, // namespace
boost::none, // uuid
true, // fromMigrate
diff --git a/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp b/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp
index d86f87610a0..4900d1905c0 100644
--- a/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp
+++ b/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp
@@ -408,6 +408,7 @@ OplogEntry makeOplogEntry(OpTypeEnum opType,
return {DurableOplogEntry(OpTime(Timestamp(1, 1), 1), // optime
boost::none, // hash
opType, // opType
+ boost::none, // tenant id
nss, // namespace
uuid, // uuid
fromMigrate, // fromMigrate
diff --git a/src/mongo/db/repl/oplog_batcher_test_fixture.cpp b/src/mongo/db/repl/oplog_batcher_test_fixture.cpp
index 780e08a3216..4c8c2519783 100644
--- a/src/mongo/db/repl/oplog_batcher_test_fixture.cpp
+++ b/src/mongo/db/repl/oplog_batcher_test_fixture.cpp
@@ -173,6 +173,7 @@ OplogEntry makeInsertOplogEntry(int t, const NamespaceString& nss, boost::option
return {DurableOplogEntry(OpTime(Timestamp(t, 1), 1), // optime
boost::none, // hash
OpTypeEnum::kInsert, // op type
+ boost::none, // tenant id
nss, // namespace
uuid, // uuid
boost::none, // fromMigrate
@@ -205,6 +206,7 @@ OplogEntry makeUpdateOplogEntry(int t,
return {DurableOplogEntry(OpTime(Timestamp(t, 1), 1), // optime
boost::none, // hash
OpTypeEnum::kUpdate, // op type
+ boost::none, // tenant id
nss, // namespace
uuid, // uuid
boost::none, // fromMigrate
@@ -228,6 +230,7 @@ OplogEntry makeNoopOplogEntry(int t, const StringData& msg) {
return {DurableOplogEntry(OpTime(Timestamp(t, 1), 1), // optime
boost::none, // hash
OpTypeEnum::kNoop, // op type
+ boost::none, // tenant id
NamespaceString(""), // namespace
boost::none, // uuid
boost::none, // fromMigrate
@@ -263,6 +266,7 @@ OplogEntry makeApplyOpsOplogEntry(int t, bool prepare, const std::vector<OplogEn
return {DurableOplogEntry(OpTime(Timestamp(t, 1), 1), // optime
boost::none, // hash
OpTypeEnum::kCommand, // op type
+ boost::none, // tenant id
nss, // namespace
boost::none, // uuid
boost::none, // fromMigrate
@@ -298,6 +302,7 @@ OplogEntry makeCommitTransactionOplogEntry(int t, StringData dbName, bool prepar
return {DurableOplogEntry(OpTime(Timestamp(t, 1), 1), // optime
boost::none, // hash
OpTypeEnum::kCommand, // op type
+ boost::none, // tenant id
nss, // namespace
boost::none, // uuid
boost::none, // fromMigrate
@@ -360,6 +365,7 @@ OplogEntry makeLargeTransactionOplogEntries(int t,
return {DurableOplogEntry(OpTime(Timestamp(t, 1), 1), // optime
boost::none, // hash
OpTypeEnum::kCommand, // op type
+ boost::none, // tenant id
nss, // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/repl/oplog_entry.cpp b/src/mongo/db/repl/oplog_entry.cpp
index 7906a5cf0f6..ece6da5d3ee 100644
--- a/src/mongo/db/repl/oplog_entry.cpp
+++ b/src/mongo/db/repl/oplog_entry.cpp
@@ -49,6 +49,7 @@ namespace {
BSONObj makeOplogEntryDoc(OpTime opTime,
const boost::optional<int64_t> hash,
OpTypeEnum opType,
+ const boost::optional<TenantId>& tid,
const NamespaceString& nss,
const boost::optional<UUID>& uuid,
const boost::optional<bool>& fromMigrate,
@@ -74,6 +75,9 @@ BSONObj makeOplogEntryDoc(OpTime opTime,
builder.append(OplogEntryBase::kTermFieldName, opTime.getTerm());
builder.append(OplogEntryBase::kVersionFieldName, version);
builder.append(OplogEntryBase::kOpTypeFieldName, OpType_serializer(opType));
+ if (tid) {
+ builder.append(OplogEntryBase::kTidFieldName, tid.get().toString());
+ }
builder.append(OplogEntryBase::kNssFieldName, nss.toString());
builder.append(OplogEntryBase::kWallClockTimeFieldName, wallClockTime);
if (hash) {
@@ -287,8 +291,8 @@ OpTime MutableOplogEntry::getOpTime() const {
size_t DurableOplogEntry::getDurableReplOperationSize(const DurableReplOperation& op) {
const auto stmtIds = variant_util::toVector<StmtId>(op.getStatementIds());
- return sizeof(op) + op.getNss().size() + op.getObject().objsize() +
- (op.getObject2() ? op.getObject2()->objsize() : 0) +
+ return sizeof(op) + (op.getTid() ? op.getTid()->toString().size() : 0) + op.getNss().size() +
+ op.getObject().objsize() + (op.getObject2() ? op.getObject2()->objsize() : 0) +
(sizeof(std::vector<StmtId>) + (sizeof(StmtId) * stmtIds.size()));
}
@@ -315,6 +319,7 @@ DurableOplogEntry::DurableOplogEntry(BSONObj rawInput) : _raw(std::move(rawInput
DurableOplogEntry::DurableOplogEntry(OpTime opTime,
const boost::optional<int64_t> hash,
OpTypeEnum opType,
+ const boost::optional<TenantId>& tid,
const NamespaceString& nss,
const boost::optional<UUID>& uuid,
const boost::optional<bool>& fromMigrate,
@@ -334,6 +339,7 @@ DurableOplogEntry::DurableOplogEntry(OpTime opTime,
: DurableOplogEntry(makeOplogEntryDoc(opTime,
hash,
opType,
+ tid,
nss,
uuid,
fromMigrate,
@@ -626,6 +632,10 @@ mongo::repl::OpTypeEnum OplogEntry::getOpType() const {
return _entry.getOpType();
}
+const boost::optional<mongo::TenantId>& OplogEntry::getTid() const {
+ return _entry.getTid();
+}
+
const mongo::NamespaceString& OplogEntry::getNss() const {
return _entry.getNss();
}
diff --git a/src/mongo/db/repl/oplog_entry.h b/src/mongo/db/repl/oplog_entry.h
index 902d40d80ce..8cfdf210ca9 100644
--- a/src/mongo/db/repl/oplog_entry.h
+++ b/src/mongo/db/repl/oplog_entry.h
@@ -199,6 +199,10 @@ public:
getDurableReplOperation().setOpType(std::move(value));
}
+ void setTid(boost::optional<mongo::TenantId> value) & {
+ getDurableReplOperation().setTid(std::move(value));
+ }
+
void setNss(NamespaceString value) & {
getDurableReplOperation().setNss(std::move(value));
}
@@ -299,6 +303,7 @@ public:
using MutableOplogEntry::kSessionIdFieldName;
using MutableOplogEntry::kStatementIdsFieldName;
using MutableOplogEntry::kTermFieldName;
+ using MutableOplogEntry::kTidFieldName;
using MutableOplogEntry::kTimestampFieldName;
using MutableOplogEntry::kTxnNumberFieldName;
using MutableOplogEntry::kUpsertFieldName;
@@ -325,6 +330,7 @@ public:
using MutableOplogEntry::getSessionId;
using MutableOplogEntry::getStatementIds;
using MutableOplogEntry::getTerm;
+ using MutableOplogEntry::getTid;
using MutableOplogEntry::getTimestamp;
using MutableOplogEntry::getTxnNumber;
using MutableOplogEntry::getUpsert;
@@ -369,6 +375,7 @@ public:
DurableOplogEntry(OpTime opTime,
boost::optional<int64_t> hash,
OpTypeEnum opType,
+ const boost::optional<TenantId>& tid,
const NamespaceString& nss,
const boost::optional<UUID>& uuid,
const boost::optional<bool>& fromMigrate,
@@ -533,6 +540,7 @@ public:
static constexpr auto kFromTenantMigrationFieldName =
DurableOplogEntry::kFromTenantMigrationFieldName;
static constexpr auto kHashFieldName = DurableOplogEntry::kHashFieldName;
+ static constexpr auto kTidFieldName = DurableOplogEntry::kTidFieldName;
static constexpr auto kNssFieldName = DurableOplogEntry::kNssFieldName;
static constexpr auto kObject2FieldName = DurableOplogEntry::kObject2FieldName;
static constexpr auto kObjectFieldName = DurableOplogEntry::kObjectFieldName;
@@ -603,6 +611,7 @@ public:
const boost::optional<std::int64_t> getTxnNumber() const;
const DurableReplOperation& getDurableReplOperation() const;
mongo::repl::OpTypeEnum getOpType() const;
+ const boost::optional<mongo::TenantId>& getTid() const;
const mongo::NamespaceString& getNss() const;
const boost::optional<mongo::UUID>& getUuid() const;
const mongo::BSONObj& getObject() const;
diff --git a/src/mongo/db/repl/oplog_entry.idl b/src/mongo/db/repl/oplog_entry.idl
index 6f31dc8d0c9..630cb67aef9 100644
--- a/src/mongo/db/repl/oplog_entry.idl
+++ b/src/mongo/db/repl/oplog_entry.idl
@@ -37,6 +37,7 @@ imports:
- "mongo/db/pipeline/value.idl"
- "mongo/db/repl/optime_base.idl"
- "mongo/db/repl/replication_types.idl"
+ - "mongo/db/multitenancy.idl"
- "mongo/s/sharding_types.idl"
enums:
@@ -66,6 +67,11 @@ structs:
cpp_name: opType
type: OpType
description: "The operation type"
+ tid:
+ cpp_name: tid
+ type: tenant_id
+ optional: true
+ description: "The tenant to which the operation applies"
ns:
cpp_name: nss
type: namespacestring
diff --git a/src/mongo/db/repl/oplog_entry_test_helpers.cpp b/src/mongo/db/repl/oplog_entry_test_helpers.cpp
index 8b29402db4f..870287dd8f6 100644
--- a/src/mongo/db/repl/oplog_entry_test_helpers.cpp
+++ b/src/mongo/db/repl/oplog_entry_test_helpers.cpp
@@ -63,6 +63,7 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime,
return {repl::DurableOplogEntry(opTime, // optime
boost::none, // hash
opType, // opType
+ boost::none, // tenant id
nss, // namespace
uuid, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/repl/oplog_fetcher_test.cpp b/src/mongo/db/repl/oplog_fetcher_test.cpp
index 8f566fbd9e4..eca60c5d2a3 100644
--- a/src/mongo/db/repl/oplog_fetcher_test.cpp
+++ b/src/mongo/db/repl/oplog_fetcher_test.cpp
@@ -87,6 +87,7 @@ BSONObj makeNoopOplogEntry(OpTime opTime) {
repl::DurableOplogEntry(opTime, // optime
boost::none, // hash
OpTypeEnum ::kNoop, // opType
+ boost::none, // tenant id
NamespaceString("test.t"), // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/repl/replication_recovery_test.cpp b/src/mongo/db/repl/replication_recovery_test.cpp
index dee6e3b1221..7b32092e747 100644
--- a/src/mongo/db/repl/replication_recovery_test.cpp
+++ b/src/mongo/db/repl/replication_recovery_test.cpp
@@ -253,6 +253,7 @@ repl::OplogEntry _makeOplogEntry(repl::OpTime opTime,
repl::DurableOplogEntry(opTime, // optime
boost::none, // hash
opType, // opType
+ boost::none, // tenant id
testNs, // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/repl/rollback_impl_test.cpp b/src/mongo/db/repl/rollback_impl_test.cpp
index 3f04dbc6d56..fe3f17c40d0 100644
--- a/src/mongo/db/repl/rollback_impl_test.cpp
+++ b/src/mongo/db/repl/rollback_impl_test.cpp
@@ -1492,6 +1492,7 @@ RollbackImplTest::_setUpUnpreparedTransactionForCountTest(UUID collId) {
DurableOplogEntry partialApplyOpsOplogEntry(partialApplyOpsOpTime, // opTime
1LL, // hash
OpTypeEnum::kCommand, // opType
+ boost::none, // tenant id
adminCmdNss, // nss
boost::none, // uuid
boost::none, // fromMigrate
@@ -1527,6 +1528,7 @@ RollbackImplTest::_setUpUnpreparedTransactionForCountTest(UUID collId) {
commitApplyOpsOpTime, // opTime
1LL, // hash
OpTypeEnum::kCommand, // opType
+ boost::none, // tenant id
adminCmdNss, // nss
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/repl/session_update_tracker.cpp b/src/mongo/db/repl/session_update_tracker.cpp
index 5dce32cecb1..87c12cf5463 100644
--- a/src/mongo/db/repl/session_update_tracker.cpp
+++ b/src/mongo/db/repl/session_update_tracker.cpp
@@ -53,9 +53,12 @@ OplogEntry createOplogEntryForTransactionTableUpdate(repl::OpTime opTime,
const BSONObj& updateBSON,
const BSONObj& o2Field,
Date_t wallClockTime) {
+ // The transaction table (config.transactions) is currently shared by all tenants, so an update
+ // to it is not expected to have a tenant id
return {repl::DurableOplogEntry(opTime,
boost::none, // hash
repl::OpTypeEnum::kUpdate,
+ boost::none, // tenant id
NamespaceString::kSessionTransactionsTableNamespace,
boost::none, // uuid
false, // fromMigrate
diff --git a/src/mongo/db/repl/sync_source_resolver_test.cpp b/src/mongo/db/repl/sync_source_resolver_test.cpp
index ad73867823b..65eddde1cf4 100644
--- a/src/mongo/db/repl/sync_source_resolver_test.cpp
+++ b/src/mongo/db/repl/sync_source_resolver_test.cpp
@@ -314,6 +314,7 @@ BSONObj _makeOplogEntry(Timestamp ts, long long term) {
return DurableOplogEntry(OpTime(ts, term), // optime
boost::none, // hash
OpTypeEnum::kNoop, // op type
+ boost::none, // tenant id
NamespaceString("a.a"), // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/repl/tenant_migration_recipient_service_test.cpp b/src/mongo/db/repl/tenant_migration_recipient_service_test.cpp
index c38a6bd9037..aa95027b094 100644
--- a/src/mongo/db/repl/tenant_migration_recipient_service_test.cpp
+++ b/src/mongo/db/repl/tenant_migration_recipient_service_test.cpp
@@ -89,6 +89,7 @@ OplogEntry makeOplogEntry(OpTime opTime,
return {DurableOplogEntry(opTime, // optime
boost::none, // hash
opType, // opType
+ boost::none, // tenant id
nss, // namespace
uuid, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/s/resharding/resharding_agg_test.cpp b/src/mongo/db/s/resharding/resharding_agg_test.cpp
index 255aa4904c1..f11034bd957 100644
--- a/src/mongo/db/s/resharding/resharding_agg_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_agg_test.cpp
@@ -1637,6 +1637,7 @@ TEST_F(ReshardingAggWithStorageTest, RetryableFindAndModifyWithImageLookup) {
repl::DurableOplogEntry oplog(opTime,
boost::none /* hash */,
repl::OpTypeEnum::kUpdate,
+ boost::none /* tenant id */,
kCrudNs,
kCrudUUID,
false /* fromMigrate */,
diff --git a/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp b/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp
index 254926dea80..638d1ca77cc 100644
--- a/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_oplog_applier_test.cpp
@@ -235,6 +235,7 @@ public:
return {repl::DurableOplogEntry(opTime,
boost::none /* hash */,
opType,
+ boost::none /* tenant id */,
kCrudNs,
kCrudUUID,
false /* fromMigrate */,
diff --git a/src/mongo/db/s/session_catalog_migration_destination_test.cpp b/src/mongo/db/s/session_catalog_migration_destination_test.cpp
index 45b74607cdc..0b634db0ff6 100644
--- a/src/mongo/db/s/session_catalog_migration_destination_test.cpp
+++ b/src/mongo/db/s/session_catalog_migration_destination_test.cpp
@@ -94,6 +94,7 @@ repl::OplogEntry makeOplogEntry(
repl::DurableOplogEntry(opTime, // optime
0, // hash
opType, // opType
+ boost::none, // tenant id
kNs, // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/s/session_catalog_migration_source.cpp b/src/mongo/db/s/session_catalog_migration_source.cpp
index 8d76e22c655..ce330604c81 100644
--- a/src/mongo/db/s/session_catalog_migration_source.cpp
+++ b/src/mongo/db/s/session_catalog_migration_source.cpp
@@ -142,10 +142,13 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime,
const OperationSessionInfo& sessionInfo,
Date_t wallClockTime,
const std::vector<StmtId>& statementIds) {
+ // This code is never expected to run in Serverless, since Serverless does not use chunk
+ // migration, and therefore is never expected to pass a tenant id
return {
repl::DurableOplogEntry(opTime, // optime
hash, // hash
opType, // op type
+ boost::none, // tenant id
{}, // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/s/session_catalog_migration_source_test.cpp b/src/mongo/db/s/session_catalog_migration_source_test.cpp
index 4ab71e1f569..69ad5efb0ad 100644
--- a/src/mongo/db/s/session_catalog_migration_source_test.cpp
+++ b/src/mongo/db/s/session_catalog_migration_source_test.cpp
@@ -82,6 +82,7 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime,
opTime, // optime
0, // hash
opType, // opType
+ boost::none, // tenant id
nss, // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/transaction_history_iterator_test.cpp b/src/mongo/db/transaction_history_iterator_test.cpp
index 836df9d29c4..04d59db5caa 100644
--- a/src/mongo/db/transaction_history_iterator_test.cpp
+++ b/src/mongo/db/transaction_history_iterator_test.cpp
@@ -64,6 +64,7 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime,
opTime, // optime
0, // hash
repl::OpTypeEnum::kInsert, // opType
+ boost::none, // tenant id
NamespaceString("a.b"), // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/transaction_participant_retryable_writes_test.cpp b/src/mongo/db/transaction_participant_retryable_writes_test.cpp
index 4de6f4ca517..b2b57970e94 100644
--- a/src/mongo/db/transaction_participant_retryable_writes_test.cpp
+++ b/src/mongo/db/transaction_participant_retryable_writes_test.cpp
@@ -72,6 +72,7 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime,
opTime, // optime
0, // hash
opType, // opType
+ boost::none, // tenant id
kNss, // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/db/transaction_participant_test.cpp b/src/mongo/db/transaction_participant_test.cpp
index d94ae7a6ba9..38c7a490146 100644
--- a/src/mongo/db/transaction_participant_test.cpp
+++ b/src/mongo/db/transaction_participant_test.cpp
@@ -82,6 +82,7 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime,
opTime, // optime
0, // hash
opType, // opType
+ boost::none, // tenant id
kNss, // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/dbtests/repltests.cpp b/src/mongo/dbtests/repltests.cpp
index b42439d2b57..1c4d3212e3d 100644
--- a/src/mongo/dbtests/repltests.cpp
+++ b/src/mongo/dbtests/repltests.cpp
@@ -69,6 +69,7 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime,
repl::DurableOplogEntry(opTime, // optime
0, // hash
opType, // opType
+ boost::none, // tenant id
nss, // namespace
boost::none, // uuid
boost::none, // fromMigrate
diff --git a/src/mongo/s/shard_key_pattern_test.cpp b/src/mongo/s/shard_key_pattern_test.cpp
index 2809ff17d86..2965b5d6222 100644
--- a/src/mongo/s/shard_key_pattern_test.cpp
+++ b/src/mongo/s/shard_key_pattern_test.cpp
@@ -74,6 +74,7 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime,
repl::DurableOplogEntry(opTime, // optime
boost::none, // hash
opType, // opType
+ boost::none, // tenant id
nss, // namespace
boost::none, // uuid
boost::none, // fromMigrate