summaryrefslogtreecommitdiff
path: root/src/mongo/db/logical_session_cache_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/logical_session_cache_impl.cpp')
-rw-r--r--src/mongo/db/logical_session_cache_impl.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/mongo/db/logical_session_cache_impl.cpp b/src/mongo/db/logical_session_cache_impl.cpp
index 69876f5aa92..33fc16209d3 100644
--- a/src/mongo/db/logical_session_cache_impl.cpp
+++ b/src/mongo/db/logical_session_cache_impl.cpp
@@ -220,10 +220,18 @@ Status LogicalSessionCacheImpl::_reap(Client* client) {
return uniqueCtx->get();
}();
- auto res = _sessionsColl->setupSessionsCollection(opCtx);
- if (!res.isOK()) {
- log() << "Sessions collection is not set up; "
- << "waiting until next sessions reap interval: " << res.reason();
+ auto existsStatus = _sessionsColl->checkSessionsCollectionExists(opCtx);
+ if (!existsStatus.isOK()) {
+ StringData notSetUpWarning =
+ "Sessions collection is not set up; "
+ "waiting until next sessions reap interval";
+ if (existsStatus.code() != ErrorCodes::NamespaceNotFound ||
+ existsStatus.code() != ErrorCodes::NamespaceNotSharded) {
+ log() << notSetUpWarning << ": " << existsStatus.reason();
+ } else {
+ log() << notSetUpWarning;
+ }
+
return Status::OK();
}
@@ -291,10 +299,11 @@ void LogicalSessionCacheImpl::_refresh(Client* client) {
return uniqueCtx->get();
}();
- auto res = _sessionsColl->setupSessionsCollection(opCtx);
- if (!res.isOK()) {
+ auto setupStatus = _sessionsColl->setupSessionsCollection(opCtx);
+
+ if (!setupStatus.isOK()) {
log() << "Sessions collection is not set up; "
- << "waiting until next sessions refresh interval: " << res.reason();
+ << "waiting until next sessions refresh interval: " << setupStatus.reason();
return;
}