Image segments not deleted from swift when size > image_size_cap

Bug #1154576 reported by Stuart McLaren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Mark Washenberger
Grizzly
Fix Released
High
Mark Washenberger

Bug Description

If we set image_size_cap to 10 Meg:

image_size_cap = 10485760

And set the swift_store_large_object_size to 4 Meg:

swift_store_large_object_size = 4

And set the swift chunk size to 2 Meg:

swift_store_large_object_chunk_size = 2

Then upload 10485761 bytes in a way that the image size is not known beforehand:

$ glance --os-image-api-version 1 --os-username glance --os-password XXX --os-tenant-name service --os-auth-url http://localhost:5000/v2.0 image-create --name "x1" --is-public=True --container-format ami --disk-format ami < /tmp/10485761.fifo

$ cat /tmp/10485761 >> /tmp/10485761.fifo

Request returned failure status.
400 Bad Request
Denying attempt to upload image larger than 10485760 bytes.
    (HTTP 400)

Once the operation has completed the swift segments are still present:

$ swift --os-username glance --os-password XXX --os-tenant-name service --os-auth-url http://localhost:5000/v2.0 list glance | grep d723a481-fdb2-4576-9340-5cab95c83ac1
d723a481-fdb2-4576-9340-5cab95c83ac1-00001
d723a481-fdb2-4576-9340-5cab95c83ac1-00002
d723a481-fdb2-4576-9340-5cab95c83ac1-00003
d723a481-fdb2-4576-9340-5cab95c83ac1-00004
d723a481-fdb2-4576-9340-5cab95c83ac1-00005

Changed in glance:
assignee: nobody → Stuart McLaren (stuart-mclaren)
description: updated
Changed in glance:
milestone: none → grizzly-rc1
importance: Undecided → High
status: New → Triaged
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/24421

Changed in glance:
status: Triaged → In Progress
Changed in glance:
assignee: Stuart McLaren (stuart-mclaren) → Mark Washenberger (markwash)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/24421
Committed: http://github.com/openstack/glance/commit/3642adadeaa5241950614884cd6500917cfa25ab
Submitter: Jenkins
Branch: master

commit 3642adadeaa5241950614884cd6500917cfa25ab
Author: Stuart McLaren <email address hidden>
Date: Thu Mar 14 13:16:10 2013 +0000

    Delete swift segments when image_size_cap exceeded

    When an image which is being written to swift in segments exceeds the
    'image_size_cap' limit we should ensure that the now stale swift segments
    are deleted.

    Fixes bug 1154576.

    Change-Id: I08be04e63f6d55acc6b0350810350a4ccadab7be

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

Other bug subscribers

Remote bug watches

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