)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"a60a7b4f280aec2affbecb0729ebfdeb2e6fbb32","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"To solve the race condition problem, we do anti-affinity policy"},{"line_number":10,"context_line":"sanity check in the instance build code of compute manager, but"},{"line_number":11,"context_line":"this check is only valid in original policy."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch updates the sanity check code to adapt"},{"line_number":14,"context_line":"_validate_instance_group_policy to new policy model."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_aa8ef376","line":11,"range":{"start_line":11,"start_character":25,"end_line":11,"end_character":27},"updated":"2018-06-04 07:18:28.000000000","message":"for","commit_id":"4df15d89d09d68d7d3c0aad254905b9c9ca88050"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"75f0bd8275cf53fd4a8e82c7b2e4b272ed58dee2","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"To solve the race condition problem, we do anti-affinity policy"},{"line_number":10,"context_line":"sanity check in the instance build code of compute manager, but"},{"line_number":11,"context_line":"this check is only valid in original policy."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch updates the sanity check code to adapt"},{"line_number":14,"context_line":"_validate_instance_group_policy to new policy model."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_d251a5db","line":11,"range":{"start_line":11,"start_character":25,"end_line":11,"end_character":27},"in_reply_to":"5f7c97a3_aa8ef376","updated":"2018-06-04 11:28:39.000000000","message":"Done","commit_id":"4df15d89d09d68d7d3c0aad254905b9c9ca88050"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2de13455d766dc5e1bce213db809b817e7d26249","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"To solve the race condition problem, we do anti-affinity policy"},{"line_number":10,"context_line":"sanity check in the instance build code of compute manager, but"},{"line_number":11,"context_line":"this check is only valid in original policy."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch updates the sanity check code to adapt"},{"line_number":14,"context_line":"_validate_instance_group_policy to new policy model."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"5f7c97a3_f2d445bd","line":11,"range":{"start_line":11,"start_character":25,"end_line":11,"end_character":44},"updated":"2018-07-05 16:28:54.000000000","message":"I\u0027m not sure what this means. Do you mean, before the max_server_per_host policy rule? If so, let\u0027s specifically mention that this is added validation of the new max_server_per_host policy rule which can be used to allow \u003e1 anti-affinity group member on the same host.","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"943721670fad5941397bf1f72a9839e176426afd","unresolved":false,"context_lines":[{"line_number":11,"context_line":"this check is only valid in original policy."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch updates the sanity check code to adapt"},{"line_number":14,"context_line":"_validate_instance_group_policy to new policy model."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"blueprint: complex-anti-affinity-policies"},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"5f7c97a3_843d5d2d","line":14,"updated":"2018-07-09 12:59:57.000000000","message":"nit: I would add: \"Specifically, this change adds validation of the new max_server_per_host policy rule which can be used to allow \u003e1 anti-affinity group member on the same host.\"","commit_id":"9fcb9f838c7ed8c60e05c18a3c198fb40d467ed9"}],"nova/compute/manager.py":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"a60a7b4f280aec2affbecb0729ebfdeb2e6fbb32","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"                members \u003d set(group.members)"},{"line_number":1284,"context_line":"                members_on_host \u003d inst_uuids \u0026 members - set([instance.uuid])"},{"line_number":1285,"context_line":"                policy \u003d group.policy"},{"line_number":1286,"context_line":"                if policy and policy.rules:"},{"line_number":1287,"context_line":"                    max \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1288,"context_line":"                else:"},{"line_number":1289,"context_line":"                    max \u003d 1"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_0a45a715","line":1286,"range":{"start_line":1286,"start_character":15,"end_line":1286,"end_character":26},"updated":"2018-06-04 07:18:28.000000000","message":"This already checked in line 1279","commit_id":"4df15d89d09d68d7d3c0aad254905b9c9ca88050"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"75f0bd8275cf53fd4a8e82c7b2e4b272ed58dee2","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"                members \u003d set(group.members)"},{"line_number":1284,"context_line":"                members_on_host \u003d inst_uuids \u0026 members - set([instance.uuid])"},{"line_number":1285,"context_line":"                policy \u003d group.policy"},{"line_number":1286,"context_line":"                if policy and policy.rules:"},{"line_number":1287,"context_line":"                    max \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1288,"context_line":"                else:"},{"line_number":1289,"context_line":"                    max \u003d 1"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_52c915aa","line":1286,"range":{"start_line":1286,"start_character":15,"end_line":1286,"end_character":26},"in_reply_to":"5f7c97a3_0a45a715","updated":"2018-06-04 11:28:39.000000000","message":"Done, yeah, should remove this","commit_id":"4df15d89d09d68d7d3c0aad254905b9c9ca88050"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"a60a7b4f280aec2affbecb0729ebfdeb2e6fbb32","unresolved":false,"context_lines":[{"line_number":1293,"context_line":"                    raise exception.RescheduledException("},{"line_number":1294,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1295,"context_line":"                            reason\u003dmsg)"},{"line_number":1296,"context_line":"            elif \u0027affinity\u0027 in group.policies:"},{"line_number":1297,"context_line":"                group_hosts \u003d group.get_hosts(exclude\u003d[instance.uuid])"},{"line_number":1298,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1299,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_eac2ab86","line":1296,"range":{"start_line":1296,"start_character":12,"end_line":1296,"end_character":46},"updated":"2018-06-04 07:18:28.000000000","message":"shouldn\u0027t you also change this? I mean change to group.policy.policy","commit_id":"4df15d89d09d68d7d3c0aad254905b9c9ca88050"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"75f0bd8275cf53fd4a8e82c7b2e4b272ed58dee2","unresolved":false,"context_lines":[{"line_number":1293,"context_line":"                    raise exception.RescheduledException("},{"line_number":1294,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1295,"context_line":"                            reason\u003dmsg)"},{"line_number":1296,"context_line":"            elif \u0027affinity\u0027 in group.policies:"},{"line_number":1297,"context_line":"                group_hosts \u003d group.get_hosts(exclude\u003d[instance.uuid])"},{"line_number":1298,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1299,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_7243f114","line":1296,"range":{"start_line":1296,"start_character":12,"end_line":1296,"end_character":46},"in_reply_to":"5f7c97a3_eac2ab86","updated":"2018-06-04 11:28:39.000000000","message":"Sure, but I prefer remove all these old-style polices in following patch.","commit_id":"4df15d89d09d68d7d3c0aad254905b9c9ca88050"},{"author":{"_account_id":25562,"name":"Chen","email":"dstbtgagt@foxmail.com","username":"chenn2"},"change_message_id":"22d4410a7519ee009dcbd81338cda648f601e520","unresolved":false,"context_lines":[{"line_number":1292,"context_line":"                    raise exception.RescheduledException("},{"line_number":1293,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1294,"context_line":"                            reason\u003dmsg)"},{"line_number":1295,"context_line":"            elif group.policy and \u0027anti-affinity\u0027 \u003d\u003d group.policy.policy:"},{"line_number":1296,"context_line":"                group_hosts \u003d group.get_hosts(exclude\u003d[instance.uuid])"},{"line_number":1297,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1298,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_b82f9187","line":1295,"range":{"start_line":1295,"start_character":35,"end_line":1295,"end_character":48},"updated":"2018-06-22 11:39:17.000000000","message":"should it be \u0027affinity\u0027 here?","commit_id":"1f06b3462f5b9a74fca7e34278df69b23903ce35"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"b3f598b2a070328f46dc3ca4026c830fbe422c6d","unresolved":false,"context_lines":[{"line_number":1292,"context_line":"                    raise exception.RescheduledException("},{"line_number":1293,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1294,"context_line":"                            reason\u003dmsg)"},{"line_number":1295,"context_line":"            elif group.policy and \u0027anti-affinity\u0027 \u003d\u003d group.policy.policy:"},{"line_number":1296,"context_line":"                group_hosts \u003d group.get_hosts(exclude\u003d[instance.uuid])"},{"line_number":1297,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1298,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_36adbf30","line":1295,"range":{"start_line":1295,"start_character":35,"end_line":1295,"end_character":48},"in_reply_to":"5f7c97a3_b82f9187","updated":"2018-06-25 02:15:37.000000000","message":"Done","commit_id":"1f06b3462f5b9a74fca7e34278df69b23903ce35"},{"author":{"_account_id":25562,"name":"Chen","email":"dstbtgagt@foxmail.com","username":"chenn2"},"change_message_id":"d6aede192c1d1b0218acaf3b7d26fa1621a33988","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"                members_on_host \u003d inst_uuids \u0026 members - set([instance.uuid])"},{"line_number":1284,"context_line":"                policy \u003d group.policy"},{"line_number":1285,"context_line":"                if policy.rules:"},{"line_number":1286,"context_line":"                    max \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_3121244e","line":1286,"range":{"start_line":1286,"start_character":20,"end_line":1286,"end_character":23},"updated":"2018-06-26 12:22:51.000000000","message":"shouldn\u0027t we avoid using names that are reserved (kind of) for build-in functions?","commit_id":"d042c0567be2c0cdb6728489c577b356da8b1898"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"2e7667cd40e6167b66efc4f3427db143518a83aa","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"                members_on_host \u003d inst_uuids \u0026 members - set([instance.uuid])"},{"line_number":1284,"context_line":"                policy \u003d group.policy"},{"line_number":1285,"context_line":"                if policy.rules:"},{"line_number":1286,"context_line":"                    max \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_8139aba3","line":1286,"range":{"start_line":1286,"start_character":20,"end_line":1286,"end_character":23},"in_reply_to":"5f7c97a3_3121244e","updated":"2018-06-27 11:00:21.000000000","message":"Done","commit_id":"d042c0567be2c0cdb6728489c577b356da8b1898"},{"author":{"_account_id":25562,"name":"Chen","email":"dstbtgagt@foxmail.com","username":"chenn2"},"change_message_id":"d6aede192c1d1b0218acaf3b7d26fa1621a33988","unresolved":false,"context_lines":[{"line_number":1285,"context_line":"                if policy.rules:"},{"line_number":1286,"context_line":"                    max \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max:"},{"line_number":1290,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1291,"context_line":"                            \"was violated.\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_f1164cf2","line":1288,"range":{"start_line":1288,"start_character":20,"end_line":1288,"end_character":23},"updated":"2018-06-26 12:22:51.000000000","message":"ditto","commit_id":"d042c0567be2c0cdb6728489c577b356da8b1898"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"2e7667cd40e6167b66efc4f3427db143518a83aa","unresolved":false,"context_lines":[{"line_number":1285,"context_line":"                if policy.rules:"},{"line_number":1286,"context_line":"                    max \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max:"},{"line_number":1290,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1291,"context_line":"                            \"was violated.\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_213c5790","line":1288,"range":{"start_line":1288,"start_character":20,"end_line":1288,"end_character":23},"in_reply_to":"5f7c97a3_f1164cf2","updated":"2018-06-27 11:00:21.000000000","message":"Done","commit_id":"d042c0567be2c0cdb6728489c577b356da8b1898"},{"author":{"_account_id":25562,"name":"Chen","email":"dstbtgagt@foxmail.com","username":"chenn2"},"change_message_id":"d6aede192c1d1b0218acaf3b7d26fa1621a33988","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                    max \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max:"},{"line_number":1290,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1291,"context_line":"                            \"was violated.\")"},{"line_number":1292,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_1112e8fd","line":1289,"range":{"start_line":1289,"start_character":43,"end_line":1289,"end_character":46},"updated":"2018-06-26 12:22:51.000000000","message":"ditto","commit_id":"d042c0567be2c0cdb6728489c577b356da8b1898"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"2e7667cd40e6167b66efc4f3427db143518a83aa","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                    max \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max:"},{"line_number":1290,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1291,"context_line":"                            \"was violated.\")"},{"line_number":1292,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_413f1385","line":1289,"range":{"start_line":1289,"start_character":43,"end_line":1289,"end_character":46},"in_reply_to":"5f7c97a3_1112e8fd","updated":"2018-06-27 11:00:21.000000000","message":"Done","commit_id":"d042c0567be2c0cdb6728489c577b356da8b1898"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2de13455d766dc5e1bce213db809b817e7d26249","unresolved":false,"context_lines":[{"line_number":1276,"context_line":"        def _do_validation(context, instance, group_hint):"},{"line_number":1277,"context_line":"            group \u003d objects.InstanceGroup.get_by_hint(context, group_hint)"},{"line_number":1278,"context_line":"            if group.policy and \u0027anti-affinity\u0027 \u003d\u003d group.policy.policy:"},{"line_number":1279,"context_line":"                instances \u003d objects.InstanceList.get_by_host(context,"},{"line_number":1280,"context_line":"                                                             self.host)"},{"line_number":1281,"context_line":"                inst_uuids \u003d set([inst.uuid for inst in instances])"},{"line_number":1282,"context_line":"                members \u003d set(group.members)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_b2880dc3","line":1279,"range":{"start_line":1279,"start_character":49,"end_line":1279,"end_character":60},"updated":"2018-07-05 16:28:54.000000000","message":"Use InstanceList.get_uuids_by_host here - it will be faster than loading full Instance objects with joined columns.","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"92f4fd965776246023bbc01376c93ff17b942978","unresolved":false,"context_lines":[{"line_number":1276,"context_line":"        def _do_validation(context, instance, group_hint):"},{"line_number":1277,"context_line":"            group \u003d objects.InstanceGroup.get_by_hint(context, group_hint)"},{"line_number":1278,"context_line":"            if group.policy and \u0027anti-affinity\u0027 \u003d\u003d group.policy.policy:"},{"line_number":1279,"context_line":"                instances \u003d objects.InstanceList.get_by_host(context,"},{"line_number":1280,"context_line":"                                                             self.host)"},{"line_number":1281,"context_line":"                inst_uuids \u003d set([inst.uuid for inst in instances])"},{"line_number":1282,"context_line":"                members \u003d set(group.members)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_0464f247","line":1279,"range":{"start_line":1279,"start_character":49,"end_line":1279,"end_character":60},"in_reply_to":"5f7c97a3_b2880dc3","updated":"2018-07-09 09:48:41.000000000","message":"Done","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2de13455d766dc5e1bce213db809b817e7d26249","unresolved":false,"context_lines":[{"line_number":1278,"context_line":"            if group.policy and \u0027anti-affinity\u0027 \u003d\u003d group.policy.policy:"},{"line_number":1279,"context_line":"                instances \u003d objects.InstanceList.get_by_host(context,"},{"line_number":1280,"context_line":"                                                             self.host)"},{"line_number":1281,"context_line":"                inst_uuids \u003d set([inst.uuid for inst in instances])"},{"line_number":1282,"context_line":"                members \u003d set(group.members)"},{"line_number":1283,"context_line":"                members_on_host \u003d inst_uuids \u0026 members - set([instance.uuid])"},{"line_number":1284,"context_line":"                policy \u003d group.policy"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_32b63d8b","line":1281,"range":{"start_line":1281,"start_character":16,"end_line":1281,"end_character":26},"updated":"2018-07-05 16:28:54.000000000","message":"nit: rename to instances_on_host","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"92f4fd965776246023bbc01376c93ff17b942978","unresolved":false,"context_lines":[{"line_number":1278,"context_line":"            if group.policy and \u0027anti-affinity\u0027 \u003d\u003d group.policy.policy:"},{"line_number":1279,"context_line":"                instances \u003d objects.InstanceList.get_by_host(context,"},{"line_number":1280,"context_line":"                                                             self.host)"},{"line_number":1281,"context_line":"                inst_uuids \u003d set([inst.uuid for inst in instances])"},{"line_number":1282,"context_line":"                members \u003d set(group.members)"},{"line_number":1283,"context_line":"                members_on_host \u003d inst_uuids \u0026 members - set([instance.uuid])"},{"line_number":1284,"context_line":"                policy \u003d group.policy"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_a4565e5d","line":1281,"range":{"start_line":1281,"start_character":16,"end_line":1281,"end_character":26},"in_reply_to":"5f7c97a3_32b63d8b","updated":"2018-07-09 09:48:41.000000000","message":"Done","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2de13455d766dc5e1bce213db809b817e7d26249","unresolved":false,"context_lines":[{"line_number":1280,"context_line":"                                                             self.host)"},{"line_number":1281,"context_line":"                inst_uuids \u003d set([inst.uuid for inst in instances])"},{"line_number":1282,"context_line":"                members \u003d set(group.members)"},{"line_number":1283,"context_line":"                members_on_host \u003d inst_uuids \u0026 members - set([instance.uuid])"},{"line_number":1284,"context_line":"                policy \u003d group.policy"},{"line_number":1285,"context_line":"                if policy.rules:"},{"line_number":1286,"context_line":"                    max_server \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_5260990d","line":1283,"updated":"2018-07-05 16:28:54.000000000","message":"A comment here would be nice, something like, \"Determine the set of instance group members on this host which are not the instance in question. This is used to determine how many other members from the same anti-affinity group can be on this host.\"","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"92f4fd965776246023bbc01376c93ff17b942978","unresolved":false,"context_lines":[{"line_number":1280,"context_line":"                                                             self.host)"},{"line_number":1281,"context_line":"                inst_uuids \u003d set([inst.uuid for inst in instances])"},{"line_number":1282,"context_line":"                members \u003d set(group.members)"},{"line_number":1283,"context_line":"                members_on_host \u003d inst_uuids \u0026 members - set([instance.uuid])"},{"line_number":1284,"context_line":"                policy \u003d group.policy"},{"line_number":1285,"context_line":"                if policy.rules:"},{"line_number":1286,"context_line":"                    max_server \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_e4ee9689","line":1283,"in_reply_to":"5f7c97a3_5260990d","updated":"2018-07-09 09:48:41.000000000","message":"Done","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2de13455d766dc5e1bce213db809b817e7d26249","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"                members_on_host \u003d inst_uuids \u0026 members - set([instance.uuid])"},{"line_number":1284,"context_line":"                policy \u003d group.policy"},{"line_number":1285,"context_line":"                if policy.rules:"},{"line_number":1286,"context_line":"                    max_server \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max_server \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max_server:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_f24f65bb","line":1286,"range":{"start_line":1286,"start_character":50,"end_line":1286,"end_character":53},"updated":"2018-07-05 16:28:54.000000000","message":"This will result in a NoneType error if max_server_per_host is not in rules. So you need an \"if \u0027max_server_per_host\u0027 in policy.rules\" condition.","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"92f4fd965776246023bbc01376c93ff17b942978","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"                members_on_host \u003d inst_uuids \u0026 members - set([instance.uuid])"},{"line_number":1284,"context_line":"                policy \u003d group.policy"},{"line_number":1285,"context_line":"                if policy.rules:"},{"line_number":1286,"context_line":"                    max_server \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max_server \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max_server:"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_84fd623c","line":1286,"range":{"start_line":1286,"start_character":50,"end_line":1286,"end_character":53},"in_reply_to":"5f7c97a3_f24f65bb","updated":"2018-07-09 09:48:41.000000000","message":"Done","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0349585bb2f06613f7d25d4db96f139467263833","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                    max_server \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max_server \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max_server:"},{"line_number":1290,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1291,"context_line":"                            \"was violated.\")"},{"line_number":1292,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_f53aefc1","line":1289,"updated":"2018-07-05 16:36:10.000000000","message":"Hmm, thinking about upgrades, we can have Queens level computes which won\u0027t have the max_server_per_host validation so if I create a group using the Rocky API and say max_server_per_host\u003d3 but hit a Queens compute that already has a member from the same anti-affinity group, it\u0027s going to fail and I\u0027m going to wonder why my max_server_per_host\u003d3 didn\u0027t work.\n\nOne thing we could do, is bump the nova-compute RPC API version [1] and then in the API, temporarily add a check such that users can only specify max_server_per_host\u003e1 if all computes in the deployment are running at least Rocky code, and then we can drop that restriction in the API in Stein.\n\nI\u0027m not sure if that is asking too much for this feature, but it\u0027s consistent with other things we added to the API which are dependent on code in the compute service, like tagged attachments and volume multi-attach support. I would just return a 403 from the API if computes in the deployment (across all cells) are not yet upgraded and a group is created with max_server_per_host \u003e 1. I\u0027ll ask dansmith and see what he thinks.\n\n[1] https://github.com/openstack/nova/blob/187f80a32c8b5cdfc115e9b90f4818f3d9d1f8fe/nova/objects/service.py#L34","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"92f4fd965776246023bbc01376c93ff17b942978","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                    max_server \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max_server \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max_server:"},{"line_number":1290,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1291,"context_line":"                            \"was violated.\")"},{"line_number":1292,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_0f540b21","line":1289,"in_reply_to":"5f7c97a3_0f1c0bc0","updated":"2018-07-09 09:48:41.000000000","message":"OK, thanks for your idea. I agree with we need add compute version dump, and add check in api","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4e03f535095554b74ece62c56c107b9058143edb","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                    max_server \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max_server \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max_server:"},{"line_number":1290,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1291,"context_line":"                            \"was violated.\")"},{"line_number":1292,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_b5b5571b","line":1289,"in_reply_to":"5f7c97a3_15ec4b26","updated":"2018-07-05 16:41:51.000000000","message":"Yeah, I think you mean service version, but yeah.. a service version that until we\u0027re all updated, won\u0027t allow us to create groups with that max_server_per_host thing. I\u0027m not sure why it would be \"asking too much\" since we ask that of other such features.","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"19f7a888e3df3b2e285000edd2eae5f8d8057f81","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                    max_server \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max_server \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max_server:"},{"line_number":1290,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1291,"context_line":"                            \"was violated.\")"},{"line_number":1292,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_0f1c0bc0","line":1289,"in_reply_to":"5f7c97a3_2fe9c7a9","updated":"2018-07-09 09:35:25.000000000","message":"Checking again, Matt means using this version in API to check for all the compute versions, that seems fine.","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7b76d8e07aad4b2d554ef5b93802a7428dee7d7","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                    max_server \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max_server \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max_server:"},{"line_number":1290,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1291,"context_line":"                            \"was violated.\")"},{"line_number":1292,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_15ec4b26","line":1289,"in_reply_to":"5f7c97a3_b559d729","updated":"2018-07-05 16:39:04.000000000","message":"\u003e I would just return a 403 from the API\n\nSorry, 409 in this case, not 403.","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"e454d1432c5e75ed57f3689d69c32c0d48d2a5bd","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                    max_server \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max_server \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max_server:"},{"line_number":1290,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1291,"context_line":"                            \"was violated.\")"},{"line_number":1292,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_2fe9c7a9","line":1289,"in_reply_to":"5f7c97a3_b5b5571b","updated":"2018-07-09 09:32:58.000000000","message":"I think Matt means for add API limitations might be too much? Not sure about bumping version, for the behaviour before this change, the compute will raise RescheduleException if the instance in same group is larger than 1. I think if we bump a version and add a check in rpcapi, we\u0027d also raise that if we cannot send the versions we want, that seems make no difference.","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dbf522203fd900e6a2330078fe0886421a4789cf","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                    max_server \u003d int(policy.rules.get(\u0027max_server_per_host\u0027))"},{"line_number":1287,"context_line":"                else:"},{"line_number":1288,"context_line":"                    max_server \u003d 1"},{"line_number":1289,"context_line":"                if len(members_on_host) \u003e\u003d max_server:"},{"line_number":1290,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1291,"context_line":"                            \"was violated.\")"},{"line_number":1292,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":15,"id":"5f7c97a3_b559d729","line":1289,"in_reply_to":"5f7c97a3_f53aefc1","updated":"2018-07-05 16:36:55.000000000","message":"BTW, if we add that check, we should update the spec as well:\n\nhttps://specs.openstack.org/openstack/nova-specs/specs/rocky/approved/complex-anti-affinity-policies.html#upgrade-impact","commit_id":"d7c46a6d4681cc78373596a99b5c13b089a7692c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"67f04f4f691d5a94dfe277e34c7c28efe0cbf3ba","unresolved":false,"context_lines":[{"line_number":1287,"context_line":"                members_on_host \u003d ins_on_host \u0026 members - set([instance.uuid])"},{"line_number":1288,"context_line":"                policy \u003d group.policy"},{"line_number":1289,"context_line":"                if policy.rules and \u0027max_server_per_host\u0027 in policy.rules:"},{"line_number":1290,"context_line":"                    max_server \u003d policy.rules.get(\u0027max_server_per_host\u0027)"},{"line_number":1291,"context_line":"                else:"},{"line_number":1292,"context_line":"                    max_server \u003d 1"},{"line_number":1293,"context_line":"                if len(members_on_host) \u003e\u003d max_server:"}],"source_content_type":"text/x-python","patch_set":17,"id":"5f7c97a3_da3ece88","line":1290,"range":{"start_line":1290,"start_character":46,"end_line":1290,"end_character":49},"updated":"2018-07-09 14:07:42.000000000","message":"nit: this can just be:\n\npolicy.rules[\u0027max_server_per_host\u0027]","commit_id":"726344d2ac4ee56a75510783d0c9e6a9b648d361"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"70cea9d70e524da0f3cd816a4e4fc1ad4626a75b","unresolved":false,"context_lines":[{"line_number":1287,"context_line":"                members_on_host \u003d ins_on_host \u0026 members - set([instance.uuid])"},{"line_number":1288,"context_line":"                policy \u003d group.policy"},{"line_number":1289,"context_line":"                if policy.rules and \u0027max_server_per_host\u0027 in policy.rules:"},{"line_number":1290,"context_line":"                    max_server \u003d policy.rules.get(\u0027max_server_per_host\u0027)"},{"line_number":1291,"context_line":"                else:"},{"line_number":1292,"context_line":"                    max_server \u003d 1"},{"line_number":1293,"context_line":"                if len(members_on_host) \u003e\u003d max_server:"}],"source_content_type":"text/x-python","patch_set":17,"id":"5f7c97a3_7d20d449","line":1290,"range":{"start_line":1290,"start_character":46,"end_line":1290,"end_character":49},"in_reply_to":"5f7c97a3_da3ece88","updated":"2018-07-09 14:57:57.000000000","message":"Done","commit_id":"726344d2ac4ee56a75510783d0c9e6a9b648d361"}],"nova/objects/service.py":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"51e8530c8d73bc93d5847e7f462949d9865e5d22","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    # migration if \u0027file_backed_memory\u0027 is enabled and the source does not"},{"line_number":139,"context_line":"    # support \u0027file_backed_memory\u0027"},{"line_number":140,"context_line":"    {\u0027compute_rpc\u0027: \u00275.0\u0027},"},{"line_number":141,"context_line":"    # Version 33: Add support for check on the server group with"},{"line_number":142,"context_line":"    # \u0027max_server_per_host\u0027 rules"},{"line_number":143,"context_line":"    {\u0027compute_rpc\u0027: \u00275.0\u0027},"},{"line_number":144,"context_line":")"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"5f7c97a3_5d406a5f","line":143,"range":{"start_line":141,"start_character":0,"end_line":143,"end_character":27},"updated":"2018-07-10 04:04:37.000000000","message":"Just one question, on what scenario do we change rpc version to 5.1 instead of 5.0? as my other patch aslo bumped version","commit_id":"882b3e00484ac8c2f29abcb912aeee3fe0a7be4c"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"943721670fad5941397bf1f72a9839e176426afd","unresolved":false,"context_lines":[{"line_number":5753,"context_line":"        instance \u003d objects.Instance(uuid\u003duuids.inst1)"},{"line_number":5754,"context_line":"        hints \u003d {\u0027group\u0027: [uuids.group_hint]}"},{"line_number":5755,"context_line":"        existing_insts \u003d [uuids.inst1, uuids.inst2]"},{"line_number":5756,"context_line":"        members_uuids \u003d [i.uuid for i in existing_insts]"},{"line_number":5757,"context_line":"        mock_get_by_host.return_value \u003d existing_insts"},{"line_number":5758,"context_line":""},{"line_number":5759,"context_line":"        # if group policy rules limit to 1, raise RescheduledException"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f7c97a3_64d041f5","line":5756,"range":{"start_line":5756,"start_character":41,"end_line":5756,"end_character":55},"updated":"2018-07-09 12:59:57.000000000","message":"This is a list of uuid strings so i.uuid results in an error:\n\nhttp://logs.openstack.org/65/571465/16/check/openstack-tox-py27/4c56ee6/testr_results.html.gz","commit_id":"9fcb9f838c7ed8c60e05c18a3c198fb40d467ed9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"67f04f4f691d5a94dfe277e34c7c28efe0cbf3ba","unresolved":false,"context_lines":[{"line_number":5759,"context_line":"        # if group policy rules limit to 1, raise RescheduledException"},{"line_number":5760,"context_line":"        policy \u003d objects.InstanceGroupPolicy(policy\u003d\u0027anti-affinity\u0027,"},{"line_number":5761,"context_line":"                                             rules\u003d{"},{"line_number":5762,"context_line":"                                                 \u0027max_server_per_host\u0027: 1"},{"line_number":5763,"context_line":"                                             })"},{"line_number":5764,"context_line":"        mock_get_by_hint.return_value \u003d objects.InstanceGroup("},{"line_number":5765,"context_line":"            policy\u003dpolicy, hosts\u003d[\u0027host1\u0027], members\u003dmembers_uuids)"}],"source_content_type":"text/x-python","patch_set":17,"id":"5f7c97a3_3a4fc235","line":5762,"range":{"start_line":5762,"start_character":72,"end_line":5762,"end_character":73},"updated":"2018-07-09 14:07:42.000000000","message":"Should be OK to leave one of these as a string to ensure it gets cast when InstanceGroupPolicy.rules is called.","commit_id":"726344d2ac4ee56a75510783d0c9e6a9b648d361"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"70cea9d70e524da0f3cd816a4e4fc1ad4626a75b","unresolved":false,"context_lines":[{"line_number":5759,"context_line":"        # if group policy rules limit to 1, raise RescheduledException"},{"line_number":5760,"context_line":"        policy \u003d objects.InstanceGroupPolicy(policy\u003d\u0027anti-affinity\u0027,"},{"line_number":5761,"context_line":"                                             rules\u003d{"},{"line_number":5762,"context_line":"                                                 \u0027max_server_per_host\u0027: 1"},{"line_number":5763,"context_line":"                                             })"},{"line_number":5764,"context_line":"        mock_get_by_hint.return_value \u003d objects.InstanceGroup("},{"line_number":5765,"context_line":"            policy\u003dpolicy, hosts\u003d[\u0027host1\u0027], members\u003dmembers_uuids)"}],"source_content_type":"text/x-python","patch_set":17,"id":"5f7c97a3_dd25685c","line":5762,"range":{"start_line":5762,"start_character":72,"end_line":5762,"end_character":73},"in_reply_to":"5f7c97a3_3a4fc235","updated":"2018-07-09 14:57:57.000000000","message":"Done","commit_id":"726344d2ac4ee56a75510783d0c9e6a9b648d361"}]}
