Skip to content

Commit 06e3926

Browse files
fixes
1 parent 01040d4 commit 06e3926

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

ydb/core/tx/columnshard/engines/column_engine_logs.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,11 @@ void TColumnEngineForLogs::OnTieringModified(const std::shared_ptr<NColumnShard:
497497

498498
void TColumnEngineForLogs::DoRegisterTable(const ui64 pathId) {
499499
AFL_VERIFY(Tables.emplace(pathId, std::make_shared<TGranuleMeta>(pathId, GranulesStorage, SignalCounters.RegisterGranuleDataCounters(), VersionedIndex)).second);
500+
if (TiersInitialized) {
501+
auto it = Tables.find(pathId);
502+
AFL_VERIFY(it != Tables.end());
503+
it->second->StartActualizationIndex();
504+
}
500505
}
501506

502507
} // namespace NKikimr::NOlap

ydb/core/tx/columnshard/engines/portions/portion_info.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@ const TString& TPortionInfo::GetColumnStorageId(const ui32 columnId, const TInde
387387
return indexInfo.GetColumnStorageId(columnId, GetMeta().GetTierName());
388388
}
389389

390+
const TString& TPortionInfo::GetEntityStorageId(const ui32 columnId, const TIndexInfo& indexInfo) const {
391+
return indexInfo.GetEntityStorageId(columnId, GetMeta().GetTierName());
392+
}
393+
390394
void TPortionInfo::FillBlobRangesByStorage(THashMap<TString, THashSet<TBlobRange>>& result, const TIndexInfo& indexInfo) const {
391395
for (auto&& i : Records) {
392396
const TString& storageId = GetColumnStorageId(i.GetColumnId(), indexInfo);

ydb/core/tx/columnshard/engines/portions/portion_info.h

+29
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class TPortionInfo {
8383
}
8484

8585
const TString& GetColumnStorageId(const ui32 columnId, const TIndexInfo& indexInfo) const;
86+
const TString& GetEntityStorageId(const ui32 entityId, const TIndexInfo& indexInfo) const;
8687

8788
ui64 GetTxVolume() const; // fake-correct method for determ volume on rewrite this portion in transaction progress
8889

@@ -235,6 +236,34 @@ class TPortionInfo {
235236
return nullptr;
236237
}
237238

239+
std::optional<TEntityChunk> GetEntityRecord(const TChunkAddress& address) const {
240+
for (auto&& c : GetRecords()) {
241+
if (c.GetAddress() == address) {
242+
return TEntityChunk(c.GetAddress(), c.GetMeta().GetNumRowsVerified(), c.GetMeta().GetRawBytesVerified(), c.GetBlobRange());
243+
}
244+
}
245+
for (auto&& c : GetIndexes()) {
246+
if (c.GetAddress() == address) {
247+
return TEntityChunk(c.GetAddress(), c.GetRecordsCount(), c.GetRawBytes(), c.GetBlobRange());
248+
}
249+
}
250+
return {};
251+
}
252+
253+
bool HasEntityAddress(const TChunkAddress& address) const {
254+
for (auto&& c : GetRecords()) {
255+
if (c.GetAddress() == address) {
256+
return true;
257+
}
258+
}
259+
for (auto&& c : GetIndexes()) {
260+
if (c.GetAddress() == address) {
261+
return true;
262+
}
263+
}
264+
return false;
265+
}
266+
238267
bool Empty() const { return Records.empty(); }
239268
bool Produced() const { return Meta.GetProduced() != TPortionMeta::EProduced::UNSPECIFIED; }
240269
bool Valid() const { return MinSnapshot.Valid() && PathId && Portion && !Empty() && Produced() && Meta.IndexKeyStart && Meta.IndexKeyEnd; }

ydb/core/tx/columnshard/engines/portions/with_blobs.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void TPortionInfoWithBlobs::TBlobInfo::RestoreChunk(const TPortionInfoWithBlobs&
1111
const TString& data = chunk->GetData();
1212
Size += data.size();
1313
auto address = chunk->GetChunkAddress();
14-
AFL_VERIFY(owner.GetPortionInfo().GetRecordPointer(address))("address", address.DebugString());
14+
AFL_VERIFY(owner.GetPortionInfo().HasEntityAddress(address))("address", address.DebugString());
1515
AFL_VERIFY(Chunks.emplace(address, chunk).second)("address", address.DebugString());
1616
ChunksOrdered.emplace_back(chunk);
1717
}
@@ -90,7 +90,7 @@ NKikimr::NOlap::TPortionInfoWithBlobs TPortionInfoWithBlobs::RestorePortion(cons
9090
for (auto&& i : recordsByBlob) {
9191
auto builder = result.StartBlob(storage);
9292
for (auto&& d : i.second) {
93-
auto blobData = blobs.Extract(portion.GetColumnStorageId(d.GetAddress().GetEntityId(), indexInfo), portion.RestoreBlobRange(d.GetBlobRange()));
93+
auto blobData = blobs.Extract(portion.GetEntityStorageId(d.GetAddress().GetEntityId(), indexInfo), portion.RestoreBlobRange(d.GetBlobRange()));
9494
builder.RestoreChunk(std::make_shared<NIndexes::TPortionIndexChunk>(d.GetAddress(), d.GetRecordsCount(), d.GetRawBytes(), std::move(blobData)));
9595
}
9696
}

0 commit comments

Comments
 (0)