copy-image, multiple image imports dosen't work as expected if all_stores_must_succeed passed as string

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

Bug Description

If user passes 'all_stores_must_succeed' as 'false' in copy-image, multiple image imports request body then it does not work as expected.
Expected is to skip the failure store and continue copying/importing image to other stores but instead it stops execution of task and revert it and deletes the image data copied/imported to previous stores.

How to reproduce:

1. Ensure multipe stores are enabled in your environment and multiple stores are configured
2. Run below commands to import image in multiple stores
   glance --debug image-create-via-import --container-format ami --disk-format ami --name import_scenario --file gentoo_root.img --all-stores True --allow-failure True
   (internal curl command to API - curl -g -i -X POST http://192.168.100.13:9292/v2/images/04f891c8-1a20-4c3d-a270-59b1123584cb/import -H "Content-Type: application/json" -H "User-Agent: python-glanceclient" -H "X-Auth-Token: {SHA256}b83a45c9d14131f4d461af948a9c2bf961a035762c3af6e9cc7432bb5e33b2bb" -d '{"method": {"name": "glance-direct"}, "stores": ["ceph", "cheap", "slow", "reliable", "common"], "all_stores_must_succeed": "false"}')

Assume failure occures while importing image to "slow" store

Expected result:
   Image should be uploaded to all other stores except "slow" store

Actual result:
   Image remains in 'importing' state and data imported to previous stores get deleted while reverting the import tasks.

Changed in glance:
importance: Undecided → Critical
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/718367

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/718367
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=55b7c86ecf349ee02a64dd77ff351c131f97276c
Submitter: Zuul
Branch: master

commit 55b7c86ecf349ee02a64dd77ff351c131f97276c
Author: Abhishek Kekane <email address hidden>
Date: Wed Apr 8 09:47:44 2020 +0000

    Fix multiple image imports if boolean input passed as string

    If user passes 'all_stores_must_succeed' as 'false' in copy-image, multiple
    image imports request body then it does not work as expected. Expected is
    to skip the failure store and continue copying/importing image to other
    stores but instead it stops execution of task and revert it and deletes
    the image data copied/imported to previois stores.

    Raised 400 BadRequest if 'all_stores_must_succeed' and 'all_stores' are
    other thatn than boolean values.

    NOTE: Documentation clearly suggest that we expect boolean values for
    'all_stores_must_succeed' and 'all_stores'

    Closes-Bug: #1871588
    Change-Id: I5118489284fea007f8f29663581221b07a575cf3

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.