diff options
author | Marcos José Grillo Ramírez <marcos.grillo@mongodb.com> | 2020-03-17 16:29:21 +0100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-17 15:42:50 +0000 |
commit | 47b40d87be09c4fd220d8b8dba769aa39a2ba010 (patch) | |
tree | 9eab45c501765f18a1ef2ea729612303ef767033 /src/mongo/s/commands/strategy.cpp | |
parent | ce6a53e5dd0ea28b3ed71f647d4013cb9a9ad43e (diff) | |
download | mongo-47b40d87be09c4fd220d8b8dba769aa39a2ba010.tar.gz |
Revert "SERVER-46799 Update sharding log lines to adhere to LOGV2 style guide Files checked: * src/mongo/s/commands/cluster_write_cmd.cpp * src/mongo/s/commands/strategy.cpp * src/mongo/db/kill_sessions_local.cpp * src/mongo/db/logical_session_cache_impl.cpp * src/mongo/db/session_catalog.cpp * src/mongo/db/session_catalog_mongod.cpp"
This reverts commit e4c445f8ea52a710fef4375f538083f958879dd7.
Diffstat (limited to 'src/mongo/s/commands/strategy.cpp')
-rw-r--r-- | src/mongo/s/commands/strategy.cpp | 97 |
1 files changed, 43 insertions, 54 deletions
diff --git a/src/mongo/s/commands/strategy.cpp b/src/mongo/s/commands/strategy.cpp index befba35ecd2..3ffecbf076f 100644 --- a/src/mongo/s/commands/strategy.cpp +++ b/src/mongo/s/commands/strategy.cpp @@ -145,18 +145,16 @@ void appendRequiredFieldsToResponse(OperationContext* opCtx, BSONObjBuilder* res if (operationTime != LogicalTime::kUninitialized) { LOGV2_DEBUG(22764, 5, - "Appending operationTime: {operationTime}", - "Appending operationTime", - "operationTime"_attr = operationTime.asTimestamp()); + "Appending operationTime: {operationTime_asTimestamp}", + "operationTime_asTimestamp"_attr = operationTime.asTimestamp()); responseBuilder->append(kOperationTime, operationTime.asTimestamp()); } else if (now != LogicalTime::kUninitialized) { // If we don't know the actual operation time, use the cluster time instead. This is // safe but not optimal because we can always return a later operation time than actual. LOGV2_DEBUG(22765, 5, - "Appending clusterTime as operationTime {clusterTime}", - "Appending clusterTime as operationTime", - "clusterTime"_attr = now.asTimestamp()); + "Appending clusterTime as operationTime {now_asTimestamp}", + "now_asTimestamp"_attr = now.asTimestamp()); responseBuilder->append(kOperationTime, now.asTimestamp()); } @@ -466,12 +464,12 @@ void runCommand(OperationContext* opCtx, .getDefaultWriteConcern(opCtx)) { wc = *wcDefault; customDefaultWriteConcernWasApplied = true; - LOGV2_DEBUG(22766, - 2, - "Applying default writeConcern on {command} of {writeConcern}", - "Applying default writeConcern on command", - "command"_attr = request.getCommandName(), - "writeConcern"_attr = *wcDefault); + LOGV2_DEBUG( + 22766, + 2, + "Applying default writeConcern on {request_getCommandName} of {wcDefault}", + "request_getCommandName"_attr = request.getCommandName(), + "wcDefault"_attr = wcDefault->toBSON()); } } @@ -533,10 +531,11 @@ void runCommand(OperationContext* opCtx, customDefaultReadConcernWasApplied = true; LOGV2_DEBUG(22767, 2, - "Applying default readConcern on {command} of {readConcern}", - "Applying default readConcern on command", - "command"_attr = invocation->definition()->getName(), - "readConcern"_attr = *rcDefault); + "Applying default readConcern on {invocation_definition_getName} " + "of {rcDefault}", + "invocation_definition_getName"_attr = + invocation->definition()->getName(), + "rcDefault"_attr = *rcDefault); // Update the readConcernSupport, since the default RC was applied. readConcernSupport = invocation->supportsReadConcern(readConcernArgs.getLevel()); @@ -892,12 +891,11 @@ DbResponse Strategy::queryOp(OperationContext* opCtx, const NamespaceString& nss LOGV2_DEBUG(22768, 3, - "Query: {namespace} {query} ntoreturn: {ntoreturn} options: {queryOptions}", - "Query", - "namespace"_attr = q.ns, - "query"_attr = redact(q.query), - "ntoreturn"_attr = q.ntoreturn, - "queryOptions"_attr = q.queryOptions); + "query: {q_ns} {q_query} ntoreturn: {q_ntoreturn} options: {q_queryOptions}", + "q_ns"_attr = q.ns, + "q_query"_attr = redact(q.query), + "q_ntoreturn"_attr = q.ntoreturn, + "q_queryOptions"_attr = q.queryOptions); if (q.queryOptions & QueryOption_Exhaust) { uasserted(18526, @@ -997,9 +995,8 @@ DbResponse Strategy::clientCommand(OperationContext* opCtx, const Message& m) { LOGV2_DEBUG(22769, 1, - "Exception thrown while parsing command {error}", - "Exception thrown while parsing command", - "error"_attr = redact(ex)); + "Exception thrown while parsing command {causedBy_ex}", + "causedBy_ex"_attr = causedBy(redact(ex))); throw; } }(); @@ -1017,26 +1014,23 @@ DbResponse Strategy::clientCommand(OperationContext* opCtx, const Message& m) { try { LOGV2_DEBUG(22770, 3, - "Command begin db: {db} msg id: {headerId}", - "Command begin", + "Command begin db: {db} msg id: {m_header_getId}", "db"_attr = db, - "headerId"_attr = m.header().getId()); + "m_header_getId"_attr = m.header().getId()); runCommand(opCtx, request, m.operation(), reply.get(), &errorBuilder); LOGV2_DEBUG(22771, 3, - "Command end db: {db} msg id: {headerId}", - "Command end", + "Command end db: {db} msg id: {m_header_getId}", "db"_attr = db, - "headerId"_attr = m.header().getId()); + "m_header_getId"_attr = m.header().getId()); } catch (const DBException& ex) { - LOGV2_DEBUG( - 22772, - 1, - "Exception thrown while processing command on {db} msg id: {headerId} {error}", - "Exception thrown while processing command", - "db"_attr = db, - "headerId"_attr = m.header().getId(), - "error"_attr = redact(ex)); + LOGV2_DEBUG(22772, + 1, + "Exception thrown while processing command on {db} msg id: " + "{m_header_getId}{causedBy_ex}", + "db"_attr = db, + "m_header_getId"_attr = m.header().getId(), + "causedBy_ex"_attr = causedBy(redact(ex))); // Record the exception in CurOp. CurOp::get(opCtx)->debug().errInfo = ex.toStatus(); @@ -1175,8 +1169,7 @@ void Strategy::killCursors(OperationContext* opCtx, DbMessage* dbm) { if (!nss) { LOGV2_DEBUG(22773, 3, - "Can't find cursor to kill, no namespace found. Cursor id: {cursorId}", - "Can't find cursor to kill, no namespace found", + "Can't find cursor to kill. Cursor id: {cursorId}.", "cursorId"_attr = cursorId); continue; } @@ -1191,30 +1184,26 @@ void Strategy::killCursors(OperationContext* opCtx, DbMessage* dbm) { LOGV2_DEBUG( 22774, 3, - "Not authorized to kill cursor. Namespace: '{namespace}', cursor id: {cursorId}", - "Not authorized to kill cursor", - "namespace"_attr = *nss, + "Not authorized to kill cursor. Namespace: '{nss}', cursor id: {cursorId}.", + "nss"_attr = *nss, "cursorId"_attr = cursorId); continue; } Status killCursorStatus = manager->killCursor(opCtx, *nss, cursorId); if (!killCursorStatus.isOK()) { - LOGV2_DEBUG( - 22775, - 3, - "Can't find cursor to kill. Namespace: '{namespace}', cursor id: {cursorId}", - "Can't find cursor to kill", - "namespace"_attr = *nss, - "cursorId"_attr = cursorId); + LOGV2_DEBUG(22775, + 3, + "Can't find cursor to kill. Namespace: '{nss}', cursor id: {cursorId}.", + "nss"_attr = *nss, + "cursorId"_attr = cursorId); continue; } LOGV2_DEBUG(22776, 3, - "Killed cursor. Namespace: '{namespace}', cursor id: {cursorId}", - "Killed cursor", - "namespace"_attr = *nss, + "Killed cursor. Namespace: '{nss}', cursor id: {cursorId}.", + "nss"_attr = *nss, "cursorId"_attr = cursorId); } } |