Commit f08e5132 authored by Iustin Pop's avatar Iustin Pop
Browse files

Add verification of RPC results in _WipeDisks



Due to an oversight, the pause/resume sync RPC calls in _WipeDisks
lack the verification of the overall RPC status, and directly iterate
over the payload. The code actually doing the wipe does verify
correctly the results. This can result in jobs failing with a hard to
diagnose:

OpExecError ['NoneType' object is not iterable]

instead of proper "RPC failed" message.

This patch adds a hard check on the pause call, but for the resume
call it just logs a warning if the RPC failed; the rationale being
that if we can't contact the node for pausing the sync, it's likely
wiping will fail too, but after the wipe has been done, we can
continue.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent b2631ce4
......@@ -8885,6 +8885,7 @@ def _WipeDisks(lu, instance):
result = lu.rpc.call_blockdev_pause_resume_sync(node,
(instance.disks, instance),
True)
result.Raise("Failed RPC to node %s for pausing the disk syncing" % node)
 
for idx, success in enumerate(result.payload):
if not success:
......@@ -8932,12 +8933,17 @@ def _WipeDisks(lu, instance):
(instance.disks, instance),
False)
 
for idx, success in enumerate(result.payload):
if not success:
lu.LogWarning("Resume sync of disk %d failed, please have a"
" look at the status and troubleshoot the issue", idx)
logging.warn("resume-sync of instance %s for disks %d failed",
instance.name, idx)
if result.fail_msg:
lu.LogWarning("RPC call to %s for resuming disk syncing failed,"
" please have a look at the status and troubleshoot"
" the issue: %s", node, result.fail_msg)
else:
for idx, success in enumerate(result.payload):
if not success:
lu.LogWarning("Resume sync of disk %d failed, please have a"
" look at the status and troubleshoot the issue", idx)
logging.warn("resume-sync of instance %s for disks %d failed",
instance.name, idx)
 
 
def _CreateDisks(lu, instance, to_skip=None, target_node=None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment