diff options
author | chertus <azuikov@ydb.tech> | 2023-03-26 20:02:32 +0300 |
---|---|---|
committer | chertus <azuikov@ydb.tech> | 2023-03-26 20:02:32 +0300 |
commit | 1de48402f34b7697889158208c7eb9bf752f6661 (patch) | |
tree | 7d203d3947fd3499173dfc005303367c031f8763 | |
parent | 723ccae7977b51361007bc7777fc0ed206c24692 (diff) | |
download | ydb-1de48402f34b7697889158208c7eb9bf752f6661.tar.gz |
second attempt to fix crash
-rw-r--r-- | ydb/core/tx/columnshard/engines/column_engine_logs.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp index 071c2ed0dc..716ea0ec9b 100644 --- a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp +++ b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp @@ -1513,26 +1513,25 @@ std::unique_ptr<TCompactionInfo> TColumnEngineForLogs::Compact(ui64& lastCompact } while (!CompactionGranules.empty()) { + Y_VERIFY(it != CompactionGranules.end()); ui64 granule = *it; + Y_VERIFY(Granules.count(granule)); auto spg = Granules.find(granule)->second; Y_VERIFY(spg); // We need only actual portions here (with empty XPlanStep:XTxId) auto actualPortions = GetActualPortions(spg->Portions); - if (actualPortions.empty()) { - it = CompactionGranules.erase(it); - continue; - } - - ui32 inserted = 0; - bool needSplit = NeedSplit(actualPortions, Limits, inserted); - if (needSplit) { - inGranule = false; - outGranule = granule; - break; - } else if (inserted) { - outGranule = granule; - break; + if (!actualPortions.empty()) { + ui32 inserted = 0; + bool needSplit = NeedSplit(actualPortions, Limits, inserted); + if (needSplit) { + inGranule = false; + outGranule = granule; + break; + } else if (inserted) { + outGranule = granule; + break; + } } it = CompactionGranules.erase(it); |