Skip to content

Commit

Permalink
Support pre-shred compaction on VDisk (#13973)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvru authored Jan 29, 2025
1 parent 8594d21 commit 6f3c8c9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion ydb/core/blobstorage/pdisk/blobstorage_pdisk.h
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,6 @@ struct TEvShredPDiskResult : TEventLocal<TEvShredPDiskResult, TEvBlobStorage::Ev
// PDisk sends this message to VDisk to ask for full compaction before shredding
struct TEvPreShredCompactVDisk : TEventLocal<TEvPreShredCompactVDisk, TEvBlobStorage::EvPreShredCompactVDisk> {
ui64 ShredGeneration;
std::vector<TChunkIdx> ChunksToShred;

TEvPreShredCompactVDisk(ui64 shredGeneration)
: ShredGeneration(shredGeneration)
Expand Down
13 changes: 11 additions & 2 deletions ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2659,8 +2659,17 @@ namespace NKikimr {
void HandleShred(NPDisk::TEvPreShredCompactVDisk::TPtr ev) {
STLOG(PRI_DEBUG, BS_SHRED, BSSV01, VCtx->VDiskLogPrefix << "processing TEvPreShredCompactVDisk",
(ShredGeneration, ev->Get()->ShredGeneration));
Send(ev->Sender, new NPDisk::TEvPreShredCompactVDiskResult(PDiskCtx->Dsk->Owner, PDiskCtx->Dsk->OwnerRound,
ev->Get()->ShredGeneration, NKikimrProto::OK, TString()), 0, ev->Cookie);

VDiskCompactionState->Setup(TActivationContext::AsActorContext(), LoggedRecsVault.GetLastLsnInFlight(), {
.CompactLogoBlobs = true,
.CompactBlocks = false,
.CompactBarriers = false,
.Mode = TEvCompactVDisk::EMode::FULL,
.ClientId = ev->Sender,
.ClientCookie = ev->Cookie,
.Reply = std::make_unique<NPDisk::TEvPreShredCompactVDiskResult>(PDiskCtx->Dsk->Owner,
PDiskCtx->Dsk->OwnerRound, ev->Get()->ShredGeneration, NKikimrProto::OK, TString()),
});
}

void HandleShred(NPDisk::TEvShredVDisk::TPtr ev) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace NKikimr {
TEvCompactVDisk::EMode Mode;
TActorId ClientId;
ui64 ClientCookie = 0;
std::unique_ptr<TEvCompactVDiskResult> Reply;
std::unique_ptr<IEventBase> Reply;

bool AllDone() const { return !(CompactLogoBlobs || CompactBlocks || CompactBarriers); }
};
Expand Down

0 comments on commit 6f3c8c9

Please sign in to comment.