)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"7686190bd63c054e90d16e41cbd5a7a053a8ccc0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"dd1c7d18_30a17407","updated":"2026-09-16 14:13:26.000000000","message":"In [1] we changed the loading method to \u0027joined\u0027 to improve the cardinality of the queries, avoiding creating millions of intermediate registers. That was fine for RBAC controlled resources.\n\nHowever we saw this was a problem for `SubnetPool` [2].\n\nThe same issue is reported here for a resource that doesn\u0027t have a 1:1 RBAC entry but inherits from the parent resource. This is why this approach is a good solution (and should be backported).\n\nThanks for this patch.\n\n[1]https://review.opendev.org/c/openstack/neutron/+/884877\n[2]https://review.opendev.org/c/openstack/neutron/+/922972","commit_id":"0577a7a29baf4b7b274da077267decba9149ce2b"}],"neutron/api/rpc/handlers/dhcp_rpc.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"010ca4af876ccfd400bf54aa032fbd043a6d5f9f","unresolved":true,"context_lines":[{"line_number":208,"context_line":"        if enable_dhcp is not None:"},{"line_number":209,"context_line":"            subnet_filters[\u0027enable_dhcp\u0027] \u003d enable_dhcp"},{"line_number":210,"context_line":"        subnets \u003d [plugin._make_subnet_dict(subnet) for subnet in"},{"line_number":211,"context_line":"                   subnet_obj.Subnet.get_objects(context, **subnet_filters)]"},{"line_number":212,"context_line":"        seg_subnets \u003d [subnet for subnet in subnets if"},{"line_number":213,"context_line":"                       subnet.get(\u0027segment_id\u0027)]"},{"line_number":214,"context_line":"        nonlocal_subnets \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"500469b7_d5c91adf","line":211,"range":{"start_line":211,"start_character":19,"end_line":211,"end_character":75},"updated":"2026-09-23 11:35:16.000000000","message":"This should not be necessary. `subnets` should be in `network.db_obj.subnets`. The only missing field here is the `shared` flag, that is retrieved when `Subnet.get_objects` is called because of the hook.\n\nTo avoid calling again the DB, this could be:\n```\nsubnets \u003d [plugin._make_subnet_dict(subnet, context\u003dcontext,\n                                    shared\u003dnetwork.shared)\n           for subnet in network.db_obj.subnets\n           if (enable_dhcp is None or subnet.enable_dhcp \u003d\u003d enable_dhcp)]\n```\n\nThat implies changing the `_make_subnet_dict` method too.","commit_id":"7aae84474d63a0b1c37847cd230cc85be5ee3653"}],"neutron/db/models_v2.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"8abc0422a51c29c510ed8c7429160a7285cf2d81","unresolved":true,"context_lines":[{"line_number":251,"context_line":"    # subnets don\u0027t have their own rbac_entries, they just inherit from"},{"line_number":252,"context_line":"    # the network rbac entries"},{"line_number":253,"context_line":"    rbac_entries \u003d orm.relationship("},{"line_number":254,"context_line":"        rbac_db_models.NetworkRBAC, lazy\u003d\u0027select\u0027, uselist\u003dTrue,"},{"line_number":255,"context_line":"        foreign_keys\u003d\u0027Subnet.network_id\u0027,"},{"line_number":256,"context_line":"        primaryjoin\u003d\u0027Subnet.network_id\u003d\u003dNetworkRBAC.object_id\u0027,"},{"line_number":257,"context_line":"        viewonly\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":2,"id":"6469e819_2d3c7a57","line":254,"range":{"start_line":254,"start_character":42,"end_line":254,"end_character":48},"updated":"2026-09-16 19:09:15.000000000","message":"Is this supposed to be \u0027selectin\u0027 ?","commit_id":"7aae84474d63a0b1c37847cd230cc85be5ee3653"},{"author":{"_account_id":39023,"name":"Damon Huibregtsen","email":"dhuibregtsen@gmail.com","username":"damonce"},"change_message_id":"de599d027f17c817b2510c334751f4cc32545ac0","unresolved":true,"context_lines":[{"line_number":251,"context_line":"    # subnets don\u0027t have their own rbac_entries, they just inherit from"},{"line_number":252,"context_line":"    # the network rbac entries"},{"line_number":253,"context_line":"    rbac_entries \u003d orm.relationship("},{"line_number":254,"context_line":"        rbac_db_models.NetworkRBAC, lazy\u003d\u0027select\u0027, uselist\u003dTrue,"},{"line_number":255,"context_line":"        foreign_keys\u003d\u0027Subnet.network_id\u0027,"},{"line_number":256,"context_line":"        primaryjoin\u003d\u0027Subnet.network_id\u003d\u003dNetworkRBAC.object_id\u0027,"},{"line_number":257,"context_line":"        viewonly\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":2,"id":"acaaf857_adb434d9","line":254,"range":{"start_line":254,"start_character":42,"end_line":254,"end_character":48},"in_reply_to":"6469e819_2d3c7a57","updated":"2026-09-17 08:19:50.000000000","message":"Using `lazy\u003d\u0027select\u0027` here is intentional. `selectin` would eagerly load inherited RBAC entries for every subnet query, including cases where they are not needed. This was the source of the subnet × RBAC row explosion we\u0027re fixing.\n\nWe therefore keep the relationship lazy by default and use explicit `selectinload()` in query paths that require `rbac_entries`. This avoids the joined-row multiplication while still loading RBAC entries efficiently in a single batched query when needed.","commit_id":"7aae84474d63a0b1c37847cd230cc85be5ee3653"}]}
