From 2348a3cc129ea94f493105a36113332b19dc0560 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Fri, 12 Feb 2010 13:36:10 -0500 Subject: [PATCH] make some things noLocking --- db/dbcommands.cpp | 6 +++++- db/repl.cpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp index 35e8bbbf8f3..8f1002e398f 100644 --- a/db/dbcommands.cpp +++ b/db/dbcommands.cpp @@ -304,6 +304,9 @@ namespace mongo { CmdServerStatus() : Command("serverStatus") { started = time(0); } + + virtual bool noLocking(){ return true; } + bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) { bool authed = cc().getAuthenticationInfo()->isAuthorizedReads("admin"); @@ -1026,6 +1029,7 @@ namespace mongo { CmdBuildInfo() : Command( "buildinfo" ) {} virtual bool slaveOk() { return true; } virtual bool adminOnly() { return true; } + virtual bool noLocking() { return true; } virtual void help( stringstream &help ) const { help << "example: { buildinfo:1 }"; } @@ -1480,7 +1484,7 @@ namespace mongo { } bool canRunHere = - isMaster() || + isMaster( dbname.c_str() ) || c->slaveOk() || ( c->slaveOverrideOk() && ( queryOptions & QueryOption_SlaveOk ) ) || fromRepl; diff --git a/db/repl.cpp b/db/repl.cpp index c308d6784b6..6f0081ff275 100644 --- a/db/repl.cpp +++ b/db/repl.cpp @@ -332,6 +332,8 @@ namespace mongo { virtual bool slaveOk() { return true; } + virtual bool noLocking() { return true; } + CmdIsMaster() : Command("ismaster") { } virtual bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool /*fromRepl*/) { /* currently request to arbiter is (somewhat arbitrarily) an ismaster request that is not