From b71a69891e06acd0169d1dfd595c5b8f7edb2ea0 Mon Sep 17 00:00:00 2001 From: Dwight Date: Tue, 22 Sep 2009 14:34:55 -0400 Subject: [PATCH] fix isMaster() for master-master mode --- db/replset.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/db/replset.h b/db/replset.h index 3238771118c..34d61cc8d7e 100644 --- a/db/replset.h +++ b/db/replset.h @@ -126,6 +126,13 @@ namespace mongo { if( replPair->state == ReplPair::State_Master ) return true; } + else { + if( master ) { + // if running with --master --slave, allow. note that master is also true + // for repl pairs so the check for replPair above is important. + return true; + } + } return strcmp( client, "local" ) == 0; }