Skip to content

Commit 1eae239

Browse files
louiswilliamsMongoDB Bot
authored andcommitted
SERVER-100243 Lower slow query log severity when storage stats cannot be collected (#31853)
GitOrigin-RevId: c412f7b
1 parent aa018ee commit 1eae239

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/mongo/db/curop.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ void CurOp::_fetchStorageStatsIfNecessary(Date_t deadline, AdmissionContext::Pri
449449
// a storage engine would have at-least held a global lock at one point, hence we
450450
// limit our lock acquisition to such operations. We can get here and our lock
451451
// acquisition be timed out or interrupted, in which case we'll throw. Callers should
452-
// handle that case, e.g., by logging a warning.
452+
// handle that case, e.g., by logging a message.
453453
if (_debug.storageStats == nullptr &&
454454
shard_role_details::getLocker(opCtx)->wasGlobalLockTaken() &&
455455
opCtx->getServiceContext()->getStorageEngine()) {
@@ -495,10 +495,10 @@ void CurOp::setEndOfOpMetrics(long long nreturned) {
495495
const auto& admCtx = ExecutionAdmissionContext::get(opCtx());
496496
_fetchStorageStatsIfNecessary(Date_t::max(), admCtx.getPriority());
497497
} catch (DBException& ex) {
498-
LOGV2_WARNING(8457400,
499-
"Failed to gather storage statistics for query stats",
500-
"opId"_attr = opCtx()->getOpID(),
501-
"error"_attr = redact(ex));
498+
LOGV2(8457400,
499+
"Failed to gather storage statistics for query stats",
500+
"opId"_attr = opCtx()->getOpID(),
501+
"error"_attr = redact(ex));
502502
}
503503

504504
if (_debug.storageStats) {
@@ -753,11 +753,11 @@ bool CurOp::completeAndLogOperation(const logv2::LogOptions& logOptions,
753753
_fetchStorageStatsIfNecessary(Date_t::now() + Milliseconds(500),
754754
AdmissionContext::Priority::kExempt);
755755
} catch (const DBException& ex) {
756-
LOGV2_WARNING_OPTIONS(20526,
757-
logOptions,
758-
"Failed to gather storage statistics for slow operation",
759-
"opId"_attr = opCtx->getOpID(),
760-
"error"_attr = redact(ex));
756+
LOGV2_OPTIONS(20526,
757+
logOptions,
758+
"Failed to gather storage statistics for slow operation",
759+
"opId"_attr = opCtx->getOpID(),
760+
"error"_attr = redact(ex));
761761
}
762762

763763
// Gets the time spent blocked on prepare conflicts.

0 commit comments

Comments
 (0)