summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorDaniel Gottlieb <daniel.gottlieb@mongodb.com>2017-09-01 11:14:00 -0400
committerDaniel Gottlieb <daniel.gottlieb@mongodb.com>2017-09-01 13:32:04 -0400
commit59316ba410b75c88b0c50319f1f0aaf0a9bfda52 (patch)
tree14be0355333aa0a80aa2e18ef89a4df6ed607d68 /src/mongo
parentf8eda1e61767a0adb362fde8d2447bc80cb9e58e (diff)
downloadmongo-59316ba410b75c88b0c50319f1f0aaf0a9bfda52.tar.gz
SERVER-30790: Have WiredTigerServerStatusSection take a Global IS lock.
(cherry picked from commit 1dc2afc8b5ce09d88535049df2ad72adc0434cc8)
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/storage/wiredtiger/SConscript1
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_server_status.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/storage/wiredtiger/SConscript b/src/mongo/db/storage/wiredtiger/SConscript
index 9d2a8fc8035..42eb3b4d41d 100644
--- a/src/mongo/db/storage/wiredtiger/SConscript
+++ b/src/mongo/db/storage/wiredtiger/SConscript
@@ -82,6 +82,7 @@ if wiredtiger:
],
LIBDEPS=['storage_wiredtiger_core',
'storage_wiredtiger_customization_hooks',
+ '$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/storage/kv/kv_engine',
'$BUILD_DIR/mongo/db/storage/storage_engine_lock_file',
'$BUILD_DIR/mongo/db/storage/storage_engine_metadata',
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_server_status.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_server_status.cpp
index 4967dfc2f86..3cb87349fdb 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_server_status.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_server_status.cpp
@@ -35,6 +35,7 @@
#include "mongo/base/checked_cast.h"
#include "mongo/bson/bsonobjbuilder.h"
+#include "mongo/db/concurrency/d_concurrency.h"
#include "mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h"
#include "mongo/db/storage/wiredtiger/wiredtiger_record_store.h"
#include "mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.h"
@@ -56,6 +57,8 @@ bool WiredTigerServerStatusSection::includeByDefault() const {
BSONObj WiredTigerServerStatusSection::generateSection(OperationContext* txn,
const BSONElement& configElement) const {
+ Lock::GlobalLock lk(txn->lockState(), LockMode::MODE_IS, UINT_MAX);
+
// The session does not open a transaction here as one is not needed and opening one would
// mean that execution could become blocked when a new transaction cannot be allocated
// immediately.