Activity log for bug #1715463

Date Who What changed Old value New value Message
2017-09-06 18:27:39 Ebbex bug added bug
2017-09-06 18:39:36 OpenStack Infra nova: status New In Progress
2017-09-06 18:39:36 OpenStack Infra nova: assignee Ebbex (eb4x)
2017-09-06 19:13:36 Sean Dague tags upgrade
2017-09-06 19:13:41 Sean Dague nova: status In Progress Incomplete
2017-09-06 19:14:46 Sean Dague nova: importance Undecided High
2017-09-08 08:58:12 Ebbex bug added subscriber Sean Dague
2017-09-08 08:58:28 Ebbex bug added subscriber Chris Dent
2017-09-09 01:27:42 Chris Dent nova: status Incomplete Confirmed
2017-09-11 07:35:30 OpenStack Infra nova: status Confirmed In Progress
2017-09-13 08:32:30 Ebbex bug added subscriber melissaml
2017-09-18 09:00:41 Ebbex description During an upgrade, you'll already have a entry in the nova.services table for 'nova-osapi_compute'. The new wsgi app has NAME='osapi_compute' and first queries for this name, which yields 0 rows. Then since there's no entry it decides to create a new entry with INSERT where it appends 'nova-' to this 'name'. Problem is there's already an entry for 'nova-osapi_compute', so now the insert fails because of duplicate entries. So NAME has to be changed, or append 'nova-' on both queries. Also the queries SELECT if exists UPDATE if not exists INSERT Could really just boil down to UPDATE if fail INSERT This way it's atomic aswell. Before an upgrade, we have these type of entries in the db. MariaDB [nova]> SELECT id, host, `binary`, deleted, version FROM services; +----+--------------+--------------------+---------+---------+ | id | host | binary | deleted | version | +----+--------------+--------------------+---------+---------+ | 5 | r1-n-os-api | nova-osapi_compute | 0 | 16 | | 21 | r1-n-m-api | nova-metadata | 0 | 16 | The wsgi files we run basically boil down to something like NAME=metadata return wsgi_app.init_application(NAME) In the wsgi_app.py we see this function service_ref = objects.Service.get_by_host_and_binary(ctxt, host, name) Which results in a really big query, which again comes down to SELECT host, `binary` FROM services WHERE host = 'r1-n-m-api' AND `binary` == 'metadata' No results. service_ref is set to None. Carry on. if service_ref: #Nope. else: try: ... service_obj.host = host service_obj.binary = 'nova-%s' % name service_obj.create() Which results in a INSERT statement something like this; INSERT INTO services(host, `binary`, report_count, disabled, deleted, version) VALUES ('r1-n-m-api', 'nova-metadata', 0, 0, 0, 22) ERROR 1062 (23000): Duplicate entry 'r1-n-m-api-nova-metadata-0' for key 'uniq_services0host0binary0deleted'
2017-09-18 09:01:48 Ebbex summary binary name gets confused under upgrades of osapi_compute and metadata binary/name gets confused under upgrades of osapi_compute and metadata when using wsgi files
2017-10-18 10:55:44 OpenStack Infra nova: status In Progress Fix Released
2017-12-01 17:35:42 Matt Riedemann nominated for series nova/pike
2017-12-01 17:35:42 Matt Riedemann bug task added nova/pike
2017-12-01 17:36:13 Matt Riedemann nova/pike: assignee Ebbex (eb4x)
2017-12-01 17:36:16 Matt Riedemann nova/pike: status New In Progress
2017-12-01 17:36:20 Matt Riedemann nova/pike: importance Undecided High
2017-12-11 09:20:18 OpenStack Infra nova/pike: status In Progress Fix Committed