)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"eab129903503b9f04fb649ccee7fb62054e5df65","unresolved":false,"context_lines":[{"line_number":11,"context_line":"consumer generation conflict for it. This call now moves everything from"},{"line_number":12,"context_line":"one consumer to another and also it retries in case of consumer"},{"line_number":13,"context_line":"generation conflict is returned from placement. If run out of retries it"},{"line_number":14,"context_line":"raises AllocationMoveFailed to the caller."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"TODO:"},{"line_number":17,"context_line":"* functional test shows that if move_allocation fails during migrate"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_d389d274","line":14,"updated":"2018-08-15 13:55:47.000000000","message":"and then what? does the caller care?","commit_id":"e665e7ec7c173fee94fb0a43f1fc1548c99bc3f5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5e4882d08baef5186342aa029761a27a7f430572","unresolved":false,"context_lines":[{"line_number":11,"context_line":"consumer generation conflict for it. This call now moves everything from"},{"line_number":12,"context_line":"one consumer to another and also it retries in case of consumer"},{"line_number":13,"context_line":"generation conflict is returned from placement. If run out of retries it"},{"line_number":14,"context_line":"raises AllocationMoveFailed to the caller."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"TODO:"},{"line_number":17,"context_line":"* functional test shows that if move_allocation fails during migrate"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_64e41a0e","line":14,"in_reply_to":"3f79a3b5_d389d274","updated":"2018-08-22 13:00:05.000000000","message":"I think it should care. I think if nova fails to make the allocation manipulation in placement then nova should fail the high level server lifecycle operation (e.g. migrate).\n\nI still don\u0027t how should this failure look like from the API user perspective. See my last reply on the ML[1]\n\n[1]http://lists.openstack.org/pipermail/openstack-dev/2018-August/133660.html","commit_id":"e665e7ec7c173fee94fb0a43f1fc1548c99bc3f5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4313b66966e0acedc0b6d12e9e7cdfc62dfc23a1","unresolved":false,"context_lines":[{"line_number":15,"context_line":"When migration or resize fails to move the source host allocation to the"},{"line_number":16,"context_line":"migration_uuid then the API returns HTTP 409 and the migration is aborted."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"When reverting a migration, a resize or a resize to same host fails to move"},{"line_number":19,"context_line":"the source host allocation back to the instance_uuid due consumer generation"},{"line_number":20,"context_line":"conflict the instance will be put to ERROR state. The instance still has two"},{"line_number":21,"context_line":"allocations in this state and deleting the instance only deletes the one that"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f79a3b5_44cf3a7e","line":18,"range":{"start_line":18,"start_character":27,"end_line":18,"end_character":29},"updated":"2018-09-20 20:04:09.000000000","message":"if a","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"71c03fdba63cf37e053ff10c1e5b6f8225dfe094","unresolved":false,"context_lines":[{"line_number":15,"context_line":"When migration or resize fails to move the source host allocation to the"},{"line_number":16,"context_line":"migration_uuid then the API returns HTTP 409 and the migration is aborted."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"When reverting a migration, a resize or a resize to same host fails to move"},{"line_number":19,"context_line":"the source host allocation back to the instance_uuid due consumer generation"},{"line_number":20,"context_line":"conflict the instance will be put to ERROR state. The instance still has two"},{"line_number":21,"context_line":"allocations in this state and deleting the instance only deletes the one that"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f79a3b5_6d068fd0","line":18,"range":{"start_line":18,"start_character":27,"end_line":18,"end_character":29},"in_reply_to":"3f79a3b5_44cf3a7e","updated":"2018-09-25 14:36:50.000000000","message":"I\u0027m not 100% sure I understood the comment but I did changed the commit message a bit :) There is 3 cases here 1) reverting a migration, 2) reverting a resize 3) reverting a resize to same host. In all three cases if the allocation manipulation fails nova will leak.","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4313b66966e0acedc0b6d12e9e7cdfc62dfc23a1","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"When reverting a migration, a resize or a resize to same host fails to move"},{"line_number":19,"context_line":"the source host allocation back to the instance_uuid due consumer generation"},{"line_number":20,"context_line":"conflict the instance will be put to ERROR state. The instance still has two"},{"line_number":21,"context_line":"allocations in this state and deleting the instance only deletes the one that"},{"line_number":22,"context_line":"is held by the instance_uuid. This patch logs an ERROR describing that in this"},{"line_number":23,"context_line":"case the allocation held by the migration_uuid is leaked."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f79a3b5_04c5c25b","line":20,"range":{"start_line":20,"start_character":34,"end_line":20,"end_character":36},"updated":"2018-09-20 20:04:09.000000000","message":"into","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"71c03fdba63cf37e053ff10c1e5b6f8225dfe094","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"When reverting a migration, a resize or a resize to same host fails to move"},{"line_number":19,"context_line":"the source host allocation back to the instance_uuid due consumer generation"},{"line_number":20,"context_line":"conflict the instance will be put to ERROR state. The instance still has two"},{"line_number":21,"context_line":"allocations in this state and deleting the instance only deletes the one that"},{"line_number":22,"context_line":"is held by the instance_uuid. This patch logs an ERROR describing that in this"},{"line_number":23,"context_line":"case the allocation held by the migration_uuid is leaked."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f79a3b5_0d0b5bd5","line":20,"range":{"start_line":20,"start_character":34,"end_line":20,"end_character":36},"in_reply_to":"3f79a3b5_04c5c25b","updated":"2018-09-25 14:36:50.000000000","message":"Done","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4313b66966e0acedc0b6d12e9e7cdfc62dfc23a1","unresolved":false,"context_lines":[{"line_number":22,"context_line":"is held by the instance_uuid. This patch logs an ERROR describing that in this"},{"line_number":23,"context_line":"case the allocation held by the migration_uuid is leaked."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"TODO:"},{"line_number":26,"context_line":"* Document the possible HTTP 409 return code for migrate and resize in"},{"line_number":27,"context_line":"  the API doc."},{"line_number":28,"context_line":"* Add a release note describing the possible leak during migrate and"},{"line_number":29,"context_line":"* resize revert."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Blueprint: use-nested-allocation-candidates"},{"line_number":32,"context_line":"Change-Id: Ie991d4b53e9bb5e7ec26da99219178ab7695abf6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f79a3b5_84a6b2bf","line":29,"range":{"start_line":25,"start_character":0,"end_line":29,"end_character":16},"updated":"2018-09-20 20:04:09.000000000","message":"here or later?","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"71c03fdba63cf37e053ff10c1e5b6f8225dfe094","unresolved":false,"context_lines":[{"line_number":22,"context_line":"is held by the instance_uuid. This patch logs an ERROR describing that in this"},{"line_number":23,"context_line":"case the allocation held by the migration_uuid is leaked."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"TODO:"},{"line_number":26,"context_line":"* Document the possible HTTP 409 return code for migrate and resize in"},{"line_number":27,"context_line":"  the API doc."},{"line_number":28,"context_line":"* Add a release note describing the possible leak during migrate and"},{"line_number":29,"context_line":"* resize revert."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Blueprint: use-nested-allocation-candidates"},{"line_number":32,"context_line":"Change-Id: Ie991d4b53e9bb5e7ec26da99219178ab7695abf6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f79a3b5_4ee950e1","line":29,"range":{"start_line":25,"start_character":0,"end_line":29,"end_character":16},"in_reply_to":"3f79a3b5_84a6b2bf","updated":"2018-09-25 14:36:50.000000000","message":"I\u0027ve double checked and migrate, resize and resizeRevert all has 409 listed as possible error code in the API ref already.\nAlso now I have added a release notes about the leak.","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"}],"nova/api/openstack/compute/migrate_server.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4313b66966e0acedc0b6d12e9e7cdfc62dfc23a1","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        except (exception.NoValidHost, exception.ComputeHostNotFound,"},{"line_number":68,"context_line":"                exception.CannotMigrateToSameHost) as e:"},{"line_number":69,"context_line":"            raise exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":70,"context_line":"        except exception.AllocationMoveFailed as e:"},{"line_number":71,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @wsgi.response(202)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_648fd62d","line":70,"range":{"start_line":70,"start_character":15,"end_line":70,"end_character":45},"updated":"2018-09-20 20:04:09.000000000","message":"Add this to L59-60.","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"71c03fdba63cf37e053ff10c1e5b6f8225dfe094","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        except (exception.NoValidHost, exception.ComputeHostNotFound,"},{"line_number":68,"context_line":"                exception.CannotMigrateToSameHost) as e:"},{"line_number":69,"context_line":"            raise exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":70,"context_line":"        except exception.AllocationMoveFailed as e:"},{"line_number":71,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @wsgi.response(202)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_2e72d413","line":70,"range":{"start_line":70,"start_character":15,"end_line":70,"end_character":45},"in_reply_to":"3f79a3b5_648fd62d","updated":"2018-09-25 14:36:50.000000000","message":"Done","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"}],"nova/api/openstack/compute/servers.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4313b66966e0acedc0b6d12e9e7cdfc62dfc23a1","unresolved":false,"context_lines":[{"line_number":831,"context_line":"        except exception.Invalid:"},{"line_number":832,"context_line":"            msg \u003d _(\"Invalid instance image.\")"},{"line_number":833,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":834,"context_line":"        except exception.AllocationMoveFailed as e:"},{"line_number":835,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":836,"context_line":""},{"line_number":837,"context_line":"    @wsgi.response(204)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_a482cefd","line":834,"range":{"start_line":834,"start_character":15,"end_line":834,"end_character":45},"updated":"2018-09-20 20:04:09.000000000","message":"Add to L811","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"71c03fdba63cf37e053ff10c1e5b6f8225dfe094","unresolved":false,"context_lines":[{"line_number":831,"context_line":"        except exception.Invalid:"},{"line_number":832,"context_line":"            msg \u003d _(\"Invalid instance image.\")"},{"line_number":833,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":834,"context_line":"        except exception.AllocationMoveFailed as e:"},{"line_number":835,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":836,"context_line":""},{"line_number":837,"context_line":"    @wsgi.response(204)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_6e51ac63","line":834,"range":{"start_line":834,"start_character":15,"end_line":834,"end_character":45},"in_reply_to":"3f79a3b5_a482cefd","updated":"2018-09-25 14:36:50.000000000","message":"Done","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"}],"nova/compute/manager.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"eab129903503b9f04fb649ccee7fb62054e5df65","unresolved":false,"context_lines":[{"line_number":3966,"context_line":"                           \u0027allocation\u0027),"},{"line_number":3967,"context_line":"                         {\u0027node\u0027: nodename, \u0027mig\u0027: migration.uuid})"},{"line_number":3968,"context_line":"                return"},{"line_number":3969,"context_line":""},{"line_number":3970,"context_line":"        # TODO(danms): Remove below this line when we remove compatibility"},{"line_number":3971,"context_line":"        # for double-accounting migrations (likely rocky)"},{"line_number":3972,"context_line":"        LOG.info(_(\u0027Doing legacy allocation math for migration %(mig)s after \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_937fda64","side":"PARENT","line":3969,"updated":"2018-08-15 13:55:47.000000000","message":"?","commit_id":"e7bdf5b59a639f337a3e0e1517f0a7855ec5c447"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"660a65cccd750a4b8600f55f1f22911e7e784581","unresolved":false,"context_lines":[{"line_number":3966,"context_line":"                           \u0027allocation\u0027),"},{"line_number":3967,"context_line":"                         {\u0027node\u0027: nodename, \u0027mig\u0027: migration.uuid})"},{"line_number":3968,"context_line":"                return"},{"line_number":3969,"context_line":""},{"line_number":3970,"context_line":"        # TODO(danms): Remove below this line when we remove compatibility"},{"line_number":3971,"context_line":"        # for double-accounting migrations (likely rocky)"},{"line_number":3972,"context_line":"        LOG.info(_(\u0027Doing legacy allocation math for migration %(mig)s after \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_ccd9f356","side":"PARENT","line":3969,"in_reply_to":"3f79a3b5_937fda64","updated":"2018-09-12 19:37:55.000000000","message":"Done","commit_id":"e7bdf5b59a639f337a3e0e1517f0a7855ec5c447"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"eab129903503b9f04fb649ccee7fb62054e5df65","unresolved":false,"context_lines":[{"line_number":4189,"context_line":"                 \u0027%(mig)s for instance\u0027,"},{"line_number":4190,"context_line":"                 {\u0027node\u0027: cn_uuid, \u0027mig\u0027: migration.uuid},"},{"line_number":4191,"context_line":"                 instance\u003dinstance)"},{"line_number":4192,"context_line":"        # TODO(cdent): Should we be doing anything with return values here?"},{"line_number":4193,"context_line":"        self.reportclient.move_allocations(context, migration.uuid,"},{"line_number":4194,"context_line":"                                           instance.uuid)"},{"line_number":4195,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_138bca67","line":4192,"updated":"2018-08-15 13:55:47.000000000","message":"heh, looks like I\u0027ve bee confused/concerned about this for some time","commit_id":"e665e7ec7c173fee94fb0a43f1fc1548c99bc3f5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5e4882d08baef5186342aa029761a27a7f430572","unresolved":false,"context_lines":[{"line_number":4189,"context_line":"                 \u0027%(mig)s for instance\u0027,"},{"line_number":4190,"context_line":"                 {\u0027node\u0027: cn_uuid, \u0027mig\u0027: migration.uuid},"},{"line_number":4191,"context_line":"                 instance\u003dinstance)"},{"line_number":4192,"context_line":"        # TODO(cdent): Should we be doing anything with return values here?"},{"line_number":4193,"context_line":"        self.reportclient.move_allocations(context, migration.uuid,"},{"line_number":4194,"context_line":"                                           instance.uuid)"},{"line_number":4195,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_24eaa2d7","line":4192,"in_reply_to":"3f79a3b5_138bca67","updated":"2018-08-22 13:00:05.000000000","message":"Yes, I think your concern is totally valid.","commit_id":"e665e7ec7c173fee94fb0a43f1fc1548c99bc3f5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4313b66966e0acedc0b6d12e9e7cdfc62dfc23a1","unresolved":false,"context_lines":[{"line_number":4101,"context_line":"            except exception.AllocationMoveFailed:"},{"line_number":4102,"context_line":"                LOG.error(\u0027Reverting allocation in placement for migration \u0027"},{"line_number":4103,"context_line":"                          \u0027%(migration_uuid)s failed. The instance \u0027"},{"line_number":4104,"context_line":"                          \u0027%(instance_uuid)s will be put to ERROR state but \u0027"},{"line_number":4105,"context_line":"                          \u0027the allocation held by the migration is leaked.\u0027,"},{"line_number":4106,"context_line":"                          {\u0027instance_uuid\u0027: instance.uuid,"},{"line_number":4107,"context_line":"                           \u0027migration_uuid\u0027: migration.uuid})"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_0473824f","line":4104,"range":{"start_line":4104,"start_character":57,"end_line":4104,"end_character":59},"updated":"2018-09-20 20:04:09.000000000","message":"into","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"71c03fdba63cf37e053ff10c1e5b6f8225dfe094","unresolved":false,"context_lines":[{"line_number":4101,"context_line":"            except exception.AllocationMoveFailed:"},{"line_number":4102,"context_line":"                LOG.error(\u0027Reverting allocation in placement for migration \u0027"},{"line_number":4103,"context_line":"                          \u0027%(migration_uuid)s failed. The instance \u0027"},{"line_number":4104,"context_line":"                          \u0027%(instance_uuid)s will be put to ERROR state but \u0027"},{"line_number":4105,"context_line":"                          \u0027the allocation held by the migration is leaked.\u0027,"},{"line_number":4106,"context_line":"                          {\u0027instance_uuid\u0027: instance.uuid,"},{"line_number":4107,"context_line":"                           \u0027migration_uuid\u0027: migration.uuid})"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_893442e1","line":4104,"range":{"start_line":4104,"start_character":57,"end_line":4104,"end_character":59},"in_reply_to":"3f79a3b5_0473824f","updated":"2018-09-25 14:36:50.000000000","message":"Done","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4bbbb703d8ae2a1beb0d770c93ecb63f496e07d2","unresolved":false,"context_lines":[{"line_number":4208,"context_line":"                 \u0027%(mig)s for instance\u0027,"},{"line_number":4209,"context_line":"                 {\u0027node\u0027: cn_uuid, \u0027mig\u0027: migration.uuid},"},{"line_number":4210,"context_line":"                 instance\u003dinstance)"},{"line_number":4211,"context_line":"        # TODO(cdent): Should we be doing anything with return values here?"},{"line_number":4212,"context_line":"        self.reportclient.move_allocations(context, migration.uuid,"},{"line_number":4213,"context_line":"                                           instance.uuid)"},{"line_number":4214,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_bc011eb8","line":4211,"updated":"2018-09-26 13:14:10.000000000","message":"You can probably remove the above comment, since the exception raise is the appropriate behaviour for move_allocations()","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d3d26c341945d776300cfc9edd773b0d9f40591b","unresolved":false,"context_lines":[{"line_number":4208,"context_line":"                 \u0027%(mig)s for instance\u0027,"},{"line_number":4209,"context_line":"                 {\u0027node\u0027: cn_uuid, \u0027mig\u0027: migration.uuid},"},{"line_number":4210,"context_line":"                 instance\u003dinstance)"},{"line_number":4211,"context_line":"        # TODO(cdent): Should we be doing anything with return values here?"},{"line_number":4212,"context_line":"        self.reportclient.move_allocations(context, migration.uuid,"},{"line_number":4213,"context_line":"                                           instance.uuid)"},{"line_number":4214,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_542e88ab","line":4211,"in_reply_to":"3f79a3b5_bc011eb8","updated":"2018-09-27 11:58:13.000000000","message":"there is still a return False if the there is 4xx error code other than 409","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"eab129903503b9f04fb649ccee7fb62054e5df65","unresolved":false,"context_lines":[{"line_number":1823,"context_line":"        moves what source has in Placement."},{"line_number":1824,"context_line":""},{"line_number":1825,"context_line":"        :param context: The security context"},{"line_number":1826,"context_line":"        :param source_consumer_uuid: the UUID of the consumer that\u0027s allocation"},{"line_number":1827,"context_line":"                                     is being moved."},{"line_number":1828,"context_line":"        :param target_consumer_uuid: the UUID of the consumer where the"},{"line_number":1829,"context_line":"                                     allocation is moved"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_f3908eef","line":1826,"updated":"2018-08-15 13:55:47.000000000","message":"this phrasing is a bit confusing and easy to misunderstand, maybe:\n\nsource: the UUID of the consumer from which allocations are moving\ntarget: the UUID of the target consumer for the allocations\n\nthe lack of parallelism helps to make it clear they are different (parallelism would be \"the UUID of the consumer to which...\" which would be easy to miss","commit_id":"e665e7ec7c173fee94fb0a43f1fc1548c99bc3f5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"660a65cccd750a4b8600f55f1f22911e7e784581","unresolved":false,"context_lines":[{"line_number":1823,"context_line":"        moves what source has in Placement."},{"line_number":1824,"context_line":""},{"line_number":1825,"context_line":"        :param context: The security context"},{"line_number":1826,"context_line":"        :param source_consumer_uuid: the UUID of the consumer that\u0027s allocation"},{"line_number":1827,"context_line":"                                     is being moved."},{"line_number":1828,"context_line":"        :param target_consumer_uuid: the UUID of the consumer where the"},{"line_number":1829,"context_line":"                                     allocation is moved"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_0cb92beb","line":1826,"in_reply_to":"3f79a3b5_f3908eef","updated":"2018-09-12 19:37:55.000000000","message":"Done","commit_id":"e665e7ec7c173fee94fb0a43f1fc1548c99bc3f5"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"eab129903503b9f04fb649ccee7fb62054e5df65","unresolved":false,"context_lines":[{"line_number":1855,"context_line":"                \u0027project_id\u0027: target_alloc.get(\u0027project_id\u0027,"},{"line_number":1856,"context_line":"                                               source_alloc[\u0027project_id\u0027]),"},{"line_number":1857,"context_line":"                \u0027user_id\u0027: target_alloc.get(\u0027user_id\u0027,"},{"line_number":1858,"context_line":"                                            source_alloc[\u0027user_id\u0027]),"},{"line_number":1859,"context_line":"                \u0027consumer_generation\u0027: target_alloc.get(\u0027consumer_generation\u0027)"},{"line_number":1860,"context_line":"            }"},{"line_number":1861,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_3362860b","line":1858,"updated":"2018-08-15 13:55:47.000000000","message":"What are the circumstances where we wouldn\u0027t want to always use the source_alloc project and user?\n\nOr to put it another way: When would they ever be different, and why?\n\nI suspect I\u0027m pretty confused about who owns allocations in these situations.","commit_id":"e665e7ec7c173fee94fb0a43f1fc1548c99bc3f5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5e4882d08baef5186342aa029761a27a7f430572","unresolved":false,"context_lines":[{"line_number":1855,"context_line":"                \u0027project_id\u0027: target_alloc.get(\u0027project_id\u0027,"},{"line_number":1856,"context_line":"                                               source_alloc[\u0027project_id\u0027]),"},{"line_number":1857,"context_line":"                \u0027user_id\u0027: target_alloc.get(\u0027user_id\u0027,"},{"line_number":1858,"context_line":"                                            source_alloc[\u0027user_id\u0027]),"},{"line_number":1859,"context_line":"                \u0027consumer_generation\u0027: target_alloc.get(\u0027consumer_generation\u0027)"},{"line_number":1860,"context_line":"            }"},{"line_number":1861,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_84ae167f","line":1858,"in_reply_to":"3f79a3b5_3362860b","updated":"2018-08-22 13:00:05.000000000","message":"Good point. But a tangential one. The baseline also blindly copy the project_id, user_id from the source allocation to the dest allocation. I can put your questions in the code as a comment, but I suggest try to answer it separately.","commit_id":"e665e7ec7c173fee94fb0a43f1fc1548c99bc3f5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"660a65cccd750a4b8600f55f1f22911e7e784581","unresolved":false,"context_lines":[{"line_number":1855,"context_line":"                \u0027project_id\u0027: target_alloc.get(\u0027project_id\u0027,"},{"line_number":1856,"context_line":"                                               source_alloc[\u0027project_id\u0027]),"},{"line_number":1857,"context_line":"                \u0027user_id\u0027: target_alloc.get(\u0027user_id\u0027,"},{"line_number":1858,"context_line":"                                            source_alloc[\u0027user_id\u0027]),"},{"line_number":1859,"context_line":"                \u0027consumer_generation\u0027: target_alloc.get(\u0027consumer_generation\u0027)"},{"line_number":1860,"context_line":"            }"},{"line_number":1861,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_2c8c2734","line":1858,"in_reply_to":"3f79a3b5_84ae167f","updated":"2018-09-12 19:37:55.000000000","message":"Added your question as a Note in the code","commit_id":"e665e7ec7c173fee94fb0a43f1fc1548c99bc3f5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4313b66966e0acedc0b6d12e9e7cdfc62dfc23a1","unresolved":false,"context_lines":[{"line_number":1947,"context_line":"                        consumer_uuid, r.status_code, r.text)"},{"line_number":1948,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":1949,"context_line":""},{"line_number":1950,"context_line":"    @safe_connect"},{"line_number":1951,"context_line":"    @retries"},{"line_number":1952,"context_line":"    def move_allocations(self, context, source_consumer_uuid,"},{"line_number":1953,"context_line":"                         target_consumer_uuid):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_3fe6c717","line":1950,"range":{"start_line":1950,"start_character":5,"end_line":1950,"end_character":17},"updated":"2018-09-20 20:04:09.000000000","message":"can this die, since you\u0027re basically rewriting the method?","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"71c03fdba63cf37e053ff10c1e5b6f8225dfe094","unresolved":false,"context_lines":[{"line_number":1947,"context_line":"                        consumer_uuid, r.status_code, r.text)"},{"line_number":1948,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":1949,"context_line":""},{"line_number":1950,"context_line":"    @safe_connect"},{"line_number":1951,"context_line":"    @retries"},{"line_number":1952,"context_line":"    def move_allocations(self, context, source_consumer_uuid,"},{"line_number":1953,"context_line":"                         target_consumer_uuid):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_4de5d33d","line":1950,"range":{"start_line":1950,"start_character":5,"end_line":1950,"end_character":17},"in_reply_to":"3f79a3b5_3fe6c717","updated":"2018-09-25 14:36:50.000000000","message":"Would that mean I have to replicate the warnings currently emitted by the @safe_connect decorator or let the keystoneauth1.exceptions.base.ClientException propagate? If it is the later that you suggest then I\u0027d like to do that separately as that means yet another error case to take care about higher in the call stack.","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"95e637382ce6a61297d7c593288014fe0924f3cc","unresolved":false,"context_lines":[{"line_number":1947,"context_line":"                        consumer_uuid, r.status_code, r.text)"},{"line_number":1948,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":1949,"context_line":""},{"line_number":1950,"context_line":"    @safe_connect"},{"line_number":1951,"context_line":"    @retries"},{"line_number":1952,"context_line":"    def move_allocations(self, context, source_consumer_uuid,"},{"line_number":1953,"context_line":"                         target_consumer_uuid):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_b34164a9","line":1950,"range":{"start_line":1950,"start_character":5,"end_line":1950,"end_character":17},"in_reply_to":"3f79a3b5_4de5d33d","updated":"2018-09-25 15:56:28.000000000","message":"The latter. Yes, separately is fine.","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4313b66966e0acedc0b6d12e9e7cdfc62dfc23a1","unresolved":false,"context_lines":[{"line_number":1971,"context_line":"                                      been modified while this call tries to"},{"line_number":1972,"context_line":"                                      move allocations."},{"line_number":1973,"context_line":"        \"\"\""},{"line_number":1974,"context_line":"        source_alloc \u003d self.get(\u0027/allocations/%s\u0027 % source_consumer_uuid,"},{"line_number":1975,"context_line":"                                version\u003dCONSUMER_GENERATION_VERSION,"},{"line_number":1976,"context_line":"                                global_request_id\u003dcontext.global_id).json()"},{"line_number":1977,"context_line":"        target_alloc \u003d self.get(\u0027/allocations/%s\u0027 % target_consumer_uuid,"},{"line_number":1978,"context_line":"                                version\u003dCONSUMER_GENERATION_VERSION,"},{"line_number":1979,"context_line":"                                global_request_id\u003dcontext.global_id).json()"},{"line_number":1980,"context_line":""},{"line_number":1981,"context_line":"        if target_alloc and target_alloc[\u0027allocations\u0027]:"},{"line_number":1982,"context_line":"            LOG.warning(\u0027Overwriting current allocation %(allocation)s on \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_9fb4bbf2","line":1979,"range":{"start_line":1974,"start_character":0,"end_line":1979,"end_character":75},"updated":"2018-09-20 20:04:09.000000000","message":"Use get_allocs_for_consumer()","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"71c03fdba63cf37e053ff10c1e5b6f8225dfe094","unresolved":false,"context_lines":[{"line_number":1971,"context_line":"                                      been modified while this call tries to"},{"line_number":1972,"context_line":"                                      move allocations."},{"line_number":1973,"context_line":"        \"\"\""},{"line_number":1974,"context_line":"        source_alloc \u003d self.get(\u0027/allocations/%s\u0027 % source_consumer_uuid,"},{"line_number":1975,"context_line":"                                version\u003dCONSUMER_GENERATION_VERSION,"},{"line_number":1976,"context_line":"                                global_request_id\u003dcontext.global_id).json()"},{"line_number":1977,"context_line":"        target_alloc \u003d self.get(\u0027/allocations/%s\u0027 % target_consumer_uuid,"},{"line_number":1978,"context_line":"                                version\u003dCONSUMER_GENERATION_VERSION,"},{"line_number":1979,"context_line":"                                global_request_id\u003dcontext.global_id).json()"},{"line_number":1980,"context_line":""},{"line_number":1981,"context_line":"        if target_alloc and target_alloc[\u0027allocations\u0027]:"},{"line_number":1982,"context_line":"            LOG.warning(\u0027Overwriting current allocation %(allocation)s on \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_89a7620a","line":1979,"range":{"start_line":1974,"start_character":0,"end_line":1979,"end_character":75},"in_reply_to":"3f79a3b5_9fb4bbf2","updated":"2018-09-25 14:36:50.000000000","message":"Done","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4313b66966e0acedc0b6d12e9e7cdfc62dfc23a1","unresolved":false,"context_lines":[{"line_number":1986,"context_line":""},{"line_number":1987,"context_line":"        new_allocs \u003d {"},{"line_number":1988,"context_line":"            source_consumer_uuid: {"},{"line_number":1989,"context_line":"                # \u0027allocation\u0027: {} means we are removing the allocation from"},{"line_number":1990,"context_line":"                # the source consumer"},{"line_number":1991,"context_line":"                \u0027allocations\u0027: {},"},{"line_number":1992,"context_line":"                \u0027project_id\u0027: source_alloc[\u0027project_id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_7fa67fc2","line":1989,"range":{"start_line":1989,"start_character":19,"end_line":1989,"end_character":29},"updated":"2018-09-20 20:04:09.000000000","message":"allocations","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"71c03fdba63cf37e053ff10c1e5b6f8225dfe094","unresolved":false,"context_lines":[{"line_number":1986,"context_line":""},{"line_number":1987,"context_line":"        new_allocs \u003d {"},{"line_number":1988,"context_line":"            source_consumer_uuid: {"},{"line_number":1989,"context_line":"                # \u0027allocation\u0027: {} means we are removing the allocation from"},{"line_number":1990,"context_line":"                # the source consumer"},{"line_number":1991,"context_line":"                \u0027allocations\u0027: {},"},{"line_number":1992,"context_line":"                \u0027project_id\u0027: source_alloc[\u0027project_id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_49b14a44","line":1989,"range":{"start_line":1989,"start_character":19,"end_line":1989,"end_character":29},"in_reply_to":"3f79a3b5_7fa67fc2","updated":"2018-09-25 14:36:50.000000000","message":"Done","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4313b66966e0acedc0b6d12e9e7cdfc62dfc23a1","unresolved":false,"context_lines":[{"line_number":2008,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":2009,"context_line":"            # NOTE(jaypipes): Yes, it sucks doing string comparison like this"},{"line_number":2010,"context_line":"            # but we have no error codes, only error messages."},{"line_number":2011,"context_line":"            if \u0027resource provider generation conflict\u0027 in r.text:"},{"line_number":2012,"context_line":"                reason \u003d (\u0027another process changed the resource providers \u0027"},{"line_number":2013,"context_line":"                          \u0027involved in our attempt to post allocations for \u0027"},{"line_number":2014,"context_line":"                          \u0027consumer %s\u0027 % target_consumer_uuid)"},{"line_number":2015,"context_line":"                raise Retry(\u0027move_allocations\u0027, reason)"},{"line_number":2016,"context_line":"            else:"},{"line_number":2017,"context_line":"                LOG.warning("},{"line_number":2018,"context_line":"                    \u0027Unable to post allocations for consumer \u0027"},{"line_number":2019,"context_line":"                    \u0027%(uuid)s (%(code)i %(text)s)\u0027,"},{"line_number":2020,"context_line":"                    {\u0027uuid\u0027: target_consumer_uuid,"},{"line_number":2021,"context_line":"                     \u0027code\u0027: r.status_code,"},{"line_number":2022,"context_line":"                     \u0027text\u0027: r.text})"},{"line_number":2023,"context_line":"                if \u0027consumer generation conflict\u0027 in r.text:"},{"line_number":2024,"context_line":"                    raise exception.AllocationMoveFailed("},{"line_number":2025,"context_line":"                        source_consumer\u003dsource_consumer_uuid,"},{"line_number":2026,"context_line":"                        target_consumer\u003dtarget_consumer_uuid,"},{"line_number":2027,"context_line":"                        error\u003dr.text)"},{"line_number":2028,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":2029,"context_line":""},{"line_number":2030,"context_line":"    @safe_connect"},{"line_number":2031,"context_line":"    @retries"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_1f6e6b63","line":2028,"range":{"start_line":2011,"start_character":0,"end_line":2028,"end_character":1},"updated":"2018-09-20 20:04:09.000000000","message":"See [1] - same applies here.\n\n[1] https://review.openstack.org/#/c/591647/6/nova/scheduler/client/report.py@2069","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"71c03fdba63cf37e053ff10c1e5b6f8225dfe094","unresolved":false,"context_lines":[{"line_number":2008,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":2009,"context_line":"            # NOTE(jaypipes): Yes, it sucks doing string comparison like this"},{"line_number":2010,"context_line":"            # but we have no error codes, only error messages."},{"line_number":2011,"context_line":"            if \u0027resource provider generation conflict\u0027 in r.text:"},{"line_number":2012,"context_line":"                reason \u003d (\u0027another process changed the resource providers \u0027"},{"line_number":2013,"context_line":"                          \u0027involved in our attempt to post allocations for \u0027"},{"line_number":2014,"context_line":"                          \u0027consumer %s\u0027 % target_consumer_uuid)"},{"line_number":2015,"context_line":"                raise Retry(\u0027move_allocations\u0027, reason)"},{"line_number":2016,"context_line":"            else:"},{"line_number":2017,"context_line":"                LOG.warning("},{"line_number":2018,"context_line":"                    \u0027Unable to post allocations for consumer \u0027"},{"line_number":2019,"context_line":"                    \u0027%(uuid)s (%(code)i %(text)s)\u0027,"},{"line_number":2020,"context_line":"                    {\u0027uuid\u0027: target_consumer_uuid,"},{"line_number":2021,"context_line":"                     \u0027code\u0027: r.status_code,"},{"line_number":2022,"context_line":"                     \u0027text\u0027: r.text})"},{"line_number":2023,"context_line":"                if \u0027consumer generation conflict\u0027 in r.text:"},{"line_number":2024,"context_line":"                    raise exception.AllocationMoveFailed("},{"line_number":2025,"context_line":"                        source_consumer\u003dsource_consumer_uuid,"},{"line_number":2026,"context_line":"                        target_consumer\u003dtarget_consumer_uuid,"},{"line_number":2027,"context_line":"                        error\u003dr.text)"},{"line_number":2028,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":2029,"context_line":""},{"line_number":2030,"context_line":"    @safe_connect"},{"line_number":2031,"context_line":"    @retries"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_245f5310","line":2028,"range":{"start_line":2011,"start_character":0,"end_line":2028,"end_character":1},"in_reply_to":"3f79a3b5_1f6e6b63","updated":"2018-09-25 14:36:50.000000000","message":"Sure. Done.","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4bbbb703d8ae2a1beb0d770c93ecb63f496e07d2","unresolved":false,"context_lines":[{"line_number":1928,"context_line":""},{"line_number":1929,"context_line":"        Note that this call moves the current allocation from the source"},{"line_number":1930,"context_line":"        consumer to the target consumer. If parallel update happens on either"},{"line_number":1931,"context_line":"        or both consumers during this call then Placement will detect that and"},{"line_number":1932,"context_line":"        this code will re-read the new state of the consumers and retry the"},{"line_number":1933,"context_line":"        operation. If you want to move a known piece of allocation from source"},{"line_number":1934,"context_line":"        to target then this function might not be what you want as it always"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_9cdc6246","line":1931,"range":{"start_line":1931,"start_character":8,"end_line":1931,"end_character":25},"updated":"2018-09-26 13:14:10.000000000","message":"s/or both consumers/consumer/","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d3d26c341945d776300cfc9edd773b0d9f40591b","unresolved":false,"context_lines":[{"line_number":1928,"context_line":""},{"line_number":1929,"context_line":"        Note that this call moves the current allocation from the source"},{"line_number":1930,"context_line":"        consumer to the target consumer. If parallel update happens on either"},{"line_number":1931,"context_line":"        or both consumers during this call then Placement will detect that and"},{"line_number":1932,"context_line":"        this code will re-read the new state of the consumers and retry the"},{"line_number":1933,"context_line":"        operation. If you want to move a known piece of allocation from source"},{"line_number":1934,"context_line":"        to target then this function might not be what you want as it always"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_0f06bd1d","line":1931,"range":{"start_line":1931,"start_character":8,"end_line":1931,"end_character":25},"in_reply_to":"3f79a3b5_9cdc6246","updated":"2018-09-27 11:58:13.000000000","message":"fixed in a followup","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4bbbb703d8ae2a1beb0d770c93ecb63f496e07d2","unresolved":false,"context_lines":[{"line_number":1929,"context_line":"        Note that this call moves the current allocation from the source"},{"line_number":1930,"context_line":"        consumer to the target consumer. If parallel update happens on either"},{"line_number":1931,"context_line":"        or both consumers during this call then Placement will detect that and"},{"line_number":1932,"context_line":"        this code will re-read the new state of the consumers and retry the"},{"line_number":1933,"context_line":"        operation. If you want to move a known piece of allocation from source"},{"line_number":1934,"context_line":"        to target then this function might not be what you want as it always"},{"line_number":1935,"context_line":"        moves what source has in Placement."},{"line_number":1936,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_5c9a4a60","line":1933,"range":{"start_line":1932,"start_character":8,"end_line":1933,"end_character":17},"updated":"2018-09-26 13:14:10.000000000","message":"hmm, I thought we said that any generation conflict that occurred during an attempted allocation move should result in a hard fail and set the instance to an ERROR state?\n\nThis code should only be executed in cases where a migration is being performed, right? So, if we get a consumer generation conflict in the small time below between line 1947 and 1976, that means something else modified what was essentially an in-progress migration, which is bad, right? So, we should just set the instance to ERROR in order to avoid masking that problem.\n\nThat said, I recognize that you actually are NOT changing the existing behaviour in this patch. We were retrying the operation before if we got a concurrent update, though unless I\u0027m mistaken, the only time the concurrent update could have been returned from POST /allocations is when the consumer generations that were read on the *server side* at the start of the POST /allocations handler were changed by the time the AllocationList.replace_all() call completed (again, on the server side).\n\nThe race interval being exposed in this patch is slightly larger than the previous one, since the interval now encapsulates communication between both the client and the server (as opposed to before when the race interval was just on the server side).\n\nPerhaps in a future patch we can debate setting the instance to an ERROR state instead of retrying blindly the operation here.","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d3d26c341945d776300cfc9edd773b0d9f40591b","unresolved":false,"context_lines":[{"line_number":1929,"context_line":"        Note that this call moves the current allocation from the source"},{"line_number":1930,"context_line":"        consumer to the target consumer. If parallel update happens on either"},{"line_number":1931,"context_line":"        or both consumers during this call then Placement will detect that and"},{"line_number":1932,"context_line":"        this code will re-read the new state of the consumers and retry the"},{"line_number":1933,"context_line":"        operation. If you want to move a known piece of allocation from source"},{"line_number":1934,"context_line":"        to target then this function might not be what you want as it always"},{"line_number":1935,"context_line":"        moves what source has in Placement."},{"line_number":1936,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_4ffcb50b","line":1933,"range":{"start_line":1932,"start_character":8,"end_line":1933,"end_character":17},"in_reply_to":"3f79a3b5_5c9a4a60","updated":"2018-09-27 11:58:13.000000000","message":"the code does not retry for consumer conflict. There was a patchset in the past where there was retry and I failed to update the description after we dropped the idea of retry. I\u0027m updating this in followup.","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"}],"nova/tests/functional/integrated_helpers.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4313b66966e0acedc0b6d12e9e7cdfc62dfc23a1","unresolved":false,"context_lines":[{"line_number":644,"context_line":"                compute.manager.host)"},{"line_number":645,"context_line":"            compute.manager.update_available_resource(ctx)"},{"line_number":646,"context_line":"        LOG.info(\u0027Finished with periodics\u0027)"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def _move_and_check_allocations(self, server, request, old_flavor,"},{"line_number":649,"context_line":"                                    new_flavor, source_rp_uuid, dest_rp_uuid):"},{"line_number":650,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], request)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_bfdc1718","line":647,"updated":"2018-09-20 20:04:09.000000000","message":"Why did you move these?","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"71c03fdba63cf37e053ff10c1e5b6f8225dfe094","unresolved":false,"context_lines":[{"line_number":644,"context_line":"                compute.manager.host)"},{"line_number":645,"context_line":"            compute.manager.update_available_resource(ctx)"},{"line_number":646,"context_line":"        LOG.info(\u0027Finished with periodics\u0027)"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def _move_and_check_allocations(self, server, request, old_flavor,"},{"line_number":649,"context_line":"                                    new_flavor, source_rp_uuid, dest_rp_uuid):"},{"line_number":650,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], request)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_ea584558","line":647,"in_reply_to":"3f79a3b5_bfdc1718","updated":"2018-09-25 14:36:50.000000000","message":"test_revert_migrate_delete_dest_allocation_fails_due_to_conflict() uses _migrate_and_check_allocations()\n\ntest_revert_resize_same_host_delete_dest_fails_due_to_conflict uses _resize_to_same_host_and_check_allocations()\n\nOriginally this helpers were in ServerMovingTests but ConsumerGenerationConflictTest only inherits from ProviderUsageBaseTestCase so the helpers are moved to ProviderUsageBaseTestCase","commit_id":"6bf95ffd3f21ebad239320ef267214cdeb04c707"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4bbbb703d8ae2a1beb0d770c93ecb63f496e07d2","unresolved":false,"context_lines":[{"line_number":721,"context_line":"        allocation \u003d allocations[rp_uuid][\u0027resources\u0027]"},{"line_number":722,"context_line":"        self.assertFlavorMatchesAllocation(old_flavor, allocation)"},{"line_number":723,"context_line":""},{"line_number":724,"context_line":"        # We\u0027ve resized to the same host and have doubled allocations for both"},{"line_number":725,"context_line":"        # the old and new flavor on the same host. Run the periodic on the"},{"line_number":726,"context_line":"        # compute to see if it tramples on what the scheduler did."},{"line_number":727,"context_line":"        self._run_periodics()"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_3ccd0e5e","line":724,"range":{"start_line":724,"start_character":10,"end_line":724,"end_character":41},"updated":"2018-09-26 13:14:10.000000000","message":"How are we guaranteed that the resize will have gone to the same host?","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d3d26c341945d776300cfc9edd773b0d9f40591b","unresolved":false,"context_lines":[{"line_number":721,"context_line":"        allocation \u003d allocations[rp_uuid][\u0027resources\u0027]"},{"line_number":722,"context_line":"        self.assertFlavorMatchesAllocation(old_flavor, allocation)"},{"line_number":723,"context_line":""},{"line_number":724,"context_line":"        # We\u0027ve resized to the same host and have doubled allocations for both"},{"line_number":725,"context_line":"        # the old and new flavor on the same host. Run the periodic on the"},{"line_number":726,"context_line":"        # compute to see if it tramples on what the scheduler did."},{"line_number":727,"context_line":"        self._run_periodics()"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_4f4a755b","line":724,"range":{"start_line":724,"start_character":10,"end_line":724,"end_character":41},"in_reply_to":"3f79a3b5_3ccd0e5e","updated":"2018-09-27 11:58:13.000000000","message":"The caller disabled the second compute [1] and L699 change the config to allow same host resize.\n\n[1] https://review.openstack.org/#/c/591810/7/nova/tests/functional/test_servers.py@4554","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4bbbb703d8ae2a1beb0d770c93ecb63f496e07d2","unresolved":false,"context_lines":[{"line_number":4521,"context_line":""},{"line_number":4522,"context_line":"            post \u003d {\u0027revertResize\u0027: None}"},{"line_number":4523,"context_line":"            self.api.post_server_action(server[\u0027id\u0027], post)"},{"line_number":4524,"context_line":"            server \u003d self._wait_for_state_change(self.api, server, \u0027ERROR\u0027,)"},{"line_number":4525,"context_line":""},{"line_number":4526,"context_line":"        self.assertEqual(1, mock_post.call_count)"},{"line_number":4527,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_5c36ca51","line":4524,"range":{"start_line":4524,"start_character":74,"end_line":4524,"end_character":75},"updated":"2018-09-26 13:14:10.000000000","message":"nit: extra comma?","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d3d26c341945d776300cfc9edd773b0d9f40591b","unresolved":false,"context_lines":[{"line_number":4521,"context_line":""},{"line_number":4522,"context_line":"            post \u003d {\u0027revertResize\u0027: None}"},{"line_number":4523,"context_line":"            self.api.post_server_action(server[\u0027id\u0027], post)"},{"line_number":4524,"context_line":"            server \u003d self._wait_for_state_change(self.api, server, \u0027ERROR\u0027,)"},{"line_number":4525,"context_line":""},{"line_number":4526,"context_line":"        self.assertEqual(1, mock_post.call_count)"},{"line_number":4527,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_6f7651a6","line":4524,"range":{"start_line":4524,"start_character":74,"end_line":4524,"end_character":75},"in_reply_to":"3f79a3b5_5c36ca51","updated":"2018-09-27 11:58:13.000000000","message":"fixed in a followup","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"}],"nova/tests/unit/scheduler/client/test_report.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4bbbb703d8ae2a1beb0d770c93ecb63f496e07d2","unresolved":false,"context_lines":[{"line_number":1135,"context_line":"        self.user_id \u003d mock.sentinel.user_id"},{"line_number":1136,"context_line":""},{"line_number":1137,"context_line":"        self.mock_post.return_value.status_code \u003d 204"},{"line_number":1138,"context_line":"        self.rp_uuid \u003d mock.sentinel.rp"},{"line_number":1139,"context_line":"        self.source_consumer_uuid \u003d mock.sentinel.source_consumer"},{"line_number":1140,"context_line":"        self.target_consumer_uuid \u003d mock.sentinel.target_consumer"},{"line_number":1141,"context_line":"        self.source_consumer_data \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_bcc35e06","line":1138,"range":{"start_line":1138,"start_character":8,"end_line":1138,"end_character":39},"updated":"2018-09-26 13:14:10.000000000","message":"I would have thought there would be a target and destination RP UUID. Are all the moves in this test case class supposed to be for same host migrations?","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d3d26c341945d776300cfc9edd773b0d9f40591b","unresolved":false,"context_lines":[{"line_number":1135,"context_line":"        self.user_id \u003d mock.sentinel.user_id"},{"line_number":1136,"context_line":""},{"line_number":1137,"context_line":"        self.mock_post.return_value.status_code \u003d 204"},{"line_number":1138,"context_line":"        self.rp_uuid \u003d mock.sentinel.rp"},{"line_number":1139,"context_line":"        self.source_consumer_uuid \u003d mock.sentinel.source_consumer"},{"line_number":1140,"context_line":"        self.target_consumer_uuid \u003d mock.sentinel.target_consumer"},{"line_number":1141,"context_line":"        self.source_consumer_data \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_2f7e196a","line":1138,"range":{"start_line":1138,"start_character":8,"end_line":1138,"end_character":39},"in_reply_to":"3f79a3b5_bcc35e06","updated":"2018-09-27 11:58:13.000000000","message":"move_allocation does not move allocation between RPs it moves allocations between consumers. During migration the source host allocation is moved from the instance.uuid consumer to the migration.uuid consumer. Then a new scheduling happens for the instance.uuid that will call claim_resources.","commit_id":"53ca096750685b7bb88c2a5062db19d92facc548"}],"releasenotes/notes/leaking_migration_allocations_in_placement-bd0a6f2a30e2e3d2.yaml":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"95e637382ce6a61297d7c593288014fe0924f3cc","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"issues:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Nova leaks resource allocation in placement during"},{"line_number":5,"context_line":"    ``POST /servers/{server_id}/action (revertResize Action)`` if the"},{"line_number":6,"context_line":"    allocation held by the migration_uuid is modified in parallel with the"},{"line_number":7,"context_line":"    revert operation. Nova will log an ERROR and will put the server into ERROR"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"3f79a3b5_f3f27c9b","line":4,"range":{"start_line":4,"start_character":24,"end_line":4,"end_character":34},"updated":"2018-09-25 15:56:28.000000000","message":"allocations","commit_id":"258af912e5e1aee3205e33c4e48bee6ffa352f8e"}]}
