summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/balancer_stats_registry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/balancer_stats_registry.cpp')
-rw-r--r--src/mongo/db/s/balancer_stats_registry.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mongo/db/s/balancer_stats_registry.cpp b/src/mongo/db/s/balancer_stats_registry.cpp
index 508648eb29f..0d262b2c299 100644
--- a/src/mongo/db/s/balancer_stats_registry.cpp
+++ b/src/mongo/db/s/balancer_stats_registry.cpp
@@ -284,9 +284,12 @@ void BalancerStatsRegistry::updateOrphansCount(const UUID& collectionUUID, long
stats.numOrphanDocs += delta;
if (stats.numOrphanDocs < 0) {
- // This should happen only in case of direct manipulation of range deletion tasks
- // documents or direct writes into orphaned ranges
- LOGV2_ERROR(6419611,
+ // This could happen in case of direct manipulation of range deletion tasks documents or
+ // direct writes into orphaned ranges, but also in some other benign situations.
+ // numOrphanDocs is a best-effort counter, miscounting or even being negative in some
+ // scenarios is expected.
+ LOGV2_DEBUG(6419611,
+ 1,
"Cached orphan documents count became negative, resetting it to 0",
"collectionUUID"_attr = collectionUUID,
"numOrphanDocs"_attr = stats.numOrphanDocs,
@@ -334,7 +337,8 @@ void BalancerStatsRegistry::_loadOrphansCount(OperationContext* opCtx) {
auto numRangeDeletionTasks = collObj[kNumRangeDeletionTasksLabel].exactNumberLong();
invariant(numRangeDeletionTasks > 0);
if (orphanCount < 0) {
- LOGV2_ERROR(6419621,
+ LOGV2_DEBUG(6419621,
+ 1,
"Found negative orphan count in range deletion task documents",
"collectionUUID"_attr = collUUID,
"numOrphanDocs"_attr = orphanCount,