Duplicate volumes in image cache

Bug #1649636 reported by Ollie Leahy
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Alan Bishop

Bug Description

The purpose of cinder image caching is to cache a copy of each glance image on the cinder backend, so that subsequent volume creates from that image do not need to download the image from cache. However, when concurrent requests are made to create volumes from a 'new' glance image we end up with multiple copies of the same glance image in the backend.

In general this is not a problem, and it is noted in the spec:

"It is also possible that multiple of the same images are cached at the same time, this is considered ‘OK’, eventually extra ones will be evicted if space is needed."

However, if a customer creates a new glance image, and then creates many volumes from that image, we can end up with many copies of the image, which is not desirable. For example, we've seen users create 30 volumes concurrently, and end up with 30 downloads and 30 copies of the new image in the cinder cache. As well as wasting space and causing confusion, the create times for the volumes can be very long, because of the time to download 30 copies of the image.

Changed in cinder:
assignee: nobody → Alan Bishop (alan-bishop)
status: New → Confirmed
Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

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

Reviewed: https://review.openstack.org/446590
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=63aa3c7d1cf73e18067a7ae3a68a173359994aab
Submitter: Jenkins
Branch: master

commit 63aa3c7d1cf73e18067a7ae3a68a173359994aab
Author: Alan Bishop <email address hidden>
Date: Thu Mar 16 10:52:25 2017 -0400

    Prevent duplicate entries in the image cache

    Add a synchronization lock to prevent duplicate entries in the image
    cache. The relevant code was refactored into its own function in order
    to reduce the scope of the lock.

    Closes-Bug: #1649636
    Change-Id: I979f966c821876750b2a616ef32a905192eafbd6

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/448540

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/ocata)

Reviewed: https://review.openstack.org/448540
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=ebdbb18bec985c17a7de1ce3ca70301a1ae3ab2f
Submitter: Jenkins
Branch: stable/ocata

commit ebdbb18bec985c17a7de1ce3ca70301a1ae3ab2f
Author: Alan Bishop <email address hidden>
Date: Thu Mar 16 10:52:25 2017 -0400

    Prevent duplicate entries in the image cache

    Add a synchronization lock to prevent duplicate entries in the image
    cache. The relevant code was refactored into its own function in order
    to reduce the scope of the lock.

    Closes-Bug: #1649636
    Change-Id: I979f966c821876750b2a616ef32a905192eafbd6
    (cherry picked from commit 63aa3c7d1cf73e18067a7ae3a68a173359994aab)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 10.0.1

This issue was fixed in the openstack/cinder 10.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 11.0.0.0b1

This issue was fixed in the openstack/cinder 11.0.0.0b1 development milestone.

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.