When manila services are stopped or restarted via stop(), the DB
entries are not deleted, they are destroyed only in kill() method. In
cluster deployments, where multiple instances of manila services are
deployed via PODs, unique hostname is derived from node name. However
if pods are deployed again and launched on new hosts/nodes, the old
entries of manila service remains as it is.
Fix it by adding 'state' column in 'services' table and introducing
per service cleanup function. On service stop, state is changed to
'stopped' and cleanup function will delete 'stopped' services unless
they are 'up' again before cleanup periodic interval.
Reviewed: https:/ /review. opendev. org/c/openstack /manila/ +/859301 /opendev. org/openstack/ manila/ commit/ 98be6376b2ec743 43e0b51eab4e5f3 6927cfc88e
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 98be6376b2ec743 43e0b51eab4e5f3 6927cfc88e
Author: Kiran Pawar <email address hidden>
Date: Mon Sep 26 14:24:29 2022 +0000
Add 'state' column in 'services' table.
When manila services are stopped or restarted via stop(), the DB
entries are not deleted, they are destroyed only in kill() method. In
cluster deployments, where multiple instances of manila services are
deployed via PODs, unique hostname is derived from node name. However
if pods are deployed again and launched on new hosts/nodes, the old
entries of manila service remains as it is.
Fix it by adding 'state' column in 'services' table and introducing
per service cleanup function. On service stop, state is changed to
'stopped' and cleanup function will delete 'stopped' services unless
they are 'up' again before cleanup periodic interval.
Closes-bug: #1990839 b25616a95a5ed83 62a7f4ffc61
Change-Id: I8b71c4c27ff8fc