aggregate db api handles read_deleted in an inconsistent way

Bug #949038 reported by John Garbutt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Mark McLoughlin

Bug Description

Following review comments, it is clear the aggregate db api deals with the read_deleted flag in a different way to other DB calls.

You currently can't set read_deleted in the context, that value is just ignored. It might be worth looking at making it more consistent with other parts of the code.

Changed in nova:
assignee: nobody → John Garbutt (johngarbutt)
Changed in nova:
status: New → Triaged
tags: added: essex-rc-potential
Changed in nova:
importance: Undecided → Low
Changed in nova:
status: Triaged → In Progress
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/5397

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/5397
Committed: http://github.com/openstack/nova/commit/1cd050e767c4dd5e9a6664911f4f8e408f437f41
Submitter: Jenkins
Branch: master

commit 1cd050e767c4dd5e9a6664911f4f8e408f437f41
Author: John Garbutt <email address hidden>
Date: Tue Mar 20 10:14:58 2012 +0000

    Fixes bug 949038

    Make the api calls better fit the standard pattern where
    read_deleted can be changed using context.read_deleted

    I have retained the ability to pass read_deleted
    explicitly. If that is not specified, it uses the value in
    the context.

    Note: read_deleted defaults to "no" in the context.

    The two exceptions are:
     aggregate_host_get_all
     aggregate_get_all

    In this case, it is better for read_deleted=yes to be the default
    So in this case the context cannot be used, as that would default
    to read_deleted=no. In this case you must explicity override
    read_deleted, the context is totally ignored, as before.

    Change-Id: Idb048a592d8c6b788651d131a3345e70989c0ec4

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/5774

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/5792

Changed in nova:
assignee: John Garbutt (johngarbutt) → Mark McLoughlin (markmc)
status: Fix Committed → In Progress
Thierry Carrez (ttx)
tags: removed: essex-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/5792
Committed: http://github.com/openstack/nova/commit/ef1f1738f23909feb5c5b2a617b1cb88986989ee
Submitter: Jenkins
Branch: master

commit ef1f1738f23909feb5c5b2a617b1cb88986989ee
Author: Mark McLoughlin <email address hidden>
Date: Sun Mar 25 21:59:29 2012 +0100

    Clean up read_deleted support in host aggregates code

    tl;dr - this is a cleaner fix for bug #949038

    It seems clear to me that all of the DB APIs should not explicitly pass
    read_deleted='no' or read_deleted='yes' to model_query without good
    reason.

    We want to allow callers to specify read_deleted via the context and
    that only works if we don't explicitly pass it to model_query().

    If we don't explicitly specify it to model_query(), we use the value
    from the context which defaults to 'no'.

    Given all that, there is no need to support read_deleted to any of the
    DB API calls because they should support specifying the flag via the
    context. There should also be no need to pass read_deleted='no' because
    that is the default.

    Really, the only place there should be any mention of read_deleted is
    where we want read_deleted='yes' behaviour e.g.

      - In tests, where we want to check the operational_state of an
        aggregate after it has been deleted

      - Where we want to support undeleting an aggregate or aggreate host

    Change-Id: I916a8d189a33d7f30838cccb26531a024066ef96

Changed in nova:
status: In Progress → Fix Committed
Devin Carlen (devcamcar)
Changed in nova:
milestone: none → folsom-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-1 → 2012.2
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.