Nova DB Cleanup

Registered by Joe Gordon

Catch-all for cleaning up Nova DB. Sub-topics are getting broken out into separate BPs.
* db-api-cleanup
* db-session-cleanup
* db-archiving
* db-unique-keys

This work is preparing the way for the following items:
* db-reconnect

Blueprint information

Vish Ishaya
aeva black
aeva black
Series goal:
Milestone target:
Started by
Thierry Carrez
Completed by
John Garbutt


johnthetubaguy: seems to be complete, or at least stuck in the past, so marking as complete.

Gerrit topic:,topic:bp/db-cleanup,n,z

Addressed by:
    remove session parameter from fixed_ip_get

Addressed by:
    improve sessions around compute_node_*

Addressed by:
    improve sessions around floating_ip_get_by_address

Addressed by:
    add doc to standardize session usage

You know, one thing that bothers me about this one is the fact that we really need to be able to do transactions outside of the dbapi. As an example, consider quota_reserve(); all that work needs to be done in a transaction, so all that code ends up being buried deep in the dbapi, whereas arguably the dbapi should be as simple as possible.
    -- Vek, 2012-11-01T21:51Z

I disagree. Besides making it harder to read / debug the code, allowing transactions outside of dbapi also encourages very long running transactions, or XA transactions across databases/projects, both of which are very bad IMO. Taking quota_reserve() as an example, the "rollback" logic that currently exists should allow for another process to clean up after a failed allocation, eg. if the process which started the reservation dies ungracefully mid-way through. (I could be mistaken, but I think quotas already does this?) Holding open a database transaction while waiting for API callbacks from, eg. quantum for floating-ip allocation, would be terrible... and is the opposite of eventual-consistency.
   -- Devananda, 2012-11-02 11:10-07:00

See wiki page for a list of places where we check for read_deleted being "yes" or "only". (Checking for "no" is not a problem.)

Addressed by:
    blueprint db-cleanup add index to fixed_ips(deleted, allocated) columns

Gerrit topic:,topic:tests_for_inst_extra_specs,n,z

Addressed by:
    Move db.instance_type_extra_specs_* to db.instance_type_* methods

Addressed by:
    Removed unused methods from db.api

Gerrit topic:

Addressed by:
    trivial: Remove dead code

Addressed by:
    db: Drop cells v1 tables

Addressed by:
    db: Drop snapshots table

Addressed by:
    db: Drop tables that were moved to API DB

Addressed by:
    db: Remove placement tables

Addressed by:
    db: Remove unused ec2 DB APIs

Addressed by:
    db: Remove unused models


Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.