Skip to content

Commit

Permalink
add compaction to gc
Browse files Browse the repository at this point in the history
  • Loading branch information
brianolson committed Nov 17, 2024
1 parent be9e655 commit 75d29f8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions events/pebblepersist.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,12 @@ func (pp *PebblePersist) GarbageCollect(ctx context.Context) error {
}
sizeAfter, _ := pp.db.EstimateDiskUsage(zeroKey[:], ffffKey[:])
log.Infow("pebble gc", "before", sizeBefore, "after", sizeAfter)
start := time.Now()
err = pp.db.Compact(zeroKey[:], key[:], true)
if err != nil {
log.Warnw("pebble gc compact", "err", err)
}
dt := time.Since(start)
log.Infow("pebble gc compact ok", "dt", dt)
return nil
}

0 comments on commit 75d29f8

Please sign in to comment.