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 81f05f53d357a546c7f9a53cae6ef45b92e28bc1)
(cherry picked from commit 44709cfb5cfa6a8a384eb391ad520de55b2fa247)
(cherry picked from commit eadd78efe39e1958d14319cfcdbda15862485845)
Reviewed: https:/ /review. opendev. org/673824 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=de035bbfccb fd5a3e751643417 1e89e9df7d08fa
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit de035bbfccbfd5a 3e7516434171e89 e9df7d08fa
Author: Matt Riedemann <email address hidden>
Date: Tue Apr 17 16:20:53 2018 -0400
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 ext.read_ deleted already defaults to "no" so the
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
RequestCont
hard-coding in the DB API is unnecessarily restrictive).
Change-Id: I4d60da26fcf0a7 7628d1fdf4e8188 84614fa4f02 6c7f9a53cae6ef4 5b92e28bc1) a384eb391ad520d e55b2fa247) 8d14319cfcdbda1 5862485845)
Related-Bug: #1764556
(cherry picked from commit 81f05f53d357a54
(cherry picked from commit 44709cfb5cfa6a8
(cherry picked from commit eadd78efe39e195