)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"9a28dbd816c6df70e5ceac2dfff887853af0645e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"fix delete/unmange share with manage_error status will lead to quota error"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"if we failed to manage a share, we have not commit the quota usages. so"},{"line_number":10,"context_line":"we should skip quota usages cuts when delete or unmange the share with"},{"line_number":11,"context_line":"status of \"error_manage\".and the size of error_manage share should be"},{"line_number":12,"context_line":"zero."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9f560f44_14dee968","line":9,"range":{"start_line":9,"start_character":32,"end_line":9,"end_character":43},"updated":"2020-09-11 17:42:16.000000000","message":"nit: we don\u0027t need to","commit_id":"e52d369121ac74d194940387d54d420e012e84c7"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7b59b269563c407541b8e36cc98a8cfd5e91b080","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"fix delete/unmange share with manage_error status will lead to quota error"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"if we failed to manage a share, we have not commit the quota usages. so"},{"line_number":10,"context_line":"we should skip quota usages cuts when delete or unmange the share with"},{"line_number":11,"context_line":"status of \"error_manage\".and the size of error_manage share should be"},{"line_number":12,"context_line":"zero."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9f560f44_c3564ccf","line":9,"range":{"start_line":9,"start_character":32,"end_line":9,"end_character":43},"in_reply_to":"9f560f44_14dee968","updated":"2020-09-15 03:29:27.000000000","message":"Done","commit_id":"e52d369121ac74d194940387d54d420e012e84c7"},{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"9a28dbd816c6df70e5ceac2dfff887853af0645e","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"if we failed to manage a share, we have not commit the quota usages. so"},{"line_number":10,"context_line":"we should skip quota usages cuts when delete or unmange the share with"},{"line_number":11,"context_line":"status of \"error_manage\".and the size of error_manage share should be"},{"line_number":12,"context_line":"zero."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Depends-on: I1706022d0189e199ba47e296d8084526eb890e20"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9f560f44_94cb19a2","line":11,"range":{"start_line":11,"start_character":24,"end_line":11,"end_character":26},"updated":"2020-09-11 17:42:16.000000000","message":"please add a blank space here","commit_id":"e52d369121ac74d194940387d54d420e012e84c7"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7b59b269563c407541b8e36cc98a8cfd5e91b080","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"if we failed to manage a share, we have not commit the quota usages. so"},{"line_number":10,"context_line":"we should skip quota usages cuts when delete or unmange the share with"},{"line_number":11,"context_line":"status of \"error_manage\".and the size of error_manage share should be"},{"line_number":12,"context_line":"zero."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Depends-on: I1706022d0189e199ba47e296d8084526eb890e20"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9f560f44_a35b58f4","line":11,"range":{"start_line":11,"start_character":24,"end_line":11,"end_character":26},"in_reply_to":"9f560f44_94cb19a2","updated":"2020-09-15 03:29:27.000000000","message":"Done","commit_id":"e52d369121ac74d194940387d54d420e012e84c7"}],"manila/share/api.py":[{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"9a28dbd816c6df70e5ceac2dfff887853af0645e","unresolved":false,"context_lines":[{"line_number":1131,"context_line":""},{"line_number":1132,"context_line":"        self._check_is_share_busy(share)"},{"line_number":1133,"context_line":"        for share_instance in share.instances:"},{"line_number":1134,"context_line":"            if share_instance[\u0027host\u0027]:"},{"line_number":1135,"context_line":"                self.delete_instance(context, share_instance, force\u003dforce)"},{"line_number":1136,"context_line":"            else:"},{"line_number":1137,"context_line":"                if share_instance[\u0027status\u0027] \u003d\u003d constants.STATUS_MANAGE_ERROR:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_a3ff0164","line":1134,"updated":"2020-09-11 17:42:16.000000000","message":"An optional approach:\nneed_to_update_usages \u003d share_instance[\u0027status\u0027] !\u003d constants.STATUS_MANAGE_ERROR\n\nthen you could avoid the below if/else statement and specify need_to_update_usages\u003dneed_to_update_usages instead","commit_id":"e52d369121ac74d194940387d54d420e012e84c7"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7b59b269563c407541b8e36cc98a8cfd5e91b080","unresolved":false,"context_lines":[{"line_number":1131,"context_line":""},{"line_number":1132,"context_line":"        self._check_is_share_busy(share)"},{"line_number":1133,"context_line":"        for share_instance in share.instances:"},{"line_number":1134,"context_line":"            if share_instance[\u0027host\u0027]:"},{"line_number":1135,"context_line":"                self.delete_instance(context, share_instance, force\u003dforce)"},{"line_number":1136,"context_line":"            else:"},{"line_number":1137,"context_line":"                if share_instance[\u0027status\u0027] \u003d\u003d constants.STATUS_MANAGE_ERROR:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_3a8bfd17","line":1134,"in_reply_to":"9f560f44_a3ff0164","updated":"2020-09-15 03:29:27.000000000","message":"good idea!","commit_id":"e52d369121ac74d194940387d54d420e012e84c7"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"a402f7171b49a3998b7021539552c333ac009caf","unresolved":false,"context_lines":[{"line_number":1104,"context_line":"        share \u003d self.db.share_get(context, share[\u0027id\u0027])"},{"line_number":1105,"context_line":"        share_id \u003d share[\u0027id\u0027]"},{"line_number":1106,"context_line":"        statuses \u003d (constants.STATUS_AVAILABLE, constants.STATUS_ERROR,"},{"line_number":1107,"context_line":"                    constants.STATUS_INACTIVE, constants.STATUS_MANAGE_ERROR)"},{"line_number":1108,"context_line":"        if not (force or share[\u0027status\u0027] in statuses):"},{"line_number":1109,"context_line":"            msg \u003d _(\"Share status must be one of %(statuses)s\") % {"},{"line_number":1110,"context_line":"                \"statuses\": statuses}"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f560f44_c4133ab7","line":1107,"range":{"start_line":1107,"start_character":47,"end_line":1107,"end_character":75},"updated":"2020-09-24 18:08:27.000000000","message":"we don\u0027t want to allow deletion of MANAGE_ERROR shares. Those should only be unmanaged.\n\nThe reason for that is that it will always invoke the driver\u0027s delete_share path, which can potentially delete a share, as the export_location was registered when trying to manage it and there is no way to tell at which point the manage operation fail. Even if they were renamed successfully and failed later (when creating the rename export), then deleting the share will delete the share and the user will lose all its data.","commit_id":"3f34d89447a44cafdde019f43a47821f8e314ae5"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"e5aae63d1f0648793cd86181d7a902cb6f3e635b","unresolved":false,"context_lines":[{"line_number":1104,"context_line":"        share \u003d self.db.share_get(context, share[\u0027id\u0027])"},{"line_number":1105,"context_line":"        share_id \u003d share[\u0027id\u0027]"},{"line_number":1106,"context_line":"        statuses \u003d (constants.STATUS_AVAILABLE, constants.STATUS_ERROR,"},{"line_number":1107,"context_line":"                    constants.STATUS_INACTIVE, constants.STATUS_MANAGE_ERROR)"},{"line_number":1108,"context_line":"        if not (force or share[\u0027status\u0027] in statuses):"},{"line_number":1109,"context_line":"            msg \u003d _(\"Share status must be one of %(statuses)s\") % {"},{"line_number":1110,"context_line":"                \"statuses\": statuses}"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f560f44_d69da809","line":1107,"range":{"start_line":1107,"start_character":47,"end_line":1107,"end_character":75},"in_reply_to":"9f560f44_c4133ab7","updated":"2020-09-25 02:58:10.000000000","message":"thank you, Rodrigo Barbieri.\nDeleting share that failed manage does have some risk.i missed it.","commit_id":"3f34d89447a44cafdde019f43a47821f8e314ae5"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"74d245cd865779b6e0a34e16f9a4a12988c82be0","unresolved":false,"context_lines":[{"line_number":913,"context_line":""},{"line_number":914,"context_line":"        self._check_is_share_busy(share)"},{"line_number":915,"context_line":""},{"line_number":916,"context_line":"        if share[\u0027status\u0027] \u003d\u003d constants.STATUS_MANAGE_ERROR:"},{"line_number":917,"context_line":"            update_status \u003d constants.STATUS_MANAGE_ERROR_UNMANAGING"},{"line_number":918,"context_line":"        else:"},{"line_number":919,"context_line":"            update_status \u003d constants.STATUS_UNMANAGING"},{"line_number":920,"context_line":""},{"line_number":921,"context_line":"        update_data \u003d {\u0027status\u0027: update_status,"},{"line_number":922,"context_line":"                       \u0027terminated_at\u0027: timeutils.utcnow()}"}],"source_content_type":"text/x-python","patch_set":9,"id":"fffc6b78_a0bcd869","line":919,"range":{"start_line":916,"start_character":8,"end_line":919,"end_character":55},"updated":"2020-11-19 18:29:10.000000000","message":"please cover this in unit tests","commit_id":"f44bd583cde7ba1fae04c45767cfbd8aa5bc8d23"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"1a26b2aadc0c902f26ca5681d1b1e04e67a993b9","unresolved":false,"context_lines":[{"line_number":913,"context_line":""},{"line_number":914,"context_line":"        self._check_is_share_busy(share)"},{"line_number":915,"context_line":""},{"line_number":916,"context_line":"        if share[\u0027status\u0027] \u003d\u003d constants.STATUS_MANAGE_ERROR:"},{"line_number":917,"context_line":"            update_status \u003d constants.STATUS_MANAGE_ERROR_UNMANAGING"},{"line_number":918,"context_line":"        else:"},{"line_number":919,"context_line":"            update_status \u003d constants.STATUS_UNMANAGING"},{"line_number":920,"context_line":""},{"line_number":921,"context_line":"        update_data \u003d {\u0027status\u0027: update_status,"},{"line_number":922,"context_line":"                       \u0027terminated_at\u0027: timeutils.utcnow()}"}],"source_content_type":"text/x-python","patch_set":9,"id":"d55f1ef4_323f624d","line":919,"range":{"start_line":916,"start_character":8,"end_line":919,"end_character":55},"in_reply_to":"fffc6b78_a0bcd869","updated":"2020-11-25 08:26:22.000000000","message":"yes, i will add unit tests.\nmanila/tests/api/v1/test_share_unmanage.py#55","commit_id":"f44bd583cde7ba1fae04c45767cfbd8aa5bc8d23"}],"manila/share/manager.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"7222f476b23d253d4b4dd3bafbcb10f3608482bd","unresolved":true,"context_lines":[{"line_number":2720,"context_line":"            # to be set, it also will allow us to handle delete/unmanage"},{"line_number":2721,"context_line":"            # operations properly with this errored snapshot according to"},{"line_number":2722,"context_line":"            # quotas."},{"line_number":2723,"context_line":"            self.db.share_snapshot_update("},{"line_number":2724,"context_line":"                context, snapshot_id,"},{"line_number":2725,"context_line":"                {\u0027status\u0027: constants.STATUS_MANAGE_ERROR, \u0027size\u0027: 1})"},{"line_number":2726,"context_line":"            raise"},{"line_number":2727,"context_line":""},{"line_number":2728,"context_line":"    def _update_quota_usages(self, context, project_id, usages):"}],"source_content_type":"text/x-python","patch_set":11,"id":"30f26219_cf838a5d","line":2725,"range":{"start_line":2723,"start_character":12,"end_line":2725,"end_character":69},"updated":"2021-03-24 00:43:13.000000000","message":"Don\u0027t we have the same issue here?","commit_id":"73d0a74f3b7c93e0be8779c959b74bdb5b9fd57f"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"7222f476b23d253d4b4dd3bafbcb10f3608482bd","unresolved":true,"context_lines":[{"line_number":2878,"context_line":"            LOG.error(\"Share snapshot cannot be unmanaged: %s.\", e)"},{"line_number":2879,"context_line":"            return"},{"line_number":2880,"context_line":""},{"line_number":2881,"context_line":"        try:"},{"line_number":2882,"context_line":"            share_type_id \u003d snapshot_ref[\u0027share\u0027][\u0027instance\u0027][\u0027share_type_id\u0027]"},{"line_number":2883,"context_line":"            reservations \u003d QUOTAS.reserve("},{"line_number":2884,"context_line":"                context,"},{"line_number":2885,"context_line":"                project_id\u003dproject_id,"},{"line_number":2886,"context_line":"                snapshots\u003d-1,"},{"line_number":2887,"context_line":"                snapshot_gigabytes\u003d-snapshot_ref[\u0027size\u0027],"},{"line_number":2888,"context_line":"                share_type_id\u003dshare_type_id,"},{"line_number":2889,"context_line":"            )"},{"line_number":2890,"context_line":"            QUOTAS.commit("},{"line_number":2891,"context_line":"                context, reservations, project_id\u003dproject_id,"},{"line_number":2892,"context_line":"                share_type_id\u003dshare_type_id,"},{"line_number":2893,"context_line":"            )"},{"line_number":2894,"context_line":"        except Exception as e:"},{"line_number":2895,"context_line":"            # Note(imalinovskiy):"},{"line_number":2896,"context_line":"            # Quota reservation errors here are not fatal, because"},{"line_number":2897,"context_line":"            # unmanage is administrator API and he/she could update user"},{"line_number":2898,"context_line":"            # quota usages later if it\u0027s required."},{"line_number":2899,"context_line":"            LOG.warning(\"Failed to update quota usages: %s.\", e)"},{"line_number":2900,"context_line":""},{"line_number":2901,"context_line":"        self.db.share_snapshot_instance_delete("},{"line_number":2902,"context_line":"            context, snapshot_instance[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"f0c2e306_a4d11525","line":2899,"range":{"start_line":2881,"start_character":8,"end_line":2899,"end_character":64},"updated":"2021-03-24 00:43:13.000000000","message":"and subsequently here?","commit_id":"73d0a74f3b7c93e0be8779c959b74bdb5b9fd57f"}],"releasenotes/notes/bug-1883506-fix-delete-manage-error-share-will-lead-to-quota-error-085fd3b7d15ae109.yaml":[{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"52e36c0c0d83053f9b50df24627e0b572606b5f1","unresolved":true,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Fixed `bug #1883506 \u003chttps://bugs.launchpad.net/manila/+bug/18835060\u003e`_"},{"line_number":5,"context_line":"    that caused an quota error when delete or unmanage the share with status"},{"line_number":6,"context_line":"    of `manage_error`."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"1d9201e7_acb845db","line":5,"range":{"start_line":5,"start_character":16,"end_line":5,"end_character":18},"updated":"2021-03-17 12:46:30.000000000","message":"nit: a","commit_id":"93b95b423eda9c4d56f006dcd193a21bffac6c36"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"ad18cf012faf5c9c801b1bce35e8a0645eb85052","unresolved":false,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Fixed `bug #1883506 \u003chttps://bugs.launchpad.net/manila/+bug/18835060\u003e`_"},{"line_number":5,"context_line":"    that caused an quota error when delete or unmanage the share with status"},{"line_number":6,"context_line":"    of `manage_error`."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"b122e3a6_03e30194","line":5,"range":{"start_line":5,"start_character":16,"end_line":5,"end_character":18},"in_reply_to":"1d9201e7_acb845db","updated":"2021-03-20 02:47:46.000000000","message":"Done","commit_id":"93b95b423eda9c4d56f006dcd193a21bffac6c36"},{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"52e36c0c0d83053f9b50df24627e0b572606b5f1","unresolved":true,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Fixed `bug #1883506 \u003chttps://bugs.launchpad.net/manila/+bug/18835060\u003e`_"},{"line_number":5,"context_line":"    that caused an quota error when delete or unmanage the share with status"},{"line_number":6,"context_line":"    of `manage_error`."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"006bc05a_709782ea","line":6,"range":{"start_line":5,"start_character":55,"end_line":6,"end_character":21},"updated":"2021-03-17 12:46:30.000000000","message":"a share that failed to manage.","commit_id":"93b95b423eda9c4d56f006dcd193a21bffac6c36"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"ad18cf012faf5c9c801b1bce35e8a0645eb85052","unresolved":false,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Fixed `bug #1883506 \u003chttps://bugs.launchpad.net/manila/+bug/18835060\u003e`_"},{"line_number":5,"context_line":"    that caused an quota error when delete or unmanage the share with status"},{"line_number":6,"context_line":"    of `manage_error`."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"ce97ed5b_828faf3e","line":6,"range":{"start_line":5,"start_character":55,"end_line":6,"end_character":21},"in_reply_to":"006bc05a_709782ea","updated":"2021-03-20 02:47:46.000000000","message":"Done","commit_id":"93b95b423eda9c4d56f006dcd193a21bffac6c36"}]}
