mirror of
https://github.com/ceph/ceph
synced 2025-02-21 18:17:42 +00:00
Fix infinite wait during monitor quorum check
Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
This commit is contained in:
parent
68e08c7ac4
commit
16144d8e54
@ -1211,22 +1211,23 @@ def wait_for_mon_quorum(ctx, config):
|
||||
cluster_name = 'ceph'
|
||||
firstmon = teuthology.get_first_mon(ctx, config, cluster_name)
|
||||
(remote,) = ctx.cluster.only(firstmon).remotes.keys()
|
||||
while True:
|
||||
r = remote.run(
|
||||
args=[
|
||||
'sudo',
|
||||
'ceph',
|
||||
'quorum_status',
|
||||
],
|
||||
stdout=StringIO(),
|
||||
logger=log.getChild('quorum_status'),
|
||||
)
|
||||
j = json.loads(r.stdout.getvalue())
|
||||
q = j.get('quorum_names', [])
|
||||
log.debug('Quorum: %s', q)
|
||||
if sorted(q) == sorted(mons):
|
||||
break
|
||||
time.sleep(1)
|
||||
with contextutil.safe_while(sleep=10, tries=60,
|
||||
action='wait for monitor quorum') as proceed:
|
||||
while proceed():
|
||||
r = remote.run(
|
||||
args=[
|
||||
'sudo',
|
||||
'ceph',
|
||||
'quorum_status',
|
||||
],
|
||||
stdout=StringIO(),
|
||||
logger=log.getChild('quorum_status'),
|
||||
)
|
||||
j = json.loads(r.stdout.getvalue())
|
||||
q = j.get('quorum_names', [])
|
||||
log.debug('Quorum: %s', q)
|
||||
if sorted(q) == sorted(mons):
|
||||
break
|
||||
|
||||
|
||||
def created_pool(ctx, config):
|
||||
|
Loading…
Reference in New Issue
Block a user