summaryrefslogtreecommitdiff
path: root/src/mongo/db/op_observer/op_observer_impl.cpp
diff options
context:
space:
mode:
authorDidier Nadeau <didier.nadeau@mongodb.com>2023-03-21 15:10:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-03-21 16:23:42 +0000
commit29a46a5b729493121e2c22313f293d32d67c4537 (patch)
tree482f53d5a0bfb5a6afdb6de28494769ee1e57780 /src/mongo/db/op_observer/op_observer_impl.cpp
parentb138e8951449fad26e9e1f8a6f39d269c64e53da (diff)
downloadmongo-29a46a5b729493121e2c22313f293d32d67c4537.tar.gz
SERVER-72218 Garbage collect tenant data when shard merge aborts
Diffstat (limited to 'src/mongo/db/op_observer/op_observer_impl.cpp')
-rw-r--r--src/mongo/db/op_observer/op_observer_impl.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/mongo/db/op_observer/op_observer_impl.cpp b/src/mongo/db/op_observer/op_observer_impl.cpp
index c2cb0cd25f2..8ed830f87ac 100644
--- a/src/mongo/db/op_observer/op_observer_impl.cpp
+++ b/src/mongo/db/op_observer/op_observer_impl.cpp
@@ -1338,7 +1338,7 @@ repl::OpTime OpObserverImpl::onDropCollection(OperationContext* opCtx,
std::uint64_t numRecords,
const CollectionDropType dropType,
bool markFromMigrate) {
- if (!collectionName.isSystemDotProfile()) {
+ if (!collectionName.isSystemDotProfile() && opCtx->writesAreReplicated()) {
// Do not replicate system.profile modifications.
MutableOplogEntry oplogEntry;
oplogEntry.setOpType(repl::OpTypeEnum::kCommand);
@@ -1351,14 +1351,12 @@ repl::OpTime OpObserverImpl::onDropCollection(OperationContext* opCtx,
oplogEntry.setObject2(makeObject2ForDropOrRename(numRecords));
auto opTime =
logOperation(opCtx, &oplogEntry, true /*assignWallClockTime*/, _oplogWriter.get());
- if (opCtx->writesAreReplicated()) {
- LOGV2(7360106,
- "Wrote oplog entry for drop",
- "namespace"_attr = oplogEntry.getNss(),
- "uuid"_attr = oplogEntry.getUuid(),
- "opTime"_attr = opTime,
- "object"_attr = oplogEntry.getObject());
- }
+ LOGV2(7360106,
+ "Wrote oplog entry for drop",
+ "namespace"_attr = oplogEntry.getNss(),
+ "uuid"_attr = oplogEntry.getUuid(),
+ "opTime"_attr = opTime,
+ "object"_attr = oplogEntry.getObject());
}
uassert(50715,