Skip to content

Commit b22b64b

Browse files
committed
better merge
1 parent efa4be7 commit b22b64b

File tree

1 file changed

+8
-28
lines changed

1 file changed

+8
-28
lines changed

ydb/core/tx/datashard/datashard__stats.cpp

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ void TDataShard::Handle(TEvPrivate::TEvAsyncTableStats::TPtr& ev, const TActorCo
357357
Actors.erase(ev->Sender);
358358

359359
ui64 tableId = ev->Get()->TableId;
360+
LOG_DEBUG_S(ctx, NKikimrServices::TX_DATASHARD, "BuildStats result received at datashard " << TabletID() << ", for tableId " << tableId);
360361

361362
i64 dataSize = 0;
362363
if (TableInfos.contains(tableId)) {
@@ -376,6 +377,7 @@ void TDataShard::Handle(TEvPrivate::TEvAsyncTableStats::TPtr& ev, const TActorCo
376377
dataSize += tableInfo.Stats.DataStats.DataSize.Size;
377378

378379
tableInfo.Stats.SearchHeight = ev->Get()->SearchHeight;
380+
tableInfo.Stats.HasSchemaChanges = ev->Get()->HasSchemaChanges;
379381

380382
tableInfo.StatsUpdateInProgress = false;
381383

@@ -386,29 +388,7 @@ void TDataShard::Handle(TEvPrivate::TEvAsyncTableStats::TPtr& ev, const TActorCo
386388
<< ", built for tableId " << tableId << ", but table is gone (moved ot dropped)");
387389
}
388390

389-
LOG_DEBUG_S(ctx, NKikimrServices::TX_DATASHARD, "BuildStats result received at datashard " << TabletID()
390-
<< ", for tableId " << tableId);
391-
392-
const TUserTable& tableInfo = *TableInfos[tableId];
393-
394-
if (!tableInfo.StatsUpdateInProgress) { // how can this happen?
395-
LOG_ERROR(ctx, NKikimrServices::TX_DATASHARD, "Unexpected async stats update at datashard %" PRIu64, TabletID());
396-
}
397-
398-
tableInfo.Stats.DataStats = std::move(ev->Get()->Stats);
399-
tableInfo.Stats.PartOwners = std::move(ev->Get()->PartOwners);
400-
tableInfo.Stats.PartCount = ev->Get()->PartCount;
401-
tableInfo.Stats.StatsUpdateTime = ev->Get()->StatsUpdateTime;
402-
tableInfo.Stats.MemRowCount = ev->Get()->MemRowCount;
403-
tableInfo.Stats.MemDataSize = ev->Get()->MemDataSize;
404-
tableInfo.Stats.SearchHeight = ev->Get()->SearchHeight;
405-
tableInfo.Stats.HasSchemaChanges = ev->Get()->HasSchemaChanges;
406-
407-
tableInfo.StatsUpdateInProgress = false;
408-
409-
SendPeriodicTableStats(ctx);
410-
411-
if (static_cast<i64>(tableInfo.Stats.DataStats.DataSize.Size) > HighDataSizeReportThresholdBytes) {
391+
if (dataSize > HighDataSizeReportThresholdBytes) {
412392
TInstant now = AppData(ctx)->TimeProvider->Now();
413393

414394
if (LastDataSizeWarnTime + TDuration::Seconds(HighDataSizeReportIntervalSeconds) > now)
@@ -419,11 +399,11 @@ void TDataShard::Handle(TEvPrivate::TEvAsyncTableStats::TPtr& ev, const TActorCo
419399
TStringBuilder names;
420400
ListTableNames(GetUserTables(), names);
421401

422-
LOG_ERROR_S(ctx, NKikimrServices::TX_DATASHARD, "Data size " << tableInfo.Stats.DataStats.DataSize.Size
423-
<< " is higher than threshold of " << (i64)HighDataSizeReportThresholdBytes
424-
<< " at datashard: " << TabletID()
425-
<< " table: " << names
426-
<< " consider reconfiguring table partitioning settings");
402+
LOG_ERROR_S(ctx, NKikimrServices::TX_DATASHARD, "Data size " << dataSize
403+
<< " is higher than threshold of " << (i64)HighDataSizeReportThresholdBytes
404+
<< " at datashard: " << TabletID()
405+
<< " table: " << names
406+
<< " consider reconfiguring table partitioning settings");
427407
}
428408
}
429409

0 commit comments

Comments
 (0)