Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
swalrus1 committed Dec 17, 2024
1 parent 0533380 commit fe1cc5a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
14 changes: 8 additions & 6 deletions ydb/core/tx/columnshard/columnshard_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,15 @@ void TColumnShard::RunInit(const NKikimrTxColumnShard::TInitShard& proto, const

NIceDb::TNiceDb db(txc.DB);

AFL_VERIFY(proto.HasOwnerPathId());
OwnerPathId = proto.GetOwnerPathId();
Schema::SaveSpecialValue(db, Schema::EValueIds::OwnerPathId, OwnerPathId);
if (proto.HasOwnerPathId()) {
OwnerPathId = proto.GetOwnerPathId();
Schema::SaveSpecialValue(db, Schema::EValueIds::OwnerPathId, OwnerPathId);
}

AFL_VERIFY(proto.HasOwnerPathId());
OwnerPath = proto.GetOwnerPath();
Schema::SaveSpecialValue(db, Schema::EValueIds::OwnerPath, OwnerPath);
if (proto.HasOwnerPath()) {
OwnerPath = proto.GetOwnerPath();
Schema::SaveSpecialValue(db, Schema::EValueIds::OwnerPath, OwnerPath);
}

for (auto& createTable : proto.GetTables()) {
RunEnsureTable(createTable, version, txc);
Expand Down
11 changes: 8 additions & 3 deletions ydb/core/tx/columnshard/engines/scheme/objects_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ std::shared_ptr<const TIndexInfo> TSchemaObjectsCache::GetIndexInfoCache(TIndexI
const ui64 schemaVersion = indexInfo.GetVersion();
std::unique_lock lock(SchemasMutex);
auto* findSchema = SchemasByVersion.FindPtr(schemaVersion);
if (!findSchema || findSchema->expired()) {
SchemasByVersion[schemaVersion] = std::make_shared<TIndexInfo>(std::move(indexInfo));
std::shared_ptr<const TIndexInfo> cachedSchema;
if (findSchema) {
cachedSchema = findSchema->lock();
}
return findSchema->lock();
if (!cachedSchema) {
cachedSchema = std::make_shared<TIndexInfo>(std::move(indexInfo));
SchemasByVersion[schemaVersion] = cachedSchema;
}
return cachedSchema;
}

} // namespace NKikimr::NOlap

0 comments on commit fe1cc5a

Please sign in to comment.