)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"During resize and cold migrate the dest compute service needs to update"},{"line_number":10,"context_line":"the port binding based on the re-calculated port - resource provider mapping."},{"line_number":11,"context_line":"This update happens in finish_resize."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"To do that the dest compute service needs to be at least on service level"},{"line_number":14,"context_line":"39."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7faddb67_8958f6f8","line":11,"updated":"2019-09-05 16:24:25.000000000","message":"ack: https://review.opendev.org/#/c/656422/21/nova/compute/manager.py@4778","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":11,"context_line":"This update happens in finish_resize."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"To do that the dest compute service needs to be at least on service level"},{"line_number":14,"context_line":"39."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"The calculation is based on the RequestSpec. The RequestSpec is sent"},{"line_number":17,"context_line":"to the dest compute in pre_resize but the dest compute only sends it to the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7faddb67_a904d2c6","line":14,"updated":"2019-09-05 16:24:25.000000000","message":"ack: https://review.opendev.org/#/c/655721/18/nova/objects/service.py","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7507ba67099d3d675643e2099d2f246b86ee6a32","unresolved":false,"context_lines":[{"line_number":19,"context_line":"5.2. Also the source compute only sends the RequestSpec to the dest"},{"line_number":20,"context_line":"compute in the finish_resize if the rpc api version is at least 5.2. So"},{"line_number":21,"context_line":"migration with bandwidth only works if both compute talks at least 5.2"},{"line_number":22,"context_line":"which means that the min service level is at least 39."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Change-Id: Ia500b105b9ec70c0d8bd38faa084270b825476eb"},{"line_number":25,"context_line":"blueprint: support-move-ops-with-qos-ports"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5faad753_b3f41a5d","line":22,"updated":"2019-09-06 14:15:34.000000000","message":"I guess we should somehow document this in a releasenote, tbh.","commit_id":"cdab0006913a2e54ddec2bc8d6d8448d9c2f17a7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"52c1852492d6cac5b67b51f298fc90335c3bf10d","unresolved":false,"context_lines":[{"line_number":19,"context_line":"5.2. Also the source compute only sends the RequestSpec to the dest"},{"line_number":20,"context_line":"compute in the finish_resize if the rpc api version is at least 5.2. So"},{"line_number":21,"context_line":"migration with bandwidth only works if both compute talks at least 5.2"},{"line_number":22,"context_line":"which means that the min service level is at least 39."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Change-Id: Ia500b105b9ec70c0d8bd38faa084270b825476eb"},{"line_number":25,"context_line":"blueprint: support-move-ops-with-qos-ports"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5faad753_36001835","line":22,"in_reply_to":"5faad753_b3f41a5d","updated":"2019-09-06 15:13:11.000000000","message":"I updated the the api-guide and the two relevant reno\n* cold migrate: https://review.opendev.org/#/c/671497\n* resize: https://review.opendev.org/#/c/679019","commit_id":"cdab0006913a2e54ddec2bc8d6d8448d9c2f17a7"}],"nova/conductor/tasks/migrate.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                  instance\u003dinstance)"},{"line_number":66,"context_line":"        return None, None"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    # FIXME(danms): This method is flawed in that it asssumes allocations"},{"line_number":69,"context_line":"    # against only one provider. So, this may overwite allocations against"},{"line_number":70,"context_line":"    # a shared provider, if we had one."},{"line_number":71,"context_line":"    success \u003d reportclient.move_allocations(context, instance.uuid,"},{"line_number":72,"context_line":"                                            migration.uuid)"},{"line_number":73,"context_line":"    if not success:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_c9082e92","line":70,"range":{"start_line":68,"start_character":4,"end_line":70,"end_character":39},"updated":"2019-09-05 16:24:25.000000000","message":"Maybe unrelated but is this still true? And if so, does it impact this series? I was thinking of this patch later in the series:\n\nhttps://review.opendev.org/#/c/676138/\n\nBut looks like that\u0027s just compute specific.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                  instance\u003dinstance)"},{"line_number":66,"context_line":"        return None, None"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    # FIXME(danms): This method is flawed in that it asssumes allocations"},{"line_number":69,"context_line":"    # against only one provider. So, this may overwite allocations against"},{"line_number":70,"context_line":"    # a shared provider, if we had one."},{"line_number":71,"context_line":"    success \u003d reportclient.move_allocations(context, instance.uuid,"},{"line_number":72,"context_line":"                                            migration.uuid)"},{"line_number":73,"context_line":"    if not success:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_27dc6945","line":70,"range":{"start_line":68,"start_character":4,"end_line":70,"end_character":39},"in_reply_to":"7faddb67_c9082e92","updated":"2019-09-06 12:18:30.000000000","message":"The move_allocations does not assume a single provider. It still assumes that the allocation is against a single provider tree. Or more specifically that every allocation that the consumer has is moved by move_allocations. So sharing providers are not properly handled if they doesn\u0027t need to move. See my comment change of the wording in https://review.opendev.org/#/c/676138/14/nova/compute/manager.py@4366\n\nI think it was extended to support child RPs in https://review.opendev.org/#/c/591810/7/nova/scheduler/client/report.py","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    reportclient \u003d report.SchedulerReportClient()"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    # FIXME(danms): This method is flawed in that it asssumes allocations"},{"line_number":97,"context_line":"    # against only one provider. So, this may overwite allocations against"},{"line_number":98,"context_line":"    # a shared provider, if we had one."},{"line_number":99,"context_line":"    success \u003d reportclient.move_allocations(context, migration.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_69fb3a7a","line":96,"updated":"2019-09-05 16:24:25.000000000","message":"same","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    reportclient \u003d report.SchedulerReportClient()"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    # FIXME(danms): This method is flawed in that it asssumes allocations"},{"line_number":97,"context_line":"    # against only one provider. So, this may overwite allocations against"},{"line_number":98,"context_line":"    # a shared provider, if we had one."},{"line_number":99,"context_line":"    success \u003d reportclient.move_allocations(context, migration.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_e77c1122","line":96,"in_reply_to":"7faddb67_69fb3a7a","updated":"2019-09-06 12:18:30.000000000","message":"ditto I made a note to update these comments later in a separate patch.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            self.context, selection.service_host, \u0027nova-compute\u0027)"},{"line_number":194,"context_line":"        return svc.version \u003e\u003d 39"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def _get_host_supporting_request(self, selection_list):"},{"line_number":197,"context_line":"        \"\"\"Return the first compute selection from the selection_list where"},{"line_number":198,"context_line":"        the service is new enough to support resource request during migration"},{"line_number":199,"context_line":"        and the resources claimed successfully."}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_093f2622","line":196,"updated":"2019-09-05 16:24:25.000000000","message":"Shall we add a TODO that this compat code can be removed after Train?","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"38a282d2ac34812f1201f1aaa8c6f8265b02f9ff","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            self.context, selection.service_host, \u0027nova-compute\u0027)"},{"line_number":194,"context_line":"        return svc.version \u003e\u003d 39"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def _get_host_supporting_request(self, selection_list):"},{"line_number":197,"context_line":"        \"\"\"Return the first compute selection from the selection_list where"},{"line_number":198,"context_line":"        the service is new enough to support resource request during migration"},{"line_number":199,"context_line":"        and the resources claimed successfully."}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_223d2ebb","line":196,"in_reply_to":"5faad753_c7ef95ae","updated":"2019-09-06 17:54:41.000000000","message":"Sure, but in U if you only support T computes and the code you\u0027re adding is in T, we\u0027re good. We just worry about computes that don\u0027t have the code, which is older than Train.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            self.context, selection.service_host, \u0027nova-compute\u0027)"},{"line_number":194,"context_line":"        return svc.version \u003e\u003d 39"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def _get_host_supporting_request(self, selection_list):"},{"line_number":197,"context_line":"        \"\"\"Return the first compute selection from the selection_list where"},{"line_number":198,"context_line":"        the service is new enough to support resource request during migration"},{"line_number":199,"context_line":"        and the resources claimed successfully."}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_c7ef95ae","line":196,"in_reply_to":"7faddb67_093f2622","updated":"2019-09-06 12:18:30.000000000","message":"I guess in U we still need to support T computes. So I guess this can only be removed in V. Anyhow added a TODO.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        :param selection_list: a list of Selection objects returned by the"},{"line_number":202,"context_line":"            scheduler"},{"line_number":203,"context_line":"        :return: A two tuple. The first item is a Selection object"},{"line_number":204,"context_line":"            representing the host that supporting the request. The second item"},{"line_number":205,"context_line":"            is a list of Selection objects representing the remaining alternate"},{"line_number":206,"context_line":"            hosts."},{"line_number":207,"context_line":"        :raises MaxRetriesExceeded: if non of the hosts in the selection_list"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_297d421b","line":204,"range":{"start_line":204,"start_character":39,"end_line":204,"end_character":49},"updated":"2019-09-05 16:24:25.000000000","message":"supports","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        :param selection_list: a list of Selection objects returned by the"},{"line_number":202,"context_line":"            scheduler"},{"line_number":203,"context_line":"        :return: A two tuple. The first item is a Selection object"},{"line_number":204,"context_line":"            representing the host that supporting the request. The second item"},{"line_number":205,"context_line":"            is a list of Selection objects representing the remaining alternate"},{"line_number":206,"context_line":"            hosts."},{"line_number":207,"context_line":"        :raises MaxRetriesExceeded: if non of the hosts in the selection_list"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_a747f9bc","line":204,"range":{"start_line":204,"start_character":39,"end_line":204,"end_character":49},"in_reply_to":"7faddb67_297d421b","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            representing the host that supporting the request. The second item"},{"line_number":205,"context_line":"            is a list of Selection objects representing the remaining alternate"},{"line_number":206,"context_line":"            hosts."},{"line_number":207,"context_line":"        :raises MaxRetriesExceeded: if non of the hosts in the selection_list"},{"line_number":208,"context_line":"            is new enough to support the request or we cannot claim resource"},{"line_number":209,"context_line":"            on any of the hosts that are new enough."},{"line_number":210,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_898236fe","line":207,"range":{"start_line":207,"start_character":39,"end_line":207,"end_character":42},"updated":"2019-09-05 16:24:25.000000000","message":"none","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            representing the host that supporting the request. The second item"},{"line_number":205,"context_line":"            is a list of Selection objects representing the remaining alternate"},{"line_number":206,"context_line":"            hosts."},{"line_number":207,"context_line":"        :raises MaxRetriesExceeded: if non of the hosts in the selection_list"},{"line_number":208,"context_line":"            is new enough to support the request or we cannot claim resource"},{"line_number":209,"context_line":"            on any of the hosts that are new enough."},{"line_number":210,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_4712c5b3","line":207,"range":{"start_line":207,"start_character":39,"end_line":207,"end_character":42},"in_reply_to":"7faddb67_898236fe","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":212,"context_line":"        if not self.request_spec.requested_resources:"},{"line_number":213,"context_line":"            return selection_list[0], selection_list[1:]"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        elevated \u003d self.context.elevated()"},{"line_number":216,"context_line":"        # Scheduler allocated resources on the first host. So check if the"},{"line_number":217,"context_line":"        # first host is new enough"},{"line_number":218,"context_line":"        if self._support_resource_request(selection_list[0]):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_69949a36","line":215,"updated":"2019-09-05 16:24:25.000000000","message":"Is elevating the context really necessary? Usually this isn\u0027t necessary since we removed low-level DB API checks on having an admin context (many years ago). I guess you\u0027re doing this because it\u0027s copied from how _reschedule works, but it\u0027s probably not necessary.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":212,"context_line":"        if not self.request_spec.requested_resources:"},{"line_number":213,"context_line":"            return selection_list[0], selection_list[1:]"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        elevated \u003d self.context.elevated()"},{"line_number":216,"context_line":"        # Scheduler allocated resources on the first host. So check if the"},{"line_number":217,"context_line":"        # first host is new enough"},{"line_number":218,"context_line":"        if self._support_resource_request(selection_list[0]):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_a72059f9","line":215,"in_reply_to":"7faddb67_69949a36","updated":"2019-09-06 12:18:30.000000000","message":"Yeah, it was copy-paste. Let\u0027s drop it.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        # First host is old, so we need to use an alternate. Therefore we have"},{"line_number":222,"context_line":"        # to remove the allocation from the first host."},{"line_number":223,"context_line":"        self.reportclient.delete_allocation_for_instance("},{"line_number":224,"context_line":"            self.context, self.instance.uuid)"},{"line_number":225,"context_line":"        LOG.debug("},{"line_number":226,"context_line":"            \u0027Scheduler returned host %(host)s as a possible migration target \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_c97b4ef1","line":223,"range":{"start_line":223,"start_character":26,"end_line":223,"end_character":56},"updated":"2019-09-05 16:24:25.000000000","message":"If this raises AllocationDeleteFailed for some reason we\u0027ll stop and the rollback method should cleanup properly. If we reschedule from let\u0027s say an RT resize_claim failure on the compute, we\u0027d cleanup the allocations on the instance for the dest node provider here:\n\nhttps://github.com/openstack/nova/blob/f7f5e1846c7b19aa05817df7f3c4345819db413f/nova/compute/manager.py#L4502\n\nWhich is really more like what rollback in this task does (calling revert_allocation_for_migration). Then when rescheduling through conductor we\u0027d hit _preallocate_migration which would swap the allocations again (source node allocations from the instance move to the migration and the alternate host allocations get put on the instance).\n\nJust making sure I\u0027m following the flow here. I see you added a bunch of unit tests but functional tests are really the thing that would be best here since we could assert allocations in placement to make sure things are where we expect them to be. Since this is temporary compat code for Train I won\u0027t push for a bunch of complicated functional tests though.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        # First host is old, so we need to use an alternate. Therefore we have"},{"line_number":222,"context_line":"        # to remove the allocation from the first host."},{"line_number":223,"context_line":"        self.reportclient.delete_allocation_for_instance("},{"line_number":224,"context_line":"            self.context, self.instance.uuid)"},{"line_number":225,"context_line":"        LOG.debug("},{"line_number":226,"context_line":"            \u0027Scheduler returned host %(host)s as a possible migration target \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_47ee4589","line":223,"range":{"start_line":223,"start_character":26,"end_line":223,"end_character":56},"in_reply_to":"7faddb67_c97b4ef1","updated":"2019-09-06 12:18:30.000000000","message":"This code only runs for the first schedule of the migration. During reschedule we don\u0027t need to add this iteration as it had already an iteration of alternate hosts. \n\nThe only way re-schedule can happen is through calling _execute again. And a re-schedule, as you said, will go through a revert_allocation_for_migration and a preallocate_migration calls. The revert_allocation_for_migration does not care if there is nothing allocated by the instance, it just copies the migration allocation over the instance allocation blindly. So we only need to makes sure that we don\u0027t touch the migration allocation here. Then we are safe. I know famous last words. \n\nI will try to add at least one functional test where this compat code is hit, just for sanity, but covering the whole feels too much for now.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":230,"context_line":"             \u0027request\u0027: self.request_spec.requested_resources},"},{"line_number":231,"context_line":"            instance\u003dself.instance)"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        selection_list \u003d selection_list[1:]"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        for i, selection in enumerate(selection_list):"},{"line_number":236,"context_line":"            if self._support_resource_request(selection):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_09dba6e9","line":233,"range":{"start_line":233,"start_character":8,"end_line":233,"end_character":22},"updated":"2019-09-05 16:24:25.000000000","message":"nit: it would be a bit more clear to name this variable \"alternates\".","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":230,"context_line":"             \u0027request\u0027: self.request_spec.requested_resources},"},{"line_number":231,"context_line":"            instance\u003dself.instance)"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        selection_list \u003d selection_list[1:]"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        for i, selection in enumerate(selection_list):"},{"line_number":236,"context_line":"            if self._support_resource_request(selection):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_e78731b6","line":233,"range":{"start_line":233,"start_character":8,"end_line":233,"end_character":22},"in_reply_to":"7faddb67_09dba6e9","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":247,"context_line":"                    if not resource_claimed:"},{"line_number":248,"context_line":"                        LOG.debug("},{"line_number":249,"context_line":"                            \u0027Scheduler returned alternate host %(host)s as a \u0027"},{"line_number":250,"context_line":"                            \u0027possible migration target but resource claim is \u0027"},{"line_number":251,"context_line":"                            \u0027failed on that host. Trying another alternate.\u0027,"},{"line_number":252,"context_line":"                            {\u0027host\u0027: selection.service_host},"},{"line_number":253,"context_line":"                            instance\u003dself.instance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_a9305208","line":250,"range":{"start_line":250,"start_character":74,"end_line":250,"end_character":76},"updated":"2019-09-05 16:24:25.000000000","message":"nix","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":247,"context_line":"                    if not resource_claimed:"},{"line_number":248,"context_line":"                        LOG.debug("},{"line_number":249,"context_line":"                            \u0027Scheduler returned alternate host %(host)s as a \u0027"},{"line_number":250,"context_line":"                            \u0027possible migration target but resource claim is \u0027"},{"line_number":251,"context_line":"                            \u0027failed on that host. Trying another alternate.\u0027,"},{"line_number":252,"context_line":"                            {\u0027host\u0027: selection.service_host},"},{"line_number":253,"context_line":"                            instance\u003dself.instance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_a79139f4","line":250,"range":{"start_line":250,"start_character":74,"end_line":250,"end_character":76},"in_reply_to":"7faddb67_a9305208","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":272,"context_line":"                     \u0027request\u0027: self.request_spec.requested_resources},"},{"line_number":273,"context_line":"                    instance\u003dself.instance)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        # if we reach this point then non of the hosts was new enough for the"},{"line_number":276,"context_line":"        # request or we failed ot claim resources on every alternate"},{"line_number":277,"context_line":"        reason \u003d (\"Exhausted all hosts available due compute service level \""},{"line_number":278,"context_line":"                  \"check for instance %(instance_uuid)s.\" %"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_acfe2002","line":275,"range":{"start_line":275,"start_character":38,"end_line":275,"end_character":41},"updated":"2019-09-05 16:24:25.000000000","message":"none","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":272,"context_line":"                     \u0027request\u0027: self.request_spec.requested_resources},"},{"line_number":273,"context_line":"                    instance\u003dself.instance)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        # if we reach this point then non of the hosts was new enough for the"},{"line_number":276,"context_line":"        # request or we failed ot claim resources on every alternate"},{"line_number":277,"context_line":"        reason \u003d (\"Exhausted all hosts available due compute service level \""},{"line_number":278,"context_line":"                  \"check for instance %(instance_uuid)s.\" %"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_c78eb5cf","line":275,"range":{"start_line":275,"start_character":38,"end_line":275,"end_character":41},"in_reply_to":"7faddb67_acfe2002","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":273,"context_line":"                    instance\u003dself.instance)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        # if we reach this point then non of the hosts was new enough for the"},{"line_number":276,"context_line":"        # request or we failed ot claim resources on every alternate"},{"line_number":277,"context_line":"        reason \u003d (\"Exhausted all hosts available due compute service level \""},{"line_number":278,"context_line":"                  \"check for instance %(instance_uuid)s.\" %"},{"line_number":279,"context_line":"                  {\"instance_uuid\": self.instance.uuid})"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_cc011c06","line":276,"range":{"start_line":276,"start_character":31,"end_line":276,"end_character":33},"updated":"2019-09-05 16:24:25.000000000","message":"to","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":273,"context_line":"                    instance\u003dself.instance)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        # if we reach this point then non of the hosts was new enough for the"},{"line_number":276,"context_line":"        # request or we failed ot claim resources on every alternate"},{"line_number":277,"context_line":"        reason \u003d (\"Exhausted all hosts available due compute service level \""},{"line_number":278,"context_line":"                  \"check for instance %(instance_uuid)s.\" %"},{"line_number":279,"context_line":"                  {\"instance_uuid\": self.instance.uuid})"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_67bd8167","line":276,"range":{"start_line":276,"start_character":31,"end_line":276,"end_character":33},"in_reply_to":"7faddb67_cc011c06","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        # if we reach this point then non of the hosts was new enough for the"},{"line_number":276,"context_line":"        # request or we failed ot claim resources on every alternate"},{"line_number":277,"context_line":"        reason \u003d (\"Exhausted all hosts available due compute service level \""},{"line_number":278,"context_line":"                  \"check for instance %(instance_uuid)s.\" %"},{"line_number":279,"context_line":"                  {\"instance_uuid\": self.instance.uuid})"},{"line_number":280,"context_line":"        raise exception.MaxRetriesExceeded(reason\u003dreason)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_8c07a417","line":277,"range":{"start_line":277,"start_character":49,"end_line":277,"end_character":52},"updated":"2019-09-05 16:24:25.000000000","message":"during?","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        # if we reach this point then non of the hosts was new enough for the"},{"line_number":276,"context_line":"        # request or we failed ot claim resources on every alternate"},{"line_number":277,"context_line":"        reason \u003d (\"Exhausted all hosts available due compute service level \""},{"line_number":278,"context_line":"                  \"check for instance %(instance_uuid)s.\" %"},{"line_number":279,"context_line":"                  {\"instance_uuid\": self.instance.uuid})"},{"line_number":280,"context_line":"        raise exception.MaxRetriesExceeded(reason\u003dreason)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_47bc0569","line":277,"range":{"start_line":277,"start_character":49,"end_line":277,"end_character":52},"in_reply_to":"7faddb67_8c07a417","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":379,"context_line":"            self.context, self.reportclient, self.request_spec, selection)"},{"line_number":380,"context_line":"        return selection"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def _reschedule(self):"},{"line_number":383,"context_line":"        # Since the resources on these alternates may have been consumed and"},{"line_number":384,"context_line":"        # might not be able to support the migrated instance, we need to first"},{"line_number":385,"context_line":"        # claim the resources to verify the host still has sufficient"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_6ca6e8c2","line":382,"range":{"start_line":382,"start_character":8,"end_line":382,"end_character":19},"updated":"2019-09-05 16:24:25.000000000","message":"You don\u0027t have unit tests for the new conditional in this method. I can think of at least a few tests (all having requested resources on the request spec since existing tests are showing this is fine when the request spec doesn\u0027t have requested resources):\n\n1. two alternates, first is too old, second isn\u0027t so we use it\n2. two alternates, both are too old so we get MaxRetriesExceeded","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":379,"context_line":"            self.context, self.reportclient, self.request_spec, selection)"},{"line_number":380,"context_line":"        return selection"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def _reschedule(self):"},{"line_number":383,"context_line":"        # Since the resources on these alternates may have been consumed and"},{"line_number":384,"context_line":"        # might not be able to support the migrated instance, we need to first"},{"line_number":385,"context_line":"        # claim the resources to verify the host still has sufficient"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_c7a7954f","line":382,"range":{"start_line":382,"start_character":8,"end_line":382,"end_character":19},"in_reply_to":"7faddb67_6ca6e8c2","updated":"2019-09-06 12:18:30.000000000","message":"Good point. Now it is easier to add as https://review.opendev.org/#/c/679651/ has been merged. Done.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        selection \u003d None"},{"line_number":390,"context_line":"        while self.host_list and not host_available:"},{"line_number":391,"context_line":"            selection \u003d self.host_list.pop(0)"},{"line_number":392,"context_line":"            if (self.request_spec.requested_resources and not"},{"line_number":393,"context_line":"                    self._support_resource_request(selection)):"},{"line_number":394,"context_line":"                continue"},{"line_number":395,"context_line":"            if selection.allocation_request:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_09f40654","line":392,"range":{"start_line":392,"start_character":16,"end_line":392,"end_character":53},"updated":"2019-09-05 16:24:25.000000000","message":"Hmm, we\u0027re lucky that the compute is passing the RequestSpec back on reschedule since Stein because otherwise we\u0027d be creating a RequestSpec without the requested_resources I think:\n\nhttps://github.com/openstack/nova/blob/f7f5e1846c7b19aa05817df7f3c4345819db413f/nova/conductor/manager.py#L315\n\n/me reminds himself to follow up on that TODO and remove that compat code.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"468cd852ead5d55077b27c3f350874ed271451ca","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        selection \u003d None"},{"line_number":390,"context_line":"        while self.host_list and not host_available:"},{"line_number":391,"context_line":"            selection \u003d self.host_list.pop(0)"},{"line_number":392,"context_line":"            if (self.request_spec.requested_resources and not"},{"line_number":393,"context_line":"                    self._support_resource_request(selection)):"},{"line_number":394,"context_line":"                continue"},{"line_number":395,"context_line":"            if selection.allocation_request:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_2d00bf34","line":392,"range":{"start_line":392,"start_character":16,"end_line":392,"end_character":53},"in_reply_to":"7faddb67_09f40654","updated":"2019-09-06 19:43:56.000000000","message":"\u003e Hmm, we\u0027re lucky that the compute is passing the RequestSpec back\n \u003e on reschedule since Stein because otherwise we\u0027d be creating a\n \u003e RequestSpec without the requested_resources I think:\n \u003e \n \u003e https://github.com/openstack/nova/blob/f7f5e1846c7b19aa05817df7f3c4345819db413f/nova/conductor/manager.py#L315\n \u003e \n \u003e /me reminds himself to follow up on that TODO and remove that\n \u003e compat code.\n\nI looked into removing that compat code and realized we can\u0027t without a major rpc api version bump, see https://review.opendev.org/#/c/680763/ after I discussed it with Dan. You\u0027d have to have conductor pinned to a pre-mitaka version for that to happen though so I don\u0027t think we need to bend over backward to try and handle that edge case for your resource request stuff.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        selection \u003d None"},{"line_number":390,"context_line":"        while self.host_list and not host_available:"},{"line_number":391,"context_line":"            selection \u003d self.host_list.pop(0)"},{"line_number":392,"context_line":"            if (self.request_spec.requested_resources and not"},{"line_number":393,"context_line":"                    self._support_resource_request(selection)):"},{"line_number":394,"context_line":"                continue"},{"line_number":395,"context_line":"            if selection.allocation_request:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_477165e0","line":392,"range":{"start_line":392,"start_character":16,"end_line":392,"end_character":53},"in_reply_to":"7faddb67_09f40654","updated":"2019-09-06 12:18:30.000000000","message":"We could re-collect the requested_resources if needed from neutron. But yes, better to have it already.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":391,"context_line":"            selection \u003d self.host_list.pop(0)"},{"line_number":392,"context_line":"            if (self.request_spec.requested_resources and not"},{"line_number":393,"context_line":"                    self._support_resource_request(selection)):"},{"line_number":394,"context_line":"                continue"},{"line_number":395,"context_line":"            if selection.allocation_request:"},{"line_number":396,"context_line":"                alloc_req \u003d jsonutils.loads(selection.allocation_request)"},{"line_number":397,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_a9bb72e2","line":394,"updated":"2019-09-05 16:24:25.000000000","message":"Should log something here about why we\u0027re filtering out the alternate host.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":391,"context_line":"            selection \u003d self.host_list.pop(0)"},{"line_number":392,"context_line":"            if (self.request_spec.requested_resources and not"},{"line_number":393,"context_line":"                    self._support_resource_request(selection)):"},{"line_number":394,"context_line":"                continue"},{"line_number":395,"context_line":"            if selection.allocation_request:"},{"line_number":396,"context_line":"                alloc_req \u003d jsonutils.loads(selection.allocation_request)"},{"line_number":397,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_e775f1cd","line":394,"in_reply_to":"7faddb67_a9bb72e2","updated":"2019-09-06 12:18:30.000000000","message":"Good point. Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e20447f7863329d4236f5ee2cdf844e6115f9f43","unresolved":false,"context_lines":[{"line_number":408,"context_line":"            if alloc_req:"},{"line_number":409,"context_line":"                # If this call succeeds, the resources on the destination"},{"line_number":410,"context_line":"                # host will be claimed by the instance."},{"line_number":411,"context_line":"                print(\u0027claiming on \u0027, selection.service_host)"},{"line_number":412,"context_line":"                host_available \u003d scheduler_utils.claim_resources("},{"line_number":413,"context_line":"                    elevated, self.reportclient, self.request_spec,"},{"line_number":414,"context_line":"                    self.instance.uuid, alloc_req,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5faad753_fd0ca243","line":411,"updated":"2019-09-06 12:36:51.000000000","message":"bahh. :/","commit_id":"cdab0006913a2e54ddec2bc8d6d8448d9c2f17a7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"52c1852492d6cac5b67b51f298fc90335c3bf10d","unresolved":false,"context_lines":[{"line_number":408,"context_line":"            if alloc_req:"},{"line_number":409,"context_line":"                # If this call succeeds, the resources on the destination"},{"line_number":410,"context_line":"                # host will be claimed by the instance."},{"line_number":411,"context_line":"                print(\u0027claiming on \u0027, selection.service_host)"},{"line_number":412,"context_line":"                host_available \u003d scheduler_utils.claim_resources("},{"line_number":413,"context_line":"                    elevated, self.reportclient, self.request_spec,"},{"line_number":414,"context_line":"                    self.instance.uuid, alloc_req,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5faad753_96946cea","line":411,"in_reply_to":"5faad753_fd0ca243","updated":"2019-09-06 15:13:11.000000000","message":"Done","commit_id":"cdab0006913a2e54ddec2bc8d6d8448d9c2f17a7"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0a9ce919d57951be9e5b29e1fd1cab1df367cd37","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            on any of the hosts that are new enough."},{"line_number":212,"context_line":"        \"\"\""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        if not self.request_spec.requested_resources:"},{"line_number":215,"context_line":"            return selection_list[0], selection_list[1:]"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        # Scheduler allocated resources on the first host. So check if the"}],"source_content_type":"text/x-python","patch_set":4,"id":"5faad753_06a4a656","line":214,"updated":"2019-09-09 16:28:03.000000000","message":"I guess we\u0027re getting the original RequestSpec (containing te resources) and not a mocked one since we pass it to execute().\n\nCool with me.","commit_id":"d6795e1393a7f9cc781c0d149220e6b5dacf716e"}],"nova/tests/unit/conductor/tasks/test_migrate.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":370,"context_line":""},{"line_number":371,"context_line":"        first_service \u003d objects.Service(service_host\u003d\u0027host1\u0027)"},{"line_number":372,"context_line":"        first_service.version \u003d 39"},{"line_number":373,"context_line":"        mock_get_service.side_effect \u003d [first_service]"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"        selected, alternates \u003d task._get_host_supporting_request("},{"line_number":376,"context_line":"            selection_list)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_ac2700b6","line":373,"range":{"start_line":373,"start_character":25,"end_line":373,"end_character":54},"updated":"2019-09-05 16:24:25.000000000","message":"nit: could just be:\n\n  return_value \u003d first_service\n\nside_effect with a list isn\u0027t necessary until we make more than one call on the mock, so this was a bit confusing to me at first.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":370,"context_line":""},{"line_number":371,"context_line":"        first_service \u003d objects.Service(service_host\u003d\u0027host1\u0027)"},{"line_number":372,"context_line":"        first_service.version \u003d 39"},{"line_number":373,"context_line":"        mock_get_service.side_effect \u003d [first_service]"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"        selected, alternates \u003d task._get_host_supporting_request("},{"line_number":376,"context_line":"            selection_list)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_fdad82ea","line":373,"range":{"start_line":373,"start_character":25,"end_line":373,"end_character":54},"in_reply_to":"7faddb67_ac2700b6","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":412,"context_line":""},{"line_number":413,"context_line":"        first_service \u003d objects.Service(service_host\u003d\u0027host1\u0027)"},{"line_number":414,"context_line":"        first_service.version \u003d 38"},{"line_number":415,"context_line":"        mock_get_service.side_effect \u003d [first_service]"},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"        self.assertRaises("},{"line_number":418,"context_line":"            exception.MaxRetriesExceeded, task._get_host_supporting_request,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_2c3b10d1","line":415,"range":{"start_line":415,"start_character":25,"end_line":415,"end_character":54},"updated":"2019-09-05 16:24:25.000000000","message":"same","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":412,"context_line":""},{"line_number":413,"context_line":"        first_service \u003d objects.Service(service_host\u003d\u0027host1\u0027)"},{"line_number":414,"context_line":"        first_service.version \u003d 38"},{"line_number":415,"context_line":"        mock_get_service.side_effect \u003d [first_service]"},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"        self.assertRaises("},{"line_number":418,"context_line":"            exception.MaxRetriesExceeded, task._get_host_supporting_request,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_bdb70a3b","line":415,"range":{"start_line":415,"start_character":25,"end_line":415,"end_character":54},"in_reply_to":"7faddb67_2c3b10d1","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        mock_get_service.assert_called_once_with("},{"line_number":422,"context_line":"            task.context, \u0027host1\u0027, \u0027nova-compute\u0027)"},{"line_number":423,"context_line":"        mock_delete_allocation.assert_called_once_with("},{"line_number":424,"context_line":"            task.context, self.instance.uuid)"},{"line_number":425,"context_line":"        mock_claim_resources.assert_not_called()"},{"line_number":426,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_cc783c90","line":423,"updated":"2019-09-05 16:24:25.000000000","message":"OK so in this case we\u0027d hit the rollback method which calls revert_allocation_for_migration which calls move_allocations which should be safe since it only cares if the source consumer allocations are missing, which they wouldn\u0027t be (the migration is holding those for the source provider(s)). The target consumer (instance) allocations would be gone, but it doesn\u0027t matter since move_allocations overwrites them anyway if they aren\u0027t gone.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        mock_get_service.assert_called_once_with("},{"line_number":422,"context_line":"            task.context, \u0027host1\u0027, \u0027nova-compute\u0027)"},{"line_number":423,"context_line":"        mock_delete_allocation.assert_called_once_with("},{"line_number":424,"context_line":"            task.context, self.instance.uuid)"},{"line_number":425,"context_line":"        mock_claim_resources.assert_not_called()"},{"line_number":426,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_7d83d257","line":423,"in_reply_to":"7faddb67_cc783c90","updated":"2019-09-06 12:18:30.000000000","message":"Exactly.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":457,"context_line":"            allocation_request\u003djsonutils.dumps("},{"line_number":458,"context_line":"                {\"allocations\": {uuids.host2: resources}}),"},{"line_number":459,"context_line":"            allocation_request_version\u003d\u00271.19\u0027)"},{"line_number":460,"context_line":"        alternate \u003d objects.Selection("},{"line_number":461,"context_line":"            service_host\u003d\"host3\","},{"line_number":462,"context_line":"            nodename\u003d\"node3\","},{"line_number":463,"context_line":"            cell_uuid\u003duuids.cell1,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_6ca028f4","line":460,"range":{"start_line":460,"start_character":8,"end_line":460,"end_character":17},"updated":"2019-09-05 16:24:25.000000000","message":"nit: could be more like alternate1 and alternate2 yeah? or call this third since second is also an alternate.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":457,"context_line":"            allocation_request\u003djsonutils.dumps("},{"line_number":458,"context_line":"                {\"allocations\": {uuids.host2: resources}}),"},{"line_number":459,"context_line":"            allocation_request_version\u003d\u00271.19\u0027)"},{"line_number":460,"context_line":"        alternate \u003d objects.Selection("},{"line_number":461,"context_line":"            service_host\u003d\"host3\","},{"line_number":462,"context_line":"            nodename\u003d\"node3\","},{"line_number":463,"context_line":"            cell_uuid\u003duuids.cell1,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_3df23a08","line":460,"range":{"start_line":460,"start_character":8,"end_line":460,"end_character":17},"in_reply_to":"7faddb67_6ca028f4","updated":"2019-09-06 12:18:30.000000000","message":"I think I wanted to differentiate between hosts that is consumed by the first schedule from the hosts that left in the host_list for later re-schedule. But yeah, it is not clear from the naming. I falling back to \u0027third\u0027 and let the reader put the pieces together at L479.","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":535,"context_line":"            allocation_request\u003djsonutils.dumps("},{"line_number":536,"context_line":"                {\"allocations\": {uuids.host3: resources}}),"},{"line_number":537,"context_line":"            allocation_request_version\u003d\u00271.19\u0027)"},{"line_number":538,"context_line":"        alternate \u003d objects.Selection("},{"line_number":539,"context_line":"            service_host\u003d\"host4\","},{"line_number":540,"context_line":"            nodename\u003d\"node4\","},{"line_number":541,"context_line":"            cell_uuid\u003duuids.cell1,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_ac838055","line":538,"range":{"start_line":538,"start_character":8,"end_line":538,"end_character":17},"updated":"2019-09-05 16:24:25.000000000","message":"nit: same as above - call this fourth or call second and third alternate1 and alternate2 and this alternate3?","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":535,"context_line":"            allocation_request\u003djsonutils.dumps("},{"line_number":536,"context_line":"                {\"allocations\": {uuids.host3: resources}}),"},{"line_number":537,"context_line":"            allocation_request_version\u003d\u00271.19\u0027)"},{"line_number":538,"context_line":"        alternate \u003d objects.Selection("},{"line_number":539,"context_line":"            service_host\u003d\"host4\","},{"line_number":540,"context_line":"            nodename\u003d\"node4\","},{"line_number":541,"context_line":"            cell_uuid\u003duuids.cell1,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_5dd05651","line":538,"range":{"start_line":538,"start_character":8,"end_line":538,"end_character":17},"in_reply_to":"7faddb67_ac838055","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":634,"context_line":"            allocation_request\u003djsonutils.dumps("},{"line_number":635,"context_line":"                {\"allocations\": {uuids.host3: resources}}),"},{"line_number":636,"context_line":"            allocation_request_version\u003d\u00271.19\u0027)"},{"line_number":637,"context_line":"        alternate \u003d objects.Selection("},{"line_number":638,"context_line":"            service_host\u003d\"host4\","},{"line_number":639,"context_line":"            nodename\u003d\"node4\","},{"line_number":640,"context_line":"            cell_uuid\u003duuids.cell1,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_4cd76c50","line":637,"range":{"start_line":637,"start_character":8,"end_line":637,"end_character":17},"updated":"2019-09-05 16:24:25.000000000","message":"same","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":634,"context_line":"            allocation_request\u003djsonutils.dumps("},{"line_number":635,"context_line":"                {\"allocations\": {uuids.host3: resources}}),"},{"line_number":636,"context_line":"            allocation_request_version\u003d\u00271.19\u0027)"},{"line_number":637,"context_line":"        alternate \u003d objects.Selection("},{"line_number":638,"context_line":"            service_host\u003d\"host4\","},{"line_number":639,"context_line":"            nodename\u003d\"node4\","},{"line_number":640,"context_line":"            cell_uuid\u003duuids.cell1,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_fdc4a294","line":637,"range":{"start_line":637,"start_character":8,"end_line":637,"end_character":17},"in_reply_to":"7faddb67_4cd76c50","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aef198225dc5ce4feeb0215fb526503a0c99cc93","unresolved":false,"context_lines":[{"line_number":666,"context_line":"        ])"},{"line_number":667,"context_line":"        mock_delete_allocation.assert_called_once_with("},{"line_number":668,"context_line":"            task.context, self.instance.uuid)"},{"line_number":669,"context_line":"        mock_claim_resources.assert_has_calls(["},{"line_number":670,"context_line":"            mock.call("},{"line_number":671,"context_line":"                self.context.elevated(), task.reportclient, task.request_spec,"},{"line_number":672,"context_line":"                self.instance.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_ecbad808","line":669,"range":{"start_line":669,"start_character":29,"end_line":669,"end_character":45},"updated":"2019-09-05 16:24:25.000000000","message":"nit: could just be assert_called_once_with","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"67ddfc72860f27eb6bc77f0c1a370dd9809c455e","unresolved":false,"context_lines":[{"line_number":666,"context_line":"        ])"},{"line_number":667,"context_line":"        mock_delete_allocation.assert_called_once_with("},{"line_number":668,"context_line":"            task.context, self.instance.uuid)"},{"line_number":669,"context_line":"        mock_claim_resources.assert_has_calls(["},{"line_number":670,"context_line":"            mock.call("},{"line_number":671,"context_line":"                self.context.elevated(), task.reportclient, task.request_spec,"},{"line_number":672,"context_line":"                self.instance.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5faad753_7d3672b7","line":669,"range":{"start_line":669,"start_character":29,"end_line":669,"end_character":45},"in_reply_to":"7faddb67_ecbad808","updated":"2019-09-06 12:18:30.000000000","message":"Done","commit_id":"b188b9fb8a54e5cd6363341df871a8895b99b7c9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"38a282d2ac34812f1201f1aaa8c6f8265b02f9ff","unresolved":false,"context_lines":[{"line_number":693,"context_line":"    @mock.patch(\u0027nova.scheduler.utils.fill_provider_mapping\u0027)"},{"line_number":694,"context_line":"    @mock.patch(\u0027nova.scheduler.utils.claim_resources\u0027)"},{"line_number":695,"context_line":"    @mock.patch(\u0027nova.objects.Service.get_by_host_and_binary\u0027)"},{"line_number":696,"context_line":"    def test_reschedule_old_compute_skipped("},{"line_number":697,"context_line":"            self, mock_get_service, mock_claim_resources, mock_fill_mapping,"},{"line_number":698,"context_line":"            mock_debug):"},{"line_number":699,"context_line":"        self.request_spec.requested_resources \u003d ["}],"source_content_type":"text/x-python","patch_set":4,"id":"5faad753_829ae2c2","line":696,"range":{"start_line":696,"start_character":8,"end_line":696,"end_character":43},"updated":"2019-09-06 17:54:41.000000000","message":"nit: I\u0027d try to work \"_with_resource_request_\" into this somehow for context.","commit_id":"d6795e1393a7f9cc781c0d149220e6b5dacf716e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"38a282d2ac34812f1201f1aaa8c6f8265b02f9ff","unresolved":false,"context_lines":[{"line_number":744,"context_line":"            {\"allocations\": {uuids.host2: resources}}, \u00271.19\u0027)"},{"line_number":745,"context_line":"        mock_fill_mapping.assert_called_once_with("},{"line_number":746,"context_line":"            task.context, task.reportclient, task.request_spec, second)"},{"line_number":747,"context_line":"        mock_debug.assert_has_calls(["},{"line_number":748,"context_line":"            mock.call("},{"line_number":749,"context_line":"                \u0027Scheduler returned alternate host %(host)s as a possible \u0027"},{"line_number":750,"context_line":"                \u0027migration target for re-schedule but that host is not \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"5faad753_a29fdeb2","line":747,"range":{"start_line":747,"start_character":19,"end_line":747,"end_character":35},"updated":"2019-09-06 17:54:41.000000000","message":"nit: could just be assert_called_once_with","commit_id":"d6795e1393a7f9cc781c0d149220e6b5dacf716e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"38a282d2ac34812f1201f1aaa8c6f8265b02f9ff","unresolved":false,"context_lines":[{"line_number":759,"context_line":"    @mock.patch(\u0027nova.scheduler.utils.fill_provider_mapping\u0027)"},{"line_number":760,"context_line":"    @mock.patch(\u0027nova.scheduler.utils.claim_resources\u0027)"},{"line_number":761,"context_line":"    @mock.patch(\u0027nova.objects.Service.get_by_host_and_binary\u0027)"},{"line_number":762,"context_line":"    def test_reschedule_old_computes_no_more_alternates("},{"line_number":763,"context_line":"            self, mock_get_service, mock_claim_resources, mock_fill_mapping,"},{"line_number":764,"context_line":"            mock_debug):"},{"line_number":765,"context_line":"        self.request_spec.requested_resources \u003d ["}],"source_content_type":"text/x-python","patch_set":4,"id":"5faad753_c2b77a3a","line":762,"range":{"start_line":762,"start_character":8,"end_line":762,"end_character":55},"updated":"2019-09-06 17:54:41.000000000","message":"same nit as above about naming for context","commit_id":"d6795e1393a7f9cc781c0d149220e6b5dacf716e"}]}
