{"push_id":1443160144,"size":1,"distinct_size":1,"ref":"refs/heads/milestone-proposed","head":"5b197c393fa1ac1b2593c3a81e7258ed2b305369","before":"ab75f7f5b6af523a8be218846c840a9598e4bc40","commits":[{"sha":"5b197c393fa1ac1b2593c3a81e7258ed2b305369","author":{"name":"Jenkins","email":"61eb39d4445155efb6068840385577c11776cd20@review.openstack.org"},"message":"Updated openstack/openstack\nProject: openstack/glance  62ea036a4a65b627ef1ce124b5275da4886e3ddd\n\nRestrict location updates to active, queued images\n\nCurrently image location updates (removing, replacing) are permitted for\nimages even if their state is not ``active``.\n\nThis need is to:\n * Prevent the replacement of image locations of images that are not\n   ``active`` or ``queued`` by returning a Conflict Error\n    (409 response code).\n * Prevent removal of image locations of images that are not ``active``\n   by returning a Conflict Error (409 response code).\n\nChanging of image locations when the image state is not ``active`` can\nresult in bad experiences for the users.\n *  If one tries to change or remove the location for an image while it\n    is in ``saving`` state, Glance would be trying to write data to a\n    previously saved location while the user updates the custom\n    location. This results in a race condition.\n *  For images that are in ``queued`` state and no image data has been\n    uploaded yet, there is no need for an image location to be\n    removed and permitting users to remove the image\n    location can result in a bad experience. However users can be\n    allowed to replace the image location to maintain backward\n    compatibility and also because replacing could mean replacing an\n    empty location by a non-empty image location.\n*   For images in ``deactivated`` state, it is essential that image\n    locations are not updated as it does not abide with the purpose of\n    the image state being set to ``deactivated`` and may cause security\n    concerns.\n\nThis commit introduces the following change in behavior:\n  * If an image is in ``active`` state, removing/replacing the custom\n    locations on that image will be allowed so there is no change in\n    behavior for this case.\n  * If an image is in ``saving`` or ``deactivated``, the status of\n    that image will be checked while trying to replace/remove the custom\n    location and a HTTP 409 Conflict status will be returned in response\n    to the user.\n  * If an image is in ``queued`` state, removing the custom\n    image location will not be permitted as an image in queued status\n    should not have any location associated with it. Replacing of location\n    may be permitted here though.\n  * If an image is in ``deleted`` or ``pending_delete`` state, a HTTP\n    409 Conflict status will be returned, if that image is visible to\n    the user (in case of admins). Otherwise, the location cannot be\n    removed/replaced anyway.  Please note ``pending_delete`` is another\n    form of the ``deleted`` status and behavior in either case should be\n    expected to be same.\n  * If an image is in ``killed`` status, a HTTP 409 Conflict status will\n    be returned.\n\nTODO:\nAtomicity is required such that glance permits removal/replacement of\nimage locations on certain permissible image transition states handling\nthe race conditions like:\n  * In case where the status of the image is ``saving`` and it\n    has just moved to ```active`` status, ideally removing/replacing\n    custom location should be allowed. However, due to lack of\n    atomicity in setting image status glance will ignore setting the\n    location and a 409 will be returned.\n  * In case where the status of the image is ``deactivated`` and it\n    has just been moved to ``active`` status, ideally\n    removing/replacing custom location should be allowed. Again, due\n    to lack of atomicity in setting image status glance will ignore\n    the request and a 409 will be returned.\n  * In case where the status of the image is ``active`` and it has\n    just been moved to ``deactivated`` status, due to lack of\n    atomicity in setting image status, glance may remove/replace\n    the location on that image.\n  * In case where the status of the image is ``queued`` and it has\n    just been moved to ``saving`` status, due to lack of atomicity\n    in setting image status, glance may replace the location for\n    that image.\n  * In case where the status of the image is ``active`` and location\n    is attempted to be set on it, and at that point if the image goes\n    into ``deleted``, ``pending_delete`` or ``killed`` status, then the\n    user must get a HTTP 409 Conflict status. However due to lack of\n    atomicity in setting the image status, the location may get updated.\n\nNOTE:\nThis commit ensures that removal of image locations\nis not allowed for an image in any state except ``active`` and\nreplacement of an image location is not allowed except for ``active``\nand ``queued`` images.\nFurther work is required on the atomicity of glance to accommodate\nlocation updates in cases where the images would be undergoing state\nchanges.\n\nImpacts:\nAPIImpact\nDocImpact\n\nCredits:\nThis commit message contains text and information from the commit\nmessage for: https://review.openstack.org/#/c/324012/\nco authored by Nikhil Komawar <nik.komawar@gmail.com>.\n\nCo-Authored-By: Nikhil Komawar <nik.komawar@gmail.com>\nCo-Authored-By: Dharini Chandrasekar <dharini.chandrasekar@intel.com>\n\nLite-Spec: https://review.openstack.org/#/c/368192/\nCloses-Bug: 1622016\n\nChange-Id: Ic24cf8234599a32add1cb9f294f902e497d885e0","distinct":true,"url":"https://api.github.com/repos/openstack/openstack/commits/5b197c393fa1ac1b2593c3a81e7258ed2b305369"}]}
{"actor":{"display_login":"openstack-gerrit"}}