summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/repl_block.cpp5
-rw-r--r--db/replpair.h4
2 files changed, 6 insertions, 3 deletions
diff --git a/db/repl_block.cpp b/db/repl_block.cpp
index 6f68789560b..9cff24f3839 100644
--- a/db/repl_block.cpp
+++ b/db/repl_block.cpp
@@ -24,6 +24,7 @@
#include "../util/background.h"
#include "../util/mongoutils/str.h"
#include "../client/dbclient.h"
+#include "replpair.h"
//#define REPLDEBUG(x) log() << "replBlock: " << x << endl;
#define REPLDEBUG(x)
@@ -154,8 +155,10 @@ namespace mongo {
RARELY {
REPLDEBUG( "looking for : " << op << " w=" << w );
}
- if ( w <= 1 || ! replSettings.master )
+
+ if ( w <= 1 || ! _isMaster() )
return true;
+
w--; // now this is the # of slaves i need
scoped_lock mylk(_mutex);
for ( map<Ident,Info>::iterator i=_slaves.begin(); i!=_slaves.end(); i++){
diff --git a/db/replpair.h b/db/replpair.h
index 4897a0abf7a..19b79bd3eba 100644
--- a/db/replpair.h
+++ b/db/replpair.h
@@ -111,7 +111,7 @@ namespace mongo {
If 'client' is not specified, the current client is used.
*/
- inline bool _isMaster( const char *client = 0 ) {
+ inline bool _isMaster() {
if( replSet ) {
if( theReplSet )
return theReplSet->isPrimary();
@@ -142,7 +142,7 @@ namespace mongo {
return false;
}
inline bool isMaster(const char *client = 0) {
- if( _isMaster(client) )
+ if( _isMaster() )
return true;
if ( !client ) {
Database *database = cc().database();