resize_claim lazy-loads at least 3 joined fields in separate DB calls

Bug #1853370 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Low
Unassigned

Bug Description

During a resize_claim the ResourceTracker lazy-loads in 3 separate calls to the DB (over RPC) these 3 fields:

    b"2019-11-20 16:13:29,521 DEBUG [nova.objects.instance] Lazy-loading 'pci_requests' on Instance uuid c0fdac69-b360-4526-917e-16fb018cb8a3"
    b"2019-11-20 16:13:29,525 DEBUG [nova.objects.instance] Lazy-loading 'resources' on Instance uuid c0fdac69-b360-4526-917e-16fb018cb8a3"
    b"2019-11-20 16:13:29,527 DEBUG [nova.objects.instance] Lazy-loading 'pci_devices' on Instance uuid c0fdac69-b360-4526-917e-16fb018cb8a3"

It seems we should be able to collapse that into a single DB call to load the necessary fields in a single call.

We could add a new extra_attrs kwarg to the Instance.refresh method so we can keep using the same instance we have in memory (and is shared by the ComputeManager method calling the resize_claim) or we could add a new load_if_not_present() method to the Instance object. I'm not sure if there are pros/cons either way on using refresh or adding a new method.

Matt Riedemann (mriedem)
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
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.