Whamcloud - gitweb
LU-14393 protocol: basic batching processing framework 78/41378/17
authorQian Yingjin <qian@ddn.com>
Mon, 1 Feb 2021 03:51:08 +0000 (11:51 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 27 Jan 2023 00:31:15 +0000 (00:31 +0000)
commit840274b5c5e95e44a5ffedd08ebb4727bc39a845
tree1d7b337620e749c05d70ffc62933fdc235e5ab6c
parent3049ba6ba1241770adeeeffbdfb6fef82bbf0b92
LU-14393 protocol: basic batching processing framework

Batching processing can obtain boost performace. The larger the
batch size, the higher the latency for the entire batch. Although
the latency for the entire batch of operations is higher than the
latency of any single operation, the throughput of the batch of
operations is much high.

This patch implements the basic batching processing framework for
Lustre. It could be used for the future batching statahead and
WBC.

A batched RPC does not require that the opcodes of sub requests in
a batch are same. Each sub request has its own opcode. It allows
batching not only read-only requests but also multiple
modification updates with different opcodes, and even a mixed
workload which contains both read-only requests and modification
updates.

For the recovery, only the batched RPC contains a client XID,
there is no separate client XID for each sub-request. Although the
server will generate a transno for each update sub request, but
the transno only stores into the batched RPC (in @ptlrpc_body)
when the sub update request is finished. Thus the batched RPC only
stores the transno of the last sub update request. Only the
batched RPC contains the @ptlrpc_body message field. Each sub
request in a batched RPC does not contain @ptlrpc_body field.

A new field named @lrd_batch_idx is added in the client reply data
@lsd_reply_data. It indicates the sub request index in a batched
RPC. When the server finished a sub update request, it will update
@lrd_batch_idx accordingly.
When found that a batched RPC was a resend RPC, and if the index
of the sub request in the batched RPC is smaller or equal than
@lrd_batch_idx in the reply data, it means that the sub request has
already executed and committed, the server will reconstruct the
reply for this sub request; if the index is larger than
@lrd_batch_idx, the server will re-execute the sub request in the
batched RPC.

To simplify the reply/resend of the batched RPCs, the batch
processing stops at the first failure in the current design.

Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: Idaa814e82c968811bdda1c750b18c878b2c2ca67
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/41378
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
26 files changed:
lustre/include/lustre_net.h
lustre/include/lustre_req_layout.h
lustre/include/lustre_swab.h
lustre/include/obd.h
lustre/include/obd_class.h
lustre/include/obd_support.h
lustre/include/obj_update.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/lmv/lmv_internal.h
lustre/lmv/lmv_obd.c
lustre/mdc/Makefile.in
lustre/mdc/mdc_batch.c [new file with mode: 0644]
lustre/mdc/mdc_internal.h
lustre/mdc/mdc_request.c
lustre/mdt/Makefile.in
lustre/mdt/mdt_batch.c [new file with mode: 0644]
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/ptlrpc/Makefile.in
lustre/ptlrpc/batch.c [new file with mode: 0644]
lustre/ptlrpc/layout.c
lustre/ptlrpc/lproc_ptlrpc.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c