)]}'
{"manila/share/api.py":[{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"9e49dfa920f2c988e09ac87c7db14b2fbda64586","unresolved":false,"context_lines":[{"line_number":919,"context_line":""},{"line_number":920,"context_line":"        self._check_is_share_busy(share)"},{"line_number":921,"context_line":""},{"line_number":922,"context_line":"        for share_instance in share.instances:"},{"line_number":923,"context_line":"            if share_instance[\u0027host\u0027]:"},{"line_number":924,"context_line":"                self.delete_instance(context, share_instance, force\u003dforce)"},{"line_number":925,"context_line":"            else:"},{"line_number":926,"context_line":"                self.db.share_instance_delete(context, share_instance[\u0027id\u0027])"},{"line_number":927,"context_line":"                if share_instance \u003d\u003d share.instances[-1]:"},{"line_number":928,"context_line":"                    self.minus_shares_quota(context, share)"},{"line_number":929,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_5bf3540b","line":926,"range":{"start_line":922,"start_character":8,"end_line":926,"end_character":76},"updated":"2017-08-10 17:08:31.000000000","message":"You just need to use \"rollback\" method here in case of exception instead of implementing whole new method.","commit_id":"cbf4cb17c44a9c8492e3dfb696faf859da87803a"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"e55c0037b84975130634b8a3f9cb994226f0cd4c","unresolved":false,"context_lines":[{"line_number":919,"context_line":""},{"line_number":920,"context_line":"        self._check_is_share_busy(share)"},{"line_number":921,"context_line":""},{"line_number":922,"context_line":"        for share_instance in share.instances:"},{"line_number":923,"context_line":"            if share_instance[\u0027host\u0027]:"},{"line_number":924,"context_line":"                self.delete_instance(context, share_instance, force\u003dforce)"},{"line_number":925,"context_line":"            else:"},{"line_number":926,"context_line":"                self.db.share_instance_delete(context, share_instance[\u0027id\u0027])"},{"line_number":927,"context_line":"                if share_instance \u003d\u003d share.instances[-1]:"},{"line_number":928,"context_line":"                    self.minus_shares_quota(context, share)"},{"line_number":929,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_2fe27330","line":926,"range":{"start_line":922,"start_character":8,"end_line":926,"end_character":76},"in_reply_to":"9f436f4f_152c6600","updated":"2017-08-11 11:53:50.000000000","message":"Because we have two places to delete share instance in db. The one is code line 926 in manila-api service, the another one is code line 924, it will send delete share instance to manila-share service. So we need to handle quota of share in multiple manila-api services and manila-share service.","commit_id":"cbf4cb17c44a9c8492e3dfb696faf859da87803a"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"c2a4beeeef34eeb3be28fd79b639cca8fc14c641","unresolved":false,"context_lines":[{"line_number":919,"context_line":""},{"line_number":920,"context_line":"        self._check_is_share_busy(share)"},{"line_number":921,"context_line":""},{"line_number":922,"context_line":"        for share_instance in share.instances:"},{"line_number":923,"context_line":"            if share_instance[\u0027host\u0027]:"},{"line_number":924,"context_line":"                self.delete_instance(context, share_instance, force\u003dforce)"},{"line_number":925,"context_line":"            else:"},{"line_number":926,"context_line":"                self.db.share_instance_delete(context, share_instance[\u0027id\u0027])"},{"line_number":927,"context_line":"                if share_instance \u003d\u003d share.instances[-1]:"},{"line_number":928,"context_line":"                    self.minus_shares_quota(context, share)"},{"line_number":929,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_152c6600","line":926,"range":{"start_line":922,"start_character":8,"end_line":926,"end_character":76},"in_reply_to":"9f436f4f_18b705f9","updated":"2017-08-11 09:14:36.000000000","message":"Then, why do you need to handle quota of share in multiple manila-api services instead of ONE manila-share service?\n\nSo, I would suggest you remove the quota handling from this module and place it in share-manager.","commit_id":"cbf4cb17c44a9c8492e3dfb696faf859da87803a"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"e6301f72de797b9c762b8625054e73cfa601e781","unresolved":false,"context_lines":[{"line_number":919,"context_line":""},{"line_number":920,"context_line":"        self._check_is_share_busy(share)"},{"line_number":921,"context_line":""},{"line_number":922,"context_line":"        for share_instance in share.instances:"},{"line_number":923,"context_line":"            if share_instance[\u0027host\u0027]:"},{"line_number":924,"context_line":"                self.delete_instance(context, share_instance, force\u003dforce)"},{"line_number":925,"context_line":"            else:"},{"line_number":926,"context_line":"                self.db.share_instance_delete(context, share_instance[\u0027id\u0027])"},{"line_number":927,"context_line":"                if share_instance \u003d\u003d share.instances[-1]:"},{"line_number":928,"context_line":"                    self.minus_shares_quota(context, share)"},{"line_number":929,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_ef8d8b31","line":926,"range":{"start_line":922,"start_character":8,"end_line":926,"end_character":76},"in_reply_to":"9f436f4f_2fe27330","updated":"2017-08-11 12:03:18.000000000","message":"Deletion of DB record should not be tied to \"quota calculation\". The only thing you really should care is \"release of real resources\" on storage backend. If you think otherwise, then, please, provide arguments for \"why we should tie quota calculation to \u0027soft\u0027 DB record deletion?\".","commit_id":"cbf4cb17c44a9c8492e3dfb696faf859da87803a"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"a16e76d02c8f99bb830db4f7d02c16c2189bc999","unresolved":false,"context_lines":[{"line_number":919,"context_line":""},{"line_number":920,"context_line":"        self._check_is_share_busy(share)"},{"line_number":921,"context_line":""},{"line_number":922,"context_line":"        for share_instance in share.instances:"},{"line_number":923,"context_line":"            if share_instance[\u0027host\u0027]:"},{"line_number":924,"context_line":"                self.delete_instance(context, share_instance, force\u003dforce)"},{"line_number":925,"context_line":"            else:"},{"line_number":926,"context_line":"                self.db.share_instance_delete(context, share_instance[\u0027id\u0027])"},{"line_number":927,"context_line":"                if share_instance \u003d\u003d share.instances[-1]:"},{"line_number":928,"context_line":"                    self.minus_shares_quota(context, share)"},{"line_number":929,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_18b705f9","line":926,"range":{"start_line":922,"start_character":8,"end_line":926,"end_character":76},"in_reply_to":"9f436f4f_5bf3540b","updated":"2017-08-11 01:25:10.000000000","message":"If I just use \"rollback\" method here in case of exception instead of implementing whole new method. It will have the same problem. Because we will send delete_share_instance method to manila-share service, if we got exception, it means we send the method to manila-share service fail, but it doesn\u0027t means we delete_instance fail. We can not get the really result about whether the share instance record has been delete in db. In this case, we will summit -1 shares quota even if use \"rollback\" method here in case of exception. Then the quota usage number will fault.\nwe don\u0027t need to reserve quota before we delete share instances.","commit_id":"cbf4cb17c44a9c8492e3dfb696faf859da87803a"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"99cc84cf1fd78f044838888a7b51699adbbd5f5b","unresolved":false,"context_lines":[{"line_number":919,"context_line":""},{"line_number":920,"context_line":"        self._check_is_share_busy(share)"},{"line_number":921,"context_line":""},{"line_number":922,"context_line":"        for share_instance in share.instances:"},{"line_number":923,"context_line":"            if share_instance[\u0027host\u0027]:"},{"line_number":924,"context_line":"                self.delete_instance(context, share_instance, force\u003dforce)"},{"line_number":925,"context_line":"            else:"},{"line_number":926,"context_line":"                self.db.share_instance_delete(context, share_instance[\u0027id\u0027])"},{"line_number":927,"context_line":"                if share_instance \u003d\u003d share.instances[-1]:"},{"line_number":928,"context_line":"                    self.minus_shares_quota(context, share)"},{"line_number":929,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_ca5cf57f","line":926,"range":{"start_line":922,"start_character":8,"end_line":926,"end_character":76},"in_reply_to":"9f436f4f_ef8d8b31","updated":"2017-08-11 12:38:42.000000000","message":"\"The only thing you really should care is \"release of real resources\" on storage backend. \" How to check whether the \"release of real resources\" on storage backend be deleted?  We could have this case:  We still have share record in db and the real resources on storage backend has been deleted. \nIn this case,  we can still change the share status to available and force delete it. It means the share record in db still work and we still don\u0027t need to -1 shares quota\nDeletion of DB record could be tied to \"quota calculation\". \nBecause the DB record created be tied to \"quota calculation\"\nWe cost the shares quota even if we doesn\u0027t have \"host\" value","commit_id":"cbf4cb17c44a9c8492e3dfb696faf859da87803a"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"9e49dfa920f2c988e09ac87c7db14b2fbda64586","unresolved":false,"context_lines":[{"line_number":927,"context_line":"                if share_instance \u003d\u003d share.instances[-1]:"},{"line_number":928,"context_line":"                    self.minus_shares_quota(context, share)"},{"line_number":929,"context_line":""},{"line_number":930,"context_line":"    def minus_shares_quota(self, context, share):"},{"line_number":931,"context_line":"        # we subtract one of the shares quota when the share already"},{"line_number":932,"context_line":"        # be deleted in db."},{"line_number":933,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_9b4d3c74","line":930,"range":{"start_line":930,"start_character":8,"end_line":930,"end_character":26},"updated":"2017-08-10 17:08:31.000000000","message":"Don\u0027t know about others, but this method name is very confusing to me.","commit_id":"cbf4cb17c44a9c8492e3dfb696faf859da87803a"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"a6e0bcc5fab556b4caf6c3a8c0e42d4c501a2bd3","unresolved":false,"context_lines":[{"line_number":927,"context_line":"                if share_instance \u003d\u003d share.instances[-1]:"},{"line_number":928,"context_line":"                    self.minus_shares_quota(context, share)"},{"line_number":929,"context_line":""},{"line_number":930,"context_line":"    def minus_shares_quota(self, context, share):"},{"line_number":931,"context_line":"        # we subtract one of the shares quota when the share already"},{"line_number":932,"context_line":"        # be deleted in db."},{"line_number":933,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_2cea8e0e","line":930,"range":{"start_line":930,"start_character":8,"end_line":930,"end_character":26},"in_reply_to":"9f436f4f_9b4d3c74","updated":"2017-08-11 02:07:15.000000000","message":"Done","commit_id":"cbf4cb17c44a9c8492e3dfb696faf859da87803a"}],"manila/share/manager.py":[{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"9e49dfa920f2c988e09ac87c7db14b2fbda64586","unresolved":false,"context_lines":[{"line_number":2680,"context_line":"    @utils.require_driver_initialized"},{"line_number":2681,"context_line":"    def delete_share_instance(self, context, share_instance_id, force\u003dFalse):"},{"line_number":2682,"context_line":"        \"\"\"Delete a share instance.\"\"\""},{"line_number":2683,"context_line":"        ctxt \u003d context.elevated()"},{"line_number":2684,"context_line":"        share_instance \u003d self._get_share_instance(ctxt, share_instance_id)"},{"line_number":2685,"context_line":"        share_id \u003d share_instance.get(\u0027share_id\u0027)"},{"line_number":2686,"context_line":"        share_server \u003d self._get_share_server(ctxt, share_instance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_1b138c5e","line":2683,"range":{"start_line":2683,"start_character":8,"end_line":2683,"end_character":12},"updated":"2017-08-10 17:08:31.000000000","message":"Why do you rename it? From what I can see it is redundant and not related to bugfix, at all.","commit_id":"cbf4cb17c44a9c8492e3dfb696faf859da87803a"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"a16e76d02c8f99bb830db4f7d02c16c2189bc999","unresolved":false,"context_lines":[{"line_number":2680,"context_line":"    @utils.require_driver_initialized"},{"line_number":2681,"context_line":"    def delete_share_instance(self, context, share_instance_id, force\u003dFalse):"},{"line_number":2682,"context_line":"        \"\"\"Delete a share instance.\"\"\""},{"line_number":2683,"context_line":"        ctxt \u003d context.elevated()"},{"line_number":2684,"context_line":"        share_instance \u003d self._get_share_instance(ctxt, share_instance_id)"},{"line_number":2685,"context_line":"        share_id \u003d share_instance.get(\u0027share_id\u0027)"},{"line_number":2686,"context_line":"        share_server \u003d self._get_share_server(ctxt, share_instance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_989f755e","line":2683,"range":{"start_line":2683,"start_character":8,"end_line":2683,"end_character":12},"in_reply_to":"9f436f4f_1b138c5e","updated":"2017-08-11 01:25:10.000000000","message":"please see code line 2757. We need original context in minus_shares_quota method. The context.elevated() changed the admin parameter value.","commit_id":"cbf4cb17c44a9c8492e3dfb696faf859da87803a"}]}
