summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@10gen.com>2013-09-23 17:25:13 -0400
committerSpencer T Brody <spencer@10gen.com>2013-09-23 17:43:41 -0400
commit221b1d1c23cf66a6609e0e0c9ab63f23c0142b3a (patch)
treeff1c680dc68037d559bd5d3b270e22b582fb0a31 /src/mongo
parent19140c53ad460ebf741de9c48b224f2443cdb18e (diff)
downloadmongo-221b1d1c23cf66a6609e0e0c9ab63f23c0142b3a.tar.gz
SERVER-9518 Change getAllDatabaseNames from using GlobalWrite to using GlobalRead
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/auth/authz_manager_external_state.h1
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_d.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/auth/authz_manager_external_state.h b/src/mongo/db/auth/authz_manager_external_state.h
index f75c49b416b..f25ead5dd44 100644
--- a/src/mongo/db/auth/authz_manager_external_state.h
+++ b/src/mongo/db/auth/authz_manager_external_state.h
@@ -84,6 +84,7 @@ namespace mongo {
/**
* Puts into the *dbnames vector the name of every database in the cluster.
+ * May take a global lock, so should only be called during startup.
*/
virtual Status getAllDatabaseNames(std::vector<std::string>* dbnames) = 0;
diff --git a/src/mongo/db/auth/authz_manager_external_state_d.cpp b/src/mongo/db/auth/authz_manager_external_state_d.cpp
index 8066e3c6a82..380e319951a 100644
--- a/src/mongo/db/auth/authz_manager_external_state_d.cpp
+++ b/src/mongo/db/auth/authz_manager_external_state_d.cpp
@@ -79,7 +79,7 @@ namespace {
Status AuthzManagerExternalStateMongod::getAllDatabaseNames(
std::vector<std::string>* dbnames) {
- Lock::GlobalWrite lk;
+ Lock::GlobalRead lk;
getDatabaseNames(*dbnames);
return Status::OK();
}