Skip to content

Commit 3b066ed

Browse files
committed
fix sigabrt
1 parent e1c0faa commit 3b066ed

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ydb/core/tx/columnshard/columnshard.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,9 @@ void TColumnShard::FillColumnTableStats(
338338
std::unique_ptr<TEvDataShard::TEvPeriodicTableStats>& ev
339339
) {
340340
auto tables = TablesManager.GetTables();
341-
TTableStatsBuilder tableStatsBuilder(Counters, Executor(), TablesManager.MutablePrimaryIndex());
341+
std::optional<TTableStatsBuilder> tableStatsBuilder =
342+
TablesManager.HasPrimaryIndex() ? std::make_optional<TTableStatsBuilder>(Counters, Executor(), TablesManager.MutablePrimaryIndex())
343+
: std::nullopt;
342344

343345
LOG_S_DEBUG("There are stats for " << tables.size() << " tables");
344346
for (const auto& [pathId, _] : tables) {
@@ -356,7 +358,9 @@ void TColumnShard::FillColumnTableStats(
356358
resourceMetrics->Fill(*periodicTableStats->MutableTabletMetrics());
357359
}
358360

359-
tableStatsBuilder.FillTableStats(pathId, *(periodicTableStats->MutableTableStats()));
361+
if (tableStatsBuilder) {
362+
tableStatsBuilder->FillTableStats(pathId, *(periodicTableStats->MutableTableStats()));
363+
}
360364

361365
LOG_S_TRACE("Add stats for table, tableLocalID=" << pathId);
362366
}

0 commit comments

Comments
 (0)