diff options
Diffstat (limited to 'src/mongo/db/db.cpp')
-rw-r--r-- | src/mongo/db/db.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index d46545f50be..ec05dcf5233 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -999,7 +999,6 @@ ExitCode _initAndListen(int listenPort) { // Set up the logical session cache LogicalSessionCacheServer kind = LogicalSessionCacheServer::kStandalone; - if (serverGlobalParams.clusterRole == ClusterRole::ShardServer) { kind = LogicalSessionCacheServer::kSharded; } else if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) { @@ -1008,14 +1007,8 @@ ExitCode _initAndListen(int listenPort) { kind = LogicalSessionCacheServer::kReplicaSet; } - // Shards and config servers set up the LogicalSessionCache when they go through sharding - // state initialization - if (kind == LogicalSessionCacheServer::kStandalone || - kind == LogicalSessionCacheServer::kReplicaSet) { - invariant(LogicalSessionCache::get(startupOpCtx.get()) == nullptr); - auto sessionCache = makeLogicalSessionCacheD(serviceContext, kind); - LogicalSessionCache::set(serviceContext, std::move(sessionCache)); - } + auto sessionCache = makeLogicalSessionCacheD(serviceContext, kind); + LogicalSessionCache::set(serviceContext, std::move(sessionCache)); // MessageServer::run will return when exit code closes its socket and we don't need the // operation context anymore |