re-creating a previously deleted image member fails with 500 ServerError

Bug #1098700 reported by Eoghan Glynn
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Critical
Eoghan Glynn
Grizzly
Fix Released
Critical
Eoghan Glynn

Bug Description

When a previously deleted image member is re-created, this fails with 500 ServerError due to the registry service failing to commit the update to the image_members table.

The problem arises because the declared uniqueness constraint on that table only spans the image_id and member columns, but does not take into account that deleted rows are left in situ with the deleted_at and deleted columns set appropriately. Hence the unique constraint is violated by the addition of the new row.

Eoghan Glynn (eglynn)
Changed in glance:
importance: Undecided → Medium
assignee: nobody → Eoghan Glynn (eglynn)
milestone: none → grizzly-3
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Brian Waldon (bcwaldon)
Changed in glance:
milestone: grizzly-3 → grizzly-rc1
Revision history for this message
Iccha Sethi (iccha-sethi) wrote :

How about the approach of making deleted column non-boolean and instead having either id or datetime and adding it to the primary keys?

Changed in glance:
importance: Medium → Critical
Changed in glance:
assignee: Eoghan Glynn (eglynn) → Mark Washenberger (markwash)
Changed in glance:
assignee: Mark Washenberger (markwash) → Eoghan Glynn (eglynn)
Changed in glance:
assignee: Eoghan Glynn (eglynn) → Mark Washenberger (markwash)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/19547
Committed: http://github.com/openstack/glance/commit/c4f97dfa6eba8893a0e50128f7d5c7b1ea8f6003
Submitter: Jenkins
Branch: master

commit c4f97dfa6eba8893a0e50128f7d5c7b1ea8f6003
Author: Eoghan Glynn <email address hidden>
Date: Sat Mar 9 20:14:22 2013 +0000

    Fix uniqueness constraint on image_members table.

    Fixes bug #1098700.

    Previously, deleting then re-creating an image member failed with
    500 ServerError due to the registry service failing to commit
    the update to the image_members table.

    The problem arose because the declared uniqueness constraint on that
    table only spanned the image_id and member columns, but did not take
    into account that deleted rows are left in situ with the deleted_at
    and deleted columns set as appropriate. Hence the unique constraint
    was violated by the addition of the new row.

    We modify the uniqueness constraint via a migration script to take
    account of the deleted_at column also (NULL for live memberships).

    Note that the new ability to recreate an image membership cannot be
    be asserted in a functional test, as these tests are based on sqlite
    which does not support 'ALTER TABLE DROP CONSTRAINT'.

    Change-Id: I175801ba95ecd9295791bb12e9096f59efa19c02

Changed in glance:
status: In Progress → Fix Committed
Eoghan Glynn (eglynn)
Changed in glance:
assignee: Mark Washenberger (markwash) → Eoghan Glynn (eglynn)
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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