[openstack-dev] Fw: [OpenStack] [Glance] Reuse the image id when recreate an image in Glance which had been deleted

David Ripton dripton at redhat.com
Tue May 21 15:31:12 UTC 2013


On 05/20/2013 03:25 AM, Flavio Percoco wrote:
> On 17/05/13 11:33 -0700, Mark Washenberger wrote:
>>   I wonder if the best solution here is to change the uniqueness
>>   constraint in our tables (as has been mentioned in several other
>>   OpenStack-related database discussions) so that deleted images do not
>>   conflict with active images with the same uuid. As I recall, the best
>>   practice suggestion was to key the uniqueness constraint off the pair
>>   <uuid, deleted>. In this scheme, deleted is no longer a simple boolean,
>>   but rather either 0 (not deleted) or equal to the auto-increment row id
>>   (deleted).
>>   Does that make sense?
>
> That should work.
>
> I must admit, I'm a bit worried about keeping deleted images in the
> database, I see how that can be usefull (I guess) but I also think it
> just makes the database bigger and the table slower - thinking about
> really big environments and the fact that we're working on making
> glance public.
> I guess my question is, Do we really need them?
> If so, would it make sense to move deleted images to a separate table
> so that we can keep the images table smaller?

We do this in Nova.  The feature is called db-archiving, added in 
Grizzly.  Let me know if you have any questions about it -- if you 
decide to do the same thing in Glance, knowing how we did it in Nova 
could speed things up.

-- 
David Ripton   Red Hat   dripton at redhat.com



More information about the OpenStack-dev mailing list