DeletionTask should remove only nodes that it was scheduled for

Bug #1415062 reported by Przemyslaw Kaminski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Przemyslaw Kaminski
6.0.x
Fix Committed
High
Unassigned

Bug Description

Current implementation of

nailgun/task/task.py -> DeletionTask

is that it takes a cluster as parameter and when it's executes, removes all cluster's nodes that have the 'pending_deletion' attribute set to True. This is incorrect and could lead to strange behavior.

Scenario:
DeletionTask is scheduled but not yet executed (for example there are some other tasks running in the meantime), user in the UI clicks that some node in cluster is to be deleted but doesn't click 'Deploy Changes' button. The effect is that the 'pending_deletion' attribute is set to True in the database but user hasn't confirmed his change yet and can take that change back in the UI. When the DeletionTask now starts to execute suddenly the node will be removed without user confirmation. Same happens for CLI for which the command 'fuel node remove --node x' also sets 'pending_deletion' to 'True'.

The proposed solution is to explicitly pass node uids as parameters to DeletionTask, instead of cluster.

I have not been able to reproduce it on a live system, I'm just filing this bug based on analysis of the code.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/151648

Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Przemyslaw Kaminski (pkaminski)
status: New → In Progress
Changed in fuel:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/151648
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=de7b840f04cb17c37f1704b2d8b979149956d376
Submitter: Jenkins
Branch: master

commit de7b840f04cb17c37f1704b2d8b979149956d376
Author: Przemyslaw Kaminski <email address hidden>
Date: Thu Jan 29 15:07:06 2015 +0100

    Refactoring of DeletionTask

    - DeletionTask now accepts explicit 'nodes' parameter for nodes to be removed
    - Cleaned up unnecessary DB calls
    - Added tests

    Implements blueprint node-removal-task
    Closes-Bug: #1415062

    Change-Id: I85b22d1e79a8f9fbe3f224a5d5076fb3ce045e5b

Changed in fuel:
status: In Progress → Fix Committed
Alex Ermolov (aermolov)
no longer affects: fuel/6.0-updates
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/6.0)

Fix proposed to branch: stable/6.0
Review: https://review.openstack.org/159407

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/6.0)

Reviewed: https://review.openstack.org/159407
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=9809b33bc70457959f8f8f0b6a07723e5e75770d
Submitter: Jenkins
Branch: stable/6.0

commit 9809b33bc70457959f8f8f0b6a07723e5e75770d
Author: Przemyslaw Kaminski <email address hidden>
Date: Thu Jan 29 15:07:06 2015 +0100

    Backport from 6.1: Refactoring of DeletionTask

    - DeletionTask now accepts explicit 'nodes' parameter for nodes to be removed
    - Cleaned up unnecessary DB calls
    - Added tests

    Implements blueprint node-removal-task
    Closes-Bug: #1415062

    Change-Id: I85b22d1e79a8f9fbe3f224a5d5076fb3ce045e5b

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.