)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"89a2c2d32cf3a7c7b9f9fa61f6c1907ed01def95","unresolved":false,"context_lines":[{"line_number":26,"context_line":"sent request to delete the instance."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I424e31c39baa4d7c96bb29687cfa45b7a6092e32"},{"line_number":29,"context_line":"Closes-Bug: 1296414"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"1a4dcd0f_026a43ee","line":29,"updated":"2015-08-06 09:41:24.000000000","message":"This bug is apparently already fixed.\n\nIs this a new bug, or a regression, or something else?\n\nSorry, I am just trying to work out what is trying to be fixed here.","commit_id":"326c8da5a035b9309ce297c85aed3d2e7e729848"}],"nova/compute/manager.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e26b4bd39dbe7692b9cd883ce245b655fe19406b","unresolved":false,"context_lines":[{"line_number":926,"context_line":"                deltas \u003d compute_utils.reverse_upsize_quota_delta(context,"},{"line_number":927,"context_line":"                                                                  migration)"},{"line_number":928,"context_line":"                reserved_quota \u003d compute_utils.reserve_quota_delta("},{"line_number":929,"context_line":"                    context, deltas, instance)"},{"line_number":930,"context_line":""},{"line_number":931,"context_line":"        quotas \u003d objects.Quotas(context\u003dcontext)"},{"line_number":932,"context_line":"        quotas.reserve(project_id\u003dproject_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"da20952f_fd71110d","line":929,"updated":"2015-09-04 04:43:26.000000000","message":"Changing this _create_reservations() method like this makes the code very difficult to follow, IMHO, especially without providing any docstring with regards to the changed return arguments.\n\nI\u0027d rather see a separate _create_reservations_for_migration() (or similarly-named) method that only handles the creation of the migration-caused quota adjustments, instead of changing this method like this.","commit_id":"42a7cd02d68445e5d49da6e62edffa171a80591c"},{"author":{"_account_id":10795,"name":"Rajesh Tailor","email":"tailor.rajesh88@gmail.com","username":"rajeshtailor"},"change_message_id":"444a169b5abd021a001ebad848b45d574c354b1c","unresolved":false,"context_lines":[{"line_number":926,"context_line":"                deltas \u003d compute_utils.reverse_upsize_quota_delta(context,"},{"line_number":927,"context_line":"                                                                  migration)"},{"line_number":928,"context_line":"                reserved_quota \u003d compute_utils.reserve_quota_delta("},{"line_number":929,"context_line":"                    context, deltas, instance)"},{"line_number":930,"context_line":""},{"line_number":931,"context_line":"        quotas \u003d objects.Quotas(context\u003dcontext)"},{"line_number":932,"context_line":"        quotas.reserve(project_id\u003dproject_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"da20952f_f2dd73e0","line":929,"in_reply_to":"da20952f_fd71110d","updated":"2015-09-07 13:27:38.000000000","message":"We need to change in existing method only instead of implementing separate methods because here we are handling two cases:\n\n1) If instance was stuck in deleting task state:\n\nIn this case, we need to get vcpus and memory_mb information associated with instance.\n\n2) If instance was stuck in deleting task state during resizing:\n\nIn this case, we need to get vcpus and memory_mb information w.r.t old_flavor information associated with migration record. \n(we can\u0027t use vcpus and memory_mb information associated with instance because instance information was already updated with new flavor information.)\n\nNote:\nIn existing code, vcpus and memory_mb information was fetched from instance object in line #909-910 which satisfy case (1).\n\nIn proposed code, old flavor related vcpus and memory_mb information are fetched in line #924-925 which satisfy case (2).\n\nAccording to scenario (1) or (2)  the correct vcpus and memory_mb information is used to reserve quota in line #932-936 when create_reservations method is called.\n\nIn below patch create_reservation method was added and current patch is follow up patch to improve quota-update on nova-compute restart:\n\nhttps://review.openstack.org/#/c/122347","commit_id":"42a7cd02d68445e5d49da6e62edffa171a80591c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e26b4bd39dbe7692b9cd883ce245b655fe19406b","unresolved":false,"context_lines":[{"line_number":1047,"context_line":"                quotas, reserved_quota, migration \u003d self._create_reservations("},{"line_number":1048,"context_line":"                    context, instance, project_id, user_id)"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"                self._delete_instance(context, instance, bdms, quotas)"},{"line_number":1051,"context_line":"                if reserved_quota:"},{"line_number":1052,"context_line":"                    # Reverse the reserved quota resources"},{"line_number":1053,"context_line":"                    reserved_quota.commit(invert_quota\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":17,"id":"da20952f_3d3ea928","line":1050,"updated":"2015-09-04 04:43:26.000000000","message":"What happens if nova-compute crashes here? The reserved_quota object created in the _create_reservation() method will never commit. When nova-compute restarts, what precisely will happen, since this marks the instance as fully deleted... which means there will be some quotas that remain unadjusted, right?","commit_id":"42a7cd02d68445e5d49da6e62edffa171a80591c"},{"author":{"_account_id":10795,"name":"Rajesh Tailor","email":"tailor.rajesh88@gmail.com","username":"rajeshtailor"},"change_message_id":"cf716bc1846c5216e238684ac1012068c2636d88","unresolved":false,"context_lines":[{"line_number":1047,"context_line":"                quotas, reserved_quota, migration \u003d self._create_reservations("},{"line_number":1048,"context_line":"                    context, instance, project_id, user_id)"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"                self._delete_instance(context, instance, bdms, quotas)"},{"line_number":1051,"context_line":"                if reserved_quota:"},{"line_number":1052,"context_line":"                    # Reverse the reserved quota resources"},{"line_number":1053,"context_line":"                    reserved_quota.commit(invert_quota\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":17,"id":"da20952f_884d969b","line":1050,"in_reply_to":"da20952f_3d3ea928","updated":"2015-09-09 07:19:50.000000000","message":"Hi Jay,\n\nNova-crash issue can happen during any instance delete request and it might end up in situation [1] where quotas will never get updated for that instance.\n\n[1] https://bugs.launchpad.net/nova/+bug/1493694","commit_id":"42a7cd02d68445e5d49da6e62edffa171a80591c"},{"author":{"_account_id":10795,"name":"Rajesh Tailor","email":"tailor.rajesh88@gmail.com","username":"rajeshtailor"},"change_message_id":"444a169b5abd021a001ebad848b45d574c354b1c","unresolved":false,"context_lines":[{"line_number":1047,"context_line":"                quotas, reserved_quota, migration \u003d self._create_reservations("},{"line_number":1048,"context_line":"                    context, instance, project_id, user_id)"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"                self._delete_instance(context, instance, bdms, quotas)"},{"line_number":1051,"context_line":"                if reserved_quota:"},{"line_number":1052,"context_line":"                    # Reverse the reserved quota resources"},{"line_number":1053,"context_line":"                    reserved_quota.commit(invert_quota\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":17,"id":"da20952f_2d286985","line":1050,"in_reply_to":"da20952f_3d3ea928","updated":"2015-09-07 13:27:38.000000000","message":"You point is valid, if nova-compute crashes after _delete_instance method, in that case, we might end up with unadjusted reserved quota.\n\nWould it be ok, if I move below if condition (line #1051-1053) before _delete_instance method call.","commit_id":"42a7cd02d68445e5d49da6e62edffa171a80591c"},{"author":{"_account_id":10795,"name":"Rajesh Tailor","email":"tailor.rajesh88@gmail.com","username":"rajeshtailor"},"change_message_id":"82a53475324d4fde3dfd965be2636a36c63cc2bd","unresolved":false,"context_lines":[{"line_number":2401,"context_line":"            instance.save()"},{"line_number":2402,"context_line":"            self._update_resource_tracker(context, instance)"},{"line_number":2403,"context_line":"            system_meta \u003d instance.system_metadata"},{"line_number":2404,"context_line":"            instance.destroy()"},{"line_number":2405,"context_line":"        except Exception:"},{"line_number":2406,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":2407,"context_line":"                quotas.rollback()"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a1a9d01_3a2cfdaa","line":2404,"updated":"2015-09-24 14:12:49.000000000","message":"Hi Jay,\n\nIMHO if nova-compute crashes here, in that case also there will not be any way to commit the quotas for instance since instance was already marked as fully deleted.\n\nTo handle the case, which you have mentioned in above comment, we can move reserved_quota commit code before _delete_instance call. \n\nPlease suggest.","commit_id":"42a7cd02d68445e5d49da6e62edffa171a80591c"},{"author":{"_account_id":10795,"name":"Rajesh Tailor","email":"tailor.rajesh88@gmail.com","username":"rajeshtailor"},"change_message_id":"27d0e6cd17d9714b81fd65c7d109019a4d1b2edb","unresolved":false,"context_lines":[{"line_number":1063,"context_line":""},{"line_number":1064,"context_line":"        if instance.task_state \u003d\u003d task_states.DELETING:"},{"line_number":1065,"context_line":"            try:"},{"line_number":1066,"context_line":"                self._complete_instance_deletion_with_deleting_task_state("},{"line_number":1067,"context_line":"                    context, instance)"},{"line_number":1068,"context_line":"            except Exception:"},{"line_number":1069,"context_line":"                # we don\u0027t want that an exception blocks the init_host"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a1a9d01_2e51c80e","line":1066,"updated":"2015-09-28 07:39:34.000000000","message":"Hi,\n\nI have moved the code in separate method, so that I can avoid below pep8 error for code complexity.\n\n./nova/compute/manager.py:943:1: C901 \u0027ComputeManager._init_instance\u0027 is too complex (35)","commit_id":"3121d9904ec107a42f21c176a5707292243e2ca4"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e6c614c9eb61c382cbf3df05b504ec60c82423ca","unresolved":false,"context_lines":[{"line_number":945,"context_line":"                                                             instance):"},{"line_number":946,"context_line":"        LOG.info(_LI(\u0027Service started deleting the instance during \u0027"},{"line_number":947,"context_line":"                     \u0027the previous run, but did not finish. Restarting\u0027"},{"line_number":948,"context_line":"                     \u0027 the deletion now.\u0027), instance\u003dinstance)"},{"line_number":949,"context_line":"        instance.obj_load_attr(\u0027metadata\u0027)"},{"line_number":950,"context_line":"        instance.obj_load_attr(\u0027system_metadata\u0027)"},{"line_number":951,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("}],"source_content_type":"text/x-python","patch_set":19,"id":"5a2ca52d_635b4588","line":948,"updated":"2015-10-15 09:19:30.000000000","message":"minor pathetic issue - but can we please be consistenat with spaces at the end of the lines","commit_id":"0eeb6afbc247700fd84bf77d1d45aac3202eb7ca"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e6c614c9eb61c382cbf3df05b504ec60c82423ca","unresolved":false,"context_lines":[{"line_number":947,"context_line":"                     \u0027the previous run, but did not finish. Restarting\u0027"},{"line_number":948,"context_line":"                     \u0027 the deletion now.\u0027), instance\u003dinstance)"},{"line_number":949,"context_line":"        instance.obj_load_attr(\u0027metadata\u0027)"},{"line_number":950,"context_line":"        instance.obj_load_attr(\u0027system_metadata\u0027)"},{"line_number":951,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":952,"context_line":"                context, instance.uuid)"},{"line_number":953,"context_line":"        project_id, user_id \u003d objects.quotas.ids_from_instance("}],"source_content_type":"text/x-python","patch_set":19,"id":"5a2ca52d_63d265d4","line":950,"updated":"2015-10-15 09:19:30.000000000","message":"why do we need these 2 lines above? can you please add a comment for that","commit_id":"0eeb6afbc247700fd84bf77d1d45aac3202eb7ca"},{"author":{"_account_id":10795,"name":"Rajesh Tailor","email":"tailor.rajesh88@gmail.com","username":"rajeshtailor"},"change_message_id":"8c9259aa33abbe882f61f99ca4fbe03471913cef","unresolved":false,"context_lines":[{"line_number":947,"context_line":"                     \u0027the previous run, but did not finish. Restarting\u0027"},{"line_number":948,"context_line":"                     \u0027 the deletion now.\u0027), instance\u003dinstance)"},{"line_number":949,"context_line":"        instance.obj_load_attr(\u0027metadata\u0027)"},{"line_number":950,"context_line":"        instance.obj_load_attr(\u0027system_metadata\u0027)"},{"line_number":951,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":952,"context_line":"                context, instance.uuid)"},{"line_number":953,"context_line":"        project_id, user_id \u003d objects.quotas.ids_from_instance("}],"source_content_type":"text/x-python","patch_set":19,"id":"5a2ca52d_21cd1366","line":950,"in_reply_to":"5a2ca52d_63d265d4","updated":"2015-10-19 06:37:34.000000000","message":"Hi Gary,\n\nI haven\u0027t added these two lines, I have just moved code from init_instance to separate method. Please check [1] for your reference.\n\n[1] https://review.openstack.org/#/c/122347/25/nova/compute/manager.py\n\nNote: Even if we remove #949 and #950, instance system_metadata is getting deleted from instance_system_metadata table. I have checked it functionally.\n\nIMO we don\u0027t need line #949, as it is already loaded by line #1337 so it can be removed.\n\nShould I also remove line #950 or add \u0027system_metadata\u0027 in expected_attrs kwargs in line #1337 ?","commit_id":"0eeb6afbc247700fd84bf77d1d45aac3202eb7ca"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4dc1ee96139b70e52b868c86699a2a63cbc5f658","unresolved":false,"context_lines":[{"line_number":3697,"context_line":"            if invert_quota and reservation.delta \u003c 0:"},{"line_number":3698,"context_line":"                usage.reserved +\u003d reservation.delta"},{"line_number":3699,"context_line":"            else:"},{"line_number":3700,"context_line":"                usage.in_use +\u003d reservation.delta"},{"line_number":3701,"context_line":"        reservation_query.soft_delete(synchronize_session\u003dFalse)"},{"line_number":3702,"context_line":""},{"line_number":3703,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"da20952f_1db16547","line":3700,"updated":"2015-09-04 04:15:52.000000000","message":"Wouldn\u0027t it be simpler to get rid of the invert_quota parameter entirely and just remove the if condition on line 3694?\n\nIn other words, just remove the invert_quota parameter and just do this here:\n\n usage.reserved -\u003d reservation.delta\n usage.in_use +\u003d reservation.delta","commit_id":"42a7cd02d68445e5d49da6e62edffa171a80591c"},{"author":{"_account_id":10795,"name":"Rajesh Tailor","email":"tailor.rajesh88@gmail.com","username":"rajeshtailor"},"change_message_id":"bbc0718a19cd585ea366edc661f9a8ba0426ec94","unresolved":false,"context_lines":[{"line_number":3697,"context_line":"            if invert_quota and reservation.delta \u003c 0:"},{"line_number":3698,"context_line":"                usage.reserved +\u003d reservation.delta"},{"line_number":3699,"context_line":"            else:"},{"line_number":3700,"context_line":"                usage.in_use +\u003d reservation.delta"},{"line_number":3701,"context_line":"        reservation_query.soft_delete(synchronize_session\u003dFalse)"},{"line_number":3702,"context_line":""},{"line_number":3703,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"da20952f_5d559dbf","line":3700,"in_reply_to":"da20952f_1db16547","updated":"2015-09-04 04:21:29.000000000","message":"It won\u0027t work, because we don\u0027t want to update in_use and reserved quota everytime. Sometimes we only want to update reserved quota while other times we only need to update in_use quota. \n\nHence that invert_quota parameter is needed to check when we need to update reserved quota.","commit_id":"42a7cd02d68445e5d49da6e62edffa171a80591c"}]}
