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

Only update non-terminal tasks on node removal. #2867

Merged
merged 1 commit into from
Jul 26, 2019

Conversation

dperny
Copy link
Collaborator

@dperny dperny commented Jun 24, 2019

- What I did

When a node is removed, its tasks are set in state ORPHANED. This does not need to be done for tasks that are already in a terminal state, and if all tasks in all states are updated, the size of the transaction may grow too large to process, and node removal becomes impossible.

This changes to only set non-terminal tasks to state ORPHANED, and terminal tasks are left alone.

- How I did it

Altered the orphanNodeTasks function in manager/controlapi/node.go to check if a task is in a terminal state before updating it.

- How to test it

Updated the unit test for that function to check correctness of the new behavior.

- Description for the changelog

Fixed an issue where nodes with lots of tasks could not be removed.

When a node is removed, its tasks are set in state ORPHANED. This does
not need to be done for tasks that are already in a terminal state, and
if all tasks in all states are updated, the size of the transaction may
grow too large to process, and node removal becomes impossible.

This changes to only set non-terminal tasks to state ORPHANED, and
terminal tasks are left alone.

Signed-off-by: Drew Erny <[email protected]>
@dani-docker
Copy link
Contributor

LGTM 👍

@dperny dperny merged commit f1fb59c into moby:master Jul 26, 2019
dani-docker pushed a commit to dani-docker/swarmkit that referenced this pull request Jul 26, 2019
Only update non-terminal tasks on node removal.
dani-docker pushed a commit to dani-docker/swarmkit that referenced this pull request Jul 26, 2019
Only update non-terminal tasks on node removal.
Timestamp: gogotypes.TimestampNow(),
State: api.TaskStateOrphaned,
Message: "Task belonged to a node that has been deleted",
// this operation must occur within the same transaction boundary. If
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix brah! @dperny

thaJeztah added a commit to thaJeztah/docker that referenced this pull request Aug 8, 2019
full diff: moby/swarmkit@19e791f...142a737

included:

- moby/swarmkit#2872 [19.03 backport] Only update non-terminal tasks on node removal
  - backport of moby/swarmkit#2867 Only update non-terminal tasks on node removal

Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Aug 8, 2019
…3 branch)

full diff: moby/swarmkit@961ec3a...4fb9e96

included:

- moby/swarmkit#2873 [19.03 backport] Only update non-terminal tasks on node removal
  - backport of moby/swarmkit#2867 Only update non-terminal tasks on node removal

Signed-off-by: Sebastiaan van Stijn <[email protected]>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Aug 9, 2019
full diff: moby/swarmkit@19e791f...142a737

included:

- moby/swarmkit#2872 [19.03 backport] Only update non-terminal tasks on node removal
  - backport of moby/swarmkit#2867 Only update non-terminal tasks on node removal

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Upstream-commit: 7fcfdbaab6d8c6a2d55ad7b72a851c5e92b360ac
Component: engine
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Aug 9, 2019
…3 branch)

full diff: moby/swarmkit@961ec3a...4fb9e96

included:

- moby/swarmkit#2873 [19.03 backport] Only update non-terminal tasks on node removal
  - backport of moby/swarmkit#2867 Only update non-terminal tasks on node removal

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Upstream-commit: ee64eae9034a2cd3edd751632961e6895b069d1d
Component: engine
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Oct 7, 2019
full diff: moby/swarmkit@7dded76...a8bbe7d

changes included:

- moby/swarmkit#2867 Only update non-terminal tasks on node removal
  - related to moby/swarmkit#2806 Fix leaking task resources when nodes are deleted
- moby/swarmkit#2880 Bump to golang 1.12.9
- moby/swarmkit#2886 Bump vendoring to match current docker/docker master
  - regenerates protobufs
- moby/swarmkit#2890 Remove hardcoded IPAM config subnet value for ingress network
  - fixes [ENGORC-2651] Specifying --default-addr-pool for docker swarm init is not picked up by ingress network

Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Oct 21, 2019
full diff: moby/swarmkit@7dded76...a8bbe7d

changes included:

- moby/swarmkit#2867 Only update non-terminal tasks on node removal
  - related to moby/swarmkit#2806 Fix leaking task resources when nodes are deleted
- moby/swarmkit#2880 Bump to golang 1.12.9
- moby/swarmkit#2886 Bump vendoring to match current docker/docker master
  - regenerates protobufs
- moby/swarmkit#2890 Remove hardcoded IPAM config subnet value for ingress network
  - fixes [ENGORC-2651] Specifying --default-addr-pool for docker swarm init is not picked up by ingress network

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants