Skip to content

Commit 2b30a70

Browse files
fix portions cleanup (#13290)
1 parent ee8a9c6 commit 2b30a70

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

ydb/core/tx/columnshard/engines/changes/cleanup_portions.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ void TCleanupPortionsColumnEngineChanges::DoWriteIndexOnExecute(NColumnShard::TC
2929
auto schemaPtr = context.EngineLogs.GetVersionedIndex().GetLastSchema();
3030

3131
THashMap<TString, THashSet<TUnifiedBlobId>> blobIdsByStorage;
32-
for (auto&& [_, p] : FetchedDataAccessors->GetPortions()) {
33-
p.RemoveFromDatabase(context.DBWrapper);
34-
p.FillBlobIdsByStorage(blobIdsByStorage, context.EngineLogs.GetVersionedIndex());
35-
pathIds.emplace(p.GetPortionInfo().GetPathId());
32+
33+
for (auto&& p : PortionsToDrop) {
34+
const auto& accessor = FetchedDataAccessors->GetPortionAccessorVerified(p->GetPortionId());
35+
accessor.RemoveFromDatabase(context.DBWrapper);
36+
accessor.FillBlobIdsByStorage(blobIdsByStorage, context.EngineLogs.GetVersionedIndex());
37+
pathIds.emplace(p->GetPathId());
3638
}
3739
for (auto&& i : blobIdsByStorage) {
3840
auto action = BlobsAction.GetRemoving(i.first);

ydb/core/tx/columnshard/engines/changes/cleanup_portions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class TCleanupPortionsColumnEngineChanges: public TColumnEngineChanges,
6868

6969
void AddPortionToRemove(const TPortionInfo::TConstPtr& portion) {
7070
PortionsToRemove.AddPortion(portion);
71+
PortionsToAccess->AddPortion(portion);
7172
}
7273

7374
virtual ui32 GetWritePortionsCount() const override {

0 commit comments

Comments
 (0)