Merge "Release reservation when stoping the ironic-conductor service"
This commit is contained in:
commit
6db7e8bf68
ironic
releasenotes/notes
@ -297,6 +297,8 @@ class BaseConductorManager(object):
|
|||||||
return
|
return
|
||||||
self._shutdown = True
|
self._shutdown = True
|
||||||
self._keepalive_evt.set()
|
self._keepalive_evt.set()
|
||||||
|
# clear all locks held by this conductor before deregistering
|
||||||
|
self.dbapi.clear_node_reservations_for_conductor(self.host)
|
||||||
if deregister:
|
if deregister:
|
||||||
try:
|
try:
|
||||||
# Inform the cluster that this conductor is shutting down.
|
# Inform the cluster that this conductor is shutting down.
|
||||||
|
@ -64,6 +64,17 @@ class StartStopTestCase(mgr_utils.ServiceSetUpMixin, db_base.DbTestCase):
|
|||||||
node.refresh()
|
node.refresh()
|
||||||
self.assertIsNone(node.reservation)
|
self.assertIsNone(node.reservation)
|
||||||
|
|
||||||
|
def test_stop_clears_conductor_locks(self):
|
||||||
|
node = obj_utils.create_test_node(self.context,
|
||||||
|
reservation=self.hostname)
|
||||||
|
node.save()
|
||||||
|
self._start_service()
|
||||||
|
res = objects.Conductor.get_by_hostname(self.context, self.hostname)
|
||||||
|
self.assertEqual(self.hostname, res['hostname'])
|
||||||
|
self.service.del_host()
|
||||||
|
node.refresh()
|
||||||
|
self.assertIsNone(node.reservation)
|
||||||
|
|
||||||
def test_stop_unregisters_conductor(self):
|
def test_stop_unregisters_conductor(self):
|
||||||
self._start_service()
|
self._start_service()
|
||||||
res = objects.Conductor.get_by_hostname(self.context, self.hostname)
|
res = objects.Conductor.get_by_hostname(self.context, self.hostname)
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixes an issue where a node may be locked from changes if a conductor's
|
||||||
|
hostname case is changed before restarting the conductor service. clean
|
||||||
|
up the reservation once the conductor stopped.
|
Loading…
x
Reference in New Issue
Block a user