Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit ca22417

Browse files
committed
fix tracing message. prevent reallocation of availableShards
1 parent d28170d commit ca22417

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ func (api *API) FragmentBlocks(ctx context.Context, indexName, fieldName, viewNa
561561

562562
// FragmentData returns all data in the specified fragment.
563563
func (api *API) FragmentData(ctx context.Context, indexName, fieldName, viewName string, shard uint64) (io.WriterTo, error) {
564-
span, _ := tracing.StartSpanFromContext(ctx, "API.FragmentBlocks")
564+
span, _ := tracing.StartSpanFromContext(ctx, "API.FragmentData")
565565
defer span.Finish()
566566

567567
if err := api.validate(apiFragmentData); err != nil {

cluster.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1840,12 +1840,14 @@ func (c *cluster) nodeStatus() *NodeStatus {
18401840
Node: c.Node,
18411841
Schema: &Schema{Indexes: c.holder.Schema()},
18421842
}
1843+
var availableShards *roaring.Bitmap
18431844
for _, idx := range ns.Schema.Indexes {
18441845
is := &IndexStatus{Name: idx.Name}
18451846
for _, f := range idx.Fields {
1846-
availableShards := roaring.NewBitmap()
18471847
if field := c.holder.Field(idx.Name, f.Name); field != nil {
18481848
availableShards = field.AvailableShards()
1849+
} else {
1850+
availableShards = roaring.NewBitmap()
18491851
}
18501852
is.Fields = append(is.Fields, &FieldStatus{
18511853
Name: f.Name,

0 commit comments

Comments
 (0)