diff options
author | Kristina Chodorow <k@ubuntu.(none)> | 2010-07-19 10:33:30 -0400 |
---|---|---|
committer | Kristina Chodorow <k@ubuntu.(none)> | 2010-07-19 10:33:30 -0400 |
commit | e3fe9ea6a0e8f1b603c283b47d387a4296b48181 (patch) | |
tree | 13f5f39bb0efac5247f38d232d8117d8433532fe /db | |
parent | 4378ad93d13a8a7cffc3e7dc2427a88a5e2ae499 (diff) | |
download | mongo-e3fe9ea6a0e8f1b603c283b47d387a4296b48181.tar.gz |
don't return unconditionally
Diffstat (limited to 'db')
-rw-r--r-- | db/repl/manager.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/db/repl/manager.cpp b/db/repl/manager.cpp index afc2026f253..b6575a07ba4 100644 --- a/db/repl/manager.cpp +++ b/db/repl/manager.cpp @@ -75,19 +75,28 @@ namespace mongo { return; } - if( p == p2 && p ) return; + if( p == p2 && p ) { + return; + } if( p2 ) { /* someone else thinks they are primary. */ - if( p == p2 ) // already match + if( p == p2 ) { // already match + return; + } + if( p == 0 ) { + noteARemoteIsPrimary(p2); return; - if( p == 0 ) - noteARemoteIsPrimary(p2); return; - if( p != rs->_self ) - noteARemoteIsPrimary(p2); return; + } + if( p != rs->_self ) { + noteARemoteIsPrimary(p2); + return; + } /* we thought we were primary, yet now someone else thinks they are. */ - if( !rs->elect.aMajoritySeemsToBeUp() ) - noteARemoteIsPrimary(p2); return; + if( !rs->elect.aMajoritySeemsToBeUp() ) { + noteARemoteIsPrimary(p2); + return; + } /* ignore for now, keep thinking we are master */ return; } |