Commit 5449685e authored by Iustin Pop's avatar Iustin Pop
Browse files

Switch blockdev_getmirrorstatus_multi to per-node bodies



Even for a small 4-node node-group, this reduces the payload of this
RPC call by half for each node; for a big node group, previous testing
(using a different patch) showed a general reduction in traffic over
the entire cluster verify from 9MB to ~2MB.

We only need to change the RPC call, not its return value, since that
was already in an "optimised" form.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent d9de612c
...@@ -105,6 +105,17 @@ def _BlockdevGetMirrorStatusPostProc(result): ...@@ -105,6 +105,17 @@ def _BlockdevGetMirrorStatusPostProc(result):
return result return result
def _BlockdevGetMirrorStatusMultiPreProc(node, args):
"""Prepares the appropriate node values for blockdev_getmirrorstatus_multi.
"""
# there should be only one argument to this RPC, already holding a
# node->disks dictionary, we just need to extract the value for the
# current node
assert len(args) == 1
return [args[0][node]]
def _BlockdevGetMirrorStatusMultiPostProc(result): def _BlockdevGetMirrorStatusMultiPostProc(result):
"""Post-processor for L{rpc.RpcRunner.call_blockdev_getmirrorstatus_multi}. """Post-processor for L{rpc.RpcRunner.call_blockdev_getmirrorstatus_multi}.
...@@ -396,7 +407,8 @@ _BLOCKDEV_CALLS = [ ...@@ -396,7 +407,8 @@ _BLOCKDEV_CALLS = [
"Request status of a (mirroring) device"), "Request status of a (mirroring) device"),
("blockdev_getmirrorstatus_multi", MULTI, TMO_NORMAL, [ ("blockdev_getmirrorstatus_multi", MULTI, TMO_NORMAL, [
("node_disks", ED_NODE_TO_DISK_DICT, None), ("node_disks", ED_NODE_TO_DISK_DICT, None),
], None, _BlockdevGetMirrorStatusMultiPostProc, ], _BlockdevGetMirrorStatusMultiPreProc,
_BlockdevGetMirrorStatusMultiPostProc,
"Request status of (mirroring) devices from multiple nodes"), "Request status of (mirroring) devices from multiple nodes"),
] ]
......
...@@ -288,10 +288,7 @@ class NodeHttpServer(http.server.HttpServer): ...@@ -288,10 +288,7 @@ class NodeHttpServer(http.server.HttpServer):
""" """
(node_disks, ) = params (node_disks, ) = params
node_name = netutils.Hostname.GetSysName() disks = [objects.Disk.FromDict(dsk_s) for dsk_s in node_disks]
disks = [objects.Disk.FromDict(dsk_s)
for dsk_s in node_disks.get(node_name, [])]
result = [] result = []
......
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