@@ -374,6 +374,21 @@ var (
374
374
int64 (metamorphic .ConstantWithTestRange ("storage.value_separation.max_reference_depth" , 10 /* default */ , 2 , 20 )),
375
375
settings .IntWithMinimum (2 ),
376
376
)
377
+ valueSeparationRewriteMinimumAge = settings .RegisterDurationSetting (
378
+ settings .SystemVisible ,
379
+ "storage.value_separation.rewrite_minimum_age" ,
380
+ "the minimum age of a blob file before it is eligible for a rewrite compaction" ,
381
+ 5 * time .Minute , // 5 minutes
382
+ settings .DurationWithMinimum (0 ),
383
+ )
384
+ valueSeparationCompactionGarbageThreshold = settings .RegisterIntSetting (
385
+ settings .SystemVisible ,
386
+ "storage.value_separation.compaction_garbage_threshold" ,
387
+ "the max garbage threshold configures the percentage of unreferenced value " +
388
+ "bytes that trigger blob-file rewrite compactions; 100 disables these compactions" ,
389
+ 100 , /* default; disables blob-file rewrites */
390
+ settings .IntInRange (1 , 100 ),
391
+ )
377
392
)
378
393
379
394
// EngineComparer is a pebble.Comparer object that implements MVCC-specific
@@ -848,8 +863,8 @@ func newPebble(ctx context.Context, cfg engineConfig) (p *Pebble, err error) {
848
863
Enabled : true ,
849
864
MinimumSize : int (valueSeparationMinimumSize .Get (& cfg .settings .SV )),
850
865
MaxBlobReferenceDepth : int (valueSeparationMaxReferenceDepth .Get (& cfg .settings .SV )),
851
- RewriteMinimumAge : time . Minute ,
852
- TargetGarbageRatio : 1.0 , // Disable blob file rewrites
866
+ RewriteMinimumAge : valueSeparationRewriteMinimumAge . Get ( & cfg . settings . SV ) ,
867
+ TargetGarbageRatio : float64 ( valueSeparationCompactionGarbageThreshold . Get ( & cfg . settings . SV )) / 100.0 ,
853
868
}
854
869
}
855
870
0 commit comments