diff options
| author | Sophia Tan <sophia_tll@hotmail.com> | 2023-04-18 07:41:17 +0000 |
|---|---|---|
| committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-18 08:57:59 +0000 |
| commit | 274cb477d2a1b64ac81b85e9f1b3172387ce0184 (patch) | |
| tree | e89f778fa52a40413403b6a125b69271cf8469c0 /src/mongo/db/session/sessions_collection_standalone.cpp | |
| parent | 8863b04c282557081cf2634bce0e26f4fa5389b2 (diff) | |
| download | mongo-274cb477d2a1b64ac81b85e9f1b3172387ce0184.tar.gz | |
SERVER-74486 Always include tenant in collection name attributes in error messages
Diffstat (limited to 'src/mongo/db/session/sessions_collection_standalone.cpp')
| -rw-r--r-- | src/mongo/db/session/sessions_collection_standalone.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mongo/db/session/sessions_collection_standalone.cpp b/src/mongo/db/session/sessions_collection_standalone.cpp index ef63bd4b2e0..0f5a09c249d 100644 --- a/src/mongo/db/session/sessions_collection_standalone.cpp +++ b/src/mongo/db/session/sessions_collection_standalone.cpp @@ -60,9 +60,10 @@ void SessionsCollectionStandalone::setupSessionsCollection(OperationContext* opC BSONObj info; if (!client.runCommand(NamespaceString::kLogicalSessionsNamespace.dbName(), cmd, info)) { - uassertStatusOKWithContext(getStatusFromCommandResult(info), - str::stream() << "Failed to create " - << NamespaceString::kLogicalSessionsNamespace); + uassertStatusOKWithContext( + getStatusFromCommandResult(info), + str::stream() << "Failed to create " + << NamespaceString::kLogicalSessionsNamespace.toStringForErrorMsg()); } } } @@ -76,7 +77,8 @@ void SessionsCollectionStandalone::checkSessionsCollectionExists(OperationContex NamespaceString::kLogicalSessionsNamespace, includeBuildUUIDs, options); uassert(ErrorCodes::NamespaceNotFound, - str::stream() << NamespaceString::kLogicalSessionsNamespace << " does not exist", + str::stream() << NamespaceString::kLogicalSessionsNamespace.toStringForErrorMsg() + << " does not exist", indexes.size() != 0u); auto index = std::find_if(indexes.begin(), indexes.end(), [](const BSONObj& index) { @@ -84,12 +86,12 @@ void SessionsCollectionStandalone::checkSessionsCollectionExists(OperationContex }); uassert(ErrorCodes::IndexNotFound, - str::stream() << NamespaceString::kLogicalSessionsNamespace + str::stream() << NamespaceString::kLogicalSessionsNamespace.toStringForErrorMsg() << " does not have the required TTL index", index != indexes.end()); uassert(ErrorCodes::IndexOptionsConflict, - str::stream() << NamespaceString::kLogicalSessionsNamespace + str::stream() << NamespaceString::kLogicalSessionsNamespace.toStringForErrorMsg() << " currently has the incorrect timeout for the TTL index", index->hasField("expireAfterSeconds") && index->getField("expireAfterSeconds").Int() == |
