Notify all back ends when clustering is complete

Before this change there was a race condition in which keystone would
hand out its local IP rather than the VIP when in HA mode and never
update clients other than on the identity-service relation.

This change guarantees the other relations are also updated with HA VIP
information.

Change-Id: Ib2ea3103c06a7a06bb1d04b6c7e872f36d12c1c4
This commit is contained in:
David Ames 2019-03-19 10:48:34 -07:00
parent 2c804d25b9
commit ce613b3c35
2 changed files with 10 additions and 2 deletions

View File

@ -569,6 +569,8 @@ def ha_changed():
is_unit_paused_set()):
ensure_initial_admin(config)
update_all_identity_relation_units()
update_all_domain_backends()
update_all_fid_backends()
@hooks.hook('identity-admin-relation-changed')

View File

@ -486,6 +486,8 @@ class KeystoneRelationTests(CharmTestCase):
hooks.ha_changed()
self.assertTrue(configs.write_all.called)
@patch.object(hooks, 'update_all_fid_backends')
@patch.object(hooks, 'update_all_domain_backends')
@patch.object(hooks, 'update_all_identity_relation_units')
@patch.object(hooks, 'is_db_initialised')
@patch('keystone_utils.log')
@ -495,7 +497,9 @@ class KeystoneRelationTests(CharmTestCase):
identity_changed,
mock_log,
mock_is_db_initialised,
update):
update_ids,
update_domains,
update_fids):
mock_is_db_initialised.return_value = True
self.is_db_ready.return_value = True
self.relation_get.return_value = True
@ -504,7 +508,9 @@ class KeystoneRelationTests(CharmTestCase):
hooks.ha_changed()
self.assertTrue(configs.write_all.called)
self.assertTrue(update.called)
update_ids.assert_called_once_with()
update_domains.assert_called_once_with()
update_fids.assert_called_once_with()
@patch('keystone_utils.log')
@patch.object(hooks, 'CONFIGS')