File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -265,9 +265,7 @@ func GC(
265
265
// Check if optional GC hint on the range is expired (e.g. delete operation is
266
266
// older than GC threshold) and remove it. Otherwise this range could be
267
267
// unnecessarily GC'd with high priority again.
268
- // We should only do that when we are doing actual cleanup as we want to have
269
- // a hint when request is being handled.
270
- if len (args .Keys ) != 0 || len (args .RangeKeys ) != 0 || args .ClearRange != nil {
268
+ {
271
269
sl := MakeStateLoader (cArgs .EvalCtx )
272
270
hint , err := sl .LoadGCHint (ctx , readWriter )
273
271
if err != nil {
Original file line number Diff line number Diff line change @@ -783,6 +783,12 @@ func (mgcq *mvccGCQueue) process(
783
783
if scoreAfter .ShouldQueue {
784
784
// The scores are very long, so splitting into multiple lines manually for
785
785
// readability.
786
+ //
787
+ // NB: there are likely situations in which this check triggers incorrectly,
788
+ // for example when the GC hint triggers GC but a protected timestamp
789
+ // prevents the GC threshold from advancing. In that case, not only did we
790
+ // run a GC cycle without improving anything, but we also pile up a stats
791
+ // recomputation. This is hopefully too rare to matter.
786
792
log .Dev .Infof (ctx , "GC still needed following GC, recomputing MVCC stats" )
787
793
log .Dev .Infof (ctx , "old score %s" , r )
788
794
log .Dev .Infof (ctx , "new score %s" , scoreAfter )
You can’t perform that action at this time.
0 commit comments