Whamcloud - gitweb
LU-1267 lfsck: enhance API for MDT-OST consistency 56/7156/33
authorFan Yong <fan.yong@intel.com>
Thu, 30 Jan 2014 19:05:05 +0000 (03:05 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 12 Feb 2014 06:14:54 +0000 (06:14 +0000)
commita52aa3b4d9dd5efb87bc983c13b9f58d61ce8a8e
tree416bfe75ba6d803c3450be88d96751378770d26b
parent7681cdd22debca79c149e21d74b4e1ef508fead0
LU-1267 lfsck: enhance API for MDT-OST consistency

Introduce new dt_object method ::do_declare_attr_get(). The caller
can use such method to notify low layer that "It will need the OST
object attribute very soon, please help to prepare in advance". For
the LFSCK layout consistency verification, the osp_declare_attr_get()
will use UPDATE_OBJ RPC with sub_opcode OBJ_ATTR_GET.

Similarly, another new new dt_object method ::do_declare_xattr_get()
is used to notify low layer that "It will need the OST object xattr
very soon, please help to prepare in advance", which uses UPDATE_OBJ
RPC with sub_opcode OBJ_XATTR_GET.

These idempotent requests can be batched together during the phase
of declaration and sent out via single OUT RPC. It can be shared by
any thread that wants to send idempotent requests to the same OST.

Introduce cache in OSP for remote object's attribute and extended
attribute. Currently, it is mainly used to hold those pre-fetched
OST-objects' kinds of attr/parent FID. But it also can be used by
DNE for other purposes in the future.

For performance, the batched idempotent OUT RPC uses asynchronous
mode. Every sub operation needs to register its own interpterer.
These interpterers will be called one by one after the batched OUT
RPC is replied by the OST.

Implement do_attr_get() against OSP-object for the MDT to get OST
object attribute.

Implement do_xattr_get() against OSP-object for the MDT to get OST
object parent FID attribute.

Implement do_xattr_set() against OSP-object for the MDT to set OST
object parent FID extended attribute.

Some code cleanup and re-organization, such as moving transaction
related code from osp/osp_md_object.c to osp/osp_trans.c, moving
common OUT code from osp/osp_md_object.c to target/out_lib.c.

Originally, only DNE operations will use OUT RPCs, so they use sync
mode transaction. But with LFSCK phase II introduced, sync mode OUT
RPC processing is bad performance. The patch improves related funcs
to allow LFSCK to use async mode transaction for OUT RPC processing,
and DNE related operations still use sync mode transaction.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I4fe99f96ad24d43c1edea3a4a16b7ed206c38c4f
Reviewed-on: http://review.whamcloud.com/7156
Tested-by: Jenkins
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
19 files changed:
lustre/include/dt_object.h
lustre/include/lu_target.h
lustre/include/lustre_export.h
lustre/include/lustre_update.h
lustre/lfsck/lfsck_layout.c
lustre/mdt/mdt_handler.c
lustre/osp/Makefile.in
lustre/osp/osp_dev.c
lustre/osp/osp_internal.h
lustre/osp/osp_md_object.c
lustre/osp/osp_object.c
lustre/osp/osp_trans.c [new file with mode: 0644]
lustre/ptlrpc/Makefile.in
lustre/ptlrpc/ptlrpcd.c
lustre/target/Makefile.am
lustre/target/out_handler.c
lustre/target/out_lib.c [new file with mode: 0644]
lustre/target/tgt_internal.h
lustre/target/tgt_lastrcvd.c