diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-07-25 10:35:01 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-07-25 15:16:17 -0400 |
commit | 8855c03bdf307ef74825e0274344b1ce8df0852b (patch) | |
tree | 7267e9725bff6495956229c5b661bfb297ef0406 /src/mongo/db/commands/get_last_error.cpp | |
parent | 72728d0429e74e1bec1715b4339f60159b0d6b4e (diff) | |
download | mongo-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.cpp | 6 |
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()) { |