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.
This commit is contained in:
rachithrr 2022-07-27 11:47:52 -05:00 committed by GitHub
parent 89159134a4
commit d627ee46cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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