Process client broker requests post bootstrap
Its possible that a remote client unit will present its broker
request prior to the Ceph MON cluster being bootstrapped; ensure
that any client-relation-changed hooks are re-executed after
bootstrap to process any pending broker requests.
Change-Id: Id412a6b3503e00bd870ccb8f3acc5f3957c23f5d
Closes-Bug: 1734620
(cherry picked from commit 9d095b31d9)
This commit is contained in:
@@ -435,6 +435,8 @@ def notify_radosgws():
|
||||
def notify_client():
|
||||
for relid in relation_ids('client'):
|
||||
client_relation_joined(relid)
|
||||
for unit in related_units(relid):
|
||||
client_relation_changed(relid, unit)
|
||||
|
||||
|
||||
@hooks.hook('osd-relation-changed')
|
||||
@@ -531,10 +533,12 @@ def client_relation_joined(relid=None):
|
||||
|
||||
|
||||
@hooks.hook('client-relation-changed')
|
||||
def client_relation_changed():
|
||||
def client_relation_changed(relid=None, unit=None):
|
||||
"""Process broker requests from ceph client relations."""
|
||||
if ceph.is_quorum():
|
||||
settings = relation_get()
|
||||
if not unit:
|
||||
unit = remote_unit()
|
||||
settings = relation_get(rid=relid, unit=unit)
|
||||
if 'broker_req' in settings:
|
||||
if not ceph.is_leader():
|
||||
log("Not leader - ignoring broker request", level=DEBUG)
|
||||
@@ -548,7 +552,8 @@ def client_relation_changed():
|
||||
'broker_rsp': rsp,
|
||||
unit_response_key: rsp,
|
||||
}
|
||||
relation_set(relation_settings=data)
|
||||
relation_set(relation_id=relid,
|
||||
relation_settings=data)
|
||||
else:
|
||||
log('mon cluster not in quorum', level=DEBUG)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user