diff --git a/nomad/job_endpoint.go b/nomad/job_endpoint.go index 1f6b2faf1..1c078aba9 100644 --- a/nomad/job_endpoint.go +++ b/nomad/job_endpoint.go @@ -416,10 +416,10 @@ func (j *Job) Stable(args *structs.JobStabilityRequest, reply *structs.JobStabil return fmt.Errorf("job %q at version %d not found", args.JobID, args.JobVersion) } - // Commit this evaluation via Raft + // Commit this stability request via Raft _, modifyIndex, err := j.srv.raftApply(structs.JobStabilityRequestType, args) if err != nil { - j.srv.logger.Printf("[ERR] nomad.job: Eval create failed: %v", err) + j.srv.logger.Printf("[ERR] nomad.job: Job stability request failed: %v", err) return err } diff --git a/nomad/state/state_store.go b/nomad/state/state_store.go index a2f4e2fb8..ad9b46074 100644 --- a/nomad/state/state_store.go +++ b/nomad/state/state_store.go @@ -873,13 +873,15 @@ func (s *StateStore) jobVersionByID(txn *memdb.Txn, ws *memdb.WatchSet, id strin return all, nil } -// JobByIDAndVersion returns the job identified by its ID and Version +// JobByIDAndVersion returns the job identified by its ID and Version. The +// passed watchset may be nil. func (s *StateStore) JobByIDAndVersion(ws memdb.WatchSet, id string, version uint64) (*structs.Job, error) { txn := s.db.Txn(false) return s.jobByIDAndVersionImpl(ws, id, version, txn) } -// jobByIDAndVersionImpl returns the job identified by its ID and Version +// jobByIDAndVersionImpl returns the job identified by its ID and Version. The +// passed watchset may be nil. func (s *StateStore) jobByIDAndVersionImpl(ws memdb.WatchSet, id string, version uint64, txn *memdb.Txn) (*structs.Job, error) { watchCh, existing, err := txn.FirstWatch("job_version", "id", id, version) if err != nil { diff --git a/website/source/api/jobs.html.md b/website/source/api/jobs.html.md index a241887ab..f368b9d73 100644 --- a/website/source/api/jobs.html.md +++ b/website/source/api/jobs.html.md @@ -821,7 +821,7 @@ This endpoint returns a single job's most recent deployment. | Method | Path | Produces | | ------ | ----------------------------- | -------------------------- | -| `GET` | `/v1/job/:job_id/deployment` | `application/json` | +| `GET` | `/v1/job/:job_id/deployment` | `application/json` | The table below shows this endpoint's support for [blocking queries](/api/index.html#blocking-queries) and @@ -1070,7 +1070,7 @@ The table below shows this endpoint's support for - `JobID` `(string: )` - Specifies the ID of the job (as specified in the job file during submission). This is specified as part of the path. -- `JobVersion` `(integer: 0) - Specifies the job version to revert to. +- `JobVersion` `(integer: 0)` - Specifies the job version to revert to. - `EnforcePriorVersion` `(integer: nil)` - Optional value specifying the current job's version. This is checked and acts as a check-and-set value before @@ -1111,7 +1111,7 @@ This endpoint sets the job's stability. | Method | Path | Produces | | ------- | -------------------------- | -------------------------- | -| `POST` | `/v1/job/:job_id/stable` | `application/json` | +| `POST` | `/v1/job/:job_id/stable` | `application/json` | The table below shows this endpoint's support for [blocking queries](/api/index.html#blocking-queries) and @@ -1126,7 +1126,7 @@ The table below shows this endpoint's support for - `JobID` `(string: )` - Specifies the ID of the job (as specified in the job file during submission). This is specified as part of the path. -- `JobVersion` `(integer: 0) - Specifies the job version to set the stability on. +- `JobVersion` `(integer: 0)` - Specifies the job version to set the stability on. - `Stable` `(bool: false)` - Specifies whether the job should be marked as stable or not.