mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-12 23:51:03 +00:00
add lock on cluster.OwnsShard
This commit is contained in:
parent
97ba8771bc
commit
33b54c68d5
1 changed files with 2 additions and 0 deletions
|
|
@ -851,6 +851,8 @@ func (c *cluster) shardNodes(index string, shard uint64) []*Node {
|
|||
|
||||
// ownsShard returns true if a host owns a fragment.
|
||||
func (c *cluster) ownsShard(nodeID string, index string, shard uint64) bool {
|
||||
c.mu.RLock()
|
||||
defer c.mu.RUnlock()
|
||||
return Nodes(c.shardNodes(index, shard)).ContainsID(nodeID)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue