Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add volume_type to volume object expected_attrs
We haven't had volume_type in expected_attrs for volume objects lists. This resulted in situation in which although we were joining the volume_type explicitely in DB API, the object just dropped the data. Volume type was then lazy loaded when needed, so every "cinder list" call was making additional DB queries per returned volume, causing massive performance drop. Actually there were two unnecessary DB calls per volume, because not only volume_type was fetched, but also volume_type.extra_specs as a result of passing 'extra_specs' in expected_attrs when calling VolumeType._from_db_volume in Volume._from_db_volume (wow, that's complicated…). This commit sorts this out by adding volume_type to expected_attrs to match what we join in the DB. Please note that I'm not adding consistencygroup and volume_attachment on purpose - addition causes some unit tests failure and that late in the release it seems risky to try fixing that. The changes also required minor rework of expected_attrs infrastructure in the o.vo layer to be able to pass different values when we query for just a single volume and when we fetch whole list (as we're doing different joins in the DB layer in both cases). Change-Id: Iabf9c3fab56ffef50695ce45745f193273822b39 Closes-Bug: 1555153
- Loading branch information
Michał Dulko
committed
Mar 10, 2016
1 parent
08b74ce
commit 4e3f61b
Showing
6 changed files
with
64 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters