findall in cinderclient is inefficient

Bug #1449444 reported by Anton Arefiev
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Undecided
Anton Arefiev

Bug Description

findall method in cinderclient/base.py isn't very efficient: it loads the entire list then filters on the Python side. When calling "cinder show volName" on a tenant holding a lot of volumes (> 1000) the run time is too long(on my env with ~10000 volumes - ~2 min ).
Instead of listing all servers and doing clientside filtering, we should use the servers filtering on name, the server's list already supports filtering so just pass a search_opts dictionary into list().

Anton Arefiev (aarefiev)
Changed in python-cinderclient:
assignee: nobody → Anton Arefiev (aarefiev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-cinderclient (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/180533

Changed in python-cinderclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-cinderclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/180534

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-cinderclient (master)

Reviewed: https://review.openstack.org/180533
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=c5c2d67b7f683ea1f4e8acfb54930bfc2954b342
Submitter: Jenkins
Branch: master

commit c5c2d67b7f683ea1f4e8acfb54930bfc2954b342
Author: Anton Arefiev <email address hidden>
Date: Tue Apr 28 13:12:48 2015 +0300

    Find resource refactoring

    The 'name' field for some resources is called something different,
    for example 'display_name' for volumes, 'name' for volumes type.
    So class 'resource' has attribute 'NAME_ATTR' wich contains
    attribute name for different resources.

    This change removes reduntant call find in resource manager, instead
    of it checks NAME_ATTR value.

    Related-Bug: #1449444
    Change-Id: Ide334d7535c73cbdff72c30319eb539d8f5304d6

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (master)

Reviewed: https://review.openstack.org/180534
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=0b8b9f2de7270a74fb54d40122a9ed397b6360c7
Submitter: Jenkins
Branch: master

commit 0b8b9f2de7270a74fb54d40122a9ed397b6360c7
Author: Anton Arefiev <email address hidden>
Date: Wed May 6 14:54:15 2015 +0300

    Add findall server side filtering

    Findall method in cinderclient/base.py isn't very efficient: it loads
    the entire list then filters on the Python side. When calling "cinder
    show 'volName'" on a tenant holding a lot of volumes (> 1000) the run
    time is too long.

    On my env show command with 10000 volumes takes ~2 min, after apply
    this patch few seconds.

    Closes-Bug: #1449444
    Change-Id: I23070d94d5bb100b2dd8677f67d7c8b1e7d34e52

Changed in python-cinderclient:
status: In Progress → Fix Committed
Changed in python-cinderclient:
milestone: none → 1.3.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.