summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclient_rs.cpp
diff options
context:
space:
mode:
authorGreg Studer <greg@10gen.com>2013-10-15 14:23:01 -0400
committerGreg Studer <greg@10gen.com>2013-10-15 14:45:48 -0400
commit2e972e1e7de2966dd5e39ebd79f9fad8dcf5a78c (patch)
treeaf553ab4d0f5ae63f57833804a2d656a6809295f /src/mongo/client/dbclient_rs.cpp
parent487d9e61dba245cfb58af084b802ee4fc41e6288 (diff)
downloadmongo-2e972e1e7de2966dd5e39ebd79f9fad8dcf5a78c.tar.gz
SERVER-11177 buildbot stale_clustered.js make repl error codes constants
Diffstat (limited to 'src/mongo/client/dbclient_rs.cpp')
-rw-r--r--src/mongo/client/dbclient_rs.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp
index 69419586fae..7e3f9bd794f 100644
--- a/src/mongo/client/dbclient_rs.cpp
+++ b/src/mongo/client/dbclient_rs.cpp
@@ -1755,7 +1755,8 @@ namespace mongo {
// If the error code here ever changes, we need to change this code also
BSONElement code = error["code"];
- if( code.isNumber() && code.Int() == 13436 /* not master or secondary */ ){
+ if( code.isNumber() &&
+ code.Int() == NotMasterOrSecondaryCode /* not master or secondary */ ) {
isntSecondary();
throw DBException( str::stream() << "slave " << _lastSlaveOkHost.toString()
<< " is no longer secondary", 14812 );
@@ -1951,7 +1952,8 @@ namespace mongo {
// Check the error code for a slave not secondary error
if( nReturned == -1 ||
- ( hasErrField( dataObj ) && ! dataObj["code"].eoo() && dataObj["code"].Int() == 13436 ) ){
+ ( hasErrField( dataObj ) && ! dataObj["code"].eoo()
+ && dataObj["code"].Int() == NotMasterOrSecondaryCode ) ){
bool wasMaster = false;
if( _lazyState._lastClient == _lastSlaveOkConn.get() ){
@@ -1980,7 +1982,8 @@ namespace mongo {
// slaveOk is not set, just mark the master as bad
if( nReturned == -1 ||
- ( hasErrField( dataObj ) && ! dataObj["code"].eoo() && dataObj["code"].Int() == 13435 ) )
+ ( hasErrField( dataObj ) && ! dataObj["code"].eoo()
+ && dataObj["code"].Int() == NotMasterNoSlaveOkCode ) )
{
if( _lazyState._lastClient == _master.get() ){
isntMaster();