Public bug reported: The require_instance_exists_using_uuid decorator is only used in one place in the DB API:
https://github.com/openstack/nova/blob/fb1fee6772bb101eac83845bac9022df77113aaa/nova/db/sqlalchemy/api.py#L1599 This means that when listing virtual interfaces for an instance, we're doing two queries, which is kind of dumb. I believe this is the only place this is used: https://github.com/openstack/nova/blob/fb1fee6772bb101eac83845bac9022df77113aaa/nova/objects/virtual_interface.py#L143 And VirtualInterfaceList.get_by_instance_uuid could be handled by calling code to determine what to do about any missing vifs for the instance if the caller cares. It looks like all of the places that call VirtualInterfaceList.get_by_instance_uuid already handle an empty list so we could probably just remove require_instance_exists_using_uuid. ** Affects: nova Importance: Low Status: New ** Tags: db -- 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/1823794 Title: We should remove require_instance_exists_using_uuid Status in OpenStack Compute (nova): New Bug description: The require_instance_exists_using_uuid decorator is only used in one place in the DB API: https://github.com/openstack/nova/blob/fb1fee6772bb101eac83845bac9022df77113aaa/nova/db/sqlalchemy/api.py#L1599 This means that when listing virtual interfaces for an instance, we're doing two queries, which is kind of dumb. I believe this is the only place this is used: https://github.com/openstack/nova/blob/fb1fee6772bb101eac83845bac9022df77113aaa/nova/objects/virtual_interface.py#L143 And VirtualInterfaceList.get_by_instance_uuid could be handled by calling code to determine what to do about any missing vifs for the instance if the caller cares. It looks like all of the places that call VirtualInterfaceList.get_by_instance_uuid already handle an empty list so we could probably just remove require_instance_exists_using_uuid. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1823794/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp