Skip to content

Commit

Permalink
Temporary fix for crash when loading columnshard (#9487)
Browse files Browse the repository at this point in the history
  • Loading branch information
fexolm committed Sep 20, 2024
1 parent 210906c commit b218229
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ydb/core/tx/columnshard/engines/column_engine_logs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,20 @@ 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();
}
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();
Expand Down

0 comments on commit b218229

Please sign in to comment.