summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/dbcommands.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/commands/dbcommands.cpp
parentba3db7220399aedbb871aa8a18d325a877c30d53 (diff)
downloadmongo-73f9e8b8a8422becf8694fe3d82c0e647dc71189.tar.gz
SERVER-26965 Use RAII type for turning off replicated writes
Diffstat (limited to 'src/mongo/db/commands/dbcommands.cpp')
-rw-r--r--src/mongo/db/commands/dbcommands.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp
index 233c3e408e4..f89b9fe723b 100644
--- a/src/mongo/db/commands/dbcommands.cpp
+++ b/src/mongo/db/commands/dbcommands.cpp
@@ -326,9 +326,7 @@ public:
bool backupOriginalFiles = e.isBoolean() && e.boolean();
StorageEngine* engine = getGlobalServiceContext()->getGlobalStorageEngine();
- bool shouldReplicateWrites = opCtx->writesAreReplicated();
- opCtx->setReplicatedWrites(false);
- ON_BLOCK_EXIT(&OperationContext::setReplicatedWrites, opCtx, shouldReplicateWrites);
+ repl::UnreplicatedWritesBlock uwb(opCtx);
Status status = repairDatabase(
opCtx, engine, dbname, preserveClonedFilesOnFailure, backupOriginalFiles);