@@ -48,19 +48,20 @@ namespace NKikimr {
4848 bool HugeHeapDefragmentationRequired (
4949 const TOutOfSpaceState& oos,
5050 ui32 hugeCanBeFreedChunks,
51- ui32 hugeTotalChunks) {
51+ ui32 hugeTotalChunks,
52+ double defaultPercent) {
5253
5354 if (hugeCanBeFreedChunks < 10 )
5455 return false ;
5556
5657 double percentOfGarbage = static_cast <double >(hugeCanBeFreedChunks) / hugeTotalChunks;
5758
5859 if (oos.GetLocalColor () > TSpaceColor::CYAN) {
59- return percentOfGarbage >= 0.02 ;
60+ return percentOfGarbage >= Min ( 0.02 , defaultPercent) ;
6061 } else if (oos.GetLocalColor () > TSpaceColor::GREEN) {
61- return percentOfGarbage >= 0.15 ;
62+ return percentOfGarbage >= Min ( 0.15 , defaultPercent) ;
6263 } else {
63- return percentOfGarbage >= 0.30 ;
64+ return percentOfGarbage >= Min ( 0.30 , defaultPercent) ;
6465 }
6566 }
6667
@@ -113,7 +114,8 @@ namespace NKikimr {
113114 const auto & oos = DCtx->VCtx ->GetOutOfSpaceState ();
114115 Y_ABORT_UNLESS (usefulChunks <= totalChunks);
115116 const ui32 canBeFreedChunks = totalChunks - usefulChunks;
116- if (HugeHeapDefragmentationRequired (oos, canBeFreedChunks, totalChunks)) {
117+ double defaultPercent = DCtx->VCtx ->DefaultHugeGarbagePerMille / 1000.0 ;
118+ if (HugeHeapDefragmentationRequired (oos, canBeFreedChunks, totalChunks, defaultPercent)) {
117119 TChunksToDefrag chunksToDefrag = calcStat.GetChunksToDefrag (DCtx->MaxChunksToDefrag );
118120 Y_ABORT_UNLESS (chunksToDefrag);
119121 STLOG (PRI_INFO, BS_VDISK_DEFRAG, BSVDD03, VDISKP (DCtx->VCtx ->VDiskLogPrefix , " scan finished" ),
0 commit comments