summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2015-12-30 12:09:42 -0500
committerDan Pasette <dan@mongodb.com>2016-01-29 11:54:33 -0500
commit9287affdb7e7c80061450fed87671311672b55d8 (patch)
treeebe156c7e48dcb9c7af17eb097f2a0c043c2d809
parente9e372e1e2e48c1420c11af63f13b5ec227b4e8c (diff)
downloadmongo-9287affdb7e7c80061450fed87671311672b55d8.tar.gz
SERVER-22007 Disable last-error tracking for help commands.
(cherry picked from commit 8ae053a4d9c5bd2672140964e7f09bd6b734dbdc)
-rw-r--r--src/mongo/db/commands/get_last_error.cpp1
-rw-r--r--src/mongo/db/dbcommands.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp
index dfb8a6d7097..e14e13d4221 100644
--- a/src/mongo/db/commands/get_last_error.cpp
+++ b/src/mongo/db/commands/get_last_error.cpp
@@ -93,7 +93,6 @@ public:
const BSONObj& cmdObj,
std::vector<Privilege>* out) {} // No auth required
virtual void help(stringstream& help) const {
- LastError::get(cc()).disable(); // SERVER-11492
help << "return error status of the last operation on this connection\n"
<< "options:\n"
<< " { fsync:true } - fsync before returning, or wait for journal commit if running "
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp
index 2edf13c149e..cf44a4e145e 100644
--- a/src/mongo/db/dbcommands.cpp
+++ b/src/mongo/db/dbcommands.cpp
@@ -1216,6 +1216,10 @@ void Command::execCommand(OperationContext* txn,
if (isHelpRequest(extractedFields[kHelpField])) {
CurOp::get(txn)->ensureStarted();
+ // We disable last-error for help requests due to SERVER-11492, because config servers
+ // use help requests to determine which commands are database writes, and so must be
+ // forwarded to all mirrored (SCCC) config servers.
+ LastError::get(txn->getClient()).disable();
generateHelpResponse(txn, request, replyBuilder, *command);
return;
}