[openstack-dev] Fw: [OpenStack] [Glance] Reuse the image id when recreate an image in Glance which had been deleted
Clint Byrum
clint at fewbar.com
Mon May 20 15:59:45 UTC 2013
Excerpts from Flavio Percoco's message of 2013-05-20 00:25:28 -0700:
> 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.
>
This is why we have indexes. If there is a table scan, there is a
huge failure waiting to happen no matter how small the table is (see:
thundering herd). Well optimized access to tables shouldn't be any slower
if they have millions of small rows or just a few.
More information about the OpenStack-dev
mailing list