mirror of https://github.com/mongodb/mongo
SERVER-98720: Add missing redact() calls to query logs (#33192)
GitOrigin-RevId: be2ab84df04dd10fcecc8efd8f4e0c5e7640dec8
This commit is contained in:
parent
64beac1126
commit
f4184f18fe
|
|
@ -299,7 +299,7 @@ public:
|
||||||
"Plan executor error during distinct command",
|
"Plan executor error during distinct command",
|
||||||
"error"_attr = exception.toStatus(),
|
"error"_attr = exception.toStatus(),
|
||||||
"stats"_attr = redact(stats),
|
"stats"_attr = redact(stats),
|
||||||
"cmd"_attr = cmdObj);
|
"cmd"_attr = redact(cmdObj));
|
||||||
|
|
||||||
exception.addContext("Executor error during distinct command");
|
exception.addContext("Executor error during distinct command");
|
||||||
throw;
|
throw;
|
||||||
|
|
|
||||||
|
|
@ -670,7 +670,7 @@ public:
|
||||||
"Plan executor error during find command",
|
"Plan executor error during find command",
|
||||||
"error"_attr = exception.toStatus(),
|
"error"_attr = exception.toStatus(),
|
||||||
"stats"_attr = redact(stats),
|
"stats"_attr = redact(stats),
|
||||||
"cmd"_attr = cmdObj);
|
"cmd"_attr = redact(cmdObj));
|
||||||
|
|
||||||
exception.addContext("Executor error during find command");
|
exception.addContext("Executor error during find command");
|
||||||
throw;
|
throw;
|
||||||
|
|
|
||||||
|
|
@ -439,7 +439,7 @@ public:
|
||||||
"getMore command executor error",
|
"getMore command executor error",
|
||||||
"error"_attr = exception.toStatus(),
|
"error"_attr = exception.toStatus(),
|
||||||
"stats"_attr = redact(stats),
|
"stats"_attr = redact(stats),
|
||||||
"cmd"_attr = cmd.toBSON({}));
|
"cmd"_attr = redact(cmd.toBSON({})));
|
||||||
|
|
||||||
exception.addContext("Executor error during getMore");
|
exception.addContext("Executor error during getMore");
|
||||||
throw;
|
throw;
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ bool handleCursorCommand(OperationContext* opCtx,
|
||||||
"Aggregate command executor error",
|
"Aggregate command executor error",
|
||||||
"error"_attr = exception.toStatus(),
|
"error"_attr = exception.toStatus(),
|
||||||
"stats"_attr = redact(stats),
|
"stats"_attr = redact(stats),
|
||||||
"cmd"_attr = cmdObj);
|
"cmd"_attr = redact(cmdObj));
|
||||||
|
|
||||||
exception.addContext("PlanExecutor error during aggregation");
|
exception.addContext("PlanExecutor error during aggregation");
|
||||||
throw;
|
throw;
|
||||||
|
|
|
||||||
|
|
@ -420,7 +420,8 @@ std::unique_ptr<PlanStage> ClassicStageBuilder::build(const QuerySolutionNode* r
|
||||||
case STAGE_SENTINEL:
|
case STAGE_SENTINEL:
|
||||||
case STAGE_COLUMN_IXSCAN:
|
case STAGE_COLUMN_IXSCAN:
|
||||||
case STAGE_UPDATE: {
|
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()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ void ExpressionMapping::S2CellIdsToIntervals(const std::vector<S2CellId>& interv
|
||||||
if (!oilOut->isValidFor(1)) {
|
if (!oilOut->isValidFor(1)) {
|
||||||
LOGV2(6029801,
|
LOGV2(6029801,
|
||||||
"invalid OrderedIntervalList",
|
"invalid OrderedIntervalList",
|
||||||
"orderedIntervalList"_attr = oilOut->toString(false));
|
"orderedIntervalList"_attr = redact(oilOut->toString(false)));
|
||||||
MONGO_UNREACHABLE;
|
MONGO_UNREACHABLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -229,7 +229,7 @@ void ExpressionMapping::S2CellIdsToIntervalsWithParents(const std::vector<S2Cell
|
||||||
if (!oilOut->isValidFor(1)) {
|
if (!oilOut->isValidFor(1)) {
|
||||||
LOGV2(6029802,
|
LOGV2(6029802,
|
||||||
"invalid OrderedIntervalList",
|
"invalid OrderedIntervalList",
|
||||||
"orderedIntervalList"_attr = oilOut->toString(false));
|
"orderedIntervalList"_attr = redact(oilOut->toString(false)));
|
||||||
MONGO_UNREACHABLE;
|
MONGO_UNREACHABLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -382,7 +382,7 @@ unique_ptr<MatchExpression> PlanEnumerator::getNext() {
|
||||||
tagForSort(tree.get());
|
tagForSort(tree.get());
|
||||||
|
|
||||||
_root->resetTag();
|
_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));
|
_done = nextMemo(memoIDForNode(_root));
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,8 +137,8 @@ StatusWith<std::unique_ptr<PlanExecutor, PlanExecutor::Deleter>> make(
|
||||||
LOGV2_DEBUG(4822860,
|
LOGV2_DEBUG(4822860,
|
||||||
5,
|
5,
|
||||||
"SBE plan",
|
"SBE plan",
|
||||||
"slots"_attr = data.debugString(),
|
"slots"_attr = redact(data.debugString()),
|
||||||
"stages"_attr = sbe::DebugPrinter{}.print(*rootStage));
|
"stages"_attr = redact(sbe::DebugPrinter{}.print(*rootStage)));
|
||||||
|
|
||||||
return {{new PlanExecutorSBE(
|
return {{new PlanExecutorSBE(
|
||||||
opCtx,
|
opCtx,
|
||||||
|
|
@ -165,8 +165,8 @@ StatusWith<std::unique_ptr<PlanExecutor, PlanExecutor::Deleter>> make(
|
||||||
LOGV2_DEBUG(4822861,
|
LOGV2_DEBUG(4822861,
|
||||||
5,
|
5,
|
||||||
"SBE plan",
|
"SBE plan",
|
||||||
"slots"_attr = candidates.winner().data.debugString(),
|
"slots"_attr = redact(candidates.winner().data.debugString()),
|
||||||
"stages"_attr = sbe::DebugPrinter{}.print(*candidates.winner().root));
|
"stages"_attr = redact(sbe::DebugPrinter{}.print(*candidates.winner().root)));
|
||||||
|
|
||||||
return {{new PlanExecutorSBE(opCtx,
|
return {{new PlanExecutorSBE(opCtx,
|
||||||
std::move(cq),
|
std::move(cq),
|
||||||
|
|
|
||||||
|
|
@ -633,7 +633,7 @@ bool QueryPlannerIXSelect::_compatible(const BSONElement& keyPatternElt,
|
||||||
} else {
|
} else {
|
||||||
LOGV2_WARNING(20954,
|
LOGV2_WARNING(20954,
|
||||||
"Unknown indexing for given node and field",
|
"Unknown indexing for given node and field",
|
||||||
"node"_attr = node->debugString(),
|
"node"_attr = redact(node->debugString()),
|
||||||
"field"_attr = keyPatternElt.toString());
|
"field"_attr = keyPatternElt.toString());
|
||||||
verify(0);
|
verify(0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -318,7 +318,7 @@ void registerRequest(OperationContext* opCtx,
|
||||||
"Error encountered when creating the Query Stats store key. Metrics will not "
|
"Error encountered when creating the Query Stats store key. Metrics will not "
|
||||||
"be collected for this command",
|
"be collected for this command",
|
||||||
"status"_attr = status,
|
"status"_attr = status,
|
||||||
"command"_attr = cmdObj);
|
"command"_attr = redact(cmdObj));
|
||||||
if (kDebugBuild || internalQueryStatsErrorsAreCommandFatal.load()) {
|
if (kDebugBuild || internalQueryStatsErrorsAreCommandFatal.load()) {
|
||||||
// uassert rather than tassert so that we avoid creating fatal failures on queries that
|
// 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
|
// were going to fail anyway, but trigger the error here first. A query that ONLY fails
|
||||||
|
|
|
||||||
|
|
@ -1073,8 +1073,8 @@ IndexIntervals makeIntervalsFromIndexBounds(const IndexBounds& bounds,
|
||||||
LOGV2_DEBUG(4742906,
|
LOGV2_DEBUG(4742906,
|
||||||
5,
|
5,
|
||||||
"Generated interval [lowKey, highKey]",
|
"Generated interval [lowKey, highKey]",
|
||||||
"lowKey"_attr = lowKey,
|
"lowKey"_attr = redact(lowKey),
|
||||||
"highKey"_attr = highKey);
|
"highKey"_attr = redact(highKey));
|
||||||
// Note that 'makeKeyFromBSONKeyForSeek()' is intended to compute the "start" key for an
|
// 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
|
// 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
|
// is why we use 'makeKeyStringFromBSONKey()' to manually specify the discriminator for the
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue