remove some dead code related to coordinator

This commit is contained in:
Travis 2021-02-02 15:59:36 -06:00
parent c45e21640c
commit 4c1d94da14
No known key found for this signature in database
GPG key ID: 37080CC2042BA34E
3 changed files with 0 additions and 28 deletions

View file

@ -64,8 +64,6 @@ const (
messageTypeClusterStatus
messageTypeResizeInstruction
messageTypeResizeInstructionComplete
messageTypeSetCoordinator
messageTypeUpdateCoordinator
messageTypeNodeState
messageTypeRecalculateCaches
messageTypeNodeEvent

View file

@ -214,23 +214,6 @@ func (c *cluster) unprotectedIsCoordinator() bool {
return snap.PrimaryFieldTranslationNode().ID == c.Node.ID
}
// setCoordinator tells the current node to become the
// Coordinator. In response to this, the current node
// will consider itself coordinator and update the other
// nodes with its version of Cluster.Status.
func (c *cluster) setCoordinator(n *topology.Node) error {
c.mu.Lock()
defer c.mu.Unlock()
// Verify that the new Coordinator value matches
// this node.
if c.Node.ID != n.ID {
return fmt.Errorf("coordinator node does not match this node")
}
// Broadcast cluster status.
return c.unprotectedSendSync(c.unprotectedStatus())
}
// unprotectedSendSync is used in place of c.broadcaster.SendSync (which is
// Server.SendSync) because Server.SendSync needs to obtain a cluster lock to
// get the list of nodes. TODO: the reference loop from

View file

@ -2028,15 +2028,6 @@ func parseUint64Slice(s string) ([]uint64, error) {
return a, nil
}
type setCoordinatorRequest struct {
ID string `json:"id"`
}
type setCoordinatorResponse struct {
Old *topology.Node `json:"old"`
New *topology.Node `json:"new"`
}
// handlePostClusterResizeRemoveNode handles POST /cluster/resize/remove-node request.
func (h *Handler) handlePostClusterResizeRemoveNode(w http.ResponseWriter, r *http.Request) {
if !validHeaderAcceptJSON(r.Header) {