Fix for inconsistent cinder-services state change
This bug was introduced to cinder as a side effect of fix :
18365 (https://review.openstack.org/#/c/18365/).
API “service_update” is used by periodic and manual service-enable/
disable to update cinder-services table. Due to this ‘updated_at’
column of cinder-services table receives an update for both periodic
updates and manual service-enable/disable. Since state of any cinder
service is calculated based on the ‘updated_at’ column of the service,
we get inconsistent state transitions if a service is manually
enabled/disabled and a service-list command is launched before
“CONF.service_down_time”, for services which are already in a “down”
state.
This fix introduces a new column: “modified_at” in cinder-services
table. As per the fix all the periodic updates will be updated in
‘updated_at’ column and manual service-enable/disable in
“modified_at” column. This will result in correct state transitions
as ‘updated_at’ column will only contains time value for periodic
updates which in turn would be used to calculate the state of the
cinder-service if it is ‘up’/’down’. Also, the time for any service
receiving an update will be displayed as “updated_at” or
“modified_at”, which ever is latest.
Closes-bug:
1397167
Change-Id: Iaee4a9cec035dd60c9de04699b1135ee306f6257