What is the difference in Job between JobModifyIndex, ModifyIndex and Version?

In the Nomad Job JSON specification we can find the following fields, from Jobs - HTTP API | Nomad | HashiCorp Developer :

    "JobModifyIndex": 637478,
    "ModifyIndex": 637480,
    "Version": 1,

What is “JobModifyIndex”? What is “ModifyIndex”? How do they differ? What is the relation between them and job “Version”?

Hi @Kamilcuk,

ModifyIndex is set to the Raft index used to perform the Nomad state store write when a job has been registered by a user which has changes compared to the current state representation. It can also be updated, if the status of a job changes due to a deployment update.

JobModifyIndex is the Raft index used to update the job state store object. In a difference to ModifyIndex, this value is not update when the job state object is update to account for the jobs stability based on a deployment which is classed as an internal field.

Version is an incremented value; the incrementation happens with the same conditions as the JobModifyIndex.

The code within the state store for these updates can be found here.

Thanks,
jrasell and the Nomad team

1 Like

Thank you! Amazing answer and that link is amazing.