diff --git a/tsdb/store.go b/tsdb/store.go index 82e72c52299..c5073b785be 100644 --- a/tsdb/store.go +++ b/tsdb/store.go @@ -567,14 +567,13 @@ func (s *Store) loadShards() error { loader := s.newShardLoader(sh.id, sh.db, sh.rp, false, withIndexVersion(indexVersion)) // Now perform the actual loading in parallel in separate goroutines. - go func() { + go func(log *zap.Logger) { t.Take() defer t.Release() - log := log.With(logger.Shard(sh.id), zap.String("path", loader.path)) start := time.Now() res := loader.Load() - if res.err != nil { + if res.err == nil { log.Info("Opened shard", zap.String("index_version", res.s.IndexType()), zap.Duration("duration", time.Since(start))) } else { log.Error("Failed to open shard", zap.Error(res.err)) @@ -584,7 +583,7 @@ func (s *Store) loadShards() error { if s.startupProgressMetrics != nil { s.startupProgressMetrics.CompletedShard() } - }() + }(log.With(logger.Shard(sh.id), zap.String("path", loader.path))) } // Register shards serially as the parallel goroutines finish opening them.