mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
fix isMaster() broken earlier today
This commit is contained in:
parent
1a700c121e
commit
bc50b778cf
12
db/replset.h
12
db/replset.h
@ -113,12 +113,14 @@ namespace mongo {
|
||||
inline bool isMaster( const char *client = 0 ) {
|
||||
if ( !client )
|
||||
client = database->name.c_str();
|
||||
if ( replAllDead || slave ) {
|
||||
return strcmp( client, "local" ) == 0;
|
||||
}
|
||||
|
||||
if ( replPair == 0 || replPair->state == ReplPair::State_Master )
|
||||
return true;
|
||||
if ( replAllDead )
|
||||
return strcmp( client, "local" ) == 0;
|
||||
|
||||
if ( replPair ) {
|
||||
if( replPair->state == ReplPair::State_Master )
|
||||
return true;
|
||||
}
|
||||
|
||||
return strcmp( client, "local" ) == 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user