summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorGreg Studer <greg@10gen.com>2014-01-14 16:34:32 -0500
committerGreg Studer <greg@10gen.com>2014-01-15 07:05:40 +0000
commit288056872d40a1b40194937603f4456458586f22 (patch)
treec7b6cb824684f60c900f529c44ca6c835a38a3ed /src/mongo
parent96afe1fc3fff700046344f9cc59004151fb02bc1 (diff)
downloadmongo-288056872d40a1b40194937603f4456458586f22.tar.gz
SERVER-12274 bugfix append wc info to GLE, more wc error codes
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/commands/get_last_error.cpp1
-rw-r--r--src/mongo/s/write_ops/batch_downconvert.cpp6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp
index 1d7ea39abf1..608f3ed64ae 100644
--- a/src/mongo/db/commands/get_last_error.cpp
+++ b/src/mongo/db/commands/get_last_error.cpp
@@ -189,6 +189,7 @@ namespace mongo {
WriteConcernResult res;
status = waitForWriteConcern( writeConcern, wOpTime, &res );
+ res.appendTo( &result );
// For backward compatibility with 2.4, wtimeout returns ok : 1.0
if ( res.wTimedOut ) {
diff --git a/src/mongo/s/write_ops/batch_downconvert.cpp b/src/mongo/s/write_ops/batch_downconvert.cpp
index ce093bccff9..dc4e723fd17 100644
--- a/src/mongo/s/write_ops/batch_downconvert.cpp
+++ b/src/mongo/s/write_ops/batch_downconvert.cpp
@@ -74,7 +74,11 @@ namespace mongo {
}
else if ( code == 10990 /* no longer primary */
|| code == 16805 /* replicatedToNum no longer primary */
- || code == 14830 /* gle wmode changed / invalid */) {
+ || code == 14830 /* gle wmode changed / invalid */
+ // 2.6 Error codes
+ || code == ErrorCodes::NotMaster
+ || code == ErrorCodes::UnknownReplWriteConcern
+ || code == ErrorCodes::WriteConcernFailed ) {
// Write concern errors that get returned as regular errors (result may not be ok: 1.0)
errors->wcError.reset( new WCErrorDetail );
errors->wcError->setErrCode( code );