summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/dbcommands.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/dbcommands.cpp')
-rw-r--r--src/mongo/db/commands/dbcommands.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp
index b46512cd7e2..8f25ddcc13d 100644
--- a/src/mongo/db/commands/dbcommands.cpp
+++ b/src/mongo/db/commands/dbcommands.cpp
@@ -147,8 +147,8 @@ public:
std::string help() const override {
return "drop (delete) this database";
}
- virtual bool slaveOk() const {
- return false;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kNever;
}
virtual void addRequiredPrivileges(const std::string& dbname,
@@ -210,8 +210,8 @@ public:
class CmdRepairDatabase : public ErrmsgCommandDeprecated {
public:
- virtual bool slaveOk() const {
- return true;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kAlways;
}
virtual bool maintenanceMode() const {
return true;
@@ -295,8 +295,8 @@ public:
*/
class CmdProfile : public ErrmsgCommandDeprecated {
public:
- virtual bool slaveOk() const {
- return true;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kAlways;
}
std::string help() const override {
@@ -396,8 +396,8 @@ public:
class CmdDrop : public ErrmsgCommandDeprecated {
public:
CmdDrop() : ErrmsgCommandDeprecated("drop") {}
- virtual bool slaveOk() const {
- return false;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kNever;
}
virtual bool adminOnly() const {
return false;
@@ -452,8 +452,8 @@ public:
class CmdCreate : public BasicCommand {
public:
CmdCreate() : BasicCommand("create") {}
- virtual bool slaveOk() const {
- return false;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kNever;
}
virtual bool adminOnly() const {
return false;
@@ -570,8 +570,8 @@ class CmdFileMD5 : public BasicCommand {
public:
CmdFileMD5() : BasicCommand("filemd5") {}
- virtual bool slaveOk() const {
- return true;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kAlways;
}
std::string help() const override {
@@ -747,8 +747,8 @@ class CmdDatasize : public ErrmsgCommandDeprecated {
public:
CmdDatasize() : ErrmsgCommandDeprecated("dataSize", "datasize") {}
- virtual bool slaveOk() const {
- return true;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kAlways;
}
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
return false;
@@ -897,8 +897,8 @@ class CollectionStats : public ErrmsgCommandDeprecated {
public:
CollectionStats() : ErrmsgCommandDeprecated("collStats", "collstats") {}
- virtual bool slaveOk() const {
- return true;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kAlways;
}
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
return false;
@@ -944,8 +944,8 @@ class CollectionModCommand : public BasicCommand {
public:
CollectionModCommand() : BasicCommand("collMod") {}
- virtual bool slaveOk() const {
- return false;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kNever;
}
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
return true;
@@ -978,8 +978,8 @@ class DBStats : public ErrmsgCommandDeprecated {
public:
DBStats() : ErrmsgCommandDeprecated("dbStats", "dbstats") {}
- virtual bool slaveOk() const {
- return true;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kAlways;
}
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
return false;
@@ -1074,8 +1074,8 @@ public:
class CmdWhatsMyUri : public BasicCommand {
public:
CmdWhatsMyUri() : BasicCommand("whatsmyuri") {}
- virtual bool slaveOk() const {
- return true;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kAlways;
}
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
return false;
@@ -1099,8 +1099,8 @@ class AvailableQueryOptions : public BasicCommand {
public:
AvailableQueryOptions() : BasicCommand("availableQueryOptions", "availablequeryoptions") {}
- virtual bool slaveOk() const {
- return true;
+ AllowedOnSecondary secondaryAllowed() const override {
+ return AllowedOnSecondary::kAlways;
}
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
return false;