mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-09 06:31:02 +00:00
rename cluster.coordinatorNode to unprotectedCoordinatorNode
This commit is contained in:
parent
4aa57f56a4
commit
8b2d8295d1
1 changed files with 5 additions and 5 deletions
10
cluster.go
10
cluster.go
|
|
@ -233,8 +233,8 @@ func newCluster() *cluster {
|
|||
}
|
||||
}
|
||||
|
||||
// coordinatorNode returns the coordinator node.
|
||||
func (c *cluster) coordinatorNode() *Node {
|
||||
// unprotectedCoordinatorNode returns the coordinator node.
|
||||
func (c *cluster) unprotectedCoordinatorNode() *Node {
|
||||
return c.unprotectedNodeByID(c.Coordinator)
|
||||
}
|
||||
|
||||
|
|
@ -428,7 +428,7 @@ func (c *cluster) setNodeState(state string) error { // nolint: unparam
|
|||
}
|
||||
|
||||
c.logger.Printf("Sending State %s (%s)", state, c.Coordinator)
|
||||
if err := c.sendTo(c.coordinatorNode(), ns); err != nil {
|
||||
if err := c.sendTo(c.unprotectedCoordinatorNode(), ns); err != nil {
|
||||
return fmt.Errorf("sending node state error: err=%s", err)
|
||||
}
|
||||
|
||||
|
|
@ -1101,7 +1101,7 @@ func (c *cluster) generateResizeJobByAction(nodeAction nodeAction) (*resizeJob,
|
|||
instr := &ResizeInstruction{
|
||||
JobID: j.ID,
|
||||
Node: toCluster.unprotectedNodeByID(id),
|
||||
Coordinator: c.coordinatorNode(),
|
||||
Coordinator: c.unprotectedCoordinatorNode(),
|
||||
Sources: sources,
|
||||
Schema: &Schema{Indexes: c.holder.Schema()}, // Include the schema to ensure it's in sync on the receiving node.
|
||||
ClusterStatus: c.Status(),
|
||||
|
|
@ -1629,7 +1629,7 @@ func (c *cluster) nodeJoin(node *Node) error {
|
|||
func (c *cluster) nodeLeave(node *Node) error {
|
||||
// Refuse the request if this is not the coordinator.
|
||||
if !c.isCoordinator() {
|
||||
return fmt.Errorf("node removal requests are only valid on the coordinator node: %s", c.coordinatorNode().ID)
|
||||
return fmt.Errorf("node removal requests are only valid on the coordinator node: %s", c.unprotectedCoordinatorNode().ID)
|
||||
}
|
||||
|
||||
if c.State() != ClusterStateNormal {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue