Stale aggregate metadata remains in the database

Bug #1052479 reported by Mate Lakat
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Joe Gordon

Bug Description

By removing an aggregate, the associated metadata remains in the database, and upon re-creation of the same aggregate, the old metadata is returned from the previously deleted aggregate.

If you have an aggregate with some metadata:

stack@DevStackOSDomU:~/devstack$ nova aggregate-details 1
+----+---------------------+-------------------+-------+...
| Id | Name | Availability Zone | Hosts |
+----+---------------------+-------------------+-------+...
| 1 | my_livemigrate_pool | nova | [] |
+----+---------------------+-------------------+-------+...

...-----------------------------------------------------------------...
 Metadata
...-----------------------------------------------------------------...
 {u'master_compute': u'DevStackOSDomU', u'operational_state': u'crea
...-----------------------------------------------------------------...

And you remove that aggregate:
stack@DevStackOSDomU:~/devstack$ nova aggregate-delete 1
Aggregate 1 has been successfully deleted.

And re-create with the same name:
stack@DevStackOSDomU:~/devstack$ nova aggregate-create my_livemigrate_pool nova
+----+---------------------+-------------------+-------+----------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+---------------------+-------------------+-------+----------+
| 1 | my_livemigrate_pool | nova | | |
+----+---------------------+-------------------+-------+----------+
It is saying, that metadata is empty,

Whereas querying the details shows that the metadata persists:
stack@DevStackOSDomU:~/devstack$ nova aggregate-details 1
+----+---------------------+-------------------+-------+...
| Id | Name | Availability Zone | Hosts |
+----+---------------------+-------------------+-------+...
| 1 | my_livemigrate_pool | nova | [] |
+----+---------------------+-------------------+-------+...

...-----------------------------------------------------------------...
 Metadata
...-----------------------------------------------------------------...
 {u'master_compute': u'DevStackOSDomU', u'operational_state': u'crea
...-----------------------------------------------------------------...

Joe Gordon (jogo)
Changed in nova:
status: New → Confirmed
assignee: nobody → Joe Gordon (joe-gordon0)
Revision history for this message
Joe Gordon (jogo) wrote :

This is caused by two things:

1) when adding an aggregate that has the same name as a deleted one. The deleted aggregate is undeleted.
2) When deleting an aggregate, only the Aggregate table row is marked as deleted and not the AggregateMetadata and AggregateHost rows.

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

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

Changed in nova:
status: Confirmed → In Progress
Joe Gordon (jogo)
tags: added: folsom-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/13308

Changed in nova:
milestone: none → folsom-rc1
importance: Undecided → High
Changed in nova:
assignee: Joe Gordon (joe-gordon0) → Vish Ishaya (vishvananda)
Changed in nova:
assignee: Vish Ishaya (vishvananda) → Joe Gordon (joe-gordon0)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/13241
Committed: http://github.com/openstack/nova/commit/0edd4cc1f14ed72654186fb7930811f44369d129
Submitter: Jenkins
Branch: master

commit 0edd4cc1f14ed72654186fb7930811f44369d129
Author: Joe Gordon <email address hidden>
Date: Tue Sep 18 23:41:44 2012 +0000

    Properly create and delete Aggregates

    * If deleted aggregate with same name exists, ignore it
    * When delete aggregate, delete metadata as well
    * Removes aggregates.name unique constraint

    Fix bug 1052479

    Change-Id: I430e69367bdedbf65049a5142d137ab788763ae3

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (milestone-proposed)

Reviewed: https://review.openstack.org/13308
Committed: http://github.com/openstack/nova/commit/10d94acc4d6d6ce518c941ca78a0d94cdb2827b3
Submitter: Jenkins
Branch: milestone-proposed

commit 10d94acc4d6d6ce518c941ca78a0d94cdb2827b3
Author: Joe Gordon <email address hidden>
Date: Tue Sep 18 23:41:44 2012 +0000

    Properly create and delete Aggregates

    * If deleted aggregate with same name exists, ignore it
    * When delete aggregate, delete metadata as well
    * Removes aggregates.name unique constraint

    Fix bug 1052479

    Change-Id: I430e69367bdedbf65049a5142d137ab788763ae3
    (cherry picked from commit 852dd4d5cf137c9ec04ad65f7225b86e7a0fdeda)

Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
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.