Libvirt's image caching fetches images multiple times

Bug #1298420 reported by John Warren
30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
John Warren

Bug Description

When launching several VMs in rapid succession, it is possible that libvirt's image caching will fetch the same image several times. This can occur when all of the VMs in question are using the same base image and this base image has not been previously fetched. The inline fetch_func_sync method prevents multiple threads from fetching the same image at the same time, but it does not prevent a thread that is waiting to acquire the lock from fetching the image that was being fetched while the lock was still in use. This is because the presence of the image is checked only before the lock has been acquired, not after.

Tags: libvirt
wangpan (hzwangpan)
Changed in nova:
assignee: nobody → wangpan (hzwangpan)
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Jay Pipes (jaypipes)
description: updated
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
Joe Gordon (jogo) wrote :
Revision history for this message
Sean Dague (sdague) wrote :

There are competing upstream patches, and it's not really clear either are making forward progress.

Changed in nova:
assignee: wangpan (hzwangpan) → nobody
status: In Progress → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Wangpan (<email address hidden>) on branch: master
Review: https://review.openstack.org/83313

Changed in nova:
assignee: nobody → Joe Gordon (jogo)
status: Confirmed → In Progress
Changed in nova:
assignee: Joe Gordon (jogo) → John Warren (jswarren)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/83400
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=04fa99095cd82f7b6030694996c75d2fd95e7c61
Submitter: Jenkins
Branch: master

commit 04fa99095cd82f7b6030694996c75d2fd95e7c61
Author: John Warren <email address hidden>
Date: Thu Mar 27 14:26:48 2014 +0000

    Add exists check to fetch_func_sync in libvirt imagebackend

    This change adds a path exists check to fetch_func_sync to deal with
    cases where a thread is waiting to acquire the lock while another
    thread has the lock and is downloading the same image. Without this
    check the same image template will be downloaded multiple times.

    Change-Id: Ib410903c7fd9d6954a8082391f89b42bac6a20d3
    Closes-Bug: #1298420

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-rc1 → 2014.2
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.