Skip to content

Commit

Permalink
Revert "Backport of core: Add client scheduling eligibility to heartb…
Browse files Browse the repository at this point in the history
…eat into release/1.1.x (#14510)" (#14569)

This reverts commit a2fa740.
  • Loading branch information
angrycub authored Sep 13, 2022
1 parent b756b2c commit 90f9e33
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 23 deletions.
3 changes: 0 additions & 3 deletions .changelog/14483.txt

This file was deleted.

8 changes: 0 additions & 8 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1870,14 +1870,6 @@ func (c *Client) updateNodeStatus() error {
}
}

// Check heartbeat response for information about the server-side scheduling
// state of this node
c.UpdateConfig(func(c *config.Config) {
if resp.SchedulingEligibility != "" {
c.Node.SchedulingEligibility = resp.SchedulingEligibility
}
})

// Update the number of nodes in the cluster so we can adjust our server
// rebalance rate.
c.servers.SetNumNodes(resp.NumNodes)
Expand Down
12 changes: 4 additions & 8 deletions nomad/node_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (n *Node) Register(args *structs.NodeRegisterRequest, reply *structs.NodeUp

n.srv.peerLock.RLock()
defer n.srv.peerLock.RUnlock()
if err := n.constructNodeServerInfoResponse(args.Node.ID, snap, reply); err != nil {
if err := n.constructNodeServerInfoResponse(snap, reply); err != nil {
n.logger.Error("failed to populate NodeUpdateResponse", "error", err)
return err
}
Expand Down Expand Up @@ -258,7 +258,7 @@ func equalDevices(n1, n2 *structs.Node) bool {
}

// updateNodeUpdateResponse assumes the n.srv.peerLock is held for reading.
func (n *Node) constructNodeServerInfoResponse(nodeID string, snap *state.StateSnapshot, reply *structs.NodeUpdateResponse) error {
func (n *Node) constructNodeServerInfoResponse(snap *state.StateSnapshot, reply *structs.NodeUpdateResponse) error {
reply.LeaderRPCAddr = string(n.srv.raft.Leader())

// Reply with config information required for future RPC requests
Expand All @@ -273,10 +273,6 @@ func (n *Node) constructNodeServerInfoResponse(nodeID string, snap *state.StateS
})
}

// Add ClientStatus information to heartbeat response.
node, _ := snap.NodeByID(nil, nodeID)
reply.SchedulingEligibility = node.SchedulingEligibility

// TODO(sean@): Use an indexed node count instead
//
// Snapshot is used only to iterate over all nodes to create a node
Expand Down Expand Up @@ -541,7 +537,7 @@ func (n *Node) UpdateStatus(args *structs.NodeUpdateStatusRequest, reply *struct
reply.Index = index
n.srv.peerLock.RLock()
defer n.srv.peerLock.RUnlock()
if err := n.constructNodeServerInfoResponse(node.GetID(), snap, reply); err != nil {
if err := n.constructNodeServerInfoResponse(snap, reply); err != nil {
n.logger.Error("failed to populate NodeUpdateResponse", "error", err)
return err
}
Expand Down Expand Up @@ -793,7 +789,7 @@ func (n *Node) Evaluate(args *structs.NodeEvaluateRequest, reply *structs.NodeUp

n.srv.peerLock.RLock()
defer n.srv.peerLock.RUnlock()
if err := n.constructNodeServerInfoResponse(node.GetID(), snap, reply); err != nil {
if err := n.constructNodeServerInfoResponse(snap, reply); err != nil {
n.logger.Error("failed to populate NodeUpdateResponse", "error", err)
return err
}
Expand Down
4 changes: 0 additions & 4 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1295,10 +1295,6 @@ type NodeUpdateResponse struct {
// region.
Servers []*NodeServerInfo

// SchedulingEligibility is used to inform clients what the server-side
// has for their scheduling status during heartbeats.
SchedulingEligibility string

QueryMeta
}

Expand Down

0 comments on commit 90f9e33

Please sign in to comment.