diff options
author | Dianna Hohensee <dianna.hohensee@10gen.com> | 2017-05-17 09:21:49 -0400 |
---|---|---|
committer | Dianna Hohensee <dianna.hohensee@10gen.com> | 2017-05-19 14:20:14 -0400 |
commit | f7c5e33fc4634658877bafdb607c3865787acc7c (patch) | |
tree | 6b9d072bcd402ba0f7d0fb143cf45d20ee146ece /src/mongo/db/s/sharding_state.h | |
parent | 9ba2ced42110d439cf2644eaf57fac057dd1f337 (diff) | |
download | mongo-f7c5e33fc4634658877bafdb607c3865787acc7c.tar.gz |
SERVER-28724 add onStepDown and onStepUp functionality to ShardServerCatalogCacheLoader
Diffstat (limited to 'src/mongo/db/s/sharding_state.h')
-rw-r--r-- | src/mongo/db/s/sharding_state.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/s/sharding_state.h b/src/mongo/db/s/sharding_state.h index c6efdeaae30..d41764c1d01 100644 --- a/src/mongo/db/s/sharding_state.h +++ b/src/mongo/db/s/sharding_state.h @@ -114,7 +114,11 @@ public: } /** - * Initializes the sharding state of this server from the shard identity document argument. + * Initializes the sharding state of this server from the shard identity document argument + * and sets secondary or primary state information on the catalog cache loader. + * + * Note: caller must hold a global/database lock! Needed in order to stably check for + * replica set state (primary, secondary, standalone). */ Status initializeFromShardIdentity(OperationContext* opCtx, const ShardIdentityType& shardIdentity); @@ -247,6 +251,8 @@ public: * classes for sharding were initialized, but no networking calls were made yet (with the * exception of the duplicate ShardRegistry reload in ShardRegistry::startup() (see * SERVER-26123). Outgoing networking calls to cluster members can now be made. + * + * Note: this function briefly takes the global lock to determine primary/secondary state. */ StatusWith<bool> initializeShardingAwarenessIfNeeded(OperationContext* opCtx); |