nodes table needs ON CASCADE DELETE constraints so that batch deletion is possible

Bug #1423872 reported by Przemyslaw Kaminski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Maciej Kwiek

Bug Description

Currently the 'nodes' table is referenced by the following:

    TABLE "cluster_changes" CONSTRAINT "cluster_changes_node_id_fkey" FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE
    TABLE "ip_addrs" CONSTRAINT "ip_addrs_node_fkey" FOREIGN KEY (node) REFERENCES nodes(id) ON DELETE CASCADE
    TABLE "node_attributes" CONSTRAINT "node_attributes_node_id_fkey" FOREIGN KEY (node_id) REFERENCES nodes(id)
    TABLE "node_bond_interfaces" CONSTRAINT "node_bond_interfaces_node_id_fkey" FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE
    TABLE "node_nic_interfaces" CONSTRAINT "node_nic_interfaces_node_id_fkey" FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE
    TABLE "node_roles" CONSTRAINT "node_roles_node_fkey" FOREIGN KEY (node) REFERENCES nodes(id)
    TABLE "notifications" CONSTRAINT "notifications_node_id_fkey" FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE SET NULL
    TABLE "pending_node_roles" CONSTRAINT "pending_node_roles_node_fkey" FOREIGN KEY (node) REFERENCES nodes(id)

Some of these are not of 'ON DELETE CASCADE' type which prevents batch deletion.

Tags: nailgun
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/158297

Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Maciej Kwiek (maciej-iai)
status: New → In Progress
Changed in fuel:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

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

commit 4dd0bb058483de9c5cdf34ceaeb410de15791b7d
Author: Maciej Kwiek <email address hidden>
Date: Mon Feb 23 14:43:39 2015 +0100

    Add cascade deletion for tables relating to nodes

    Batch deletion of nodes was impossible without setting ON DELETE CASCADE for
    foreignt key constraint for tables
      node_roles,
      pending_node_roles,
      node_attributes

    Change-Id: Iee147ec13f2f533492099639112ac983c04addaa
    Closes-Bug: #1423872

Changed in fuel:
status: In Progress → Fix Committed
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.