diff options
Diffstat (limited to 'src/mongo')
119 files changed, 1 insertions, 608 deletions
diff --git a/src/mongo/db/auth/sasl_commands.cpp b/src/mongo/db/auth/sasl_commands.cpp index 14ca0df2b1c..fe049a988d0 100644 --- a/src/mongo/db/auth/sasl_commands.cpp +++ b/src/mongo/db/auth/sasl_commands.cpp @@ -81,9 +81,6 @@ public: BSONObjBuilder& result); virtual void help(stringstream& help) const; - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } @@ -109,9 +106,6 @@ public: BSONObjBuilder& result); virtual void help(stringstream& help) const; - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/clientlistplugin.cpp b/src/mongo/db/clientlistplugin.cpp index f206020b012..d3636f39099 100644 --- a/src/mongo/db/clientlistplugin.cpp +++ b/src/mongo/db/clientlistplugin.cpp @@ -140,9 +140,6 @@ class CurrentOpContexts : public Command { public: CurrentOpContexts() : Command("currentOpCtx") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp index 65560607e50..69e6011d8a0 100644 --- a/src/mongo/db/commands.cpp +++ b/src/mongo/db/commands.cpp @@ -143,11 +143,7 @@ void Command::htmlHelp(stringstream& ss) const { ss << "</a>"; ss << "</td>\n"; ss << "<td>"; - if (isWriteCommandForConfigServer()) { - ss << "W "; - } else { - ss << "R "; - } + ss << "UNUSED "; if (slaveOk()) ss << "S "; if (adminOnly()) @@ -398,7 +394,6 @@ void Command::generateHelpResponse(OperationContext* txn, ss << "help for: " << command.name << " "; command.help(ss); helpBuilder.append("help", ss.str()); - helpBuilder.append("lockType", command.isWriteCommandForConfigServer() ? 1 : 0); replyBuilder->setCommandReply(helpBuilder.done()); replyBuilder->setMetadata(rpc::makeEmptyMetadata()); diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h index 37550c64131..19fadaeeee3 100644 --- a/src/mongo/db/commands.h +++ b/src/mongo/db/commands.h @@ -123,17 +123,6 @@ public: const rpc::RequestInterface& request, rpc::ReplyBuilderInterface* replyBuilder); - - /** - * This designation for the command is only used by the 'help' call and has nothing to do - * with lock acquisition. The reason we need to have it there is because - * SyncClusterConnection uses this to determine whether the command is update and needs to - * be sent to all three servers or just one. - * - * Eventually when SyncClusterConnection is refactored out, we can get rid of it. - */ - virtual bool isWriteCommandForConfigServer() const = 0; - /* Return true if only the admin ns has privileges to run this command. */ virtual bool adminOnly() const { return false; diff --git a/src/mongo/db/commands/apply_ops.cpp b/src/mongo/db/commands/apply_ops.cpp index 12dc70ceb86..4b5e53e5225 100644 --- a/src/mongo/db/commands/apply_ops.cpp +++ b/src/mongo/db/commands/apply_ops.cpp @@ -69,9 +69,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } ApplyOpsCmd() : Command("applyOps") {} virtual void help(stringstream& help) const { diff --git a/src/mongo/db/commands/authentication_commands.cpp b/src/mongo/db/commands/authentication_commands.cpp index 03759d1302e..b30a7694417 100644 --- a/src/mongo/db/commands/authentication_commands.cpp +++ b/src/mongo/db/commands/authentication_commands.cpp @@ -105,9 +105,6 @@ public: void help(stringstream& h) const { h << "internal"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) {} // No auth required @@ -363,9 +360,6 @@ public: void help(stringstream& h) const { h << "de-authenticate"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } CmdLogout() : Command("logout") {} bool run(OperationContext* txn, const string& dbname, diff --git a/src/mongo/db/commands/authentication_commands.h b/src/mongo/db/commands/authentication_commands.h index 0831a62ac82..d11ae5bc536 100644 --- a/src/mongo/db/commands/authentication_commands.h +++ b/src/mongo/db/commands/authentication_commands.h @@ -43,9 +43,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& ss) const { ss << "internal"; } diff --git a/src/mongo/db/commands/clone.cpp b/src/mongo/db/commands/clone.cpp index b5632dd44d7..499b8827a76 100644 --- a/src/mongo/db/commands/clone.cpp +++ b/src/mongo/db/commands/clone.cpp @@ -59,9 +59,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& help) const { help << "clone this database from an instance of the db on another host\n"; diff --git a/src/mongo/db/commands/clone_collection.cpp b/src/mongo/db/commands/clone_collection.cpp index dbbe117f97d..efd3500d395 100644 --- a/src/mongo/db/commands/clone_collection.cpp +++ b/src/mongo/db/commands/clone_collection.cpp @@ -70,9 +70,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual std::string parseNs(const std::string& dbname, const BSONObj& cmdObj) const { return parseNsFullyQualified(dbname, cmdObj); diff --git a/src/mongo/db/commands/collection_to_capped.cpp b/src/mongo/db/commands/collection_to_capped.cpp index f73d20a59e1..a0b283ebc49 100644 --- a/src/mongo/db/commands/collection_to_capped.cpp +++ b/src/mongo/db/commands/collection_to_capped.cpp @@ -56,9 +56,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& help) const { help << "{ cloneCollectionAsCapped:<fromName>, toCollection:<toName>, size:<sizeInBytes> }"; } @@ -132,9 +129,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& help) const { help << "{ convertToCapped:<fromCollectionName>, size:<sizeInBytes> }"; } diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp index 01f2eb607e1..cff4a4c359b 100644 --- a/src/mongo/db/commands/compact.cpp +++ b/src/mongo/db/commands/compact.cpp @@ -56,9 +56,6 @@ using std::stringstream; class CompactCmd : public Command { public: - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool adminOnly() const { return false; } diff --git a/src/mongo/db/commands/conn_pool_stats.cpp b/src/mongo/db/commands/conn_pool_stats.cpp index 39d27c1200e..ffd0945ed3f 100644 --- a/src/mongo/db/commands/conn_pool_stats.cpp +++ b/src/mongo/db/commands/conn_pool_stats.cpp @@ -52,9 +52,6 @@ public: help << "stats about connections between servers in a replica set or sharded cluster."; } - bool isWriteCommandForConfigServer() const override { - return false; - } void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/db/commands/conn_pool_sync.cpp b/src/mongo/db/commands/conn_pool_sync.cpp index e84c418761b..839e3a045b4 100644 --- a/src/mongo/db/commands/conn_pool_sync.cpp +++ b/src/mongo/db/commands/conn_pool_sync.cpp @@ -43,9 +43,6 @@ public: virtual void help(std::stringstream& help) const { help << "internal"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) { diff --git a/src/mongo/db/commands/connection_status.cpp b/src/mongo/db/commands/connection_status.cpp index 843b8b1728a..340bc032cdb 100644 --- a/src/mongo/db/commands/connection_status.cpp +++ b/src/mongo/db/commands/connection_status.cpp @@ -44,9 +44,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) {} // No auth required diff --git a/src/mongo/db/commands/copydb.cpp b/src/mongo/db/commands/copydb.cpp index c53dd86f8f9..75d5aa4e6dd 100644 --- a/src/mongo/db/commands/copydb.cpp +++ b/src/mongo/db/commands/copydb.cpp @@ -98,9 +98,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, diff --git a/src/mongo/db/commands/copydb_start_commands.cpp b/src/mongo/db/commands/copydb_start_commands.cpp index 078ddca6039..95d5c9499fe 100644 --- a/src/mongo/db/commands/copydb_start_commands.cpp +++ b/src/mongo/db/commands/copydb_start_commands.cpp @@ -78,9 +78,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, @@ -150,9 +147,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, diff --git a/src/mongo/db/commands/count_cmd.cpp b/src/mongo/db/commands/count_cmd.cpp index f22b573d65d..c292f27c40c 100644 --- a/src/mongo/db/commands/count_cmd.cpp +++ b/src/mongo/db/commands/count_cmd.cpp @@ -54,9 +54,6 @@ using std::stringstream; */ class CmdCount : public Command { public: - virtual bool isWriteCommandForConfigServer() const { - return false; - } CmdCount() : Command("count") {} virtual bool slaveOk() const { // ok on --slave setups diff --git a/src/mongo/db/commands/cpuprofile.cpp b/src/mongo/db/commands/cpuprofile.cpp index 10be4af8978..2706d44510b 100644 --- a/src/mongo/db/commands/cpuprofile.cpp +++ b/src/mongo/db/commands/cpuprofile.cpp @@ -91,9 +91,6 @@ public: // This is an abuse of the global dbmutex. We only really need to // ensure that only one cpuprofiler command runs at once; it would // be fine for it to run concurrently with other operations. - virtual bool isWriteCommandForConfigServer() const { - return true; - } }; /** diff --git a/src/mongo/db/commands/create_indexes.cpp b/src/mongo/db/commands/create_indexes.cpp index bf560e1cb8d..4ee3e3af167 100644 --- a/src/mongo/db/commands/create_indexes.cpp +++ b/src/mongo/db/commands/create_indexes.cpp @@ -64,9 +64,6 @@ class CmdCreateIndex : public Command { public: CmdCreateIndex() : Command("createIndexes") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return false; } // TODO: this could be made true... diff --git a/src/mongo/db/commands/current_op.cpp b/src/mongo/db/commands/current_op.cpp index f15f60807e7..680a99ced73 100644 --- a/src/mongo/db/commands/current_op.cpp +++ b/src/mongo/db/commands/current_op.cpp @@ -53,9 +53,6 @@ class CurrentOpCommand : public Command { public: CurrentOpCommand() : Command("currentOp") {} - bool isWriteCommandForConfigServer() const final { - return false; - } bool slaveOk() const final { return true; diff --git a/src/mongo/db/commands/dbhash.h b/src/mongo/db/commands/dbhash.h index 8fc964b6b12..d496832f15a 100644 --- a/src/mongo/db/commands/dbhash.h +++ b/src/mongo/db/commands/dbhash.h @@ -46,9 +46,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out); diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp index 425e888f8ec..c03f6382fe0 100644 --- a/src/mongo/db/commands/distinct.cpp +++ b/src/mongo/db/commands/distinct.cpp @@ -75,9 +75,6 @@ public: virtual bool slaveOverrideOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } bool supportsReadConcern() const final { return true; } diff --git a/src/mongo/db/commands/drop_indexes.cpp b/src/mongo/db/commands/drop_indexes.cpp index 96757af0834..cead3ea45c7 100644 --- a/src/mongo/db/commands/drop_indexes.cpp +++ b/src/mongo/db/commands/drop_indexes.cpp @@ -70,9 +70,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& help) const { help << "drop indexes for a collection"; } @@ -102,9 +99,6 @@ public: virtual bool slaveOk() const { return true; } // can reindex on a secondary - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& help) const { help << "re-index a collection"; } diff --git a/src/mongo/db/commands/explain_cmd.cpp b/src/mongo/db/commands/explain_cmd.cpp index 2af6f18fed5..dc467846603 100644 --- a/src/mongo/db/commands/explain_cmd.cpp +++ b/src/mongo/db/commands/explain_cmd.cpp @@ -56,9 +56,6 @@ class CmdExplain : public Command { public: CmdExplain() : Command("explain") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } /** * Running an explain on a secondary requires explicitly setting slaveOk. diff --git a/src/mongo/db/commands/fail_point_cmd.cpp b/src/mongo/db/commands/fail_point_cmd.cpp index 2b6e5cff0fc..65ca22d59e0 100644 --- a/src/mongo/db/commands/fail_point_cmd.cpp +++ b/src/mongo/db/commands/fail_point_cmd.cpp @@ -69,9 +69,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool adminOnly() const { return true; diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp index 0657d640e77..c1666497b78 100644 --- a/src/mongo/db/commands/find_and_modify.cpp +++ b/src/mongo/db/commands/find_and_modify.cpp @@ -214,9 +214,6 @@ public: bool slaveOk() const override { return false; } - bool isWriteCommandForConfigServer() const override { - return true; - } void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) override { diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index 62e0a08807f..5ecc6330afb 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -73,9 +73,6 @@ class FindCmd : public Command { public: FindCmd() : Command("find") {} - bool isWriteCommandForConfigServer() const override { - return false; - } bool slaveOk() const override { return false; diff --git a/src/mongo/db/commands/fsync.cpp b/src/mongo/db/commands/fsync.cpp index 35207dd950e..8bc028c926f 100644 --- a/src/mongo/db/commands/fsync.cpp +++ b/src/mongo/db/commands/fsync.cpp @@ -103,9 +103,6 @@ public: locked = false; pendingUnlock = false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } @@ -187,9 +184,6 @@ class FSyncUnlockCommand : public Command { public: FSyncUnlockCommand() : Command("fsyncUnlock") {} - bool isWriteCommandForConfigServer() const override { - return false; - } bool slaveOk() const override { return true; diff --git a/src/mongo/db/commands/generic.cpp b/src/mongo/db/commands/generic.cpp index 47f47442452..26746480db6 100644 --- a/src/mongo/db/commands/generic.cpp +++ b/src/mongo/db/commands/generic.cpp @@ -78,9 +78,6 @@ public: virtual bool adminOnly() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) {} // No auth required @@ -113,9 +110,6 @@ public: help << "a way to check that the server is alive. responds immediately even if server is " "in a db lock."; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) {} // No auth required @@ -139,9 +133,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) {} // No auth required @@ -173,9 +164,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "returns information about the daemon's host"; @@ -219,9 +207,6 @@ public: class LogRotateCmd : public Command { public: LogRotateCmd() : Command("logRotate") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } @@ -255,9 +240,6 @@ public: help << "get a list of all db commands"; } ListCommandsCmd() : Command("listCommands", false) {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } @@ -359,9 +341,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) {} // No auth required @@ -384,9 +363,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool adminOnly() const { return true; } @@ -454,9 +430,6 @@ public: void help(stringstream& h) const { h << "get argv"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool adminOnly() const { return true; } diff --git a/src/mongo/db/commands/geo_near_cmd.cpp b/src/mongo/db/commands/geo_near_cmd.cpp index e3b51377c9a..743329370be 100644 --- a/src/mongo/db/commands/geo_near_cmd.cpp +++ b/src/mongo/db/commands/geo_near_cmd.cpp @@ -63,9 +63,6 @@ class Geo2dFindNearCmd : public Command { public: Geo2dFindNearCmd() : Command("geoNear") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } bool slaveOk() const { return true; } diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp index e14e13d4221..ae10f85e7f9 100644 --- a/src/mongo/db/commands/get_last_error.cpp +++ b/src/mongo/db/commands/get_last_error.cpp @@ -56,9 +56,6 @@ using std::stringstream; */ class CmdResetError : public Command { public: - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } @@ -83,9 +80,6 @@ public: class CmdGetLastError : public Command { public: CmdGetLastError() : Command("getLastError", false, "getlasterror") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } @@ -289,9 +283,6 @@ public: class CmdGetPrevError : public Command { public: - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "check for errors since last reseterror commandcal"; } diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp index 81b18386b8f..0d474ed100d 100644 --- a/src/mongo/db/commands/getmore_cmd.cpp +++ b/src/mongo/db/commands/getmore_cmd.cpp @@ -79,9 +79,6 @@ class GetMoreCmd : public Command { public: GetMoreCmd() : Command("getMore") {} - bool isWriteCommandForConfigServer() const override { - return false; - } bool slaveOk() const override { return true; diff --git a/src/mongo/db/commands/group_cmd.cpp b/src/mongo/db/commands/group_cmd.cpp index 2bbc9515f5f..e49a9081b49 100644 --- a/src/mongo/db/commands/group_cmd.cpp +++ b/src/mongo/db/commands/group_cmd.cpp @@ -52,10 +52,6 @@ public: GroupCommand() : Command("group") {} private: - virtual bool isWriteCommandForConfigServer() const { - return false; - } - virtual bool maintenanceOk() const { return false; } diff --git a/src/mongo/db/commands/hashcmd.cpp b/src/mongo/db/commands/hashcmd.cpp index a4f7c437630..f65690dddb3 100644 --- a/src/mongo/db/commands/hashcmd.cpp +++ b/src/mongo/db/commands/hashcmd.cpp @@ -53,9 +53,6 @@ using std::stringstream; class CmdHashElt : public Command { public: CmdHashElt() : Command("_hashBSONElement"){}; - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/commands/index_filter_commands.cpp b/src/mongo/db/commands/index_filter_commands.cpp index 5dee23e4385..936dab77670 100644 --- a/src/mongo/db/commands/index_filter_commands.cpp +++ b/src/mongo/db/commands/index_filter_commands.cpp @@ -144,9 +144,6 @@ bool IndexFilterCommand::run(OperationContext* txn, return true; } -bool IndexFilterCommand::isWriteCommandForConfigServer() const { - return false; -} bool IndexFilterCommand::slaveOk() const { return false; diff --git a/src/mongo/db/commands/index_filter_commands.h b/src/mongo/db/commands/index_filter_commands.h index 9b2815dba70..ddd2553823a 100644 --- a/src/mongo/db/commands/index_filter_commands.h +++ b/src/mongo/db/commands/index_filter_commands.h @@ -70,8 +70,6 @@ public: std::string& errmsg, BSONObjBuilder& result); - virtual bool isWriteCommandForConfigServer() const; - virtual bool slaveOk() const; virtual bool slaveOverrideOk() const; diff --git a/src/mongo/db/commands/isself.cpp b/src/mongo/db/commands/isself.cpp index 91522b4ddb7..a3d8a3af918 100644 --- a/src/mongo/db/commands/isself.cpp +++ b/src/mongo/db/commands/isself.cpp @@ -45,9 +45,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "{ _isSelf : 1 } INTERNAL ONLY"; } diff --git a/src/mongo/db/commands/kill_op.cpp b/src/mongo/db/commands/kill_op.cpp index baaf8106220..753d48b9362 100644 --- a/src/mongo/db/commands/kill_op.cpp +++ b/src/mongo/db/commands/kill_op.cpp @@ -49,9 +49,6 @@ class KillOpCommand : public Command { public: KillOpCommand() : Command("killOp") {} - bool isWriteCommandForConfigServer() const final { - return false; - } bool slaveOk() const final { return true; diff --git a/src/mongo/db/commands/killcursors_common.h b/src/mongo/db/commands/killcursors_common.h index 7e7d854ea93..7d082063858 100644 --- a/src/mongo/db/commands/killcursors_common.h +++ b/src/mongo/db/commands/killcursors_common.h @@ -41,9 +41,6 @@ class KillCursorsCmdBase : public Command { public: KillCursorsCmdBase() : Command("killCursors") {} - bool isWriteCommandForConfigServer() const final { - return false; - } bool slaveOk() const final { return true; diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp index 1c21d3b561d..7895de4510d 100644 --- a/src/mongo/db/commands/list_collections.cpp +++ b/src/mongo/db/commands/list_collections.cpp @@ -151,9 +151,6 @@ public: virtual bool adminOnly() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "list collections for this db"; diff --git a/src/mongo/db/commands/list_databases.cpp b/src/mongo/db/commands/list_databases.cpp index 886c035d076..f7184d7de7d 100644 --- a/src/mongo/db/commands/list_databases.cpp +++ b/src/mongo/db/commands/list_databases.cpp @@ -57,9 +57,6 @@ public: virtual bool adminOnly() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "list databases on this server"; } diff --git a/src/mongo/db/commands/list_indexes.cpp b/src/mongo/db/commands/list_indexes.cpp index 6f637c17e1e..1fb0fb8ffca 100644 --- a/src/mongo/db/commands/list_indexes.cpp +++ b/src/mongo/db/commands/list_indexes.cpp @@ -82,9 +82,6 @@ public: virtual bool adminOnly() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "list indexes for a collection"; diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index 33291845269..716b0afd01f 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -1286,9 +1286,6 @@ public: help << "http://dochub.mongodb.org/core/mapreduce"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, @@ -1590,9 +1587,6 @@ public: virtual bool slaveOverrideOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) { diff --git a/src/mongo/db/commands/oplog_note.cpp b/src/mongo/db/commands/oplog_note.cpp index a9f1ad7e619..6c96f0907b8 100644 --- a/src/mongo/db/commands/oplog_note.cpp +++ b/src/mongo/db/commands/oplog_note.cpp @@ -54,9 +54,6 @@ public: virtual bool adminOnly() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "Adds a no-op entry to the oplog"; } diff --git a/src/mongo/db/commands/parallel_collection_scan.cpp b/src/mongo/db/commands/parallel_collection_scan.cpp index 6806ec8ab57..9acaca45d2f 100644 --- a/src/mongo/db/commands/parallel_collection_scan.cpp +++ b/src/mongo/db/commands/parallel_collection_scan.cpp @@ -60,9 +60,6 @@ public: ParallelCollectionScanCmd() : Command("parallelCollectionScan") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/commands/parameters.cpp b/src/mongo/db/commands/parameters.cpp index e5bb81ea032..17a85c757b3 100644 --- a/src/mongo/db/commands/parameters.cpp +++ b/src/mongo/db/commands/parameters.cpp @@ -71,9 +71,6 @@ public: virtual bool adminOnly() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) { @@ -121,9 +118,6 @@ public: virtual bool adminOnly() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) { diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index 0c690b32480..b04d6ffe1ef 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -154,9 +154,6 @@ public: PipelineCommand() : Command(Pipeline::commandName) {} // command is called "aggregate" // Locks are managed manually, in particular by DocumentSourceCursor. - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return false; } diff --git a/src/mongo/db/commands/plan_cache_commands.cpp b/src/mongo/db/commands/plan_cache_commands.cpp index 8b5c94e74e7..49c25de5514 100644 --- a/src/mongo/db/commands/plan_cache_commands.cpp +++ b/src/mongo/db/commands/plan_cache_commands.cpp @@ -140,9 +140,6 @@ bool PlanCacheCommand::run(OperationContext* txn, return true; } -bool PlanCacheCommand::isWriteCommandForConfigServer() const { - return false; -} bool PlanCacheCommand::slaveOk() const { return false; diff --git a/src/mongo/db/commands/plan_cache_commands.h b/src/mongo/db/commands/plan_cache_commands.h index d42773f42e7..f419eaed8eb 100644 --- a/src/mongo/db/commands/plan_cache_commands.h +++ b/src/mongo/db/commands/plan_cache_commands.h @@ -64,8 +64,6 @@ public: std::string& errmsg, BSONObjBuilder& result); - virtual bool isWriteCommandForConfigServer() const; - virtual bool slaveOk() const; virtual bool slaveOverrideOk() const; diff --git a/src/mongo/db/commands/rename_collection.cpp b/src/mongo/db/commands/rename_collection.cpp index 68c47676527..4e4eef26434 100644 --- a/src/mongo/db/commands/rename_collection.cpp +++ b/src/mongo/db/commands/rename_collection.cpp @@ -65,9 +65,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, const BSONObj& cmdObj) { diff --git a/src/mongo/db/commands/repair_cursor.cpp b/src/mongo/db/commands/repair_cursor.cpp index 82de7d406c7..8792afe2092 100644 --- a/src/mongo/db/commands/repair_cursor.cpp +++ b/src/mongo/db/commands/repair_cursor.cpp @@ -48,9 +48,6 @@ class RepairCursorCmd : public Command { public: RepairCursorCmd() : Command("repairCursor") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/commands/server_status.cpp b/src/mongo/db/commands/server_status.cpp index c4b475f6a40..e7f15f8e4cb 100644 --- a/src/mongo/db/commands/server_status.cpp +++ b/src/mongo/db/commands/server_status.cpp @@ -67,9 +67,6 @@ public: CmdServerStatus() : Command("serverStatus", true), _started(curTimeMillis64()), _runCalled(false) {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/commands/shutdown.h b/src/mongo/db/commands/shutdown.h index c184c22aa4f..2bb71e7373d 100644 --- a/src/mongo/db/commands/shutdown.h +++ b/src/mongo/db/commands/shutdown.h @@ -54,9 +54,6 @@ public: virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out); - virtual bool isWriteCommandForConfigServer() const { - return false; - } protected: static void shutdownHelper(); diff --git a/src/mongo/db/commands/snapshot_management.cpp b/src/mongo/db/commands/snapshot_management.cpp index 1b3828dfbc0..cb90e41d685 100644 --- a/src/mongo/db/commands/snapshot_management.cpp +++ b/src/mongo/db/commands/snapshot_management.cpp @@ -45,9 +45,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool adminOnly() const { return true; } @@ -95,9 +92,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool adminOnly() const { return true; } diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp index 485998c4e3a..39b6ef90636 100644 --- a/src/mongo/db/commands/test_commands.cpp +++ b/src/mongo/db/commands/test_commands.cpp @@ -65,9 +65,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } // No auth needed because it only works when enabled via command line. virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, @@ -113,10 +110,6 @@ public: /* for diagnostic / testing purposes. Enabled via command line. */ class CmdSleep : public Command { public: - virtual bool isWriteCommandForConfigServer() const { - return false; - } - virtual bool adminOnly() const { return true; } @@ -211,9 +204,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } // No auth needed because it only works when enabled via command line. virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, @@ -281,9 +271,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } // No auth needed because it only works when enabled via command line. virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/db/commands/top_command.cpp b/src/mongo/db/commands/top_command.cpp index b716457f311..70407d67ea6 100644 --- a/src/mongo/db/commands/top_command.cpp +++ b/src/mongo/db/commands/top_command.cpp @@ -52,9 +52,6 @@ public: virtual bool adminOnly() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "usage by collection, in micros "; } diff --git a/src/mongo/db/commands/touch.cpp b/src/mongo/db/commands/touch.cpp index 9beace559f2..530d8937588 100644 --- a/src/mongo/db/commands/touch.cpp +++ b/src/mongo/db/commands/touch.cpp @@ -57,9 +57,6 @@ using std::stringstream; class TouchCmd : public Command { public: - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool adminOnly() const { return false; } diff --git a/src/mongo/db/commands/user_management_commands.cpp b/src/mongo/db/commands/user_management_commands.cpp index 9a48de6d74e..5e35694173e 100644 --- a/src/mongo/db/commands/user_management_commands.cpp +++ b/src/mongo/db/commands/user_management_commands.cpp @@ -608,9 +608,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Adds a user to the system" << endl; @@ -753,9 +750,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Used to update a user, for example to change its password" << endl; @@ -870,9 +864,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Drops a single user." << endl; @@ -942,9 +933,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Drops all users for a single database." << endl; @@ -1004,9 +992,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Grants roles to a user." << endl; @@ -1079,9 +1064,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Revokes roles from a user." << endl; @@ -1156,9 +1138,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } CmdUsersInfo() : Command("usersInfo") {} @@ -1310,9 +1289,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Adds a role to the system" << endl; @@ -1424,9 +1400,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Used to update a role" << endl; @@ -1523,9 +1496,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Grants privileges to a role" << endl; @@ -1631,9 +1601,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Revokes privileges from a role" << endl; @@ -1747,9 +1714,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Grants roles to another role." << endl; @@ -1842,9 +1806,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Revokes roles from another role." << endl; @@ -1931,9 +1892,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Drops a single role. Before deleting the role completely it must remove it " @@ -2085,9 +2043,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Drops all roles from the given database. Before deleting the roles completely " @@ -2208,9 +2163,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } CmdRolesInfo() : Command("rolesInfo") {} @@ -2283,9 +2235,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } CmdInvalidateUserCache() : Command("invalidateUserCache") {} @@ -2322,9 +2271,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } CmdGetCacheGeneration() : Command("_getUserCacheGeneration") {} @@ -2369,9 +2315,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual bool adminOnly() const { return true; @@ -2954,9 +2897,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Upgrades the auth data storage schema"; diff --git a/src/mongo/db/commands/validate.cpp b/src/mongo/db/commands/validate.cpp index 93693e68c57..d9b7a588188 100644 --- a/src/mongo/db/commands/validate.cpp +++ b/src/mongo/db/commands/validate.cpp @@ -59,9 +59,6 @@ public: "Add full:true option to do a more thorough check"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) { diff --git a/src/mongo/db/commands/write_commands/write_commands.cpp b/src/mongo/db/commands/write_commands/write_commands.cpp index 4d5f625c948..cd3c13674a1 100644 --- a/src/mongo/db/commands/write_commands/write_commands.cpp +++ b/src/mongo/db/commands/write_commands/write_commands.cpp @@ -91,9 +91,6 @@ bool WriteCmd::slaveOk() const { return false; } -bool WriteCmd::isWriteCommandForConfigServer() const { - return false; -} Status WriteCmd::checkAuthForCommand(ClientBasic* client, const std::string& dbname, diff --git a/src/mongo/db/commands/write_commands/write_commands.h b/src/mongo/db/commands/write_commands/write_commands.h index 8ea3d37411a..e8dfaaa9608 100644 --- a/src/mongo/db/commands/write_commands/write_commands.h +++ b/src/mongo/db/commands/write_commands/write_commands.h @@ -63,8 +63,6 @@ protected: private: virtual bool slaveOk() const; - virtual bool isWriteCommandForConfigServer() const; - virtual Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, const BSONObj& cmdObj); diff --git a/src/mongo/db/commands/writeback_compatibility_shim.cpp b/src/mongo/db/commands/writeback_compatibility_shim.cpp index b03cf3b21dc..3c56cac9415 100644 --- a/src/mongo/db/commands/writeback_compatibility_shim.cpp +++ b/src/mongo/db/commands/writeback_compatibility_shim.cpp @@ -61,9 +61,6 @@ public: helpOut << "v3.0 disallowed internal command, present for compatibility only"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } // // Same as v2.6 settings diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp index 790c90b744a..a469d2ebfaf 100644 --- a/src/mongo/db/dbcommands.cpp +++ b/src/mongo/db/dbcommands.cpp @@ -179,9 +179,6 @@ public: out->push_back(Privilege(ResourcePattern::forDatabaseName(dbname), actions)); } - virtual bool isWriteCommandForConfigServer() const { - return true; - } CmdDropDatabase() : Command("dropDatabase") {} @@ -238,9 +235,6 @@ public: help << "repair database. also compacts. note: slow."; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, @@ -314,9 +308,6 @@ public: help << "http://docs.mongodb.org/manual/reference/command/profile/#dbcmd.profile"; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, @@ -406,9 +397,6 @@ public: "monitoring#MonitoringandDiagnostics-DatabaseRecord%2FReplay%28diagLoggingcommand%29"; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, @@ -473,9 +461,6 @@ public: help << "drop a collection\n{drop : <collectionName>}"; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual bool run(OperationContext* txn, const string& dbname, @@ -513,9 +498,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& help) const { help << "create a collection explicitly\n" @@ -571,9 +553,6 @@ public: help << " example: { filemd5 : ObjectId(aaaaaaa) , root : \"fs\" }"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual std::string parseNs(const std::string& dbname, const BSONObj& cmdObj) const { std::string collectionName = cmdObj.getStringField("root"); @@ -745,9 +724,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "determine data size for a set of data in a certain range" "\nexample: { dataSize:\"blog.posts\", keyPattern:{x:1}, min:{x:10}, max:{x:55} }" @@ -894,9 +870,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "{ collStats:\"blog.posts\" , scale : 1 } scale divides sizes e.g. for KB use 1024\n" @@ -1004,9 +977,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& help) const { help << "Sets collection options.\n" "Example: { collMod: 'foo', usePowerOf2Sizes:true }\n" @@ -1040,9 +1010,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "Get stats on a database. Not instantaneous. Slower for databases with large " ".ns files.\n" @@ -1130,9 +1097,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "{whatsmyuri:1}"; } @@ -1157,9 +1121,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, const BSONObj& cmdObj) { diff --git a/src/mongo/db/dbeval.cpp b/src/mongo/db/dbeval.cpp index 5fefb31cfd0..6df169bfefd 100644 --- a/src/mongo/db/dbeval.cpp +++ b/src/mongo/db/dbeval.cpp @@ -160,9 +160,6 @@ public: << "Evaluate javascript at the server.\n" << "http://dochub.mongodb.org/core/serversidecodeexecution"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) { diff --git a/src/mongo/db/driverHelpers.cpp b/src/mongo/db/driverHelpers.cpp index 3721d93f194..0480050edce 100644 --- a/src/mongo/db/driverHelpers.cpp +++ b/src/mongo/db/driverHelpers.cpp @@ -56,9 +56,6 @@ class BasicDriverHelper : public Command { public: BasicDriverHelper(const char* name) : Command(name) {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/exec/stagedebug_cmd.cpp b/src/mongo/db/exec/stagedebug_cmd.cpp index 3cacf015fcc..8c012f01862 100644 --- a/src/mongo/db/exec/stagedebug_cmd.cpp +++ b/src/mongo/db/exec/stagedebug_cmd.cpp @@ -119,9 +119,6 @@ class StageDebugCmd : public Command { public: StageDebugCmd() : Command("stageDebug") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } bool slaveOk() const { return false; } diff --git a/src/mongo/db/geo/haystack.cpp b/src/mongo/db/geo/haystack.cpp index 23c537534c5..2027dc5dd8c 100644 --- a/src/mongo/db/geo/haystack.cpp +++ b/src/mongo/db/geo/haystack.cpp @@ -62,9 +62,6 @@ class GeoHaystackSearchCommand : public Command { public: GeoHaystackSearchCommand() : Command("geoSearch") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } bool slaveOk() const { return true; } diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp index 2b2f43fdd97..c3a0cc260e9 100644 --- a/src/mongo/db/repl/master_slave.cpp +++ b/src/mongo/db/repl/master_slave.cpp @@ -355,9 +355,6 @@ public: h << "internal"; } HandshakeCmd() : Command("handshake") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } diff --git a/src/mongo/db/repl/repl_set_command.h b/src/mongo/db/repl/repl_set_command.h index 0b8c74c44b8..61e2b9b07f3 100644 --- a/src/mongo/db/repl/repl_set_command.h +++ b/src/mongo/db/repl/repl_set_command.h @@ -55,9 +55,6 @@ protected: return true; } - bool isWriteCommandForConfigServer() const override { - return false; - } Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp index 887b4fe4e06..02a7a6f8a81 100644 --- a/src/mongo/db/repl/replication_info.cpp +++ b/src/mongo/db/repl/replication_info.cpp @@ -210,9 +210,6 @@ public: "--slave in simple master/slave setups.\n"; help << "{ isMaster : 1 }"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) {} // No auth required diff --git a/src/mongo/db/repl/resync.cpp b/src/mongo/db/repl/resync.cpp index bdab9c63cc4..1b53ac4d162 100644 --- a/src/mongo/db/repl/resync.cpp +++ b/src/mongo/db/repl/resync.cpp @@ -49,9 +49,6 @@ public: virtual bool adminOnly() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, std::vector<Privilege>* out) { diff --git a/src/mongo/db/s/cleanup_orphaned_cmd.cpp b/src/mongo/db/s/cleanup_orphaned_cmd.cpp index 0694335b79d..9c2a6477186 100644 --- a/src/mongo/db/s/cleanup_orphaned_cmd.cpp +++ b/src/mongo/db/s/cleanup_orphaned_cmd.cpp @@ -188,9 +188,6 @@ public: return Status::OK(); } - virtual bool isWriteCommandForConfigServer() const { - return false; - } // Input static BSONField<string> nsField; diff --git a/src/mongo/db/s/merge_chunks_command.cpp b/src/mongo/db/s/merge_chunks_command.cpp index a89a4cd9a16..d6d3011f47b 100644 --- a/src/mongo/db/s/merge_chunks_command.cpp +++ b/src/mongo/db/s/merge_chunks_command.cpp @@ -79,9 +79,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } // Required static BSONField<string> nsField; diff --git a/src/mongo/db/s/move_chunk_command.cpp b/src/mongo/db/s/move_chunk_command.cpp index 0b9b72e9e33..e0c028e630f 100644 --- a/src/mongo/db/s/move_chunk_command.cpp +++ b/src/mongo/db/s/move_chunk_command.cpp @@ -106,9 +106,6 @@ public: return true; } - bool isWriteCommandForConfigServer() const override { - return false; - } Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, diff --git a/src/mongo/db/s/set_shard_version_command.cpp b/src/mongo/db/s/set_shard_version_command.cpp index 4606720cb33..04710cd8c95 100644 --- a/src/mongo/db/s/set_shard_version_command.cpp +++ b/src/mongo/db/s/set_shard_version_command.cpp @@ -72,9 +72,6 @@ public: return true; } - bool isWriteCommandForConfigServer() const override { - return false; - } void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp index 45291f62ae4..743d3d9f2dc 100644 --- a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp +++ b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp @@ -71,9 +71,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool adminOnly() const { return true; } diff --git a/src/mongo/s/client/shard_connection.cpp b/src/mongo/s/client/shard_connection.cpp index 4d810238744..177fd934e8c 100644 --- a/src/mongo/s/client/shard_connection.cpp +++ b/src/mongo/s/client/shard_connection.cpp @@ -94,9 +94,6 @@ public: virtual void help(stringstream& help) const { help << "stats about the shard connection pool"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; } diff --git a/src/mongo/s/commands/cluster_add_shard_cmd.cpp b/src/mongo/s/commands/cluster_add_shard_cmd.cpp index 1867191bd45..2e50407f0a0 100644 --- a/src/mongo/s/commands/cluster_add_shard_cmd.cpp +++ b/src/mongo/s/commands/cluster_add_shard_cmd.cpp @@ -57,9 +57,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "add a new shard to the system"; diff --git a/src/mongo/s/commands/cluster_count_cmd.cpp b/src/mongo/s/commands/cluster_count_cmd.cpp index 4fc8fea39e7..70a678b987b 100644 --- a/src/mongo/s/commands/cluster_count_cmd.cpp +++ b/src/mongo/s/commands/cluster_count_cmd.cpp @@ -82,9 +82,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/s/commands/cluster_drop_database_cmd.cpp b/src/mongo/s/commands/cluster_drop_database_cmd.cpp index d9523db3ed2..9577e9327fb 100644 --- a/src/mongo/s/commands/cluster_drop_database_cmd.cpp +++ b/src/mongo/s/commands/cluster_drop_database_cmd.cpp @@ -56,9 +56,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp index 49bdcdba2b4..7023252ec0c 100644 --- a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp +++ b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp @@ -60,9 +60,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "Enable sharding for a database. " diff --git a/src/mongo/s/commands/cluster_explain_cmd.cpp b/src/mongo/s/commands/cluster_explain_cmd.cpp index a48076dc93a..5ddada38664 100644 --- a/src/mongo/s/commands/cluster_explain_cmd.cpp +++ b/src/mongo/s/commands/cluster_explain_cmd.cpp @@ -56,9 +56,6 @@ class ClusterExplainCmd : public Command { public: ClusterExplainCmd() : Command("explain") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } /** * Running an explain on a secondary requires explicitly setting slaveOk. diff --git a/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp index 4288b29620c..9109ecee01d 100644 --- a/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp +++ b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp @@ -65,9 +65,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/s/commands/cluster_find_cmd.cpp b/src/mongo/s/commands/cluster_find_cmd.cpp index 44ec66acb12..f8a21610032 100644 --- a/src/mongo/s/commands/cluster_find_cmd.cpp +++ b/src/mongo/s/commands/cluster_find_cmd.cpp @@ -57,9 +57,6 @@ class ClusterFindCmd : public Command { public: ClusterFindCmd() : Command("find") {} - bool isWriteCommandForConfigServer() const final { - return false; - } bool slaveOk() const final { return false; diff --git a/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp b/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp index dbb52870602..47e9d56afcd 100644 --- a/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp +++ b/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp @@ -48,9 +48,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "flush all router config"; diff --git a/src/mongo/s/commands/cluster_fsync_cmd.cpp b/src/mongo/s/commands/cluster_fsync_cmd.cpp index 732c75c2866..ec14aa91db3 100644 --- a/src/mongo/s/commands/cluster_fsync_cmd.cpp +++ b/src/mongo/s/commands/cluster_fsync_cmd.cpp @@ -50,9 +50,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "invoke fsync on all shards belonging to the cluster"; diff --git a/src/mongo/s/commands/cluster_get_last_error_cmd.cpp b/src/mongo/s/commands/cluster_get_last_error_cmd.cpp index 1e219d77114..f59cb038e64 100644 --- a/src/mongo/s/commands/cluster_get_last_error_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_last_error_cmd.cpp @@ -45,9 +45,6 @@ class GetLastErrorCmd : public Command { public: GetLastErrorCmd() : Command("getLastError", false, "getlasterror") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp b/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp index c0dcdfc618c..473ad25c9ea 100644 --- a/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp @@ -42,9 +42,6 @@ class GetPrevErrorCmd : public Command { public: GetPrevErrorCmd() : Command("getPrevError", false, "getpreverror") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp b/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp index 0fcdc77d6fc..78796a4ce06 100644 --- a/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp @@ -42,9 +42,6 @@ class CmdGetShardMap : public Command { public: CmdGetShardMap() : Command("getShardMap") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp b/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp index 66733161fdc..20791505430 100644 --- a/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp @@ -57,9 +57,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << " example: { getShardVersion : 'alleyinsider.foo' } "; diff --git a/src/mongo/s/commands/cluster_getmore_cmd.cpp b/src/mongo/s/commands/cluster_getmore_cmd.cpp index 05248bba6e1..ec8d444f769 100644 --- a/src/mongo/s/commands/cluster_getmore_cmd.cpp +++ b/src/mongo/s/commands/cluster_getmore_cmd.cpp @@ -50,9 +50,6 @@ class ClusterGetMoreCmd final : public Command { public: ClusterGetMoreCmd() : Command("getMore") {} - bool isWriteCommandForConfigServer() const final { - return false; - } bool slaveOk() const final { return true; diff --git a/src/mongo/s/commands/cluster_index_filter_cmd.cpp b/src/mongo/s/commands/cluster_index_filter_cmd.cpp index 05c5724ee3e..7c4711acd3d 100644 --- a/src/mongo/s/commands/cluster_index_filter_cmd.cpp +++ b/src/mongo/s/commands/cluster_index_filter_cmd.cpp @@ -61,9 +61,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } void help(stringstream& ss) const { ss << _helpText; diff --git a/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp b/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp index 3c16419807d..83b5a795390 100644 --- a/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp +++ b/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp @@ -38,9 +38,6 @@ class IsDbGridCmd : public Command { public: IsDbGridCmd() : Command("isdbgrid") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_is_master_cmd.cpp b/src/mongo/s/commands/cluster_is_master_cmd.cpp index 50f70f01352..e88e8de9e37 100644 --- a/src/mongo/s/commands/cluster_is_master_cmd.cpp +++ b/src/mongo/s/commands/cluster_is_master_cmd.cpp @@ -40,9 +40,6 @@ class CmdIsMaster : public Command { public: CmdIsMaster() : Command("isMaster", false, "ismaster") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_kill_op.cpp b/src/mongo/s/commands/cluster_kill_op.cpp index b370b31b87d..92a98d851d3 100644 --- a/src/mongo/s/commands/cluster_kill_op.cpp +++ b/src/mongo/s/commands/cluster_kill_op.cpp @@ -55,9 +55,6 @@ class ClusterKillOpCommand : public Command { public: ClusterKillOpCommand() : Command("killOp") {} - bool isWriteCommandForConfigServer() const final { - return false; - } bool slaveOk() const final { return true; diff --git a/src/mongo/s/commands/cluster_list_databases_cmd.cpp b/src/mongo/s/commands/cluster_list_databases_cmd.cpp index 23dad76f0a3..6b50526cee6 100644 --- a/src/mongo/s/commands/cluster_list_databases_cmd.cpp +++ b/src/mongo/s/commands/cluster_list_databases_cmd.cpp @@ -65,9 +65,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "list databases in a cluster"; diff --git a/src/mongo/s/commands/cluster_list_shards_cmd.cpp b/src/mongo/s/commands/cluster_list_shards_cmd.cpp index 1e0f4e4060f..3c7d234d9df 100644 --- a/src/mongo/s/commands/cluster_list_shards_cmd.cpp +++ b/src/mongo/s/commands/cluster_list_shards_cmd.cpp @@ -51,9 +51,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "list all shards of the system"; diff --git a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp index 507ea29f3bd..b660c56a421 100644 --- a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp +++ b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp @@ -164,9 +164,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "Runs the sharded map/reduce command"; diff --git a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp index dca68e45779..fe318b26d62 100644 --- a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp +++ b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp @@ -85,9 +85,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } // Required static BSONField<string> nsField; diff --git a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp index 4d180c4f201..6cca0081281 100644 --- a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp +++ b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp @@ -68,9 +68,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "Example: move chunk that contains the doc {num : 7} to shard001\n" diff --git a/src/mongo/s/commands/cluster_move_primary_cmd.cpp b/src/mongo/s/commands/cluster_move_primary_cmd.cpp index 9cfc87c7c58..d3ddea28226 100644 --- a/src/mongo/s/commands/cluster_move_primary_cmd.cpp +++ b/src/mongo/s/commands/cluster_move_primary_cmd.cpp @@ -70,9 +70,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << " example: { moveprimary : 'foo' , to : 'localhost:9999' }"; diff --git a/src/mongo/s/commands/cluster_netstat_cmd.cpp b/src/mongo/s/commands/cluster_netstat_cmd.cpp index e7a10b0ea49..6e19901c336 100644 --- a/src/mongo/s/commands/cluster_netstat_cmd.cpp +++ b/src/mongo/s/commands/cluster_netstat_cmd.cpp @@ -48,9 +48,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << " shows status/reachability of servers in the cluster"; diff --git a/src/mongo/s/commands/cluster_pipeline_cmd.cpp b/src/mongo/s/commands/cluster_pipeline_cmd.cpp index 48544a41c3d..5d34c4fb2b7 100644 --- a/src/mongo/s/commands/cluster_pipeline_cmd.cpp +++ b/src/mongo/s/commands/cluster_pipeline_cmd.cpp @@ -80,9 +80,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "Runs the sharded aggregation command"; diff --git a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp index 42f240b7dd3..839265f0a70 100644 --- a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp +++ b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp @@ -61,9 +61,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } void help(stringstream& ss) const { ss << _helpText; diff --git a/src/mongo/s/commands/cluster_profile_cmd.cpp b/src/mongo/s/commands/cluster_profile_cmd.cpp index ca619d80fbe..a93bcaea43f 100644 --- a/src/mongo/s/commands/cluster_profile_cmd.cpp +++ b/src/mongo/s/commands/cluster_profile_cmd.cpp @@ -45,9 +45,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/s/commands/cluster_remove_shard_cmd.cpp b/src/mongo/s/commands/cluster_remove_shard_cmd.cpp index 5c6d412391c..7600808ef04 100644 --- a/src/mongo/s/commands/cluster_remove_shard_cmd.cpp +++ b/src/mongo/s/commands/cluster_remove_shard_cmd.cpp @@ -62,9 +62,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "remove a shard from the system."; diff --git a/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp b/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp index bd8c0332bb1..3695f978883 100644 --- a/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp +++ b/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp @@ -48,9 +48,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "Not supported through mongos"; diff --git a/src/mongo/s/commands/cluster_reset_error_cmd.cpp b/src/mongo/s/commands/cluster_reset_error_cmd.cpp index e82b43db1ec..2da2656efa7 100644 --- a/src/mongo/s/commands/cluster_reset_error_cmd.cpp +++ b/src/mongo/s/commands/cluster_reset_error_cmd.cpp @@ -44,9 +44,6 @@ class CmdShardingResetError : public Command { public: CmdShardingResetError() : Command("resetError", false, "reseterror") {} - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return true; diff --git a/src/mongo/s/commands/cluster_shard_collection_cmd.cpp b/src/mongo/s/commands/cluster_shard_collection_cmd.cpp index 34a7eff7807..8bdae0a8f1c 100644 --- a/src/mongo/s/commands/cluster_shard_collection_cmd.cpp +++ b/src/mongo/s/commands/cluster_shard_collection_cmd.cpp @@ -76,9 +76,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "Shard a collection. Requires key. Optional unique." diff --git a/src/mongo/s/commands/cluster_split_collection_cmd.cpp b/src/mongo/s/commands/cluster_split_collection_cmd.cpp index 06a50c1d3cf..8f231f45de3 100644 --- a/src/mongo/s/commands/cluster_split_collection_cmd.cpp +++ b/src/mongo/s/commands/cluster_split_collection_cmd.cpp @@ -67,9 +67,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << " example: - split the shard that contains give key\n" diff --git a/src/mongo/s/commands/cluster_user_management_commands.cpp b/src/mongo/s/commands/cluster_user_management_commands.cpp index a3d98a0fc0a..0f435706e56 100644 --- a/src/mongo/s/commands/cluster_user_management_commands.cpp +++ b/src/mongo/s/commands/cluster_user_management_commands.cpp @@ -60,9 +60,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Adds a user to the system"; @@ -98,9 +95,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Used to update a user, for example to change its password"; @@ -147,9 +141,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Drops a single user."; @@ -194,9 +185,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Drops all users for a single database."; @@ -234,9 +222,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Grants roles to a user."; @@ -282,9 +267,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Revokes roles from a user."; @@ -332,9 +314,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } CmdUsersInfo() : Command("usersInfo") {} @@ -367,9 +346,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Adds a role to the system"; @@ -401,9 +377,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Used to update a role"; @@ -441,9 +414,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Grants privileges to a role"; @@ -481,9 +451,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Revokes privileges from a role"; @@ -521,9 +488,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Grants roles to another role."; @@ -561,9 +525,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Revokes roles from another role."; @@ -601,9 +562,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Drops a single role. Before deleting the role completely it must remove it " @@ -644,9 +602,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Drops all roles from the given database. Before deleting the roles completely " @@ -692,9 +647,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Returns information about roles."; @@ -729,9 +681,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& ss) const { ss << "Invalidates the in-memory cache of user information"; @@ -775,9 +724,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool adminOnly() const { return true; @@ -855,9 +801,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual void help(stringstream& ss) const { ss << "Upgrades the auth data storage schema"; diff --git a/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp b/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp index 6b10eb476e6..e8b3ad130d0 100644 --- a/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp +++ b/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp @@ -43,9 +43,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(std::stringstream& help) const { help << "{whatsmyuri:1}"; diff --git a/src/mongo/s/commands/cluster_write_cmd.cpp b/src/mongo/s/commands/cluster_write_cmd.cpp index c7055229889..01f0b79662e 100644 --- a/src/mongo/s/commands/cluster_write_cmd.cpp +++ b/src/mongo/s/commands/cluster_write_cmd.cpp @@ -73,9 +73,6 @@ public: return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, diff --git a/src/mongo/s/commands/commands_public.cpp b/src/mongo/s/commands/commands_public.cpp index 6c177a05d59..12279397501 100644 --- a/src/mongo/s/commands/commands_public.cpp +++ b/src/mongo/s/commands/commands_public.cpp @@ -137,9 +137,6 @@ public: } // all grid commands are designed not to lock - virtual bool isWriteCommandForConfigServer() const { - return false; - } protected: bool passthrough(OperationContext* txn, @@ -1527,9 +1524,6 @@ public: virtual bool slaveOk() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, const BSONObj& cmdObj) { diff --git a/src/mongo/s/commands/run_on_all_shards_cmd.h b/src/mongo/s/commands/run_on_all_shards_cmd.h index b1601f9ef90..f0c983b8578 100644 --- a/src/mongo/s/commands/run_on_all_shards_cmd.h +++ b/src/mongo/s/commands/run_on_all_shards_cmd.h @@ -63,9 +63,6 @@ public: bool adminOnly() const override { return false; } - bool isWriteCommandForConfigServer() const override { - return false; - } // The StringData contains the shard ident. // This can be used to create an instance of Shard diff --git a/src/mongo/s/d_migrate.cpp b/src/mongo/s/d_migrate.cpp index 5b5b649e329..b1a618f464a 100644 --- a/src/mongo/s/d_migrate.cpp +++ b/src/mongo/s/d_migrate.cpp @@ -74,9 +74,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, @@ -116,9 +113,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, @@ -190,9 +184,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, @@ -316,9 +307,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, @@ -356,9 +344,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, @@ -401,9 +386,6 @@ public: return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void addRequiredPrivileges(const std::string& dbname, const BSONObj& cmdObj, diff --git a/src/mongo/s/d_split.cpp b/src/mongo/s/d_split.cpp index 7e36bbe3389..d8a690d211e 100644 --- a/src/mongo/s/d_split.cpp +++ b/src/mongo/s/d_split.cpp @@ -79,9 +79,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "Internal command.\n"; } @@ -234,9 +231,6 @@ public: virtual bool slaveOk() const { return false; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual void help(stringstream& help) const { help << "Internal command.\n" "examples:\n" @@ -555,9 +549,6 @@ public: virtual bool adminOnly() const { return true; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, const BSONObj& cmdObj) { diff --git a/src/mongo/s/d_state.cpp b/src/mongo/s/d_state.cpp index af47f7027a1..9e1a413690a 100644 --- a/src/mongo/s/d_state.cpp +++ b/src/mongo/s/d_state.cpp @@ -65,9 +65,6 @@ public: help << "internal"; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool adminOnly() const { return true; @@ -105,9 +102,6 @@ public: help << " example: { getShardVersion : 'alleyinsider.foo' } "; } - virtual bool isWriteCommandForConfigServer() const { - return false; - } virtual bool slaveOk() const { return false; @@ -188,9 +182,6 @@ class ShardingStateCmd : public Command { public: ShardingStateCmd() : Command("shardingState") {} - virtual bool isWriteCommandForConfigServer() const { - return true; - } virtual bool slaveOk() const { return false; diff --git a/src/mongo/s/s_only.cpp b/src/mongo/s/s_only.cpp index 2322aa67d3d..26c62a577e3 100644 --- a/src/mongo/s/s_only.cpp +++ b/src/mongo/s/s_only.cpp @@ -105,7 +105,6 @@ void Command::execCommandClientBasic(OperationContext* txn, help << "help for: " << c->name << " "; c->help(help); result.append("help", help.str()); - result.append("lockType", c->isWriteCommandForConfigServer() ? 1 : 0); appendCommandStatus(result, true, ""); return; } |