From a261c7b107d932cef6785fed238dc109c7986210 Mon Sep 17 00:00:00 2001 From: azevaykin <145343289+azevaykin@users.noreply.github.com> Date: Fri, 30 Aug 2024 09:30:49 +0300 Subject: [PATCH] Statistics: more logging (#8480) --- .../statistics/aggregator/aggregator_impl.cpp | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/ydb/core/statistics/aggregator/aggregator_impl.cpp b/ydb/core/statistics/aggregator/aggregator_impl.cpp index 4a73e57fc636..ef16ee226551 100644 --- a/ydb/core/statistics/aggregator/aggregator_impl.cpp +++ b/ydb/core/statistics/aggregator/aggregator_impl.cpp @@ -660,26 +660,30 @@ void TStatisticsAggregator::ScheduleNextTraversal(NIceDb::TNiceDb& db) { if (!LastTraversalWasForce) { LastTraversalWasForce = true; - for (TForceTraversalOperation& operation : ForceTraversals) { - for (TForceTraversalTable& operationTable : operation.Tables) { - if (operationTable.Status == TForceTraversalTable::EStatus::AnalyzeFinished) { - UpdateForceTraversalTableStatus(TForceTraversalTable::EStatus::TraversalStarted, operation.OperationId, operationTable, db); - pathId = operationTable.PathId; - break; + if (ForceTraversals.empty()) { + SA_LOG_D("[" << TabletID() << "] ScheduleNextTraversal. No force traversals."); + } else { + for (TForceTraversalOperation& operation : ForceTraversals) { + for (TForceTraversalTable& operationTable : operation.Tables) { + if (operationTable.Status == TForceTraversalTable::EStatus::AnalyzeFinished) { + UpdateForceTraversalTableStatus(TForceTraversalTable::EStatus::TraversalStarted, operation.OperationId, operationTable, db); + pathId = operationTable.PathId; + break; + } + } + + if (!pathId) { + SA_LOG_D("[" << TabletID() << "] ScheduleNextTraversal. All the force traversal tables sent the requests. OperationId=" << operation.OperationId); + continue; } + + ForceTraversalOperationId = operation.OperationId; + break; } - + if (!pathId) { - SA_LOG_D("[" << TabletID() << "] ScheduleNextTraversal. All the force traversal tables sent the requests. OperationId=" << operation.OperationId); - continue; + SA_LOG_D("[" << TabletID() << "] ScheduleNextTraversal. All the force traversal operations sent the requests."); } - - ForceTraversalOperationId = operation.OperationId; - break; - } - - if (!pathId) { - SA_LOG_D("[" << TabletID() << "] ScheduleNextTraversal. All the force traversal operations sent the requests."); } }