Skip to content

Commit

Permalink
Don't send queries to non-ok master.
Browse files Browse the repository at this point in the history
  • Loading branch information
stbrody committed Oct 6, 2011
1 parent 3db92ac commit 243aaea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/dbclient_rs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ namespace mongo {
}
}

if( _master >= 0 ) {
if( _master >= 0 && _nodes[_master].ok ) {
assert( static_cast<unsigned>(_master) < _nodes.size() );
LOG(2) << "dbclient_rs getSlave no member in secondary state found, returning primary " << _nodes[ _master ] << endl;
return _nodes[_master].addr;
Expand Down

0 comments on commit 243aaea

Please sign in to comment.