diff options
author | Kevin Pulo <kevin.pulo@mongodb.com> | 2020-09-24 15:22:07 +1000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-25 14:20:32 +0000 |
commit | 754dc47c7905877f73a6526e449549a3baba10ed (patch) | |
tree | 4dbab77cb754adf7a7ad2ac3bf57c1c4d1050ae7 /src/mongo/db/s/sharding_initialization_mongod.cpp | |
parent | 290a414a08695acd8d5d8a9eccecb09ae0490856 (diff) | |
download | mongo-754dc47c7905877f73a6526e449549a3baba10ed.tar.gz |
SERVER-51103 Allow ShardRegistry to distinguish between complete/partial connection string updates
Diffstat (limited to 'src/mongo/db/s/sharding_initialization_mongod.cpp')
-rw-r--r-- | src/mongo/db/s/sharding_initialization_mongod.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/db/s/sharding_initialization_mongod.cpp b/src/mongo/db/s/sharding_initialization_mongod.cpp index 3c2bcd143e4..0cfebae2635 100644 --- a/src/mongo/db/s/sharding_initialization_mongod.cpp +++ b/src/mongo/db/s/sharding_initialization_mongod.cpp @@ -105,7 +105,10 @@ public: LOGV2(471691, "Updating the shard registry with confirmed replica set", "connectionString"_attr = connStr); - Grid::get(_serviceContext)->shardRegistry()->updateReplSetHosts(connStr); + Grid::get(_serviceContext) + ->shardRegistry() + ->updateReplSetHosts(connStr, + ShardRegistry::ConnectionStringUpdateType::kConfirmed); } catch (const ExceptionForCat<ErrorCategory::ShutdownError>& e) { LOGV2(471692, "Unable to update the shard registry", "error"_attr = e); } @@ -130,7 +133,10 @@ public: void onPossibleSet(const State& state) noexcept final { try { - Grid::get(_serviceContext)->shardRegistry()->updateReplSetHosts(state.connStr); + Grid::get(_serviceContext) + ->shardRegistry() + ->updateReplSetHosts(state.connStr, + ShardRegistry::ConnectionStringUpdateType::kPossible); } catch (const DBException& ex) { LOGV2_DEBUG(22070, 2, |