Closed moshaad7 closed 3 weeks ago
Closing it as bitmap Stat collection will also fail in case of a presence of a nil container in it. My apologies for missing this detail
Adding relevant code sections here
// GetCardinality returns the number of integers contained in the bitmap
func (rb *Bitmap) GetCardinality() uint64 {
size := uint64(0)
for _, c := range rb.highlowcontainer.containers {
size += uint64(c.getCardinality())
}
return size
}
// Stats returns details on container type usage in a Statistics struct.
func (rb *Bitmap) Stats() Statistics {
stats := Statistics{}
stats.Containers = uint64(len(rb.highlowcontainer.containers))
for _, c := range rb.highlowcontainer.containers {
stats.Cardinality += uint64(c.getCardinality())
...
}
return stats
}
We couldn't determine the data and operations that lead our bitmap to this situation where once of the container was nil. Adding panic recover method to log bitmap data and stats in order to position us better in case this rare bug strikes again.