Public bug reported: Since [1], we introduced a way to skip the load of the OVO synthetic fields depending on the resource fields retrieved. In the case of the security groups (SG), the SG rules are child objects to the SGs. The SG rules are retrieved when a SG OVO is created.
The improvement done in [1] is to make the SG rules load dynamically, that means using the load mode "lazy='dynamic'". That will issue a SQL query only if the SG rules are read; if not, the query is never issued. However since [3] (and this is previous to the [1] optimization), we always add the field "shared" to the filters and thus to the fields to retrieve, because it is a policy required field. Because "shared" is a synthetic field [4], that will force the SG "synthetic_fields" load and the retrieval of the SG rules always. This is undoing any performance improvement. Because the "shared" object belongs to the RBAC functionality and we are always going to load it, we need another way to load the "shared" synthetic field *without* loading the others (if no other synthetic field is required, as is for example the "os security group list" command). [1]https://review.opendev.org/q/topic:%22bug/1810563%22 [2]https://github.com/openstack/neutron/blob/b85b19e3846fa74975ba5d703336b6e7cd8af433/neutron/db/models/securitygroup.py#L90-L93 [3]https://review.opendev.org/c/openstack/neutron/+/328313 [4]https://github.com/openstack/neutron/blob/b85b19e3846fa74975ba5d703336b6e7cd8af433/neutron/objects/rbac_db.py#L349 ** Affects: neutron Importance: Medium Status: New ** Changed in: neutron Importance: Undecided => Medium -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/2052419 Title: SG list retrieval is slow because we are always loading "synthetic_fields" Status in neutron: New Bug description: Since [1], we introduced a way to skip the load of the OVO synthetic fields depending on the resource fields retrieved. In the case of the security groups (SG), the SG rules are child objects to the SGs. The SG rules are retrieved when a SG OVO is created. The improvement done in [1] is to make the SG rules load dynamically, that means using the load mode "lazy='dynamic'". That will issue a SQL query only if the SG rules are read; if not, the query is never issued. However since [3] (and this is previous to the [1] optimization), we always add the field "shared" to the filters and thus to the fields to retrieve, because it is a policy required field. Because "shared" is a synthetic field [4], that will force the SG "synthetic_fields" load and the retrieval of the SG rules always. This is undoing any performance improvement. Because the "shared" object belongs to the RBAC functionality and we are always going to load it, we need another way to load the "shared" synthetic field *without* loading the others (if no other synthetic field is required, as is for example the "os security group list" command). [1]https://review.opendev.org/q/topic:%22bug/1810563%22 [2]https://github.com/openstack/neutron/blob/b85b19e3846fa74975ba5d703336b6e7cd8af433/neutron/db/models/securitygroup.py#L90-L93 [3]https://review.opendev.org/c/openstack/neutron/+/328313 [4]https://github.com/openstack/neutron/blob/b85b19e3846fa74975ba5d703336b6e7cd8af433/neutron/objects/rbac_db.py#L349 To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/2052419/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp