)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":31721,"name":"Felipe Rodrigues","email":"felipefuty01@gmail.com","username":"felipefutty"},"change_message_id":"3d89489e786012304d6db4dedd9aa2ee6c33c469","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"fix logic about allocated_capacity_gb and provisioned_capacity_gb"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"allocated_capacity_gb only include shares created on a backend"},{"line_number":10,"context_line":"in manila. provisioned_capacity_gb also include shares created"},{"line_number":11,"context_line":"manually on the storage back end."},{"line_number":12,"context_line":"provisioned_capacity_gb \u003d allocated_capacity_gb + other_backend_shares_gb"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"582c048e_1ddd4428","line":9,"range":{"start_line":9,"start_character":27,"end_line":9,"end_character":34},"updated":"2022-02-03 15:00:36.000000000","message":"includes","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7b21f43c80cd8ff2248ee6fa8eea2a944649f00c","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"fix logic about allocated_capacity_gb and provisioned_capacity_gb"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"allocated_capacity_gb only include shares created on a backend"},{"line_number":10,"context_line":"in manila. provisioned_capacity_gb also include shares created"},{"line_number":11,"context_line":"manually on the storage back end."},{"line_number":12,"context_line":"provisioned_capacity_gb \u003d allocated_capacity_gb + other_backend_shares_gb"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"fb6c1a92_f772ce54","line":9,"range":{"start_line":9,"start_character":27,"end_line":9,"end_character":34},"in_reply_to":"582c048e_1ddd4428","updated":"2022-02-08 09:09:08.000000000","message":"Done","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":31721,"name":"Felipe Rodrigues","email":"felipefuty01@gmail.com","username":"felipefutty"},"change_message_id":"3d89489e786012304d6db4dedd9aa2ee6c33c469","unresolved":true,"context_lines":[{"line_number":7,"context_line":"fix logic about allocated_capacity_gb and provisioned_capacity_gb"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"allocated_capacity_gb only include shares created on a backend"},{"line_number":10,"context_line":"in manila. provisioned_capacity_gb also include shares created"},{"line_number":11,"context_line":"manually on the storage back end."},{"line_number":12,"context_line":"provisioned_capacity_gb \u003d allocated_capacity_gb + other_backend_shares_gb"},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"bbc7ec10_37fd8263","line":10,"range":{"start_line":10,"start_character":40,"end_line":10,"end_character":47},"updated":"2022-02-03 15:00:36.000000000","message":"includes","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7b21f43c80cd8ff2248ee6fa8eea2a944649f00c","unresolved":false,"context_lines":[{"line_number":7,"context_line":"fix logic about allocated_capacity_gb and provisioned_capacity_gb"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"allocated_capacity_gb only include shares created on a backend"},{"line_number":10,"context_line":"in manila. provisioned_capacity_gb also include shares created"},{"line_number":11,"context_line":"manually on the storage back end."},{"line_number":12,"context_line":"provisioned_capacity_gb \u003d allocated_capacity_gb + other_backend_shares_gb"},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"f0564fbd_46d60c09","line":10,"range":{"start_line":10,"start_character":40,"end_line":10,"end_character":47},"in_reply_to":"bbc7ec10_37fd8263","updated":"2022-02-08 09:09:08.000000000","message":"Done","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":31721,"name":"Felipe Rodrigues","email":"felipefuty01@gmail.com","username":"felipefutty"},"change_message_id":"3d89489e786012304d6db4dedd9aa2ee6c33c469","unresolved":true,"context_lines":[{"line_number":17,"context_line":"provisioned_capacity_gb, but only use it to judge provisioned"},{"line_number":18,"context_line":"ratio on thin provisioned pools when go through capacity filter."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Partial-Bug: #1943829"},{"line_number":21,"context_line":"Change-Id: Ibcf0d4240cc200d67c0ad947d0274746248b472c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3378f82e_d422d378","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":11},"updated":"2022-02-03 15:00:36.000000000","message":"why is it partial ?! It seems the bug is being fixed by the patch","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7b21f43c80cd8ff2248ee6fa8eea2a944649f00c","unresolved":false,"context_lines":[{"line_number":17,"context_line":"provisioned_capacity_gb, but only use it to judge provisioned"},{"line_number":18,"context_line":"ratio on thin provisioned pools when go through capacity filter."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Partial-Bug: #1943829"},{"line_number":21,"context_line":"Change-Id: Ibcf0d4240cc200d67c0ad947d0274746248b472c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"32067da5_32d1ce1a","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":11},"in_reply_to":"3378f82e_d422d378","updated":"2022-02-08 09:09:08.000000000","message":"Done","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":31721,"name":"Felipe Rodrigues","email":"felipefuty01@gmail.com","username":"felipefutty"},"change_message_id":"3d89489e786012304d6db4dedd9aa2ee6c33c469","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"e6d19e95_1b2a85f0","updated":"2022-02-03 15:00:36.000000000","message":"Thanks Haixi. Overall, it looks good, just some doc comments. Also, I\u0027m waiting for passing with NetApp CI.","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":31721,"name":"Felipe Rodrigues","email":"felipefuty01@gmail.com","username":"felipefutty"},"change_message_id":"27f1a789528379d7a51a6b8c336b95b181458e25","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"33a1f924_3eed7d5c","updated":"2022-02-04 18:36:52.000000000","message":"adding the vote back","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":31721,"name":"Felipe Rodrigues","email":"felipefuty01@gmail.com","username":"felipefutty"},"change_message_id":"ddb7e914f4c386a5b1404d95c4c4f6eafabb8e9a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"23830eb6_2dbbc6df","updated":"2022-01-20 13:29:14.000000000","message":"run-NetApp CI","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":31721,"name":"Felipe Rodrigues","email":"felipefuty01@gmail.com","username":"felipefutty"},"change_message_id":"2d8b4ce761371b0011062b7013011e6e2837f6a6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"60480864_8dd7ab0b","updated":"2022-02-03 15:01:05.000000000","message":"run-NetApp CI","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":31721,"name":"Felipe Rodrigues","email":"felipefuty01@gmail.com","username":"felipefutty"},"change_message_id":"d30dc27035284d0404e2f0a0ef5090283ea49c38","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"720f6e8f_f00eb80a","updated":"2021-12-12 02:20:06.000000000","message":"run-NetApp CI","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7b21f43c80cd8ff2248ee6fa8eea2a944649f00c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"af6aa8ac_2676a054","updated":"2022-02-08 09:09:08.000000000","message":"thanks for your review.  Felipe Rodrigues.","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":31721,"name":"Felipe Rodrigues","email":"felipefuty01@gmail.com","username":"felipefutty"},"change_message_id":"33c031899038f25e4a6e0d885029632a46b06d7b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"52fecbc9_2e5f2b94","updated":"2022-02-08 17:59:37.000000000","message":"Good work, haixin! LGTM.","commit_id":"717a77823268cf4cf9aa9df68715b1949685cf5a"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"34ac96cb9c83c153e73301dfd3e2844526cdad63","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"a1658972_9e3b05cc","updated":"2022-02-08 19:32:32.000000000","message":"Thanks for working on this change, haixin - a longish question/comment inline","commit_id":"717a77823268cf4cf9aa9df68715b1949685cf5a"}],"manila/scheduler/host_manager.py":[{"author":{"_account_id":31721,"name":"Felipe Rodrigues","email":"felipefuty01@gmail.com","username":"felipefutty"},"change_message_id":"d30dc27035284d0404e2f0a0ef5090283ea49c38","unresolved":true,"context_lines":[{"line_number":415,"context_line":"    def _estimate_allocated_capacity(self, host_name, context\u003dNone):"},{"line_number":416,"context_line":"        \"\"\"Estimate allocated capacity from share sizes on backend."},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"           allocated_capacity_gb only include shares created on a backend"},{"line_number":419,"context_line":"           in manila. provisioned_capacity_gb also include shares created"},{"line_number":420,"context_line":"           manually on the storage back end."},{"line_number":421,"context_line":"           provisioned_capacity_gb \u003d allocated_capacity_gb +"}],"source_content_type":"text/x-python","patch_set":4,"id":"f5cd07a6_d9a95a86","line":418,"range":{"start_line":418,"start_character":38,"end_line":418,"end_character":46},"updated":"2021-12-12 02:20:06.000000000","message":"includes","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"34ac96cb9c83c153e73301dfd3e2844526cdad63","unresolved":true,"context_lines":[{"line_number":443,"context_line":""},{"line_number":444,"context_line":"            self.total_capacity_gb \u003d capability[\u0027total_capacity_gb\u0027]"},{"line_number":445,"context_line":"            self.free_capacity_gb \u003d capability[\u0027free_capacity_gb\u0027]"},{"line_number":446,"context_line":"            self.allocated_capacity_gb \u003d capability.get("},{"line_number":447,"context_line":"                \u0027allocated_capacity_gb\u0027,"},{"line_number":448,"context_line":"                self._estimate_allocated_capacity(self.host,"},{"line_number":449,"context_line":"                                                  context\u003dcontext))"},{"line_number":450,"context_line":"            self.qos \u003d capability.get(\u0027qos\u0027, False)"},{"line_number":451,"context_line":"            self.reserved_percentage \u003d capability[\u0027reserved_percentage\u0027]"},{"line_number":452,"context_line":"            self.reserved_snapshot_percentage \u003d ("}],"source_content_type":"text/x-python","patch_set":5,"id":"3bb2fb96_406d8174","line":449,"range":{"start_line":446,"start_character":12,"end_line":449,"end_character":67},"updated":"2022-02-08 19:32:32.000000000","message":"Although we pick this statistic from the share driver for each storage pool, manila hasn\u0027t _used_ this value in making scheduling decisions so far.. It\u0027s possible that administrators can use allocated_capacity_gb in share types and in driver filters and goodness functions if desired. \n\nNow, with your change, we\u0027re falling back to allocated_capacity_gb if backends do not report provisioned_capacity_gb. I agree with this fallback, although i really don\u0027t know how this solves the bug reported. \n\nA huge thing to consider is that the scheduler service supports Active/Active HA - which means that multiple copies of the scheduler service will be running at any given point in time in deployments; if each scheduler process performs this calculation periodically (default: once every minute), it\u0027s very wasteful and quite resource intensive. I always hated the way we performed this calculation. :(\n\nCurrently, without this change, the calculation occurs _only_ if the pool supports thin provisioning (rationale here is that you don\u0027t use provisioned_capacity_gb only when calculating oversubscription ratio). However, with this change, we\u0027ll _always_ calculate the allocated_capacity_gb if the backend doesn\u0027t report it. This seems wasteful, especially because it is retrieving a ton of information in an un-optimized way from the database to calculate this capacity info -- **every minute**, only to use it in **one place**. \n\n\nInstead of doing this, is it possible for us to create a driver resources record in the database, and keep a running tally of the allocated_capacity_gb as provisioning/de-provisioning happens? Its possible to run into race conditions - yes, but, we could periodically check and update these tallies. We just bump up the periodicity of such an update -- do it once every 30 minutes or even an hour -- we should be okay with slight variations in this data; what do you think? We can design this together and present this idea at the PTG - i\u0027m happy to collaborate :)\n\n\nAn alternative would be to go ahead and commit this fallback logic, but definitely do this *only* if the pool supports thin provisioning","commit_id":"717a77823268cf4cf9aa9df68715b1949685cf5a"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"c49c0e7443d68f881bd263cb81bfaa45590258d8","unresolved":true,"context_lines":[{"line_number":443,"context_line":""},{"line_number":444,"context_line":"            self.total_capacity_gb \u003d capability[\u0027total_capacity_gb\u0027]"},{"line_number":445,"context_line":"            self.free_capacity_gb \u003d capability[\u0027free_capacity_gb\u0027]"},{"line_number":446,"context_line":"            self.allocated_capacity_gb \u003d capability.get("},{"line_number":447,"context_line":"                \u0027allocated_capacity_gb\u0027,"},{"line_number":448,"context_line":"                self._estimate_allocated_capacity(self.host,"},{"line_number":449,"context_line":"                                                  context\u003dcontext))"},{"line_number":450,"context_line":"            self.qos \u003d capability.get(\u0027qos\u0027, False)"},{"line_number":451,"context_line":"            self.reserved_percentage \u003d capability[\u0027reserved_percentage\u0027]"},{"line_number":452,"context_line":"            self.reserved_snapshot_percentage \u003d ("}],"source_content_type":"text/x-python","patch_set":5,"id":"f5c77e6c_6401dbe3","line":449,"range":{"start_line":446,"start_character":12,"end_line":449,"end_character":67},"in_reply_to":"3bb2fb96_406d8174","updated":"2022-02-09 03:42:05.000000000","message":"Here are some of my understanding, there may be inaccurate places, we can discuss together.\n1: allocated_capacity_gb \u003d shares_gb created by manila in openstack A,\n   provisioned_capacity_gb \u003d allocated_capacity_gb + shares_gb_created_manually or \n   another manila in openstack B.\n   means provisioned_capacity_gb \u003e\u003d allocated_capacity_gb \n   Therefore, if allocated_capacity_gb is reported by the storage back-end,\n   manila in openstack A is considered to have exclusive access to the storage\n   pool. Otherwise, allocated_capacity_gb is inaccurate if it is not exclusive,\n   but it must be accurate if it is counted from the database.\n   when calculating oversubscription ratio, we must use provisioned_capacity_gb.\n   if provisioned_capacity_gb not reported. but allocated_capacity_gb reported.\n   we consider exclusive storage pool, use allocated_capacity_gb instead of \n   provisioned_capacity_gb.\n2: total_capacity_gb indicates the actual physical storage capacity of the storage\n   pool.\n   free_capacity_gb indicates the actual free physical storage capacity of the \n   storage pool.\n   used_capacity_gb \u003d total_capacity_gb - free_capacity_gb\n   if manila in openstack A exclusive the Storage Pool, then \n   allocated_capacity_gb \u003d\u003d provisioned_capacity_gb.\n   if not, provisioned_capacity_gb \u003e allocated_capacity_gb.\n   if self.thin_provisioning is false.\n   used_capacity_gb \u003d\u003d provisioned_capacity_gb \n   else used_capacity_gb \u003c provisioned_capacity_gb \n3: about scheduler service supports Active/Active HA, The consume_from_share\n   function is executed each time a share is created or extend, in this function\n   allocated_capacity_gb and free_capacity_gb must be updated,Suppose 100 1gb  \n   shares are created, 50 of which are executed on node 1 and 30 on node 2 and 20 \n   on node 3. Since allocated_capacity_gb is maintained in the memory of the \n   scheduling service. As a result, the allocated_capacity_gb values of the three \n   scheduling nodes are inconsistent. This is problematic, so we need to correct it\n   in this way.\n   so i think no matter storage pool support thin_provisioning, As long as the\n   allocated_capacity_gb (non-exclusive storage pool) is not reported, we need to\n   calculate and correct it to avoid inconsistent cache values for multiple \n   scheduling services.\n4: I prefer to count allocated_capacity_gb from the database through a scheduled \n   task loop. To reduce system performance consumption.","commit_id":"717a77823268cf4cf9aa9df68715b1949685cf5a"}],"releasenotes/notes/bug-810842-fix-logic-aboute-allocated-and-provisioned-capacity-gb-cab0668515c8fbea.yaml":[{"author":{"_account_id":31721,"name":"Felipe Rodrigues","email":"felipefuty01@gmail.com","username":"felipefutty"},"change_message_id":"3d89489e786012304d6db4dedd9aa2ee6c33c469","unresolved":true,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Fix logic about allocated_capacity_gb and provisioned_capacity_gb. See"},{"line_number":5,"context_line":"    `bug 810842 \u003chttps://bugs.launchpad.net/manila/+bug/810842\u003e`_ for more"},{"line_number":6,"context_line":"    details."}],"source_content_type":"text/x-yaml","patch_set":4,"id":"2741335b_93d5cbb2","line":5,"range":{"start_line":5,"start_character":9,"end_line":5,"end_character":62},"updated":"2022-02-03 15:00:36.000000000","message":"this reference differs from the commit message one. It seems wrong bug here.","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7b21f43c80cd8ff2248ee6fa8eea2a944649f00c","unresolved":false,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Fix logic about allocated_capacity_gb and provisioned_capacity_gb. See"},{"line_number":5,"context_line":"    `bug 810842 \u003chttps://bugs.launchpad.net/manila/+bug/810842\u003e`_ for more"},{"line_number":6,"context_line":"    details."}],"source_content_type":"text/x-yaml","patch_set":4,"id":"18db83c4_bfef6459","line":5,"range":{"start_line":5,"start_character":9,"end_line":5,"end_character":62},"in_reply_to":"2741335b_93d5cbb2","updated":"2022-02-08 09:09:08.000000000","message":"Done","commit_id":"24690b5f528aab2328d0cca931b5588811ae4b11"}]}
