summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/client/dbclient_rs.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp
index ec20b9fcd0f..a298cdfc0ab 100644
--- a/src/mongo/client/dbclient_rs.cpp
+++ b/src/mongo/client/dbclient_rs.cpp
@@ -342,6 +342,10 @@ namespace {
// If _lastSlaveOkConn is pointing to a connection to primary, make sure that it is
// the same as _master, as this is the connection that has the version set.
if (_lastSlaveOkHost == _masterHost) {
+ if (_master.get() == NULL) {
+ // _master conn has been invalidated, need to reset connections.
+ return false;
+ }
_lastSlaveOkConn = _master;
}
@@ -633,7 +637,9 @@ namespace {
if ( monitor ) {
monitor->failedHost( _masterHost );
}
- _master.reset();
+
+ _masterHost = HostAndPort();
+ _master.reset();
}
auto_ptr<DBClientCursor> DBClientReplicaSet::checkSlaveQueryResult( auto_ptr<DBClientCursor> result ){