)]}'
{"nova/compute/api.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ca2e879521679ae45db28a181709206bd9734265","unresolved":false,"context_lines":[{"line_number":878,"context_line":"        # quota check can be correctly calculated later for multi-create"},{"line_number":879,"context_line":"        # circumstances."},{"line_number":880,"context_line":"        if instance_group:"},{"line_number":881,"context_line":"            old_instance_group_members \u003d [member for member in"},{"line_number":882,"context_line":"                                          instance_group.members]"},{"line_number":883,"context_line":""},{"line_number":884,"context_line":"        try:"},{"line_number":885,"context_line":"            for i in range(num_instances):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_ed0bed78","line":882,"range":{"start_line":881,"start_character":42,"end_line":882,"end_character":64},"updated":"2018-07-06 17:33:54.000000000","message":"Note to self: this is needed to copy the list so it doesn\u0027t change later on. Might be better to just copy.copy(instance_group.members) to make it more obvious.","commit_id":"39b1f494ccbd8b908978c81b9c73f32b063bd843"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ca2e879521679ae45db28a181709206bd9734265","unresolved":false,"context_lines":[{"line_number":956,"context_line":""},{"line_number":957,"context_line":"                        try:"},{"line_number":958,"context_line":"                            objects.Quotas.check_deltas("},{"line_number":959,"context_line":"                                context, {\u0027server_group_members\u0027: igm_delta},"},{"line_number":960,"context_line":"                                instance_group, context.user_id)"},{"line_number":961,"context_line":"                        except exception.OverQuota:"},{"line_number":962,"context_line":"                            msg \u003d _(\"Quota exceeded, too many servers in \""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_ed320d5d","line":959,"updated":"2018-07-06 17:33:54.000000000","message":"Note to reviewers: check_deltas for \u0027server_group_members\u0027 counts the number of server group members for a _user_ and the only way to do that is by counting instance records. The instance_group_member table in the API database doesn\u0027t contain any project_id/user_id information.\n\nThe reason for the bug this patch is trying to fix is, at this point in the boot process we have _not_ yet created instance records. So on a fresh install followed by a multi-create, the count inside check_deltas will keep returning a count of 0 until instance records are created later on in conductor.\n\nIt seems like this is the right thing to do -- check the total multi-create delta against the existing instance record count for server group members for a user.","commit_id":"39b1f494ccbd8b908978c81b9c73f32b063bd843"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ca2e879521679ae45db28a181709206bd9734265","unresolved":false,"context_lines":[{"line_number":975,"context_line":"                        try:"},{"line_number":976,"context_line":"                            objects.Quotas.check_deltas("},{"line_number":977,"context_line":"                                context, {\u0027server_group_members\u0027: igm_delta},"},{"line_number":978,"context_line":"                                instance_group, context.user_id)"},{"line_number":979,"context_line":""},{"line_number":980,"context_line":"                        # Clean up all members that have been added to db"},{"line_number":981,"context_line":"                        # during this build call in case of quota recheck"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_cd99511e","line":978,"updated":"2018-07-06 17:33:54.000000000","message":"Here, I\u0027m not sure we\u0027re really gaining anything from a quota recheck. This was intended to be, after creating instance records, if the count is over quota, roll back. But we\u0027re not creating any instance records yet, so this check is just a repeat of the check on L959. If we\u0027re racing with other requests, creating the member record in the API database doesn\u0027t stake the claim -- the instance record does.\n\nWe\u0027re creating instance_group_member records in the API database here (on L966) that have no user info attached to them, so counting those wouldn\u0027t help.\n\nHistorically, server_group_members quota has always been implemented as the maximum number of servers per server group, per _user_. And it doesn\u0027t explain that in the nova/conf/quota.py option for it.\n\nI wonder if should take a different approach here and instead of checking the total delta, we just also count build requests in addition to instances for instance group members for a user (would have to de-dupe instance UUIDs in the case of the small window where build request and instance record co-exist for the same instance).","commit_id":"39b1f494ccbd8b908978c81b9c73f32b063bd843"}],"nova/quota.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"d3cd35176ae548320d7337828f30c3245fa60c0c","unresolved":false,"context_lines":[{"line_number":1284,"context_line":"        found \u003d greenthread.wait()"},{"line_number":1285,"context_line":"        instances \u003d instances + found"},{"line_number":1286,"context_line":"    # Count build requests using the same filters to catch group members"},{"line_number":1287,"context_line":"    # that are not yet creatd in a cell."},{"line_number":1288,"context_line":"    # NOTE(mriedem): BuildRequestList.get_by_filters is not very efficient for"},{"line_number":1289,"context_line":"    # what we need and we can optimize this with a new query method."},{"line_number":1290,"context_line":"    build_requests \u003d objects.BuildRequestList.get_by_filters(context, filters)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_0f4fe635","line":1287,"range":{"start_line":1287,"start_character":23,"end_line":1287,"end_character":29},"updated":"2018-07-11 18:37:01.000000000","message":"created","commit_id":"bbee9a26a5c64a1463bd9a9f82d735ec17c62d52"}]}
