Compute manager calls DB directly

Bug #1293756 reported by Kyle L. Henderson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Low
Matt Riedemann

Bug Description

During the course of a resize operation if the compute manager's _poll_unconfirmed_resizes() is used to automatically confirm the resize, the code path eventually tries to access the DB without going through Conductor.

The code path is something like this:

    def _poll_unconfirmed_resizes(self, context):
calls:
 self.compute_api.confirm_resize(context, instance,
                                                migration=migration)

confirm_resize contains:
        # reserve quota only for any decrease in resource usage
        deltas = self._downsize_quota_delta(context, instance)
        reservations = self._reserve_quota_delta(context, deltas)

so eventually calls:
    def _reserve_quota_delta(context, deltas, project_id=None):
        if not deltas:
            return
        return QUOTAS.reserve(context, project_id=project_id, **deltas)

quota.reserve calls the db directly:

        # Get the applicable quotas.
        # NOTE(Vek): We're not worried about races at this point.
        # Yes, the admin may be in the process of reducing
        # quotas, but that's a pretty rare thing.
        project_quotas = db.quota_get_all_by_project(context, project_id)

Tags: compute db
Matt Riedemann (mriedem)
tags: added: compute db
Revision history for this message
Matt Riedemann (mriedem) wrote :

(2:29:31 PM) mriedem: comstud: was just looking at this bug https://bugs.launchpad.net/nova/+bug/1293756, quotas goes directly to the database and is called from compute api, should that be going through conductor?
(2:29:54 PM) comstud: mriedem: compute API, no
(2:30:07 PM) comstud: typically it's only called from nova-api
(2:30:33 PM) comstud: there are a couple of cases where compute manager calls back to it
(2:30:50 PM) comstud: ah is ee
(2:30:53 PM) comstud: this is one of them, I guess
(2:31:03 PM) mriedem: comstud: yeah, confirming resizes
(2:31:12 PM) comstud: just switch that to use the quotas object
(2:31:31 PM) mriedem: ah, ok - was wondering about that given the quotas object stuff last week
(2:31:35 PM) mriedem: cool, easy enough, thanks
(2:31:40 PM) comstud: np

Matt Riedemann (mriedem)
Changed in nova:
status: New → Triaged
importance: Undecided → Low
Matt Riedemann (mriedem)
Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Triaged → In Progress
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.