Revision db8667b7
b/lib/backend.py | ||
---|---|---|
2547 | 2547 |
"""Wait until DRBDs have synchronized. |
2548 | 2548 |
|
2549 | 2549 |
""" |
2550 |
def _helper(rd): |
|
2551 |
stats = rd.GetProcStatus() |
|
2552 |
if not (stats.is_connected or stats.is_in_resync): |
|
2553 |
raise utils.RetryAgain() |
|
2554 |
return stats |
|
2555 |
|
|
2550 | 2556 |
bdevs = _FindDisks(nodes_ip, disks) |
2551 | 2557 |
|
2552 | 2558 |
min_resync = 100 |
2553 | 2559 |
alldone = True |
2554 | 2560 |
for rd in bdevs: |
2555 |
stats = rd.GetProcStatus() |
|
2556 |
if not (stats.is_connected or stats.is_in_resync): |
|
2557 |
_Fail("DRBD device %s is not in sync: stats=%s", rd, stats) |
|
2561 |
try: |
|
2562 |
# poll each second for 15 seconds |
|
2563 |
stats = utils.Retry(_helper, 1, 15, args=[rd]) |
|
2564 |
except utils.RetryTimeout: |
|
2565 |
stats = rd.GetProcStatus() |
|
2566 |
# last check |
|
2567 |
if not (stats.is_connected or stats.is_in_resync): |
|
2568 |
_Fail("DRBD device %s is not in sync: stats=%s", rd, stats) |
|
2558 | 2569 |
alldone = alldone and (not stats.is_in_resync) |
2559 | 2570 |
if stats.sync_percent is not None: |
2560 | 2571 |
min_resync = min(min_resync, stats.sync_percent) |
Also available in: Unified diff