yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #78424
[Bug 1828660] [NEW] The nova list --all-t command repeatedly queries database,which can seriously affect query performance
Public bug reported:
Description
===========
In nova list command,we use expected_attrs to search for additional information. Some parameters are added to expected_attrs by default in our code flow, such as metadata or flavor. Unfortunately, metadata is added twice, which increase query time.
We first add metadata in function:
self._view_builder.get_show_expected_attrs(expected_attrs),
and the second is in fucntion:
get_all():
//other code
fields = ['metadata', 'info_cache', 'security_groups']
if expected_attrs:
fields.extend(expected_attrs)
//other code
Next, these attributes are divided into manual and automatic attributes in function
def _manual_join_columns(columns_to_join):
However, this function only remove metadata from columns_to_join_new for one time.So our code will search metadata for twice:
query_prefix.all()
and
_instances_fill_metadata()
Environment
===========
[root@nail1 ~]# rpm -qa | grep nova
openstack-nova-api-18.0.2-1.el7.noarch
openstack-nova-common-18.0.2-1.el7.noarch
python2-novaclient-11.0.0-1.el7.noarch
openstack-nova-placement-api-18.0.2-1.el7.noarch
openstack-nova-scheduler-18.0.2-1.el7.noarch
openstack-nova-conductor-18.0.2-1.el7.noarch
openstack-nova-novncproxy-18.0.2-1.el7.noarch
python-nova-18.0.2-1.el7.noarch
openstack-nova-compute-18.0.2-1.el7.noarch
openstack-nova-console-18.0.2-1.el7.noarch
** Affects: nova
Importance: Undecided
Status: New
** Tags: list nova
** Tags added: list nova
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1828660
Title:
The nova list --all-t command repeatedly queries database,which can
seriously affect query performance
Status in OpenStack Compute (nova):
New
Bug description:
Description
===========
In nova list command,we use expected_attrs to search for additional information. Some parameters are added to expected_attrs by default in our code flow, such as metadata or flavor. Unfortunately, metadata is added twice, which increase query time.
We first add metadata in function:
self._view_builder.get_show_expected_attrs(expected_attrs),
and the second is in fucntion:
get_all():
//other code
fields = ['metadata', 'info_cache', 'security_groups']
if expected_attrs:
fields.extend(expected_attrs)
//other code
Next, these attributes are divided into manual and automatic attributes in function
def _manual_join_columns(columns_to_join):
However, this function only remove metadata from columns_to_join_new for one time.So our code will search metadata for twice:
query_prefix.all()
and
_instances_fill_metadata()
Environment
===========
[root@nail1 ~]# rpm -qa | grep nova
openstack-nova-api-18.0.2-1.el7.noarch
openstack-nova-common-18.0.2-1.el7.noarch
python2-novaclient-11.0.0-1.el7.noarch
openstack-nova-placement-api-18.0.2-1.el7.noarch
openstack-nova-scheduler-18.0.2-1.el7.noarch
openstack-nova-conductor-18.0.2-1.el7.noarch
openstack-nova-novncproxy-18.0.2-1.el7.noarch
python-nova-18.0.2-1.el7.noarch
openstack-nova-compute-18.0.2-1.el7.noarch
openstack-nova-console-18.0.2-1.el7.noarch
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1828660/+subscriptions
Follow ups