Destroy DB service_status in service.stop()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Designate |
In Progress
|
Undecided
|
Unassigned |
Bug Description
Issue
=====
Desigante service status are created(in DB) in the start() method. DB consider unique service, based on service-name and host-name combination. However when services are stopped or restarted, the DB entries are not deleted, they are destroyed.
scenario
========
1. In big cluster where multiple instances of designate services e.g. mdns, worker, producer are launched, unique host-name (we use node-name of k8s) and service-name the entries are created in DB.
2. However when deployed again(e.g. using helm) and launched on new hosts, the old entries of service_status remains as it is. And also all those services are reported as UP, where actually those services no longer exist. So they should be reported either as DOWN or not reported at all. I think, its better to not report those old entries at all since they are irrelevant for current deployment.
Solution
========
To overcome this situation, we should remove the DB entry each time service is stopped or killed and create new entry again in start() method. This will give list of only relevant services at a time.
Fix proposed to branch: master /review. opendev. org/c/openstack /designate/ +/866698
Review: https:/