summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/compact.cpp
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2014-11-20 14:26:43 -0500
committerGeert Bosch <geert@mongodb.com>2014-11-21 13:18:53 -0500
commite7f6c56327afa51847a95d9d5bc6399209856c10 (patch)
tree93a6f8b98d13ff81bd21a2ffc9f312e4ff662123 /src/mongo/db/commands/compact.cpp
parente5644e2ca12a60df677cb8e8dfc70f19a9423b0a (diff)
downloadmongo-e7f6c56327afa51847a95d9d5bc6399209856c10.tar.gz
SERVER-16192: Add ScopedTransaction to automatically commitAndRestart()
Diffstat (limited to 'src/mongo/db/commands/compact.cpp')
-rw-r--r--src/mongo/db/commands/compact.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp
index 2bc8a330c57..66d8f353e17 100644
--- a/src/mongo/db/commands/compact.cpp
+++ b/src/mongo/db/commands/compact.cpp
@@ -146,6 +146,7 @@ namespace mongo {
compactOptions.validateDocuments = cmdObj["validate"].trueValue();
+ ScopedTransaction transaction(txn, MODE_IX);
Lock::DBLock lk(txn->lockState(), db, MODE_X);
BackgroundOperation::assertNoBgOpInProgForNs(ns.ns());
Client::Context ctx(txn, ns);