From 4c1d94da14fc4f2c101d8a68e7597067b83fec12 Mon Sep 17 00:00:00 2001 From: Travis Date: Tue, 2 Feb 2021 15:59:36 -0600 Subject: [PATCH] remove some dead code related to coordinator --- broadcast.go | 2 -- cluster.go | 17 ----------------- http/handler.go | 9 --------- 3 files changed, 28 deletions(-) diff --git a/broadcast.go b/broadcast.go index 7553d04af..fad0b391d 100644 --- a/broadcast.go +++ b/broadcast.go @@ -64,8 +64,6 @@ const ( messageTypeClusterStatus messageTypeResizeInstruction messageTypeResizeInstructionComplete - messageTypeSetCoordinator - messageTypeUpdateCoordinator messageTypeNodeState messageTypeRecalculateCaches messageTypeNodeEvent diff --git a/cluster.go b/cluster.go index e8dcbf168..77a54f2ab 100644 --- a/cluster.go +++ b/cluster.go @@ -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 diff --git a/http/handler.go b/http/handler.go index 22fdce54a..9e674d497 100644 --- a/http/handler.go +++ b/http/handler.go @@ -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) {