diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2023-03-02 01:12:57 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-03-02 05:08:00 +0000 |
commit | 939f98d4847067306fa596f31b3da77a2be3edde (patch) | |
tree | ee0eafae9390fba32280c331dc12f5dee86d58db /src/mongo/s/sharding_initialization.cpp | |
parent | f5d92eb21a85e501b6175076e9559b79789e303d (diff) | |
download | mongo-939f98d4847067306fa596f31b3da77a2be3edde.tar.gz |
SERVER-71960 Convert dead cluster role checks into tasserts
Diffstat (limited to 'src/mongo/s/sharding_initialization.cpp')
-rw-r--r-- | src/mongo/s/sharding_initialization.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/mongo/s/sharding_initialization.cpp b/src/mongo/s/sharding_initialization.cpp index 2ac54d6bf06..47549e7da22 100644 --- a/src/mongo/s/sharding_initialization.cpp +++ b/src/mongo/s/sharding_initialization.cpp @@ -276,9 +276,11 @@ void preCacheMongosRoutingInfo(OperationContext* opCtx) { return; } - if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) { - return; - } + // There's no reason this can't run on a shard or config server, but it currently only runs on a + // mongos, and we'd need to consider the implications of it running on either kind of mongod. + tassert(71960, + "Unexpectedly pre caching mongos routing info on shard or config server node", + serverGlobalParams.clusterRole == ClusterRole::None); auto grid = Grid::get(opCtx); auto catalogClient = grid->catalogClient(); @@ -304,9 +306,11 @@ Status preWarmConnectionPool(OperationContext* opCtx) { return Status::OK(); } - if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) { - return Status::OK(); - } + // There's no reason this can't run on a shard or config server, but it currently only runs on a + // mongos, and we'd need to consider the implications of it running on either kind of mongod. + tassert(71961, + "Unexpectedly pre warming connection pool on shard or config server node", + serverGlobalParams.clusterRole == ClusterRole::None); std::vector<HostAndPort> allHosts; auto const grid = Grid::get(opCtx); |