yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #94083
[Bug 2068761] Re: Using "joined" relation on tags can cause slow query times in certain situations
Reviewed: https://review.opendev.org/c/openstack/neutron/+/921566
Committed: https://opendev.org/openstack/neutron/commit/bf123dfb385f85077e7e6c277da3789afa02f422
Submitter: "Zuul (22348)"
Branch: master
commit bf123dfb385f85077e7e6c277da3789afa02f422
Author: Miro Tomaska <mtomaska@xxxxxxxxxx>
Date: Fri Jun 7 19:14:00 2024 +0000
Revert "Use HasStandardAttributes as parent class for Tags DB model"
This reverts commit 85d3fff97e55ba85f72cda4365ad0441c10bd9f6.
Reason for revert:
The original change was made as a “cheap win” to optimize the number
of queries the neutron server makes during testing. This did
improve the number of queries made but introduced regression in
real world deployments where some customers(through automation)
would define hundreds of tags per port across a large deployment.
I am proposing to revert this change in favor of the old “subquery”
relation in order to fix this regression. In addition, I filed the
Related-Bug #2069061 to investigate using `selectin` as the more
appropriate long term solution.
Change-Id: I83ec349e49e1f343da8996cab149d76443120873
Closes-Bug: #2068761
Related-Bug: #2069061
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2068761
Title:
Using "joined" relation on tags can cause slow query times in certain
situations
Status in neutron:
Fix Released
Bug description:
We have recentely changed[1] the Tag class relationship technique to joined. The main reason behind it was to reduce the amount of SELECT logs during testing. With this change we were also consistant with other models loading technique(see [1] commit message).
However, we have recently discovered a corner case where some customers(through automation) would define hundreds of tags for a instance port accross a very large deployment. This essentially resulted in a massive queries when trying to retrieve a server or port data via neutron API. We have seen as 90seconds delay which caused timeouts and other side effects on the deployment.
For this reason I am going to propose revert of this change to favor
performance over reducing size of SELECT log files during testing.
Side note, there is also an option to use 'selectin` option[2], but
given that the `selectin` was in its infancy during the sqalchemy 1.3
and 1.4, I will prefer to use the old stable 'subqeury'. We can switch
to `selectin` with sqalchemy 2.0
[1] https://review.opendev.org/c/openstack/neutron/+/891580
[2] https://docs.sqlalchemy.org/en/14/orm/loading_relationships.html
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/2068761/+subscriptions
References