From ff5c22acaab7d262e4d45538674ce68ca2ce2fd3 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Wed, 8 Feb 2017 11:51:48 -0800 Subject: [PATCH] Fix missing summary restoration --- nomad/fsm.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nomad/fsm.go b/nomad/fsm.go index acf32d50e..25221ca4f 100644 --- a/nomad/fsm.go +++ b/nomad/fsm.go @@ -676,7 +676,7 @@ func (n *nomadFSM) Restore(old io.ReadCloser) error { // summaries if they were not present previously. When users upgrade to 0.5 // from 0.4.1, the snapshot will contain job summaries so it will be safe to // remove this block. - index, err := n.state.Index("job_summary") + index, err := newState.Index("job_summary") if err != nil { return fmt.Errorf("couldn't fetch index of job summary table: %v", err) } @@ -685,11 +685,11 @@ func (n *nomadFSM) Restore(old io.ReadCloser) error { // we will have to create them if index == 0 { // query the latest index - latestIndex, err := n.state.LatestIndex() + latestIndex, err := newState.LatestIndex() if err != nil { return fmt.Errorf("unable to query latest index: %v", index) } - if err := n.state.ReconcileJobSummaries(latestIndex); err != nil { + if err := newState.ReconcileJobSummaries(latestIndex); err != nil { return fmt.Errorf("error reconciling summaries: %v", err) } }