diff options
author | dwight <dwight@10gen.com> | 2011-09-27 22:47:11 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-10-08 23:32:11 -0400 |
commit | a7796c9c09b1868bf72a28811059d448995e501c (patch) | |
tree | 68bb0010facf47690ad99ab3ca9745a8e9c4488c | |
parent | 8814b71b260805dd6afc0cea13acce37cf328e15 (diff) | |
download | mongo-a7796c9c09b1868bf72a28811059d448995e501c.tar.gz |
finish SERVER-3962
-rw-r--r-- | client/dbclient_rs.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/client/dbclient_rs.cpp b/client/dbclient_rs.cpp index a1d9d879360..f72b9d10b7f 100644 --- a/client/dbclient_rs.cpp +++ b/client/dbclient_rs.cpp @@ -251,15 +251,15 @@ namespace mongo { scoped_lock lk( _lock ); - for ( unsigned i = 0; i < _nodes.size(); i++ ) { + for ( unsigned ii = 0; ii < _nodes.size(); ii++ ) { _nextSlave = ( _nextSlave + 1 ) % _nodes.size(); - if ( i == _master ){ - LOG(2) << "not selecting " << _nodes[i] << " as it is the current master" << endl; + if ( _nextSlave == _master ) { + LOG(2) << "not selecting " << _nodes[_nextSlave] << " as it is the current master" << endl; continue; } - if ( _nodes[ i ].okForSecondaryQueries() ) + if ( _nodes[ _nextSlave ].okForSecondaryQueries() ) return _nodes[ _nextSlave ].addr; - LOG(2) << "not selecting " << _nodes[i] << " as it is not ok to use" << endl; + LOG(2) << "not selecting " << _nodes[_nextSlave] << " as it is not ok to use" << endl; } LOG(2) << "no suitable slave nodes found, returning default node " << _nodes[ 0 ] << endl; |