mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Completely drop empty blocks
This commit is contained in:
parent
39df7e2bba
commit
d2673d8659
|
@ -200,6 +200,11 @@ func (c *compactor) Compact(dirs ...string) (err error) {
|
|||
}
|
||||
|
||||
func (c *compactor) Write(b Block) error {
|
||||
// Buffering blocks might have been created that often have no data.
|
||||
if b.Meta().Stats.NumSeries == 0 {
|
||||
return errors.Wrap(os.RemoveAll(b.Dir()), "remove empty block")
|
||||
}
|
||||
|
||||
entropy := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
uid := ulid.MustNew(ulid.Now(), entropy)
|
||||
|
||||
|
|
Loading…
Reference in a new issue