Skip to content

Commit

Permalink
fix portions cleanup (#13290)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 authored Jan 11, 2025
1 parent ee8a9c6 commit 2b30a70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ydb/core/tx/columnshard/engines/changes/cleanup_portions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ void TCleanupPortionsColumnEngineChanges::DoWriteIndexOnExecute(NColumnShard::TC
auto schemaPtr = context.EngineLogs.GetVersionedIndex().GetLastSchema();

THashMap<TString, THashSet<TUnifiedBlobId>> blobIdsByStorage;
for (auto&& [_, p] : FetchedDataAccessors->GetPortions()) {
p.RemoveFromDatabase(context.DBWrapper);
p.FillBlobIdsByStorage(blobIdsByStorage, context.EngineLogs.GetVersionedIndex());
pathIds.emplace(p.GetPortionInfo().GetPathId());

for (auto&& p : PortionsToDrop) {
const auto& accessor = FetchedDataAccessors->GetPortionAccessorVerified(p->GetPortionId());
accessor.RemoveFromDatabase(context.DBWrapper);
accessor.FillBlobIdsByStorage(blobIdsByStorage, context.EngineLogs.GetVersionedIndex());
pathIds.emplace(p->GetPathId());
}
for (auto&& i : blobIdsByStorage) {
auto action = BlobsAction.GetRemoving(i.first);
Expand Down
1 change: 1 addition & 0 deletions ydb/core/tx/columnshard/engines/changes/cleanup_portions.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class TCleanupPortionsColumnEngineChanges: public TColumnEngineChanges,

void AddPortionToRemove(const TPortionInfo::TConstPtr& portion) {
PortionsToRemove.AddPortion(portion);
PortionsToAccess->AddPortion(portion);
}

virtual ui32 GetWritePortionsCount() const override {
Expand Down

0 comments on commit 2b30a70

Please sign in to comment.