nova/nova/db
Matt Riedemann de035bbfcc Add functional recreate test for bug 1764556
This attempts to recreate the following scenario:

1) boot instance on ocata host where the compute service
   does not have a uuid
2) migrate instance
3) delete the ocata service (thus deleting the compute node)
4) start compute service with the same name
5) migrate instance to newly-created compute node
6) upgrade to pike where services.uuid data migration happens
7) list instances as admin to join on the services table

The failure occurs when listing instances because the deleted
service with the same name as the compute host that the instance
is running on gets pulled from the DB and the Service object
attempts to set a uuid on it, which fails since it's not using
a read_deleted="yes" context.

While working on this, the service_get_all_by_binary DB API
method had to be fixed to not hard-code read_deleted="no" since
the test needs to be able to read deleted services, which it can
control via its own context object (note that
RequestContext.read_deleted already defaults to "no" so the
hard-coding in the DB API is unnecessarily restrictive).

Change-Id: I4d60da26fcf0a77628d1fdf4e818884614fa4f02
Related-Bug: #1764556
(cherry picked from commit 81f05f53d3)
(cherry picked from commit 44709cfb5c)
(cherry picked from commit eadd78efe3)
2019-07-31 10:00:20 -04:00
..
sqlalchemy Add functional recreate test for bug 1764556 2019-07-31 10:00:20 -04:00
__init__.py Remove vi modelines 2014-02-03 14:19:44 +00:00
api.py Add cross cell sort support for get_migrations 2018-01-09 15:34:03 -05:00
base.py config options: centralize section "database" + "api_database" 2016-05-16 10:20:51 +00:00
migration.py Manage db sync command for cell0 2016-08-22 18:53:45 +03:00