Skip to content

Commit

Permalink
feat(scyllaclient): return error on 0 host shard count
Browse files Browse the repository at this point in the history
This shouldn't be possible, but we can still validate that.
  • Loading branch information
Michal-Leszczynski committed Oct 3, 2024
1 parent 88f0523 commit ad0e6de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/scyllaclient/client_scylla.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ func (c *Client) HostsShardCount(ctx context.Context, hosts []string) (map[strin

out := make(map[string]uint)
for i, h := range hosts {
if shards[i] == 0 {
return nil, errors.Errorf("host %s reported 0 shard count", h)
}
out[h] = shards[i]
}
return out, nil
Expand Down

0 comments on commit ad0e6de

Please sign in to comment.