summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/mr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/mr.cpp')
-rw-r--r--src/mongo/db/commands/mr.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index ce7d144bfcc..ef9043fd78a 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -1351,12 +1351,13 @@ class MapReduceCommand : public ErrmsgCommandDeprecated {
public:
MapReduceCommand() : ErrmsgCommandDeprecated("mapReduce", "mapreduce") {}
- AllowedOnSecondary secondaryAllowed() const override {
- if (repl::getGlobalReplicationCoordinator()->getReplicationMode() !=
- repl::ReplicationCoordinator::modeReplSet) {
- return AllowedOnSecondary::kAlways;
- }
- return AllowedOnSecondary::kOptIn;
+ virtual bool slaveOk() const {
+ return repl::getGlobalReplicationCoordinator()->getReplicationMode() !=
+ repl::ReplicationCoordinator::modeReplSet;
+ }
+
+ virtual bool slaveOverrideOk() const {
+ return true;
}
std::size_t reserveBytesForReply() const override {
@@ -1688,15 +1689,13 @@ public:
return "internal";
}
MapReduceFinishCommand() : BasicCommand("mapreduce.shardedfinish") {}
-
- AllowedOnSecondary secondaryAllowed() const override {
- if (repl::getGlobalReplicationCoordinator()->getReplicationMode() !=
- repl::ReplicationCoordinator::modeReplSet) {
- return AllowedOnSecondary::kAlways;
- }
- return AllowedOnSecondary::kOptIn;
+ virtual bool slaveOk() const {
+ return repl::getGlobalReplicationCoordinator()->getReplicationMode() !=
+ repl::ReplicationCoordinator::modeReplSet;
+ }
+ virtual bool slaveOverrideOk() const {
+ return true;
}
-
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
return true;
}