summaryrefslogtreecommitdiff
path: root/src/mongo/client
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@10gen.com>2012-03-22 17:10:00 -0400
committerSpencer T Brody <spencer@10gen.com>2012-04-09 17:43:10 -0400
commitee33c0b90fd74c0c3c48e2437648b1c2f3339dc5 (patch)
tree4f44d787fda245f8ae38c671ebaadc190e6e9969 /src/mongo/client
parent493a19e39fcd68f97ca47cdbc7b3b5f41ba3cb77 (diff)
downloadmongo-ee33c0b90fd74c0c3c48e2437648b1c2f3339dc5.tar.gz
Clean up ReplicaSetMonitor after failed addShard command. SERVER-4447.
Diffstat (limited to 'src/mongo/client')
-rw-r--r--src/mongo/client/dbclient_rs.cpp5
-rw-r--r--src/mongo/client/dbclient_rs.h7
2 files changed, 11 insertions, 1 deletions
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp
index ec6c349b44b..e6772303fc3 100644
--- a/src/mongo/client/dbclient_rs.cpp
+++ b/src/mongo/client/dbclient_rs.cpp
@@ -180,6 +180,11 @@ namespace mongo {
}
+ void ReplicaSetMonitor::remove( const string& name ) {
+ scoped_lock lk( _setsLock );
+ _sets.erase( name );
+ }
+
void ReplicaSetMonitor::setConfigChangeHook( ConfigChangeHook hook ) {
massert( 13610 , "ConfigChangeHook already specified" , _hook == 0 );
_hook = hook;
diff --git a/src/mongo/client/dbclient_rs.h b/src/mongo/client/dbclient_rs.h
index 3cf3d00b873..62fdd082dc6 100644
--- a/src/mongo/client/dbclient_rs.h
+++ b/src/mongo/client/dbclient_rs.h
@@ -63,7 +63,12 @@ namespace mongo {
static void checkAll( bool checkAllSecondaries );
/**
- * this is called whenever the config of any repclia set changes
+ * deletes the ReplicaSetMonitor for the given set name.
+ */
+ static void remove( const string& name );
+
+ /**
+ * this is called whenever the config of any replica set changes
* currently only 1 globally
* asserts if one already exists
* ownership passes to ReplicaSetMonitor and the hook will actually never be deleted