We have two controllers as HA in our OpenStack environment. There are watcher-applier and watcher-decision-engine in each controller.
So there are two same name in the services table. In this case, the objects.Service.get_by_name(context, name) will trigger exception of MultipleResultsFound.
We should use objects.Service.get(context, id) replace of objects.Service.get_by_name(context, name).
We have two controllers as HA in our OpenStack environment. There are watcher-applier and watcher- decision- engine in each controller. Service. get_by_ name(context, name) will trigger exception of MultipleResults Found. Service. get(context, id) replace of objects. Service. get_by_ name(context, name).
So there are two same name in the services table. In this case, the objects.
We should use objects.
MariaDB [watcher]> select * from services; ------- ------- -+----- ------- ------- --+---- ------- -+----- ----+-- --+---- ------- ------- ------- +------ ------- ------- +------ ------- ------- -+ ------- ------- -+----- ------- ------- --+---- ------- -+----- ----+-- --+---- ------- ------- ------- +------ ------- ------- +------ ------- ------- -+ decision- engine | host-10-43-203-132 | 2017-03-15 06:23:06 | decision- engine | controller04 | NULL | ------- ------- -+----- ------- ------- --+---- ------- -+----- ----+-- --+---- ------- ------- ------- +------ ------- ------- +------ ------- ------- -+
+------
| created_at | updated_at | deleted_at | deleted | id | name | host | last_seen_up |
+------
| 2017-03-15 05:01:56 | 2017-03-15 06:23:05 | NULL | 0 | 1 | watcher-applier | host-10-43-203-132 | 2017-03-15 06:23:05 |
| 2017-03-15 05:01:57 | 2017-03-15 06:23:06 | NULL | 0 | 2 | watcher-
| 2017-03-15 05:01:57 | NULL | NULL | 0 | 3 | watcher-applier | controller04 | NULL |
| 2017-03-15 05:01:58 | NULL | NULL | 0 | 4 | watcher-
+------