From df62aa6257624d729c124d3f3383d4599dad9c96 Mon Sep 17 00:00:00 2001 From: Linas Medziunas Date: Fri, 15 Jan 2021 09:57:07 +0200 Subject: [PATCH 1/2] [dbnode] Log namespace and shard upon invalid series read/write count --- src/dbnode/storage/shard.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dbnode/storage/shard.go b/src/dbnode/storage/shard.go index 9a5c4398c0..fecdc77e4f 100644 --- a/src/dbnode/storage/shard.go +++ b/src/dbnode/storage/shard.go @@ -860,6 +860,8 @@ func (s *dbShard) purgeExpiredSeries(expiredEntries []*lookup.Entry) { // The contract requires all entries to have count >= 1. if count < 1 { s.logger.Error("purgeExpiredSeries encountered invalid series read/write count", + zap.String("namespace", s.namespace.ID().String()), + zap.Uint32("shard", s.ID()), zap.String("series", series.ID().String()), zap.Int32("readerWriterCount", count)) continue From fc2bef41beee347aacf8848d14108019d5733a79 Mon Sep 17 00:00:00 2001 From: Linas Medziunas Date: Fri, 15 Jan 2021 10:12:30 +0200 Subject: [PATCH 2/2] Use zap.Stringer --- src/dbnode/storage/shard.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dbnode/storage/shard.go b/src/dbnode/storage/shard.go index fecdc77e4f..d5667ef6d5 100644 --- a/src/dbnode/storage/shard.go +++ b/src/dbnode/storage/shard.go @@ -860,9 +860,9 @@ func (s *dbShard) purgeExpiredSeries(expiredEntries []*lookup.Entry) { // The contract requires all entries to have count >= 1. if count < 1 { s.logger.Error("purgeExpiredSeries encountered invalid series read/write count", - zap.String("namespace", s.namespace.ID().String()), + zap.Stringer("namespace", s.namespace.ID()), zap.Uint32("shard", s.ID()), - zap.String("series", series.ID().String()), + zap.Stringer("series", series.ID()), zap.Int32("readerWriterCount", count)) continue }