Whamcloud - gitweb
LU-10092 pcc: Non-blocking PCC caching 66/32966/37
authorQian Yingjin <qian@ddn.com>
Thu, 5 Jul 2018 06:43:46 +0000 (14:43 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 13 Jun 2019 04:32:03 +0000 (04:32 +0000)
commit58d744e3eaab358ef346e51ff4aa17e9f08efbb3
tree0cc7dbf3d23efee0a8c29f1205b26203dbcadd14
parentf172b116885753d0f316549a2fb9d451e9b4bd2e
LU-10092 pcc: Non-blocking PCC caching

Current PCC uses refcount of PCC inode to determine whether a
previous PCC-attached file can be detached. If a file is open
(refcount > 1), the detaching will return -EBUSY.

When another client accesses the PCC-cached file, it will trigger
the restore process as the file is HSM released. During restore,
the Agent needs to detach the PCC-cached file.
Thus, if a PCC-attached file is keeping opened but not closed
for a long time, the restore request will always return failure.

In this patch, we implement a non-blocking PCC caching mechanism
for Lustre. After attaching the file into PCC, the client acquires
the layout lock for the file, and the layout generation is
maintained in the PCC inode. Under the layout lock protection, the
PCC caching state is valid and all I/O will direct into PCC. When
the layout lock is revoked, in the blocking AST it will invalidate
the PCC caching state and detach the file automatically.

This patch is also helpful to handle the ENOSPC error for PCC
write by fallback to normal I/O path which will restore the file
data into OSTs (The file is in HSM released state) and redo the
write again.

Change-Id: I9130c04dc0e6eae879ea2ff3fdda65726e74d177
Test-Parameters: clientcount=3 testlist=sanity-pcc,sanity-pcc,sanity-pcc
Signed-off-by: Qian Yingjin <qian@ddn.com>
Reviewed-on: https://review.whamcloud.com/32966
Tested-by: Jenkins
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
24 files changed:
lustre/doc/lfs-pcc.1
lustre/doc/llapi_pcc_attach.3
lustre/doc/llapi_pcc_attach_fid.3 [new file with mode: 0644]
lustre/doc/llapi_pcc_attach_fid_str.3 [new file with mode: 0644]
lustre/include/lustre/lustreapi.h
lustre/include/obd_support.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/llite_mmap.c
lustre/llite/namei.c
lustre/llite/pcc.c
lustre/llite/pcc.h
lustre/llite/vvp_object.c
lustre/mdt/mdt_open.c
lustre/tests/multiop.c
lustre/tests/sanity-pcc.sh
lustre/tests/test-framework.sh
lustre/utils/lfs.c
lustre/utils/lhsmtool_posix.c
lustre/utils/liblustreapi_hsm.c
lustre/utils/liblustreapi_pcc.c