diff --git a/nomad/client_endpoint.go b/nomad/client_endpoint.go index 0b3ffc672..412c57ad3 100644 --- a/nomad/client_endpoint.go +++ b/nomad/client_endpoint.go @@ -235,6 +235,8 @@ func (c *Client) createNodeEvals(nodeID string, nodeIndex uint64) ([]string, uin } // Commit this evaluation via Raft + // XXX: There is a risk of partial failure where the node update succeeds + // but that the EvalUpdate does not. _, evalIndex, err := c.srv.raftApply(structs.EvalUpdateRequestType, update) if err != nil { return nil, 0, err diff --git a/nomad/job_endpoint.go b/nomad/job_endpoint.go index bdf12e137..1e9593699 100644 --- a/nomad/job_endpoint.go +++ b/nomad/job_endpoint.go @@ -67,6 +67,8 @@ func (j *Job) Register(args *structs.JobRegisterRequest, reply *structs.JobRegis } // Commit this evaluation via Raft + // XXX: There is a risk of partial failure where the JobRegister succeeds + // but that the EvalUpdate does not. _, evalIndex, err := j.srv.raftApply(structs.EvalUpdateRequestType, update) if err != nil { j.srv.logger.Printf("[ERR] nomad.job: Eval create failed: %v", err) diff --git a/nomad/plan_apply.go b/nomad/plan_apply.go index 24f96eda6..8b51f2bb8 100644 --- a/nomad/plan_apply.go +++ b/nomad/plan_apply.go @@ -154,6 +154,8 @@ func evaluateNodePlan(snap *state.StateSnapshot, plan *structs.Plan, nodeID stri } // If the node does not exist or is not ready for schduling it is not fit + // XXX: There is a potential race between when we do this check and when + // the Raft commit happens. if node == nil || node.Status != structs.NodeStatusReady { return false, nil }