From 6240972121307f515818c996841e60368877df1a Mon Sep 17 00:00:00 2001 From: Jason Wilder Date: Mon, 26 Oct 2015 10:37:09 -0600 Subject: [PATCH] Log errors returned from failed compactions --- tsdb/engine/tsm1/tsm1.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tsdb/engine/tsm1/tsm1.go b/tsdb/engine/tsm1/tsm1.go index a7094e3b87..a8efa900b6 100644 --- a/tsdb/engine/tsm1/tsm1.go +++ b/tsdb/engine/tsm1/tsm1.go @@ -204,7 +204,11 @@ func (e *Engine) PerformMaintenance() { } } - go e.Compact(true) + go func() { + if err := e.Compact(true); err != nil { + e.logger.Printf("PerformMaintenance: error during compaction: %v", err) + } + }() } // Format returns the format type of this engine @@ -482,7 +486,11 @@ func (e *Engine) Write(pointsByKey map[string]Values, measurementFieldsToSave ma } if !e.SkipCompaction && e.shouldCompact() { - go e.Compact(false) + go func() { + if err := e.Compact(false); err != nil { + e.logger.Printf("Write: error during compaction: %v", err) + } + }() } return nil