Skip to content

Commit 087f903

Browse files
aavdonkinzverevgeny
authored andcommitted
Table stats log stable (#10162)
1 parent 57ae447 commit 087f903

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

ydb/core/tx/columnshard/engines/column_engine_logs.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ const TColumnEngineStats& TColumnEngineForLogs::GetTotalStats() {
6060

6161
void TColumnEngineForLogs::UpdatePortionStats(const TPortionInfo& portionInfo, EStatsUpdateType updateType,
6262
const TPortionInfo* exPortionInfo) {
63-
UpdatePortionStats(Counters, portionInfo, updateType, exPortionInfo);
64-
63+
if (IS_LOG_PRIORITY_ENABLED(NActors::NLog::PRI_DEBUG, NKikimrServices::TX_COLUMNSHARD)) {
64+
auto before = Counters.Active();
65+
UpdatePortionStats(Counters, portionInfo, updateType, exPortionInfo);
66+
auto after = Counters.Active();
67+
AFL_DEBUG(NKikimrServices::TX_COLUMNSHARD)("event", "portion_stats_updated")("type", updateType)("path_id", portionInfo.GetPathId())("portion", portionInfo.GetPortionId())("before_size", before.Bytes)("after_size", after.Bytes)("before_rows", before.Rows)("after_rows", after.Rows);
68+
} else {
69+
UpdatePortionStats(Counters, portionInfo, updateType, exPortionInfo);
70+
}
6571
const ui64 pathId = portionInfo.GetPathId();
6672
Y_ABORT_UNLESS(pathId);
6773
if (!PathStats.contains(pathId)) {

ydb/core/tx/columnshard/engines/ya.make

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ SRCS(
1616
defs.cpp
1717
)
1818

19+
GENERATE_ENUM_SERIALIZATION(column_engine_logs.h)
20+
1921
PEERDIR(
2022
contrib/libs/apache/arrow
2123
ydb/core/base

ydb/core/tx/schemeshard/schemeshard__table_stats.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ bool TTxStoreTableStats::PersistSingleStats(const TPathId& pathId,
246246
}
247247

248248
TShardIdx shardIdx = Self->TabletIdToShardIdx[datashardId];
249+
LOG_DEBUG_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
250+
"PersistSingleStats for pathId " << pathId.LocalPathId << " shard idx " << shardIdx << " data size " << dataSize << " row count " << rowCount
251+
);
249252
const auto* shardInfo = Self->ShardInfos.FindPtr(shardIdx);
250253
if (!shardInfo) {
251254
LOG_DEBUG_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,

0 commit comments

Comments
 (0)