)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1f075745003524f23153c54bba983c6a8cf16934","unresolved":false,"context_lines":[{"line_number":37,"context_line":"| 7   | 00:01:59      | 00:42,00   |"},{"line_number":38,"context_line":"| 8   | 00:02:01      | 00:41,00   |"},{"line_number":39,"context_line":"| 9   | 00:02:39      | 00:42,00   |"},{"line_number":40,"context_line":"| 10  | 00:01:59      | 00:41,00   |"},{"line_number":41,"context_line":"+-----+---------------+------------+"},{"line_number":42,"context_line":"| AVR | 00:02:07      | 00:00:45   |"},{"line_number":43,"context_line":"+-----+---------------+------------+"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"042fd5b5_687b68de","line":40,"updated":"2021-12-14 17:17:41.000000000","message":"(drive by comment)\n\nThe way this is formatted suggests we\u0027re talking about a huge decrease in performance, but left is (I guess) HH:mm:ss (without milliseconds) while right is mm:ss,SS (with milliseconds)","commit_id":"c4a07ad75e93a3ac175f5fa202369b33a2154aec"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7e640120f923fb6d0d6eec73888550f7334a9396","unresolved":false,"context_lines":[{"line_number":37,"context_line":"| 7   | 00:01:59      | 00:42,00   |"},{"line_number":38,"context_line":"| 8   | 00:02:01      | 00:41,00   |"},{"line_number":39,"context_line":"| 9   | 00:02:39      | 00:42,00   |"},{"line_number":40,"context_line":"| 10  | 00:01:59      | 00:41,00   |"},{"line_number":41,"context_line":"+-----+---------------+------------+"},{"line_number":42,"context_line":"| AVR | 00:02:07      | 00:00:45   |"},{"line_number":43,"context_line":"+-----+---------------+------------+"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"d0feb1fe_172f6620","line":40,"in_reply_to":"042fd5b5_687b68de","updated":"2021-12-16 11:45:44.000000000","message":"yes, that was my mistake, fixed now :)","commit_id":"c4a07ad75e93a3ac175f5fa202369b33a2154aec"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"412c958289537c4c38b5c242cc060c4a13446e46","unresolved":true,"context_lines":[{"line_number":26,"context_line":"I measured time of the creation of all those ports in the current master"},{"line_number":27,"context_line":"branch (without this patch) and with the patch. Results are like below:"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"+-----+---------------+------------+"},{"line_number":30,"context_line":"| Run | Master branch | This patch |"},{"line_number":31,"context_line":"|     | [mm:ss]       | [mm:ss]    |"},{"line_number":32,"context_line":"+-----+---------------+------------+"},{"line_number":33,"context_line":"| 1   | 01:37         | 01:02      |"},{"line_number":34,"context_line":"| 2   | 02:06         | 00:40      |"},{"line_number":35,"context_line":"| 3   | 02:08         | 00:41      |"},{"line_number":36,"context_line":"| 4   | 02:14         | 00:45      |"},{"line_number":37,"context_line":"| 5   | 01:58         | 00:45      |"},{"line_number":38,"context_line":"| 6   | 02:37         | 00:53      |"},{"line_number":39,"context_line":"| 7   | 01:59         | 00:42      |"},{"line_number":40,"context_line":"| 8   | 02:01         | 00:41      |"},{"line_number":41,"context_line":"| 9   | 02:39         | 00:42      |"},{"line_number":42,"context_line":"| 10  | 01:59         | 00:41      |"},{"line_number":43,"context_line":"+-----+---------------+------------+"},{"line_number":44,"context_line":"| AVR | 00:02:07      | 00:00:45   |"},{"line_number":45,"context_line":"+-----+---------------+------------+"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Closes-Bug: #1954763"},{"line_number":48,"context_line":"Change-Id: I8877c658446fed155130add6f1c69f2772113c27"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"d3818d80_73a16639","line":45,"range":{"start_line":29,"start_character":0,"end_line":45,"end_character":36},"updated":"2021-12-17 13:00:49.000000000","message":"Nice! Just out of interest, can we try to emulate bulk creation by just calling create_port in a loop and check results?","commit_id":"2abb2f2b3e29dc27be39c2ec80a89bec6621e84f"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8939f6ad1a7f8c851862cb949e7bcaf5548cc21a","unresolved":false,"context_lines":[{"line_number":26,"context_line":"I measured time of the creation of all those ports in the current master"},{"line_number":27,"context_line":"branch (without this patch) and with the patch. Results are like below:"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"+-----+---------------+------------+"},{"line_number":30,"context_line":"| Run | Master branch | This patch |"},{"line_number":31,"context_line":"|     | [mm:ss]       | [mm:ss]    |"},{"line_number":32,"context_line":"+-----+---------------+------------+"},{"line_number":33,"context_line":"| 1   | 01:37         | 01:02      |"},{"line_number":34,"context_line":"| 2   | 02:06         | 00:40      |"},{"line_number":35,"context_line":"| 3   | 02:08         | 00:41      |"},{"line_number":36,"context_line":"| 4   | 02:14         | 00:45      |"},{"line_number":37,"context_line":"| 5   | 01:58         | 00:45      |"},{"line_number":38,"context_line":"| 6   | 02:37         | 00:53      |"},{"line_number":39,"context_line":"| 7   | 01:59         | 00:42      |"},{"line_number":40,"context_line":"| 8   | 02:01         | 00:41      |"},{"line_number":41,"context_line":"| 9   | 02:39         | 00:42      |"},{"line_number":42,"context_line":"| 10  | 01:59         | 00:41      |"},{"line_number":43,"context_line":"+-----+---------------+------------+"},{"line_number":44,"context_line":"| AVR | 00:02:07      | 00:00:45   |"},{"line_number":45,"context_line":"+-----+---------------+------------+"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Closes-Bug: #1954763"},{"line_number":48,"context_line":"Change-Id: I8877c658446fed155130add6f1c69f2772113c27"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"eb078486_6eea8ac6","line":45,"range":{"start_line":29,"start_character":0,"end_line":45,"end_character":36},"in_reply_to":"d3818d80_73a16639","updated":"2021-12-20 10:06:25.000000000","message":"That\u0027s good question. I just did such test and added results to the table, just for reference.","commit_id":"2abb2f2b3e29dc27be39c2ec80a89bec6621e84f"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"755c4f04a75ebdc41eeb9c6c9d682989339c5f72","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"8031c627_abdbfb61","updated":"2021-12-15 08:31:00.000000000","message":"With 2 (in fact 3) transactions there is still a chance of left ip allocations after failed bulk port create - if 3rd transaction: ip deallocation - fails, is my understanding correct?","commit_id":"c4a07ad75e93a3ac175f5fa202369b33a2154aec"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"1a44338ac16ba923a239e761b00a4dd18574aefa","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"29cc0686_a6c5957a","updated":"2021-12-20 11:04:06.000000000","message":"Nice improvement.","commit_id":"172d4726f9bba122d8a50f957dead89ff4f80a98"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8ed4a1a36baaf3bb2c79df0e2216e611b989b829","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"36a134bf_ce8d28bb","updated":"2021-12-21 10:06:33.000000000","message":"recheck - bug https://bugs.launchpad.net/neutron/+bug/1953478","commit_id":"172d4726f9bba122d8a50f957dead89ff4f80a98"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"cc1e93fa4854c2d2492141e0665ecacd71e935b3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"0e38e50d_be855dff","updated":"2021-12-23 09:36:40.000000000","message":"I was able to test the patch when Sławek applied it onto my setup. A kuryr-kubernetes test creating ~500 ports normally took 7-8 minutes, with this patch I immediately got down to 4.5 minutes, so the improvement is pretty clear.","commit_id":"82aabb0aa962a3c5c5ce5ad1067952d8f3d9f992"}],"neutron/db/ipam_pluggable_backend.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"755c4f04a75ebdc41eeb9c6c9d682989339c5f72","unresolved":true,"context_lines":[{"line_number":179,"context_line":"        ipam_driver \u003d driver.Pool.get_instance(None, context)"},{"line_number":180,"context_line":"        return ipam_driver.get_subnet(subnet_id)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    def deallocate_ips_from_ports(self, context, port, ips):"},{"line_number":183,"context_line":"        if not ips:"},{"line_number":184,"context_line":"            return"},{"line_number":185,"context_line":"        ipam_driver \u003d driver.Pool.get_instance(None, context)"}],"source_content_type":"text/x-python","patch_set":1,"id":"a2735d9d_c04a03dc","line":182,"range":{"start_line":182,"start_character":28,"end_line":182,"end_character":33},"updated":"2021-12-15 08:31:00.000000000","message":"port?","commit_id":"c4a07ad75e93a3ac175f5fa202369b33a2154aec"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7e640120f923fb6d0d6eec73888550f7334a9396","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        ipam_driver \u003d driver.Pool.get_instance(None, context)"},{"line_number":180,"context_line":"        return ipam_driver.get_subnet(subnet_id)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    def deallocate_ips_from_ports(self, context, port, ips):"},{"line_number":183,"context_line":"        if not ips:"},{"line_number":184,"context_line":"            return"},{"line_number":185,"context_line":"        ipam_driver \u003d driver.Pool.get_instance(None, context)"}],"source_content_type":"text/x-python","patch_set":1,"id":"be467b79_1967bd6a","line":182,"range":{"start_line":182,"start_character":28,"end_line":182,"end_character":33},"in_reply_to":"a2735d9d_c04a03dc","updated":"2021-12-16 11:45:44.000000000","message":"Done","commit_id":"c4a07ad75e93a3ac175f5fa202369b33a2154aec"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"755c4f04a75ebdc41eeb9c6c9d682989339c5f72","unresolved":true,"context_lines":[{"line_number":217,"context_line":"            return self._allocate_ips_for_port(context, port)"},{"line_number":218,"context_line":"        except Exception:"},{"line_number":219,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":220,"context_line":"                if ips:"},{"line_number":221,"context_line":"                    ipam_driver \u003d driver.Pool.get_instance(None, context)"},{"line_number":222,"context_line":"                    if not ipam_driver.needs_rollback():"},{"line_number":223,"context_line":"                        return"}],"source_content_type":"text/x-python","patch_set":1,"id":"0cb62ff8_2d047fba","line":220,"range":{"start_line":220,"start_character":16,"end_line":220,"end_character":23},"updated":"2021-12-15 08:31:00.000000000","message":"this will always be empty now..","commit_id":"c4a07ad75e93a3ac175f5fa202369b33a2154aec"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7e640120f923fb6d0d6eec73888550f7334a9396","unresolved":true,"context_lines":[{"line_number":217,"context_line":"            return self._allocate_ips_for_port(context, port)"},{"line_number":218,"context_line":"        except Exception:"},{"line_number":219,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":220,"context_line":"                if ips:"},{"line_number":221,"context_line":"                    ipam_driver \u003d driver.Pool.get_instance(None, context)"},{"line_number":222,"context_line":"                    if not ipam_driver.needs_rollback():"},{"line_number":223,"context_line":"                        return"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f073c50_d88f5767","line":220,"range":{"start_line":220,"start_character":16,"end_line":220,"end_character":23},"in_reply_to":"0cb62ff8_2d047fba","updated":"2021-12-16 11:45:44.000000000","message":"True. I moved it now to the allocate_ips_for_port_and_store method as here really we don\u0027t need to revert anything - if it failed, then nothing is allocated really.","commit_id":"c4a07ad75e93a3ac175f5fa202369b33a2154aec"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"755c4f04a75ebdc41eeb9c6c9d682989339c5f72","unresolved":true,"context_lines":[{"line_number":238,"context_line":"                    subnet_id, port[\u0027port\u0027][\u0027id\u0027])"},{"line_number":239,"context_line":"        except Exception:"},{"line_number":240,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":241,"context_line":"                if ips:"},{"line_number":242,"context_line":"                    ipam_driver \u003d driver.Pool.get_instance(None, context)"},{"line_number":243,"context_line":"                    if not ipam_driver.needs_rollback():"},{"line_number":244,"context_line":"                        return"}],"source_content_type":"text/x-python","patch_set":1,"id":"cebcc212_0b0446d1","line":241,"range":{"start_line":241,"start_character":16,"end_line":241,"end_character":23},"updated":"2021-12-15 08:31:00.000000000","message":"no need to check: if ips is empty no exception could be raised (unless ips is not iterable)","commit_id":"c4a07ad75e93a3ac175f5fa202369b33a2154aec"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7e640120f923fb6d0d6eec73888550f7334a9396","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                    subnet_id, port[\u0027port\u0027][\u0027id\u0027])"},{"line_number":239,"context_line":"        except Exception:"},{"line_number":240,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":241,"context_line":"                if ips:"},{"line_number":242,"context_line":"                    ipam_driver \u003d driver.Pool.get_instance(None, context)"},{"line_number":243,"context_line":"                    if not ipam_driver.needs_rollback():"},{"line_number":244,"context_line":"                        return"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffcbd2d0_05c899a2","line":241,"range":{"start_line":241,"start_character":16,"end_line":241,"end_character":23},"in_reply_to":"cebcc212_0b0446d1","updated":"2021-12-16 11:45:44.000000000","message":"Done","commit_id":"c4a07ad75e93a3ac175f5fa202369b33a2154aec"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"4311f9266ce5a1925fe355714982efa52492efb7","unresolved":true,"context_lines":[{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":215,"context_line":"    @db_api.CONTEXT_WRITER"},{"line_number":216,"context_line":"    def allocate_ips_for_port(self, context, network_id, port):"},{"line_number":217,"context_line":"        return self._allocate_ips_for_port(context, port)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def store_ip_allocation_for_port(self, context, ips, network_id, port):"}],"source_content_type":"text/x-python","patch_set":3,"id":"40be481f_d188f5db","line":216,"range":{"start_line":216,"start_character":45,"end_line":216,"end_character":56},"updated":"2021-12-17 08:45:18.000000000","message":"network_id is not being used, right?","commit_id":"9f5424e4c2ebbd601226fcff573a3960bcffa080"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"945d48739b5006e3f3f2c7af834795b2f866ff1d","unresolved":false,"context_lines":[{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":215,"context_line":"    @db_api.CONTEXT_WRITER"},{"line_number":216,"context_line":"    def allocate_ips_for_port(self, context, network_id, port):"},{"line_number":217,"context_line":"        return self._allocate_ips_for_port(context, port)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def store_ip_allocation_for_port(self, context, ips, network_id, port):"}],"source_content_type":"text/x-python","patch_set":3,"id":"41bbda13_f396cfe4","line":216,"range":{"start_line":216,"start_character":45,"end_line":216,"end_character":56},"in_reply_to":"40be481f_d188f5db","updated":"2021-12-17 09:12:15.000000000","message":"Done","commit_id":"9f5424e4c2ebbd601226fcff573a3960bcffa080"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"412c958289537c4c38b5c242cc060c4a13446e46","unresolved":true,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":183,"context_line":"    @db_api.CONTEXT_WRITER"},{"line_number":184,"context_line":"    def deallocate_ips_from_port(self, context, port, ips):"},{"line_number":185,"context_line":"        if not ips:"},{"line_number":186,"context_line":"            return"},{"line_number":187,"context_line":"        ipam_driver \u003d driver.Pool.get_instance(None, context)"}],"source_content_type":"text/x-python","patch_set":4,"id":"55ccf2a9_85fe7e7b","line":184,"range":{"start_line":184,"start_character":54,"end_line":184,"end_character":57},"updated":"2021-12-17 13:00:49.000000000","message":"nit: would be good to have a docstring on \u0027ips\u0027 format","commit_id":"2abb2f2b3e29dc27be39c2ec80a89bec6621e84f"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8939f6ad1a7f8c851862cb949e7bcaf5548cc21a","unresolved":false,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    @db_api.retry_if_session_inactive()"},{"line_number":183,"context_line":"    @db_api.CONTEXT_WRITER"},{"line_number":184,"context_line":"    def deallocate_ips_from_port(self, context, port, ips):"},{"line_number":185,"context_line":"        if not ips:"},{"line_number":186,"context_line":"            return"},{"line_number":187,"context_line":"        ipam_driver \u003d driver.Pool.get_instance(None, context)"}],"source_content_type":"text/x-python","patch_set":4,"id":"2d46a932_1f78b272","line":184,"range":{"start_line":184,"start_character":54,"end_line":184,"end_character":57},"in_reply_to":"55ccf2a9_85fe7e7b","updated":"2021-12-20 10:06:25.000000000","message":"Done","commit_id":"2abb2f2b3e29dc27be39c2ec80a89bec6621e84f"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"755c4f04a75ebdc41eeb9c6c9d682989339c5f72","unresolved":true,"context_lines":[{"line_number":1546,"context_line":"                # If any issue happened allocated IP addresses needs to be"},{"line_number":1547,"context_line":"                # deallocated now"},{"line_number":1548,"context_line":"                for port in port_list:"},{"line_number":1549,"context_line":"                    self.ipam.deallocate_ips_from_ports("},{"line_number":1550,"context_line":"                        context, port, port[\u0027ips\u0027])"},{"line_number":1551,"context_line":""},{"line_number":1552,"context_line":"    @db_api.retry_if_session_inactive()"}],"source_content_type":"text/x-python","patch_set":1,"id":"80091cc5_90ef5bbc","line":1549,"range":{"start_line":1549,"start_character":30,"end_line":1549,"end_character":55},"updated":"2021-12-15 08:31:00.000000000","message":"should this also be retriable?","commit_id":"c4a07ad75e93a3ac175f5fa202369b33a2154aec"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7e640120f923fb6d0d6eec73888550f7334a9396","unresolved":false,"context_lines":[{"line_number":1546,"context_line":"                # If any issue happened allocated IP addresses needs to be"},{"line_number":1547,"context_line":"                # deallocated now"},{"line_number":1548,"context_line":"                for port in port_list:"},{"line_number":1549,"context_line":"                    self.ipam.deallocate_ips_from_ports("},{"line_number":1550,"context_line":"                        context, port, port[\u0027ips\u0027])"},{"line_number":1551,"context_line":""},{"line_number":1552,"context_line":"    @db_api.retry_if_session_inactive()"}],"source_content_type":"text/x-python","patch_set":1,"id":"d6db63e4_6296dcfd","line":1549,"range":{"start_line":1549,"start_character":30,"end_line":1549,"end_character":55},"in_reply_to":"80091cc5_90ef5bbc","updated":"2021-12-16 11:45:44.000000000","message":"Done","commit_id":"c4a07ad75e93a3ac175f5fa202369b33a2154aec"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"fd5261beab0717bf236619bd880de890d222ba79","unresolved":true,"context_lines":[{"line_number":1578,"context_line":"                try:"},{"line_number":1579,"context_line":"                    # TODO(njohnston): IPAM allocation needs to be revamped to"},{"line_number":1580,"context_line":"                    # be bulk-friendly."},{"line_number":1581,"context_line":"                    ips \u003d self.ipam.allocate_ips_for_port_and_store("},{"line_number":1582,"context_line":"                            context, port, db_port_obj[\u0027id\u0027])"},{"line_number":1583,"context_line":"                    ipam_fixed_ips \u003d []"},{"line_number":1584,"context_line":"                    for ip in ips:"}],"source_content_type":"text/x-python","patch_set":4,"id":"bb65e4f8_6f8fa981","side":"PARENT","line":1581,"range":{"start_line":1581,"start_character":26,"end_line":1581,"end_character":67},"updated":"2021-12-17 13:08:44.000000000","message":"I\u0027m thinking what if it was combined for purpose: allocate and store right away? \n\nIPAM is one of most fragile and complex neutron mechanisms in my personal rating: that\u0027s where my concerns come from :)","commit_id":"1503c67c7cc306a3b19f23137291d6dc430e6edd"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8939f6ad1a7f8c851862cb949e7bcaf5548cc21a","unresolved":true,"context_lines":[{"line_number":1578,"context_line":"                try:"},{"line_number":1579,"context_line":"                    # TODO(njohnston): IPAM allocation needs to be revamped to"},{"line_number":1580,"context_line":"                    # be bulk-friendly."},{"line_number":1581,"context_line":"                    ips \u003d self.ipam.allocate_ips_for_port_and_store("},{"line_number":1582,"context_line":"                            context, port, db_port_obj[\u0027id\u0027])"},{"line_number":1583,"context_line":"                    ipam_fixed_ips \u003d []"},{"line_number":1584,"context_line":"                    for ip in ips:"}],"source_content_type":"text/x-python","patch_set":4,"id":"86b3c3f1_dc39cd8d","side":"PARENT","line":1581,"range":{"start_line":1581,"start_character":26,"end_line":1581,"end_character":67},"in_reply_to":"bb65e4f8_6f8fa981","updated":"2021-12-20 10:06:25.000000000","message":"I know what You mean and understand that concerns. I have the same 😊\n\nBut TBH I didn\u0027t saw any reasons why to do it that way. Maybe it was like that just because it was always optimized for single port creation and not for bulk requests. And in single port creation it make perfect sense IMO to make only one db transaction instead of 2 separate transactions.\n\nAnyway, if anyone have any concerns about I\u0027ll be happy to change that patch. But for now I don\u0027t see any problems with it, at least in my testing.","commit_id":"1503c67c7cc306a3b19f23137291d6dc430e6edd"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"412c958289537c4c38b5c242cc060c4a13446e46","unresolved":true,"context_lines":[{"line_number":1607,"context_line":""},{"line_number":1608,"context_line":"                # Call IPAM to store allocated IP addresses"},{"line_number":1609,"context_line":"                ips \u003d port.pop(\"ips\")"},{"line_number":1610,"context_line":"                self.ipam.store_ip_allocation_for_port("},{"line_number":1611,"context_line":"                    context, ips, network_id, port)"},{"line_number":1612,"context_line":"                ipam_fixed_ips \u003d []"},{"line_number":1613,"context_line":"                for ip in ips:"}],"source_content_type":"text/x-python","patch_set":4,"id":"8492a277_4d0c006c","line":1610,"range":{"start_line":1610,"start_character":26,"end_line":1610,"end_character":54},"updated":"2021-12-17 13:00:49.000000000","message":"Can\u0027t this also lead to DB retries described in the bug?","commit_id":"2abb2f2b3e29dc27be39c2ec80a89bec6621e84f"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8939f6ad1a7f8c851862cb949e7bcaf5548cc21a","unresolved":false,"context_lines":[{"line_number":1607,"context_line":""},{"line_number":1608,"context_line":"                # Call IPAM to store allocated IP addresses"},{"line_number":1609,"context_line":"                ips \u003d port.pop(\"ips\")"},{"line_number":1610,"context_line":"                self.ipam.store_ip_allocation_for_port("},{"line_number":1611,"context_line":"                    context, ips, network_id, port)"},{"line_number":1612,"context_line":"                ipam_fixed_ips \u003d []"},{"line_number":1613,"context_line":"                for ip in ips:"}],"source_content_type":"text/x-python","patch_set":4,"id":"a274cea7_1275dae6","line":1610,"range":{"start_line":1610,"start_character":26,"end_line":1610,"end_character":54},"in_reply_to":"8492a277_4d0c006c","updated":"2021-12-20 10:06:25.000000000","message":"It shouldn\u0027t because allocate_ips_for_ports which is now done in separate transactions will already \"lock\" IP addresses for those ports in DB so other worker will not be able to use them.\nHere those IPs are only stored in the ipallocation table.","commit_id":"2abb2f2b3e29dc27be39c2ec80a89bec6621e84f"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"1a44338ac16ba923a239e761b00a4dd18574aefa","unresolved":true,"context_lines":[{"line_number":1518,"context_line":""},{"line_number":1519,"context_line":"            # Call IPAM to allocate IP addresses"},{"line_number":1520,"context_line":"            try:"},{"line_number":1521,"context_line":"                # TODO(njohnston): IPAM allocation needs to be revamped to"},{"line_number":1522,"context_line":"                # be bulk-friendly."},{"line_number":1523,"context_line":"                port[\u0027ips\u0027] \u003d self.ipam.allocate_ips_for_port(context, port)"},{"line_number":1524,"context_line":""},{"line_number":1525,"context_line":"                port[\u0027ip_allocation\u0027] \u003d (ipalloc_apidef."}],"source_content_type":"text/x-python","patch_set":5,"id":"99db1cee_afcdf189","line":1522,"range":{"start_line":1521,"start_character":17,"end_line":1522,"end_character":35},"updated":"2021-12-20 11:04:06.000000000","message":"I think we are doing this right now.","commit_id":"172d4726f9bba122d8a50f957dead89ff4f80a98"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"54ad6687b427b131a5b61286efb1659b3e76c3a0","unresolved":false,"context_lines":[{"line_number":1518,"context_line":""},{"line_number":1519,"context_line":"            # Call IPAM to allocate IP addresses"},{"line_number":1520,"context_line":"            try:"},{"line_number":1521,"context_line":"                # TODO(njohnston): IPAM allocation needs to be revamped to"},{"line_number":1522,"context_line":"                # be bulk-friendly."},{"line_number":1523,"context_line":"                port[\u0027ips\u0027] \u003d self.ipam.allocate_ips_for_port(context, port)"},{"line_number":1524,"context_line":""},{"line_number":1525,"context_line":"                port[\u0027ip_allocation\u0027] \u003d (ipalloc_apidef."}],"source_content_type":"text/x-python","patch_set":5,"id":"cc6982c9_d6e68671","line":1522,"range":{"start_line":1521,"start_character":17,"end_line":1522,"end_character":35},"in_reply_to":"99db1cee_afcdf189","updated":"2021-12-23 14:19:19.000000000","message":"Right :)","commit_id":"172d4726f9bba122d8a50f957dead89ff4f80a98"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"1a44338ac16ba923a239e761b00a4dd18574aefa","unresolved":true,"context_lines":[{"line_number":1520,"context_line":"            try:"},{"line_number":1521,"context_line":"                # TODO(njohnston): IPAM allocation needs to be revamped to"},{"line_number":1522,"context_line":"                # be bulk-friendly."},{"line_number":1523,"context_line":"                port[\u0027ips\u0027] \u003d self.ipam.allocate_ips_for_port(context, port)"},{"line_number":1524,"context_line":""},{"line_number":1525,"context_line":"                port[\u0027ip_allocation\u0027] \u003d (ipalloc_apidef."},{"line_number":1526,"context_line":"                                         IP_ALLOCATION_IMMEDIATE)"}],"source_content_type":"text/x-python","patch_set":5,"id":"f876d120_5a62ae01","line":1523,"range":{"start_line":1523,"start_character":22,"end_line":1523,"end_character":25},"updated":"2021-12-20 11:04:06.000000000","message":"nit: the result are not IPAllocations, but IPAMAllocations. I would use \"ipams\" here.","commit_id":"172d4726f9bba122d8a50f957dead89ff4f80a98"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"54ad6687b427b131a5b61286efb1659b3e76c3a0","unresolved":false,"context_lines":[{"line_number":1520,"context_line":"            try:"},{"line_number":1521,"context_line":"                # TODO(njohnston): IPAM allocation needs to be revamped to"},{"line_number":1522,"context_line":"                # be bulk-friendly."},{"line_number":1523,"context_line":"                port[\u0027ips\u0027] \u003d self.ipam.allocate_ips_for_port(context, port)"},{"line_number":1524,"context_line":""},{"line_number":1525,"context_line":"                port[\u0027ip_allocation\u0027] \u003d (ipalloc_apidef."},{"line_number":1526,"context_line":"                                         IP_ALLOCATION_IMMEDIATE)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fdffc4e_c1e4dafa","line":1523,"range":{"start_line":1523,"start_character":22,"end_line":1523,"end_character":25},"in_reply_to":"f876d120_5a62ae01","updated":"2021-12-23 14:19:19.000000000","message":"Done","commit_id":"172d4726f9bba122d8a50f957dead89ff4f80a98"}]}
