diff options
author | Hugh Tong <hugh.tong@mongodb.com> | 2023-05-15 15:28:20 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-15 18:00:33 +0000 |
commit | b45d9b1215bedf4328bded55913475dd6b589e92 (patch) | |
tree | ae2f4299360c4b930fef4935535a95b99fb2e002 /src/mongo/db/curop.cpp | |
parent | f1ac91d1e2db63009bd9f41d068f09f009c024cf (diff) | |
download | mongo-b45d9b1215bedf4328bded55913475dd6b589e92.tar.gz |
SERVER-76634 Add SerializationContext object to ExpressionContext
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r-- | src/mongo/db/curop.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index c24057452af..49fd43c0035 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -183,7 +183,7 @@ CurOp* CurOp::get(const OperationContext& opCtx) { return _curopStack(opCtx).top(); } -void CurOp::reportCurrentOpForClient(OperationContext* opCtx, +void CurOp::reportCurrentOpForClient(const boost::intrusive_ptr<ExpressionContext>& expCtx, Client* client, bool truncateOps, bool backtraceMode, @@ -210,8 +210,9 @@ void CurOp::reportCurrentOpForClient(OperationContext* opCtx, // Fill out the rest of the BSONObj with opCtx specific details. infoBuilder->appendBool("active", client->hasAnyActiveCurrentOp()); - infoBuilder->append("currentOpTime", - opCtx->getServiceContext()->getPreciseClockSource()->now().toString()); + infoBuilder->append( + "currentOpTime", + expCtx->opCtx->getServiceContext()->getPreciseClockSource()->now().toString()); auto authSession = AuthorizationSession::get(client); // Depending on whether the authenticated user is the same user which ran the command, @@ -261,7 +262,11 @@ void CurOp::reportCurrentOpForClient(OperationContext* opCtx, lsid->serialize(&lsidBuilder); } - CurOp::get(clientOpCtx)->reportState(infoBuilder, truncateOps); + tassert(7663403, + str::stream() << "SerializationContext on the expCtx should not be empty, with ns: " + << expCtx->ns.ns(), + expCtx->serializationCtxt != SerializationContext::stateDefault()); + CurOp::get(clientOpCtx)->reportState(infoBuilder, expCtx->serializationCtxt, truncateOps); } #ifndef MONGO_CONFIG_USE_RAW_LATCHES @@ -705,7 +710,9 @@ BSONObj CurOp::truncateAndSerializeGenericCursor(GenericCursor* cursor, return serialized; } -void CurOp::reportState(BSONObjBuilder* builder, bool truncateOps) { +void CurOp::reportState(BSONObjBuilder* builder, + const SerializationContext& serializationContext, + bool truncateOps) { auto opCtx = this->opCtx(); auto start = _start.load(); if (start) { @@ -716,7 +723,7 @@ void CurOp::reportState(BSONObjBuilder* builder, bool truncateOps) { } builder->append("op", logicalOpToString(_logicalOp)); - builder->append("ns", NamespaceStringUtil::serialize(_nss)); + builder->append("ns", NamespaceStringUtil::serialize(_nss, serializationContext)); bool omitAndRedactInformation = CurOp::get(opCtx)->debug().shouldOmitDiagnosticInformation; builder->append("redacted", omitAndRedactInformation); |