@@ -452,12 +452,21 @@ var (
452
452
settings .SystemVisible ,
453
453
"storage.value_separation.compaction_garbage_threshold" ,
454
454
"the max garbage threshold configures the percentage of unreferenced value " +
455
- "bytes that trigger blob-file rewrite compactions; 100 disables these compactions" ,
455
+ "bytes that begin to trigger blob-file rewrite compactions; 100 disables these compactions" ,
456
456
int64 (metamorphic .ConstantWithTestRange ("storage.value_separation.compaction_garbage_threshold" ,
457
457
10 , /* default */
458
458
1 /* min */ , 80 /* max */ )),
459
459
settings .IntInRange (1 , 100 ),
460
460
)
461
+ valueSeparationCompactionGarbageThresholdHighPriority = settings .RegisterIntSetting (
462
+ settings .SystemVisible ,
463
+ "storage.value_separation.compaction_garbage_threshold_high_priority" ,
464
+ "configures the percentage of unreferenced value bytes that trigger high-priority blob-file rewrite compactions" ,
465
+ int64 (metamorphic .ConstantWithTestRange ("storage.value_separation.compaction_garbage_threshold" ,
466
+ 20 , /* default */
467
+ 1 /* min */ , 80 /* max */ )),
468
+ settings .IntInRange (1 , 100 ),
469
+ )
461
470
)
462
471
463
472
// EngineComparer is a pebble.Comparer object that implements MVCC-specific
@@ -936,12 +945,16 @@ func newPebble(ctx context.Context, cfg engineConfig) (p *Pebble, err error) {
936
945
if ! valueSeparationEnabled .Get (& cfg .settings .SV ) {
937
946
return pebble.ValueSeparationPolicy {}
938
947
}
948
+ lowPri := float64 (valueSeparationCompactionGarbageThreshold .Get (& cfg .settings .SV )) / 100.0
949
+ highPri := float64 (valueSeparationCompactionGarbageThresholdHighPriority .Get (& cfg .settings .SV )) / 100.0
950
+ highPri = max (highPri , lowPri )
939
951
return pebble.ValueSeparationPolicy {
940
- Enabled : true ,
941
- MinimumSize : int (valueSeparationMinimumSize .Get (& cfg .settings .SV )),
942
- MaxBlobReferenceDepth : int (valueSeparationMaxReferenceDepth .Get (& cfg .settings .SV )),
943
- RewriteMinimumAge : valueSeparationRewriteMinimumAge .Get (& cfg .settings .SV ),
944
- TargetGarbageRatio : float64 (valueSeparationCompactionGarbageThreshold .Get (& cfg .settings .SV )) / 100.0 ,
952
+ Enabled : true ,
953
+ MinimumSize : int (valueSeparationMinimumSize .Get (& cfg .settings .SV )),
954
+ MaxBlobReferenceDepth : int (valueSeparationMaxReferenceDepth .Get (& cfg .settings .SV )),
955
+ RewriteMinimumAge : valueSeparationRewriteMinimumAge .Get (& cfg .settings .SV ),
956
+ GarbageRatioLowPriority : lowPri ,
957
+ GarbageRatioHighPriority : highPri ,
945
958
}
946
959
}
947
960
cfg .opts .Experimental .MultiLevelCompactionHeuristic = func () pebble.MultiLevelHeuristic {
0 commit comments