Skip to content

Commit

Permalink
Merge 4ca77b7 into 4f93432
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 authored Jul 14, 2024
2 parents 4f93432 + 4ca77b7 commit ab3aeea
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions ydb/core/tx/columnshard/blobs_action/abstract/blob_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,11 +573,11 @@ class TBlobsCategories {
void AddSharing(const TTabletId tabletId, const TUnifiedBlobId& id) {
AFL_VERIFY(Sharing.Add(tabletId, id));
}
void RemoveSharing(const TTabletId tabletId, const TUnifiedBlobId& id) {
Y_UNUSED(Sharing.Remove(tabletId, id));
[[nodiscard]] bool RemoveSharing(const TTabletId tabletId, const TUnifiedBlobId& id) {
return Sharing.Remove(tabletId, id);
}
void RemoveBorrowed(const TTabletId tabletId, const TUnifiedBlobId& id) {
Y_UNUSED(Borrowed.Remove(tabletId, id));
[[nodiscard]] bool RemoveBorrowed(const TTabletId tabletId, const TUnifiedBlobId& id) {
return Borrowed.Remove(tabletId, id);
}
TBlobsCategories(const TTabletId selfTabletId)
: SelfTabletId(selfTabletId)
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/columnshard/blobs_action/abstract/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class IBlobsGCAction: public ICommonBlobsAction {
virtual bool DoIsEmpty() const = 0;
public:
void AddSharedBlobToNextIteration(const TUnifiedBlobId& blobId, const TTabletId ownerTabletId) {
BlobsToRemove.RemoveSharing(ownerTabletId, blobId);
AFL_VERIFY(BlobsToRemove.RemoveBorrowed(ownerTabletId, blobId));
}

void OnExecuteTxAfterCleaning(NColumnShard::TColumnShard& self, TBlobManagerDb& dbBlobs);
Expand Down
10 changes: 7 additions & 3 deletions ydb/core/tx/columnshard/columnshard_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,9 +1072,13 @@ void TColumnShard::Handle(TAutoPtr<TEventHandle<NOlap::NBackground::TEvExecuteGe
void TColumnShard::Handle(NOlap::NBlobOperations::NEvents::TEvDeleteSharedBlobs::TPtr& ev, const TActorContext& ctx) {
if (SharingSessionsManager->IsSharingInProgress()) {
ctx.Send(NActors::ActorIdFromProto(ev->Get()->Record.GetSourceActorId()),
new NOlap::NBlobOperations::NEvents::TEvDeleteSharedBlobsFinished((NOlap::TTabletId)TabletID(),
NKikimrColumnShardBlobOperationsProto::TEvDeleteSharedBlobsFinished::DestinationCurrenlyLocked));
AFL_DEBUG(NKikimrServices::TX_COLUMNSHARD)("event", "sharing_in_progress");
new NOlap::NBlobOperations::NEvents::TEvDeleteSharedBlobsFinished(
(NOlap::TTabletId)TabletID(), NKikimrColumnShardBlobOperationsProto::TEvDeleteSharedBlobsFinished::DestinationCurrenlyLocked));
for (auto&& i : ev->Get()->Record.GetBlobIds()) {
AFL_DEBUG(NKikimrServices::TX_COLUMNSHARD_BLOBS)("event", "sharing_in_progress")("blob_id", i)(
"from_tablet", ev->Get()->Record.GetSourceTabletId());
}

return;
}

Expand Down
4 changes: 2 additions & 2 deletions ydb/core/tx/columnshard/hooks/testing/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ void TController::CheckInvariants(const ::NKikimr::NColumnShard::TColumnShard& s
const NOlap::TTabletsByBlob blobs = manager->GetBlobsToDelete();
for (auto b = blobs.GetIterator(); b.IsValid(); ++b) {
Cerr << shard.TabletID() << " SHARING_REMOVE_LOCAL:" << b.GetBlobId().ToStringNew() << " FROM " << b.GetTabletId() << Endl;
i.second.RemoveSharing(b.GetTabletId(), b.GetBlobId());
Y_UNUSED(i.second.RemoveSharing(b.GetTabletId(), b.GetBlobId()));
}
for (auto b = blobs.GetIterator(); b.IsValid(); ++b) {
Cerr << shard.TabletID() << " BORROWED_REMOVE_LOCAL:" << b.GetBlobId().ToStringNew() << " FROM " << b.GetTabletId() << Endl;
i.second.RemoveBorrowed(b.GetTabletId(), b.GetBlobId());
Y_UNUSED(i.second.RemoveBorrowed(b.GetTabletId(), b.GetBlobId()));
}
}
context.AddCategories(shard.TabletID(), std::move(shardBlobsCategories));
Expand Down

0 comments on commit ab3aeea

Please sign in to comment.