From b2182296c41ebcfd6e2b1f131823bef2ecb1a2b8 Mon Sep 17 00:00:00 2001 From: Artem Alekseev Date: Fri, 20 Sep 2024 16:45:38 +0300 Subject: [PATCH] Temporary fix for crash when loading columnshard (#9487) --- ydb/core/tx/columnshard/engines/column_engine_logs.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp index 08bddf9ce456..774861cd8d90 100644 --- a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp +++ b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp @@ -171,6 +171,12 @@ bool TColumnEngineForLogs::LoadColumns(IDbWrapper& db) { TSnapshot lastSnapshot(0, 0); const TIndexInfo* currentIndexInfo = nullptr; auto result = ColumnsTable->Load(db, [&](const TPortionInfo& portion, const TColumnChunkLoadContext& loadContext) { + auto granule = GetGranuleOptional(portion.GetPathId()); + + if (!granule) { + return; + } + if (!currentIndexInfo || lastSnapshot != portion.GetMinSnapshot()) { currentIndexInfo = &VersionedIndex.GetSchema(portion.GetMinSnapshot())->GetIndexInfo(); lastSnapshot = portion.GetMinSnapshot(); @@ -178,7 +184,7 @@ bool TColumnEngineForLogs::LoadColumns(IDbWrapper& db) { AFL_VERIFY(portion.ValidSnapshotInfo())("details", portion.DebugString()); // Locate granule and append the record. TColumnRecord rec(loadContext, *currentIndexInfo); - GetGranulePtrVerified(portion.GetPathId())->AddColumnRecord(*currentIndexInfo, portion, rec, loadContext.GetPortionMeta()); + granule->AddColumnRecord(*currentIndexInfo, portion, rec, loadContext.GetPortionMeta()); }); for (auto&& i : Tables) { i.second->OnAfterPortionsLoad();