diff --git a/ydb/core/tx/columnshard/engines/portions/constructor.h b/ydb/core/tx/columnshard/engines/portions/constructor.h index f7499aabe0ca..f444836068bf 100644 --- a/ydb/core/tx/columnshard/engines/portions/constructor.h +++ b/ydb/core/tx/columnshard/engines/portions/constructor.h @@ -175,10 +175,12 @@ class TPortionInfoConstructor { for (auto&& i : chunks) { Validate(i); if (entityId != i.GetEntityId()) { - if (recordsCount) { - AFL_VERIFY(recordsCountCurrent == *recordsCount); - } else { - recordsCount = recordsCountCurrent; + if (entityId) { + if (recordsCount) { + AFL_VERIFY(recordsCountCurrent == *recordsCount); + } else { + recordsCount = recordsCountCurrent; + } } AFL_VERIFY(entityId < i.GetEntityId())("entity", entityId)("next", i.GetEntityId())("details", debugString()); AFL_VERIFY(i.GetChunkIdx() == 0);