diff options
author | Spencer T Brody <spencer@mongodb.com> | 2015-09-03 17:24:35 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2015-09-04 11:07:37 -0400 |
commit | bbab56051a643a51b40fe53e5ecd936b374bf135 (patch) | |
tree | 5614111393d2c6dce8c8ace3b816e457745cf085 /src/mongo/client/replica_set_monitor.h | |
parent | 7a59ba6da674462e7f86a3a7111d58b0721a4138 (diff) | |
download | mongo-bbab56051a643a51b40fe53e5ecd936b374bf135.tar.gz |
SERVER-20270 SERVER-19608 Fix race condition around updating ShardRegistry on CSRS membership changes
Diffstat (limited to 'src/mongo/client/replica_set_monitor.h')
-rw-r--r-- | src/mongo/client/replica_set_monitor.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mongo/client/replica_set_monitor.h b/src/mongo/client/replica_set_monitor.h index a766f9a4722..cf005f6c7fd 100644 --- a/src/mongo/client/replica_set_monitor.h +++ b/src/mongo/client/replica_set_monitor.h @@ -162,7 +162,19 @@ public: * * The hook must not be changed while the program has multiple threads. */ - static void setConfigChangeHook(ConfigChangeHook hook); + static void setAsynchronousConfigChangeHook(ConfigChangeHook hook); + + /** + * Sets the hook to be called whenever the config of any replica set changes. + * Currently only 1 globally, so this asserts if one already exists. + * + * The hook will be called inline while refreshing the ReplicaSetMonitor's view of the set + * membership. It is important that the hook not block for long as it will be running under + * the ReplicaSetMonitor's mutex. + * + * The hook must not be changed while the program has multiple threads. + */ + static void setSynchronousConfigChangeHook(ConfigChangeHook hook); /** * Permanently stops all monitoring on replica sets and clears all cached information |