summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/get_last_error.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-07-25 10:35:01 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-07-25 15:16:17 -0400
commit8855c03bdf307ef74825e0274344b1ce8df0852b (patch)
tree7267e9725bff6495956229c5b661bfb297ef0406 /src/mongo/db/commands/get_last_error.cpp
parent72728d0429e74e1bec1715b4339f60159b0d6b4e (diff)
downloadmongo-8855c03bdf307ef74825e0274344b1ce8df0852b.tar.gz
SERVER-25204 Allow writeConcern w:1 for 'local' on CSRS config servers
Diffstat (limited to 'src/mongo/db/commands/get_last_error.cpp')
-rw-r--r--src/mongo/db/commands/get_last_error.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp
index 498d32d9d0c..899d081926d 100644
--- a/src/mongo/db/commands/get_last_error.cpp
+++ b/src/mongo/db/commands/get_last_error.cpp
@@ -221,8 +221,10 @@ public:
// Validate write concern no matter what, this matches 2.4 behavior
//
if (status.isOK()) {
- // Ensure options are valid for this host
- status = validateWriteConcern(txn, writeConcern);
+ // Ensure options are valid for this host. Since getLastError doesn't do writes itself,
+ // treat it as if these are admin database writes, which need to be replicated so we do
+ // the strictest checks write concern checks.
+ status = validateWriteConcern(txn, writeConcern, NamespaceString::kAdminDb);
}
if (!status.isOK()) {