Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter undercloud resource query for performance #13004

Merged

Conversation

tzumainn
Copy link
Contributor

@tzumainn tzumainn commented Dec 5, 2016

The openstack infra refresher queries the nested stack resources of the undercloud,
which can take a long time and even timeout. This fix adds a filter to the query, reducing
the running time from over a minute to less than ten seconds.

https://bugzilla.redhat.com/show_bug.cgi?id=1402028

@tzumainn
Copy link
Contributor Author

tzumainn commented Dec 5, 2016

@Ladas can you do a sanity check to see if this updated query breaks something I haven't thought of? Looking at the refresh code it should still provide everything needed, but...

@tzumainn tzumainn changed the title Filter undercloud resource query to only return those associated with… Filter undercloud resource query for performance Dec 5, 2016
# To further speed up the query we only search for those resources we care about - those whose
# physical_resource_id matches the id of a nova server
server_ids = servers.map{|s| s.id}
@orchestration_service.list_resources(:stack => stack, :nested_depth => 50, :physical_resource_id => server_ids).body['resources']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense, cause the resources are really filtered later to %w(OS::TripleO::Server OS::Nova::Server).include?(x["resource_type"])

so we don't need the rest

The API doesn't support filtering by resource_type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ladas it does, but there's no speed improvement, whereas this filter reduced the time of the query considerably

@Ladas
Copy link
Contributor

Ladas commented Dec 6, 2016

looks great 👍

seems like filtering using :resource_type would be better, but it's probably not done on the DB level (on OpenStack side), since it doesn't bring any speedup. Solution here brings the desired speedup, so it's good. :-)

@Ladas
Copy link
Contributor

Ladas commented Dec 6, 2016

@miq-bot assign @blomquisg

@tzumainn
Copy link
Contributor Author

tzumainn commented Dec 6, 2016

@miq-bot add_label euwe/yes
@miq-bot add_label bug
@miq-bot add_label blocker

@agrare agrare merged commit 0391e6d into ManageIQ:master Dec 6, 2016
@agrare agrare added this to the Sprint 51 Ending Jan 2, 2017 milestone Dec 6, 2016
chessbyte pushed a commit that referenced this pull request Dec 6, 2016
…-refresh-fix

Filter undercloud resource query for performance
(cherry picked from commit 0391e6d)

https://bugzilla.redhat.com/show_bug.cgi?id=1402028
@chessbyte
Copy link
Member

Euwe Backport details:

$ git log -1
commit 774ba3123d5f9d081371077846cb4e0a2bfd7f7d
Author: Adam Grare <[email protected]>
Date:   Tue Dec 6 10:47:17 2016 -0500

    Merge pull request #13004 from tzumainn/openstack-infra-orchestration-refresh-fix
    
    Filter undercloud resource query for performance
    (cherry picked from commit 0391e6d6c41d89d77d22110e5b0d6ebe9427c84b)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1402028

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants