Multiple import fails if all-stores 'True' is passed

Bug #1863879 reported by Abhishek Kekane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Abhishek Kekane

Bug Description

Newly added multiple import fails if user passes "all_stores" as "true" in the request.
The reason is if all_stores is specified then we are getting stores using CONF.enabled_backends and unfortunately we are injecting reserved stores 'os_glance_staging_store' and 'os_glance_tasks_store' runtime. As a result import job tries to import the image in the 'os_glance_staging_store' store as well where it fails as that image is already staged in this staging store.

Steps to reproduce:

1. Create image using
   glance --debug image-create-via-import --disk-format qcow2 --container-format bare --name multi-copy-test-13
2. Stage the data for import using
   glance image-stage <image-id> --file <file-name>
3. import image in multiple stores by setting all_stores as true
   curl -g -i -X POST http://192.168.0.27:9292/v2/images/<img-id>/import "User-Agent: python-glanceclient" -H "Content-Type: application/json" -H "X-Auth-Token: <token>" -d '{"method": {"name": "glance-direct"}, "all_stores": "true"}'

Expected result:
Image should be imported in all stores configured using enabled_backends config option

Actual result:
Image fails to import and data remains in staging area

Possible solution:
After population stores using CONF.enabled_backends, remove reserved stores from those stores.

Changed in glance:
importance: Undecided → High
assignee: nobody → Abhishek Kekane (abhishek-kekane)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.opendev.org/708629

Changed in glance:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.opendev.org/708629
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=d7de7ccbd68a77e07cde0e3d8bb1a0874c0be903
Submitter: Zuul
Branch: master

commit d7de7ccbd68a77e07cde0e3d8bb1a0874c0be903
Author: Abhishek Kekane <email address hidden>
Date: Wed Feb 19 12:03:58 2020 +0000

    Multiple import fails if "all_stores" specified as "true"

    Newly added multiple import fails if user passes "all_stores" as "true"
    in the request. The reason is if all_stores is specified then we are getting
    stores using CONF.enabled_backends and unfortunately we are injecting
    reserved stores 'os_glance_staging_store' and 'os_glance_tasks_store'
    runtime. As a result import job tries to import the image in the
    'os_glance_staging_store' store as well where it fails as that image
    is already staged in this staging store.

    Made a provision to exclude available reserved stores if "all_stores"
    is specified.

    Change-Id: If2616c275a969cdad5649e2cb0851275e5d0c7d2
    Closes-Bug: #1863879

Changed in glance:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 20.0.0.0b3

This issue was fixed in the openstack/glance 20.0.0.0b3 development milestone.

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.