summaryrefslogtreecommitdiff
path: root/src/mongo/db/introspect.cpp
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2017-03-09 12:34:17 -0500
committerMatthew Russotto <matthew.russotto@10gen.com>2017-03-13 09:02:03 -0400
commit73f9e8b8a8422becf8694fe3d82c0e647dc71189 (patch)
treeb938d6e3fd63fc00819b72231dfe952b8b212d79 /src/mongo/db/introspect.cpp
parentba3db7220399aedbb871aa8a18d325a877c30d53 (diff)
downloadmongo-73f9e8b8a8422becf8694fe3d82c0e647dc71189.tar.gz
SERVER-26965 Use RAII type for turning off replicated writes
Diffstat (limited to 'src/mongo/db/introspect.cpp')
-rw-r--r--src/mongo/db/introspect.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mongo/db/introspect.cpp b/src/mongo/db/introspect.cpp
index 243c23087e1..9fe9dd117cd 100644
--- a/src/mongo/db/introspect.cpp
+++ b/src/mongo/db/introspect.cpp
@@ -189,9 +189,7 @@ Status createProfileCollection(OperationContext* opCtx, Database* db) {
collectionOptions.cappedSize = 1024 * 1024;
WriteUnitOfWork wunit(opCtx);
- bool shouldReplicateWrites = opCtx->writesAreReplicated();
- opCtx->setReplicatedWrites(false);
- ON_BLOCK_EXIT(&OperationContext::setReplicatedWrites, opCtx, shouldReplicateWrites);
+ repl::UnreplicatedWritesBlock uwb(opCtx);
invariant(db->createCollection(opCtx, dbProfilingNS, collectionOptions));
wunit.commit();