From 88ddfbed312f0c277d180e828aaa82edce430201 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Mon, 22 Feb 2016 22:24:52 -0800 Subject: [PATCH] Revert "Debug messages around the plan and plan response" This reverts commit 7646657e6b8a892210779eaf5708341b94b29b24. --- nomad/plan_apply.go | 4 ---- nomad/plan_endpoint.go | 3 --- nomad/structs/structs.go | 25 ------------------------- nomad/worker.go | 4 ---- 4 files changed, 36 deletions(-) diff --git a/nomad/plan_apply.go b/nomad/plan_apply.go index bfd3400f9..a4056390d 100644 --- a/nomad/plan_apply.go +++ b/nomad/plan_apply.go @@ -58,7 +58,6 @@ func (s *Server) planApply() { if err != nil { return } - s.logger.Printf("[DEBUG] plan_apply: dequeued plan: %#v", pending.plan) // Verify the evaluation is outstanding, and that the tokens match. if err := s.evalBroker.OutstandingReset(pending.plan.EvalID, pending.plan.EvalToken); err != nil { @@ -89,7 +88,6 @@ func (s *Server) planApply() { // Evaluate the plan result, err := evaluatePlan(pool, snap, pending.plan) - s.logger.Printf("[DEBUG] plan_apply: plan result for eval %q: %#v", pending.plan.EvalID, result) if err != nil { s.logger.Printf("[ERR] nomad: failed to evaluate plan: %v", err) pending.respond(nil, err) @@ -235,8 +233,6 @@ func evaluatePlan(pool *EvaluatePool, snap *state.StateSnapshot, plan *structs.P return true } if !fit { - log.Printf("[DEBUG] plan_apply: eval %q no fit on node %q", plan.EvalID, nodeID) - // Set that this is a partial commit partialCommit = true diff --git a/nomad/plan_endpoint.go b/nomad/plan_endpoint.go index 54a661416..cb9b798e8 100644 --- a/nomad/plan_endpoint.go +++ b/nomad/plan_endpoint.go @@ -19,8 +19,6 @@ func (p *Plan) Submit(args *structs.PlanRequest, reply *structs.PlanResponse) er } defer metrics.MeasureSince([]string{"nomad", "plan", "submit"}, time.Now()) - p.srv.logger.Printf("[DEBUG] plan_endpoint.Submit request: %#v", args.Plan) - // Submit the plan to the queue future, err := p.srv.planQueue.Enqueue(args.Plan) if err != nil { @@ -36,6 +34,5 @@ func (p *Plan) Submit(args *structs.PlanRequest, reply *structs.PlanResponse) er // Package the result reply.Result = result reply.Index = result.AllocIndex - p.srv.logger.Printf("[DEBUG] plan_endpoint.Submit eval %q response: %#v", args.Plan.EvalID, reply.Result) return nil } diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index 219a82d75..bdb47b16c 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -2457,18 +2457,6 @@ func (p *Plan) IsNoOp() bool { return len(p.NodeUpdate) == 0 && len(p.NodeAllocation) == 0 && len(p.FailedAllocs) == 0 } -func (p *Plan) GoString() string { - planNodeUpdate := 0 - planNodeAlloc := 0 - for _, updates := range p.NodeUpdate { - planNodeUpdate += len(updates) - } - for _, allocs := range p.NodeAllocation { - planNodeAlloc += len(allocs) - } - return fmt.Sprintf("plan; eval %q; allocs %v; updates %v", p.EvalID, planNodeAlloc, planNodeUpdate) -} - // PlanResult is the result of a plan submitted to the leader. type PlanResult struct { // NodeUpdate contains all the updates that were committed. @@ -2512,19 +2500,6 @@ func (p *PlanResult) FullCommit(plan *Plan) (bool, int, int) { return actual == expected, expected, actual } -func (p *PlanResult) GoString() string { - planNodeUpdate := 0 - planNodeAlloc := 0 - for _, updates := range p.NodeUpdate { - planNodeUpdate += len(updates) - } - for _, allocs := range p.NodeAllocation { - planNodeAlloc += len(allocs) - } - return fmt.Sprintf("planresult allocs %v; updates %v; refresh %v; alloc index %v", - planNodeAlloc, planNodeUpdate, p.RefreshIndex, p.AllocIndex) -} - // msgpackHandle is a shared handle for encoding/decoding of structs var MsgpackHandle = func() *codec.MsgpackHandle { h := &codec.MsgpackHandle{RawToString: true} diff --git a/nomad/worker.go b/nomad/worker.go index 1acfc03c2..1bae409d5 100644 --- a/nomad/worker.go +++ b/nomad/worker.go @@ -281,8 +281,6 @@ func (w *Worker) SubmitPlan(plan *structs.Plan) (*structs.PlanResult, scheduler. } var resp structs.PlanResponse - w.logger.Printf("[DEBUG] worker.SubmitPlan request: %#v", plan) - SUBMIT: // Make the RPC call if err := w.srv.RPC("Plan.Submit", &req, &resp); err != nil { @@ -303,8 +301,6 @@ SUBMIT: return nil, nil, fmt.Errorf("missing result") } - w.logger.Printf("[DEBUG] worker.SubmitPlan eval %q result: %#v", plan.EvalID, result) - // Check if a state update is required. This could be required if we // planning based on stale data, which is causing issues. For example, a // node failure since the time we've started planning or conflicting task