Skip to content

Commit

Permalink
wip, fix failing tests, still update job summary if job status not ch…
Browse files Browse the repository at this point in the history
…anging
  • Loading branch information
drewbailey committed Jan 12, 2021
1 parent 578c02a commit 93a65ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nomad/state/state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"strings"
"time"

"github.com/davecgh/go-spew/spew"
log "github.com/hashicorp/go-hclog"
memdb "github.com/hashicorp/go-memdb"
multierror "github.com/hashicorp/go-multierror"
Expand Down Expand Up @@ -1489,7 +1488,6 @@ func (s *StateStore) upsertJobImpl(index uint64, job *structs.Job, keepVersion b

// Setup the indexes correctly
if existing != nil {
spew.Dump("EXISTING!")
job.CreateIndex = existing.(*structs.Job).CreateIndex
job.ModifyIndex = index

Expand Down Expand Up @@ -3944,7 +3942,6 @@ func (s *StateStore) updateJobStabilityImpl(index uint64, namespace, jobID strin

copy := job.Copy()
copy.Stable = stable
spew.Dump("COPY STABLEEE", copy.Stable)
return s.upsertJobImpl(index, copy, true, txn)
}

Expand Down Expand Up @@ -4447,7 +4444,6 @@ func (s *StateStore) setJobStatus(index uint64, txn *txn,

// Fast-path if nothing has changed.
if oldStatus == newStatus {
spew.Dump("DOING THIS THING")
if err := s.setJobSummary(txn, job, index, oldStatus, newStatus, firstPass); err != nil {
return err
}
Expand All @@ -4456,6 +4452,10 @@ func (s *StateStore) setJobStatus(index uint64, txn *txn,
return nil
}

// TODO (drew)
// not inserting the job again with modify index/status
// prevents job stability test pass

// Copy and update the existing job
updated := job.Copy()
updated.Status = newStatus
Expand Down

0 comments on commit 93a65ef

Please sign in to comment.