Skip to content

Commit

Permalink
core_sched use the new rpc names
Browse files Browse the repository at this point in the history
  • Loading branch information
langmartin committed Jun 26, 2019
1 parent 15a9a11 commit 143e66d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nomad/core_sched.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ OUTER:
}

func (c *CoreScheduler) nodeReap(eval *structs.Evaluation, nodeIDs []string) error {
// For pre 0.9.3 clusters, send single deregistration messages
version, _ := version.NewVersion("0.9.3")
if !ServersMeetMinimumVersion(c.srv.Members(), version, true) {
// For old clusters, send single deregistration messages
minVersionBatchNodeDeregister := version.Must(version.NewVersion("0.9.4"))
if !ServersMeetMinimumVersion(c.srv.Members(), minVersionBatchNodeDeregister, true) {
for _, id := range nodeIDs {
req := structs.NodeDeregisterRequest{
NodeID: id,
Expand All @@ -509,15 +509,15 @@ func (c *CoreScheduler) nodeReap(eval *structs.Evaluation, nodeIDs []string) err

// Call to the leader to issue the reap
for _, ids := range partitionAll(maxIdsPerReap, nodeIDs) {
req := structs.NodeDeregisterRequest{
req := structs.NodeDeregisterBatchRequest{
NodeIDs: ids,
WriteRequest: structs.WriteRequest{
Region: c.srv.config.Region,
AuthToken: eval.LeaderACL,
},
}
var resp structs.NodeUpdateResponse
if err := c.srv.RPC("Node.Deregister", &req, &resp); err != nil {
if err := c.srv.RPC("Node.DeregisterBatch", &req, &resp); err != nil {
c.logger.Error("node reap failed", "node_ids", ids, "error", err)
return err
}
Expand Down

0 comments on commit 143e66d

Please sign in to comment.