From 8ad6e1726523475011fd02c3a596ae0cc847c329 Mon Sep 17 00:00:00 2001 From: Jeffrey Smith II Date: Thu, 9 Feb 2023 09:10:25 -0500 Subject: [PATCH] chore: add additional error logging when deleting shard (#24038) * chore: add additional error logging when deleting shard * chore: better logging message --- tsdb/store.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tsdb/store.go b/tsdb/store.go index 0d37fd1309..1b8ad7f230 100644 --- a/tsdb/store.go +++ b/tsdb/store.go @@ -803,7 +803,7 @@ func (s *Store) DeleteShard(shardID uint64) error { ss := index.SeriesIDSet() - s.walkShards(shards, func(sh *Shard) error { + err = s.walkShards(shards, func(sh *Shard) error { index, err := sh.Index() if err != nil { return err @@ -813,13 +813,20 @@ func (s *Store) DeleteShard(shardID uint64) error { return nil }) + if err != nil { + s.Logger.Error("error walking shards during DeleteShard operation", zap.Error(err)) + } + // Remove any remaining series in the set from the series file, as they don't // exist in any of the database's remaining shards. if ss.Cardinality() > 0 { sfile := s.seriesFile(db) if sfile != nil { ss.ForEach(func(id uint64) { - sfile.DeleteSeriesID(id) + err = sfile.DeleteSeriesID(id) + if err != nil { + s.Logger.Error("error deleting series id during DeleteShard operation", zap.Uint64("id", id), zap.Error(err)) + } }) }