Skip to content

Commit

Permalink
Support shredding in VDisk (#14332)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvru authored Feb 7, 2025
1 parent 7500dad commit 178ae52
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions ydb/core/blobstorage/vdisk/hullop/blobstorage_buildslice.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,22 @@ namespace NKikimr {
// create a new slice
TLevelSlicePtr res(new TLevelSlice(settings, slice->Ctx));

// assign VolatileOrderId for any new SSTables at level 0 to allow merging them to level 0 below
{
for (auto it = addIt; it.Valid(); it.Next()) {
if (const auto& table = it.Get(); !table.Level) {
const ui64 prev = std::exchange(table.SstPtr->VolatileOrderId, ++slice->Ctx->VolatileOrderId);
Y_ABORT_UNLESS(prev == 0);
} else { // items are sorted in ascending order of Level
break;
}
}
}

ui32 levelsSize = slice->SortedLevels.size();
if (ctask.Action == NHullComp::ActCompactSsts &&
ctask.CompactSsts.TargetLevel != ui32(-1) &&
ctask.CompactSsts.TargetLevel > levelsSize) {
// resize levels
levelsSize = ctask.CompactSsts.TargetLevel;
if (ctask.Action == NHullComp::ActCompactSsts) {
Y_ABORT_UNLESS(ctask.CompactSsts.TargetLevel != (ui32)-1);
levelsSize = Max(levelsSize, ctask.CompactSsts.TargetLevel); // levelsSize is size of sorted levels, excluding level 0
}

res->SortedLevels.reserve(levelsSize);
Expand Down

0 comments on commit 178ae52

Please sign in to comment.