diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp index ef08e46aee7..2215e0bbbf4 100644 --- a/src/mongo/db/commands/distinct.cpp +++ b/src/mongo/db/commands/distinct.cpp @@ -299,7 +299,7 @@ public: "Plan executor error during distinct command", "error"_attr = exception.toStatus(), "stats"_attr = redact(stats), - "cmd"_attr = cmdObj); + "cmd"_attr = redact(cmdObj)); exception.addContext("Executor error during distinct command"); throw; diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index df96e09e2ce..37a60e36581 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -670,7 +670,7 @@ public: "Plan executor error during find command", "error"_attr = exception.toStatus(), "stats"_attr = redact(stats), - "cmd"_attr = cmdObj); + "cmd"_attr = redact(cmdObj)); exception.addContext("Executor error during find command"); throw; diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp index 07df3bf5a9b..1891450656f 100644 --- a/src/mongo/db/commands/getmore_cmd.cpp +++ b/src/mongo/db/commands/getmore_cmd.cpp @@ -439,7 +439,7 @@ public: "getMore command executor error", "error"_attr = exception.toStatus(), "stats"_attr = redact(stats), - "cmd"_attr = cmd.toBSON({})); + "cmd"_attr = redact(cmd.toBSON({}))); exception.addContext("Executor error during getMore"); throw; diff --git a/src/mongo/db/commands/run_aggregate.cpp b/src/mongo/db/commands/run_aggregate.cpp index 66d68f4413c..3149e57a75d 100644 --- a/src/mongo/db/commands/run_aggregate.cpp +++ b/src/mongo/db/commands/run_aggregate.cpp @@ -229,7 +229,7 @@ bool handleCursorCommand(OperationContext* opCtx, "Aggregate command executor error", "error"_attr = exception.toStatus(), "stats"_attr = redact(stats), - "cmd"_attr = cmdObj); + "cmd"_attr = redact(cmdObj)); exception.addContext("PlanExecutor error during aggregation"); throw; diff --git a/src/mongo/db/query/classic_stage_builder.cpp b/src/mongo/db/query/classic_stage_builder.cpp index e3fe78eb3b7..09f30b5869f 100644 --- a/src/mongo/db/query/classic_stage_builder.cpp +++ b/src/mongo/db/query/classic_stage_builder.cpp @@ -420,7 +420,8 @@ std::unique_ptr ClassicStageBuilder::build(const QuerySolutionNode* r case STAGE_SENTINEL: case STAGE_COLUMN_IXSCAN: case STAGE_UPDATE: { - LOGV2_WARNING(4615604, "Can't build exec tree for node", "node"_attr = *root); + LOGV2_WARNING( + 4615604, "Can't build exec tree for node", "node"_attr = redact(root->toString())); } } diff --git a/src/mongo/db/query/expression_index.cpp b/src/mongo/db/query/expression_index.cpp index 7820ffbb1ad..49e4f48f876 100644 --- a/src/mongo/db/query/expression_index.cpp +++ b/src/mongo/db/query/expression_index.cpp @@ -180,7 +180,7 @@ void ExpressionMapping::S2CellIdsToIntervals(const std::vector& interv if (!oilOut->isValidFor(1)) { LOGV2(6029801, "invalid OrderedIntervalList", - "orderedIntervalList"_attr = oilOut->toString(false)); + "orderedIntervalList"_attr = redact(oilOut->toString(false))); MONGO_UNREACHABLE; } } @@ -229,7 +229,7 @@ void ExpressionMapping::S2CellIdsToIntervalsWithParents(const std::vectorisValidFor(1)) { LOGV2(6029802, "invalid OrderedIntervalList", - "orderedIntervalList"_attr = oilOut->toString(false)); + "orderedIntervalList"_attr = redact(oilOut->toString(false))); MONGO_UNREACHABLE; } } diff --git a/src/mongo/db/query/plan_enumerator.cpp b/src/mongo/db/query/plan_enumerator.cpp index 9ad6f6b81aa..4c1c3f371e3 100644 --- a/src/mongo/db/query/plan_enumerator.cpp +++ b/src/mongo/db/query/plan_enumerator.cpp @@ -382,7 +382,7 @@ unique_ptr PlanEnumerator::getNext() { tagForSort(tree.get()); _root->resetTag(); - LOGV2_DEBUG(20943, 5, "Enumerator: memo just before moving", "memo"_attr = dumpMemo()); + LOGV2_DEBUG(20943, 5, "Enumerator: memo just before moving", "memo"_attr = redact(dumpMemo())); _done = nextMemo(memoIDForNode(_root)); return tree; } diff --git a/src/mongo/db/query/plan_executor_factory.cpp b/src/mongo/db/query/plan_executor_factory.cpp index 386bf38a538..d47052265ce 100644 --- a/src/mongo/db/query/plan_executor_factory.cpp +++ b/src/mongo/db/query/plan_executor_factory.cpp @@ -137,8 +137,8 @@ StatusWith> make( LOGV2_DEBUG(4822860, 5, "SBE plan", - "slots"_attr = data.debugString(), - "stages"_attr = sbe::DebugPrinter{}.print(*rootStage)); + "slots"_attr = redact(data.debugString()), + "stages"_attr = redact(sbe::DebugPrinter{}.print(*rootStage))); return {{new PlanExecutorSBE( opCtx, @@ -165,8 +165,8 @@ StatusWith> make( LOGV2_DEBUG(4822861, 5, "SBE plan", - "slots"_attr = candidates.winner().data.debugString(), - "stages"_attr = sbe::DebugPrinter{}.print(*candidates.winner().root)); + "slots"_attr = redact(candidates.winner().data.debugString()), + "stages"_attr = redact(sbe::DebugPrinter{}.print(*candidates.winner().root))); return {{new PlanExecutorSBE(opCtx, std::move(cq), diff --git a/src/mongo/db/query/planner_ixselect.cpp b/src/mongo/db/query/planner_ixselect.cpp index b63484717f2..1030a17b57a 100644 --- a/src/mongo/db/query/planner_ixselect.cpp +++ b/src/mongo/db/query/planner_ixselect.cpp @@ -633,7 +633,7 @@ bool QueryPlannerIXSelect::_compatible(const BSONElement& keyPatternElt, } else { LOGV2_WARNING(20954, "Unknown indexing for given node and field", - "node"_attr = node->debugString(), + "node"_attr = redact(node->debugString()), "field"_attr = keyPatternElt.toString()); verify(0); } diff --git a/src/mongo/db/query/query_stats/query_stats.cpp b/src/mongo/db/query/query_stats/query_stats.cpp index a8bd49e0533..814851364e0 100644 --- a/src/mongo/db/query/query_stats/query_stats.cpp +++ b/src/mongo/db/query/query_stats/query_stats.cpp @@ -318,7 +318,7 @@ void registerRequest(OperationContext* opCtx, "Error encountered when creating the Query Stats store key. Metrics will not " "be collected for this command", "status"_attr = status, - "command"_attr = cmdObj); + "command"_attr = redact(cmdObj)); if (kDebugBuild || internalQueryStatsErrorsAreCommandFatal.load()) { // uassert rather than tassert so that we avoid creating fatal failures on queries that // were going to fail anyway, but trigger the error here first. A query that ONLY fails diff --git a/src/mongo/db/query/sbe_stage_builder_index_scan.cpp b/src/mongo/db/query/sbe_stage_builder_index_scan.cpp index cc63eee572a..f387f4e58fc 100644 --- a/src/mongo/db/query/sbe_stage_builder_index_scan.cpp +++ b/src/mongo/db/query/sbe_stage_builder_index_scan.cpp @@ -1073,8 +1073,8 @@ IndexIntervals makeIntervalsFromIndexBounds(const IndexBounds& bounds, LOGV2_DEBUG(4742906, 5, "Generated interval [lowKey, highKey]", - "lowKey"_attr = lowKey, - "highKey"_attr = highKey); + "lowKey"_attr = redact(lowKey), + "highKey"_attr = redact(highKey)); // Note that 'makeKeyFromBSONKeyForSeek()' is intended to compute the "start" key for an // index scan. The logic for computing a "discriminator" for an "end" key is reversed, which // is why we use 'makeKeyStringFromBSONKey()' to manually specify the discriminator for the