Skip to content

Commit 629283b

Browse files
authored
Merge 98287c7 into 11a5577
2 parents 11a5577 + 98287c7 commit 629283b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

ydb/core/blobstorage/vdisk/hulldb/generic/hullds_idx.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace NKikimr {
1717
case StateCompPolicyAtWork: return "Policy At Work";
1818
case StateCompInProgress: return "Compaction In Progress";
1919
case StateWaitCommit: return "Committing";
20+
case StateWaitPreCompact: return "Waiting Huge Blob Pre-compaction";
2021
default: return "UNKNOWN";
2122
}
2223
}

ydb/core/blobstorage/vdisk/hulldb/generic/hullds_idx.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ namespace NKikimr {
2121
StateNoComp = 0, // default initial state
2222
StateCompPolicyAtWork, // compaction policy is working
2323
StateCompInProgress, // level compaction
24-
StateWaitCommit // wait for commit to disk
24+
StateWaitCommit, // wait for commit to disk
25+
StateWaitPreCompact, // wait for huge blob precompaction
2526
};
2627

2728
static const char *LevelCompStateToStr(ELevelCompState s);

ydb/core/blobstorage/vdisk/hullop/blobstorage_hullactor.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,17 @@ namespace NKikimr {
273273
if (CompactionTask->GetHugeBlobsToDelete().Empty()) {
274274
ApplyCompactionResult(ctx, {}, {}, 0);
275275
} else {
276+
// switch compaction state to pre-compaction to block any attempts of concurrent compaction
277+
RTCtx->LevelIndex->SetCompState(TLevelIndexBase::StateWaitPreCompact);
278+
276279
const ui64 cookie = NextPreCompactCookie++;
277280
LOG_DEBUG_S(ctx, NKikimrServices::BS_HULLCOMP, HullDs->HullCtx->VCtx->VDiskLogPrefix
278281
<< "requesting PreCompact for ActDeleteSsts");
279282
ctx.Send(HullLogCtx->HugeKeeperId, new TEvHugePreCompact, 0, cookie);
280283
PreCompactCallbacks.emplace(cookie, [this, ev](ui64 wId, const TActorContext& ctx) mutable {
284+
Y_ABORT_UNLESS(RTCtx->LevelIndex->GetCompState() == TLevelIndexBase::StateWaitPreCompact);
285+
RTCtx->LevelIndex->SetCompState(TLevelIndexBase::StateNoComp);
286+
281287
Y_ABORT_UNLESS(wId);
282288
LOG_DEBUG_S(ctx, NKikimrServices::BS_HULLCOMP, HullDs->HullCtx->VCtx->VDiskLogPrefix
283289
<< "got PreCompactResult for ActDeleteSsts, wId# " << wId);

0 commit comments

Comments
 (0)