Skip to content

Commit

Permalink
Fix version for MRD
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemarey committed Oct 15, 2020
1 parent 2361d4f commit d222e78
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/allocrunner/groupservice_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (h *groupServiceHook) Update(req *interfaces.RunnerUpdateRequest) error {
h.mu.Lock()
defer h.mu.Unlock()

// If we already run the PreKill don't do this
// MEIGAS: If we already run the PreKill don't do this (Is this OK?)
if h.deregistered {
return nil
}
Expand Down
6 changes: 3 additions & 3 deletions nomad/job_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ func (j *Job) Register(args *structs.JobRegisterRequest, reply *structs.JobRegis

// Submit a multiregion job to other regions (enterprise only).
// The job will have its region interpolated.
var existingVersion uint64
var newVersion uint64
if existingJob != nil {
existingVersion = existingJob.Version
newVersion = existingJob.Version + 1
}
isRunner, err := j.multiregionRegister(args, reply, existingVersion)
isRunner, err := j.multiregionRegister(args, reply, newVersion)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion nomad/job_endpoint_oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (j *Job) enforceSubmitJob(override bool, job *structs.Job) (error, error) {
}

// multiregionRegister is used to send a job across multiple regions
func (j *Job) multiregionRegister(args *structs.JobRegisterRequest, reply *structs.JobRegisterResponse, existingVersion uint64) (bool, error) {
func (j *Job) multiregionRegister(args *structs.JobRegisterRequest, reply *structs.JobRegisterResponse, newVersion uint64) (bool, error) {

// GetJob on all other regions (what for?) Check versions and set the higher one?

Expand Down
1 change: 0 additions & 1 deletion nomad/state/state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,6 @@ func (s *StateStore) upsertJobImpl(index uint64, job *structs.Job, keepVersion b
job.CreateIndex = index
job.ModifyIndex = index
job.JobModifyIndex = index
job.Version = 0

if err := s.setJobStatus(index, txn, job, false, ""); err != nil {
return fmt.Errorf("setting job status for %q failed: %v", job.ID, err)
Expand Down

0 comments on commit d222e78

Please sign in to comment.