-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
constraintenforcer: Trigger task restarts when appropriate
The constraint enforcer currently sets task desired state to "shutdown" directly, which means the orchestrator will consider these tasks already processed, and won't trigger restarts. While this is appropriate for global services, replicated services should keep the desired number of replicas running, so each task shut down by the constraint enforcer should be restarted somewhere else. This changes the constraint enforcer to trigger a task shutdown by updating the actual state rather than desired state. This will cause the orchestrator to restart the task when necessary. It's not a perfect solution, because it bends rules about field ownership, and may cause the replacement task to start before the old one stops. However, it's a good compromise solution for this problem that doesn't require absorbing the constraint enforcer into each orchestrator (which wouldn't fit the model well), or adding a third type of state to every task. Also, update the global orchestrator to only restart a task when the node still meets the constraints. Signed-off-by: Aaron Lehmann <[email protected]>
- Loading branch information
1 parent
03d5b15
commit 69fcc19
Showing
3 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters