From d627ee46cbbe049a100e3e11ce38e327d4dd25aa Mon Sep 17 00:00:00 2001 From: rachithrr Date: Wed, 27 Jul 2022 11:47:52 -0500 Subject: [PATCH] FB-1604: view knownshards return nil (#2168) In the logs, I can see that this error occurs when a query is done during the delete view.This fix is only to bypass it and log that data. The real issue is that the delete standard view which should happen only once, is occuring every hour or two. The ingester might be creating the standard views which needs to be fixed. --- field.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/field.go b/field.go index 6b319a7f5..6a0762d58 100644 --- a/field.go +++ b/field.go @@ -433,7 +433,12 @@ func (f *Field) AvailableShards(localOnly bool) *roaring.Bitmap { } else { b = f.remoteAvailableShards.Clone() } - for _, view := range f.viewMap { + for viewname, view := range f.viewMap { + availableShards := view.availableShards() + if availableShards == nil || availableShards.Containers == nil { + f.holder.Logger.Warnf("empty available shards for view: %s on field %s available shards: %v", viewname, f.name, availableShards) + continue + } b.UnionInPlace(view.availableShards()) } return b