mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
fixed deadlock in setcooridnator
This commit is contained in:
parent
e50b2aee24
commit
a436d4d32a
1 changed files with 2 additions and 2 deletions
|
|
@ -307,16 +307,16 @@ func (c *Cluster) isCoordinator() bool {
|
|||
// nodes with its version of Cluster.Status.
|
||||
func (c *Cluster) SetCoordinator(n *Node) error {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
// Verify that the new Coordinator value matches
|
||||
// this node.
|
||||
if c.Node.ID != n.ID {
|
||||
c.mu.Unlock()
|
||||
return fmt.Errorf("coordinator node does not match this node")
|
||||
}
|
||||
|
||||
// Update IsCoordinator on all nodes (locally).
|
||||
_ = c.updateCoordinator(n)
|
||||
|
||||
c.mu.Unlock()
|
||||
// Send the update coordinator message to all nodes.
|
||||
err := c.Broadcaster.SendSync(
|
||||
&internal.UpdateCoordinatorMessage{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue