)]}'
{"nova/scheduler/filter_scheduler.py":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"9a1537aab4c61e5bd07f6c70a5d14393ebf13ac1","unresolved":false,"context_lines":[{"line_number":396,"context_line":"            # chance of being able to fit another instance on it."},{"line_number":397,"context_line":"            for host in hosts:"},{"line_number":398,"context_line":"                if len(selected_plus_alts) \u003e\u003d num_alts + 1:"},{"line_number":399,"context_line":"                    break"},{"line_number":400,"context_line":"                if host.cell_uuid \u003d\u003d cell_uuid and host not in selected_hosts:"},{"line_number":401,"context_line":"                    if alloc_reqs_by_rp_uuid is not None:"},{"line_number":402,"context_line":"                        alt_uuid \u003d host.uuid"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_35067523","side":"PARENT","line":399,"updated":"2018-09-13 17:49:31.000000000","message":"Done.","commit_id":"20b667a65bf577c594520f752fe92d7d2b667c2f"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"43dbc2612c35206c16175d95d75d11eae117585d","unresolved":false,"context_lines":[{"line_number":394,"context_line":"            # any claimed host from consideration as an alternate because it"},{"line_number":395,"context_line":"            # will have had its resources reduced and will have a much lower"},{"line_number":396,"context_line":"            # chance of being able to fit another instance on it."},{"line_number":397,"context_line":"            for host in hosts:"},{"line_number":398,"context_line":"                if len(selected_plus_alts) \u003e\u003d num_alts + 1:"},{"line_number":399,"context_line":"                    break"},{"line_number":400,"context_line":"                if host.cell_uuid \u003d\u003d cell_uuid and host !\u003d selected_host:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_c340aea5","line":397,"updated":"2018-09-13 16:54:52.000000000","message":"I\u0027m a bit struggling with understanding if we respect the spreading strategy (if the operator wanted to) by making sure this hosts list is different between each call, but I don\u0027t want to hold the change on it.","commit_id":"2624889b2f0a0c2315faf4c50c8d588d932a2c5d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"52c4c62f4909130ac6b5b5c7dc38f9f7d334ce75","unresolved":false,"context_lines":[{"line_number":394,"context_line":"            # any claimed host from consideration as an alternate because it"},{"line_number":395,"context_line":"            # will have had its resources reduced and will have a much lower"},{"line_number":396,"context_line":"            # chance of being able to fit another instance on it."},{"line_number":397,"context_line":"            for host in hosts:"},{"line_number":398,"context_line":"                if len(selected_plus_alts) \u003e\u003d num_alts + 1:"},{"line_number":399,"context_line":"                    break"},{"line_number":400,"context_line":"                if host.cell_uuid \u003d\u003d cell_uuid and host !\u003d selected_host:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_b54da572","line":397,"in_reply_to":"3f79a3b5_c340aea5","updated":"2018-09-13 17:12:50.000000000","message":"At the very least, this comment should be updated to reflect the change in the strategy if this change is adopted.","commit_id":"2624889b2f0a0c2315faf4c50c8d588d932a2c5d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"52c4c62f4909130ac6b5b5c7dc38f9f7d334ce75","unresolved":false,"context_lines":[{"line_number":397,"context_line":"            for host in hosts:"},{"line_number":398,"context_line":"                if len(selected_plus_alts) \u003e\u003d num_alts + 1:"},{"line_number":399,"context_line":"                    break"},{"line_number":400,"context_line":"                if host.cell_uuid \u003d\u003d cell_uuid and host !\u003d selected_host:"},{"line_number":401,"context_line":"                    if alloc_reqs_by_rp_uuid is not None:"},{"line_number":402,"context_line":"                        alt_uuid \u003d host.uuid"},{"line_number":403,"context_line":"                        if alt_uuid not in alloc_reqs_by_rp_uuid:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_556d31ca","line":400,"updated":"2018-09-13 17:12:50.000000000","message":"Per IRC discussion with mriedem, perhaps this should only be done if the number of possible alternates is fewer than the number of requested instances.","commit_id":"2624889b2f0a0c2315faf4c50c8d588d932a2c5d"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"ad103c1b96d59d7c351fe13c539fc418ca736b6c","unresolved":false,"context_lines":[{"line_number":397,"context_line":"            for host in hosts:"},{"line_number":398,"context_line":"                if len(selected_plus_alts) \u003e\u003d num_alts + 1:"},{"line_number":399,"context_line":"                    break"},{"line_number":400,"context_line":"                if host.cell_uuid \u003d\u003d cell_uuid and host !\u003d selected_host:"},{"line_number":401,"context_line":"                    if alloc_reqs_by_rp_uuid is not None:"},{"line_number":402,"context_line":"                        alt_uuid \u003d host.uuid"},{"line_number":403,"context_line":"                        if alt_uuid not in alloc_reqs_by_rp_uuid:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_a0ceb358","line":400,"updated":"2018-09-14 16:16:29.000000000","message":"Thanks Ed, I\u0027ll respin with tests etc later today.","commit_id":"2624889b2f0a0c2315faf4c50c8d588d932a2c5d"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"9a1537aab4c61e5bd07f6c70a5d14393ebf13ac1","unresolved":false,"context_lines":[{"line_number":397,"context_line":"            for host in hosts:"},{"line_number":398,"context_line":"                if len(selected_plus_alts) \u003e\u003d num_alts + 1:"},{"line_number":399,"context_line":"                    break"},{"line_number":400,"context_line":"                if host.cell_uuid \u003d\u003d cell_uuid and host !\u003d selected_host:"},{"line_number":401,"context_line":"                    if alloc_reqs_by_rp_uuid is not None:"},{"line_number":402,"context_line":"                        alt_uuid \u003d host.uuid"},{"line_number":403,"context_line":"                        if alt_uuid not in alloc_reqs_by_rp_uuid:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_d504e11a","line":400,"updated":"2018-09-13 17:49:31.000000000","message":"What would that help avoid here?","commit_id":"2624889b2f0a0c2315faf4c50c8d588d932a2c5d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"c844c55a199165413d82636bfeace750a6e4beb1","unresolved":false,"context_lines":[{"line_number":397,"context_line":"            for host in hosts:"},{"line_number":398,"context_line":"                if len(selected_plus_alts) \u003e\u003d num_alts + 1:"},{"line_number":399,"context_line":"                    break"},{"line_number":400,"context_line":"                if host.cell_uuid \u003d\u003d cell_uuid and host !\u003d selected_host:"},{"line_number":401,"context_line":"                    if alloc_reqs_by_rp_uuid is not None:"},{"line_number":402,"context_line":"                        alt_uuid \u003d host.uuid"},{"line_number":403,"context_line":"                        if alt_uuid not in alloc_reqs_by_rp_uuid:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_1d9fd065","line":400,"in_reply_to":"3f79a3b5_d504e11a","updated":"2018-09-14 15:39:35.000000000","message":"As discussed on IRC, including hosts that have already been selected to have instances built on them increases the chance that a reschedule will fail for insufficient resources. The only time this would help is when there are more requested instances than available hosts.","commit_id":"2624889b2f0a0c2315faf4c50c8d588d932a2c5d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"aa1cbea3ec22c741a6468e915e80f915e7049be1","unresolved":false,"context_lines":[{"line_number":401,"context_line":"                # than the number of possible alternate hosts. This should"},{"line_number":402,"context_line":"                # allow alternates to always be provided even in smaller"},{"line_number":403,"context_line":"                # environments."},{"line_number":404,"context_line":"                if ((index \u003e num_alts and host !\u003d selected_host) or"},{"line_number":405,"context_line":"                    (host not in selected_hosts)):"},{"line_number":406,"context_line":"                    if alloc_reqs_by_rp_uuid is not None:"},{"line_number":407,"context_line":"                        alt_uuid \u003d host.uuid"},{"line_number":408,"context_line":"                        if alt_uuid not in alloc_reqs_by_rp_uuid:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_017c9bb4","line":405,"range":{"start_line":404,"start_character":16,"end_line":405,"end_character":50},"updated":"2018-09-24 17:17:37.000000000","message":"This seems more confusing to read and understand the logic. What if it were more like the original, but with the added check for smaller environments? We\u0027d define a variable at the top of the method like:\n\n    allow_reused_hosts \u003d (num_alts \u003e\u003d len(hosts))\n\nand then here use that as a \n\n    if host.cell_uuid \u003d\u003d cell_uuid:\n        if allow_reused_hosts or (host not in selected_hosts):","commit_id":"bfaa5ae7f9f51096ab9213135aef365127f873d0"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"f3df232a83582e2dc0f9de0a47b77df4d556c16e","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                # allow alternates to always be provided even in smaller"},{"line_number":403,"context_line":"                # environments."},{"line_number":404,"context_line":"                if ((index \u003e num_alts and host !\u003d selected_host) or"},{"line_number":405,"context_line":"                    (host not in selected_hosts)):"},{"line_number":406,"context_line":"                    if alloc_reqs_by_rp_uuid is not None:"},{"line_number":407,"context_line":"                        alt_uuid \u003d host.uuid"},{"line_number":408,"context_line":"                        if alt_uuid not in alloc_reqs_by_rp_uuid:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_1c52c036","line":405,"updated":"2018-09-24 18:12:16.000000000","message":"Yeah that\u0027s a valid point about the logic being hard to understand here, however the continue etc was to avoid indenting the below block and increasing the size of the change. I\u0027ll respin with a compromise now.","commit_id":"bfaa5ae7f9f51096ab9213135aef365127f873d0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"259254ac0866a5672cd382cbcb5990dd0be20f56","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                # allow alternates to always be provided even in smaller"},{"line_number":403,"context_line":"                # environments."},{"line_number":404,"context_line":"                if ((index \u003e num_alts and host !\u003d selected_host) or"},{"line_number":405,"context_line":"                    (host not in selected_hosts)):"},{"line_number":406,"context_line":"                    if alloc_reqs_by_rp_uuid is not None:"},{"line_number":407,"context_line":"                        alt_uuid \u003d host.uuid"},{"line_number":408,"context_line":"                        if alt_uuid not in alloc_reqs_by_rp_uuid:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_f71cbdc3","line":405,"in_reply_to":"3f79a3b5_1c52c036","updated":"2018-09-24 18:56:45.000000000","message":"Understood, but future readers of the code won\u0027t see the diff, but they will have to understand the logic.","commit_id":"bfaa5ae7f9f51096ab9213135aef365127f873d0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"259254ac0866a5672cd382cbcb5990dd0be20f56","unresolved":false,"context_lines":[{"line_number":401,"context_line":"                # than the number of possible alternate hosts. This should"},{"line_number":402,"context_line":"                # allow alternates to always be provided even in smaller"},{"line_number":403,"context_line":"                # environments."},{"line_number":404,"context_line":"                reuse_selected_hosts \u003d (index \u003e\u003d len(hosts) and"},{"line_number":405,"context_line":"                                        host !\u003d selected_host)"},{"line_number":406,"context_line":"                if reuse_selected_hosts or (host not in selected_hosts):"},{"line_number":407,"context_line":"                    if alloc_reqs_by_rp_uuid is not None:"},{"line_number":408,"context_line":"                        alt_uuid \u003d host.uuid"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_f78d9dd4","line":405,"range":{"start_line":404,"start_character":16,"end_line":405,"end_character":62},"updated":"2018-09-24 18:56:45.000000000","message":"I\u0027m not sure I understand why the index is being used. If the request if for 3 instances and there are only 3 compute nodes, why would only the third selected host get alternates?\n\nI still think it would be cleaner to establish that we are in an environment with a small number of hosts outside this loop, and then use the logic in the next line. You could also add a \u0027if host \u003d\u003d selected_host:\u0027 test to the cell uuid short circuit line above.","commit_id":"d7bbd3101406a1cb72f9a9724deca7b0697255b5"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"91080b1dd1db9417412e4dc0dde67e70c80ec40a","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                # allow alternates to always be provided even in smaller"},{"line_number":403,"context_line":"                # environments."},{"line_number":404,"context_line":"                reuse_selected_hosts \u003d (index \u003e\u003d len(hosts) and"},{"line_number":405,"context_line":"                                        host !\u003d selected_host)"},{"line_number":406,"context_line":"                if reuse_selected_hosts or (host not in selected_hosts):"},{"line_number":407,"context_line":"                    if alloc_reqs_by_rp_uuid is not None:"},{"line_number":408,"context_line":"                        alt_uuid \u003d host.uuid"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_6e23ec07","line":405,"updated":"2018-09-25 12:13:39.000000000","message":"We should really rename index to num_instances, it\u0027s not an index of the current loop just the overall count of instances being requested. So reuse_selected_hosts would be True for each of the selections, allowing hosts to be used as alternates as long as they are not the current selected host. I\u0027ll try to make this crystal clear in a respin.","commit_id":"d7bbd3101406a1cb72f9a9724deca7b0697255b5"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8bb25b3071253df8808a98c972018dc1c240415d","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                # allow alternates to always be provided even in smaller"},{"line_number":403,"context_line":"                # environments."},{"line_number":404,"context_line":"                reuse_selected_hosts \u003d (index \u003e\u003d len(hosts) and"},{"line_number":405,"context_line":"                                        host !\u003d selected_host)"},{"line_number":406,"context_line":"                if reuse_selected_hosts or (host not in selected_hosts):"},{"line_number":407,"context_line":"                    if alloc_reqs_by_rp_uuid is not None:"},{"line_number":408,"context_line":"                        alt_uuid \u003d host.uuid"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_328a15bc","line":405,"in_reply_to":"3f79a3b5_6e23ec07","updated":"2018-09-26 14:21:41.000000000","message":"It\u0027s because of the use of \u0027index\u0027 in _get_sorted_hosts() here, and its extensive usage in the host_manager.py file.","commit_id":"d7bbd3101406a1cb72f9a9724deca7b0697255b5"}],"nova/tests/functional/regressions/test_bug_1781710.py":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"18913b29805ed977f42880e4de79ef7a3a296d3b","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                             \u0027anti-affinity group.\u0027)"},{"line_number":109,"context_line":"            hosts \u003d set([])"},{"line_number":110,"context_line":"            for selection_list in selections_to_return:"},{"line_number":111,"context_line":"                self.assertEqual(1, len(selection_list), selection_list)"},{"line_number":112,"context_line":"                hosts.add(selection_list[0].service_host)"},{"line_number":113,"context_line":"            self.assertEqual(2, len(hosts), hosts)"},{"line_number":114,"context_line":"            return selections_to_return"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_8878f9f7","side":"PARENT","line":111,"range":{"start_line":111,"start_character":16,"end_line":111,"end_character":72},"updated":"2018-09-21 10:53:46.000000000","message":"I didn\u0027t call this out in the commit but will during a respin. I\u0027m not sure why we asserted this behaviour here tbh.","commit_id":"5a4c83eade9f3d06a6d5e9c768b60f51c1b51b8b"}]}
