Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nomad: compare current eval when setting WaitIndex #5381

Merged
merged 4 commits into from
Mar 6, 2019

Conversation

schmichael
Copy link
Member

Consider currently dequeued Evaluation's ModifyIndex when determining
its WaitIndex. Normally the Evaluation itself would already be in the
state store snapshot used to determine the WaitIndex. However, since the FSM
applies Raft messages to the state store concurrently with Dequeueing,
it's possible the currently dequeued Evaluation won't yet exist in the
state store snapshot used by JobsForEval.

This can be solved by always considering the current eval's modify index
and using it if it is greater than all of the evals returned by the
state store.

(My comments to code ratio is out of control in this PR, but it's so subtle and I'm fairly new to the server-side. Please bear with me. 😄 )

Consider currently dequeued Evaluation's ModifyIndex when determining
its WaitIndex. Normally the Evaluation itself would already be in the
state store snapshot used to determine the WaitIndex. However, since the FSM
applies Raft messages to the state store concurrently with Dequeueing,
it's possible the currently dequeued Evaluation won't yet exist in the
state store snapshot used by JobsForEval.

This can be solved by always considering the current eval's modify index
and using it if it is greater than all of the evals returned by the
state store.
@schmichael schmichael requested review from preetapan and dadgar March 1, 2019 23:29
nomad/eval_endpoint.go Outdated Show resolved Hide resolved
nomad/eval_endpoint.go Outdated Show resolved Hide resolved
nomad/eval_endpoint_test.go Outdated Show resolved Hide resolved
dadgar and others added 2 commits March 5, 2019 15:19
@schmichael schmichael merged commit 76d2eee into master Mar 6, 2019
@schmichael schmichael deleted the b-max-eval-wait-index branch March 6, 2019 17:22
schmichael added a commit that referenced this pull request Mar 20, 2019
schmichael added a commit that referenced this pull request Mar 20, 2019
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants