Need to drop unused DB API - vol_get_usage_by_time

Bug #1434687 reported by Davanum Srinivas (DIMS)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Matt Riedemann

Bug Description

When Matt and i were working on https://bugs.launchpad.net/nova/+bug/1426867 Matt noticed one more table.

mriedem: dimsum__: huh, interesting, vol_get_usage_by_time
mriedem: there is another table you can probably remove, but would need to remove the conductor stuff first
mriedem: which would require an rpcapi version bump i guess?
mriedem: even though there are no entry points to getting to that code
mriedem: vol_get_usage_by_time isn't in conductor manager so that is probably completely broken at this point anyway

Tags: db volumes
Revision history for this message
Matt Riedemann (mriedem) wrote :

We can't remove the volume_usages table since db api vol_usage_update is still using it and that's called in the detach_volume flow through conductor, but I don't see any entry points (API or nova-manage) that exposes what's in volume_usages so vol_usage_update seems pointless.

tags: added: db volumes
Changed in nova:
status: New → Confirmed
Revision history for this message
Matt Riedemann (mriedem) wrote :

There is also a periodic task _poll_volume_usage in the compute manager which has a config option to poll on an interval there, but I don't see how any of that information gets back to the user.

Revision history for this message
Matt Riedemann (mriedem) wrote :

This added the volume usages stuff: https://review.openstack.org/#/c/11141/

At the time that had a method to send volume usage notifications in the compute manager:

_send_volume_usage_notifications

But that's no longer in the trunk code.

Revision history for this message
Matt Riedemann (mriedem) wrote :

_send_volume_usage_notifications was removed in havana:

https://review.openstack.org/#/c/29915/

So now conductor sends the notification:

https://github.com/openstack/nova/blob/master/nova/conductor/manager.py#L269

summary: - Need to drop unused table - vol_get_usage_by_time
+ Need to drop unused DB API - vol_get_usage_by_time
Revision history for this message
Matt Riedemann (mriedem) wrote :

vol_get_usage_by_time was removed from conductor manager in juno here:

https://review.openstack.org/#/c/84254/

Revision history for this message
Matt Riedemann (mriedem) wrote :

So the messy part about removing vol_get_usage_by_time is that there are db api tests for volume_usages that are using it to get information out of the database to verify that vol_usage_update is working correctly.

It seems when https://review.openstack.org/#/c/84254/ happened it cut a bit too deep, else we could drop the methods from conductor api/rpcapi since they won't work w/o the method in the conductor manager, but we could leave the DB APIs in for testing purposes.

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

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

Reviewed: https://review.openstack.org/166370
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=307e998efbb0f481cb36e47b822337995810a389
Submitter: Jenkins
Branch: master

commit 307e998efbb0f481cb36e47b822337995810a389
Author: Matt Riedemann <email address hidden>
Date: Fri Mar 20 13:29:09 2015 -0700

    Remove vol_get_usage_by_time from conductor api/rpcapi

    In Havana, commit 3cf4cb253 moved the volume usage notify code to
    conductor.

    In Juno, commit 47f6ffad8 dropped vol_get_usage_by_time from conductor
    manager but not from the conductor api/rpcapi modules. Without
    vol_get_usage_by_time being in conductor manager it's an API pointing to
    nothing and won't work so we should remove it.

    The DB APIs are left in since the vol_usage_update DB API is tested
    using vol_get_usage_by_time.

    If we were to leave the conductor APIs in tree, we should add the
    conductor manager method back in and convert the volume_usages table to
    nova objects, and possibly also expose it via a v2.1 API extension.

    Closes-Bug: #1434687

    Change-Id: Ie2980d681c62cd3457b359fbe4f5c32a2bcfc5db

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-rc1 → 2015.1.0
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.