diff options
author | Randolph Tan <randolph@10gen.com> | 2016-04-20 17:19:30 -0400 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2016-04-26 11:55:19 -0400 |
commit | 2423026ef06c43d7de4fa54095702698b359a4f9 (patch) | |
tree | c7c3e1ea66c5021864d855c7f95b0b0f55db068c /src/mongo/db/repl | |
parent | 5c3e0d4855415cbab4bd75732208f832c11f4889 (diff) | |
download | mongo-2423026ef06c43d7de4fa54095702698b359a4f9.tar.gz |
SERVER-23814 Add sharding state initialization to secondaries
Outside of the OpObserver, there are currently 2 places where shard initialization occurs: during startup and during transition to primary.
This patch takes out the if !replSet condition in startup so secondaries will now also perform shard initialization. This also means that if the node will eventually become a primary, it will perform the initialization twice. However, since it is already initialized, most of it will be no-op the second time around.
In summary:
- secondaries initializes sharding state.
- nodes that will become primary will do what secondaries do. And on top of that, will read the minOpTime document and update it if minOpTimeUpdaters > 0.
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_external_state_impl.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp index 79eea7fcc31..ef4900c1135 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp @@ -398,7 +398,6 @@ void ReplicationCoordinatorExternalStateImpl::clearShardingState() { } void ReplicationCoordinatorExternalStateImpl::recoverShardingState(OperationContext* txn) { - uassertStatusOK(ShardingState::get(txn->getServiceContext())->initializeFromShardIdentity(txn)); uassertStatusOK(ShardingStateRecovery::recover(txn)); // There is a slight chance that some stale metadata might have been loaded before the latest |