Whamcloud - gitweb
LU-10092 pcc: auto attach during open for valid cache 87/33787/21
authorQian Yingjin <qian@ddn.com>
Wed, 5 Dec 2018 03:22:11 +0000 (11:22 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 13 Jun 2019 04:35:06 +0000 (04:35 +0000)
commite29ecb659e51dd67758c5b0adb542210e7aeddb1
tree49907e476dd4f12b2e4a4fc05c9daa29064e15a7
parent4fbae13529471ea466ad0879f04e42e12aa02786
LU-10092 pcc: auto attach during open for valid cache

In current PCC implementation, all PCC state information is
stored in the in-memory data structure named pcc_inode (a member
of data structure ll_inode_info). Once the file inode is reclaimed
due to the memory pressure or memory shrinking, the corresponding
in-memory pcc_inode will be released too, and the PCC-cached file
will be detached automatically. And the revocation of layout lock
will also trigger the detach of the PCC-cached file. These all lead
that the still valid PCC-cached file can not be used.

To solve this problem, we introduce an auto-attaching mechanism
during open. During PCC attach, the L.Gen will be stored as
extented attribute of the local copy file on PCC device. When the
in-memory inode is reclaimed or the layout lock is revoked, and
the file is opend again, it can check whether the stored L.Gen on
the PCC copy is same as the Lustre file current L.Gen on MDT. If
they are consistent, it means the cached copy on PCC device is still
valid, we can continue to use it after auto-attach.

Test-Parameters: testlist=sanity-pcc,sanity-pcc,sanity-pcc
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I63be96f8d83816529983d0f97af0aaca81703fed
Reviewed-on: https://review.whamcloud.com/33787
Tested-by: Jenkins
Reviewed-by: Li Xi <lixi@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/cl_object.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/pcc.c
lustre/llite/pcc.h
lustre/lov/lov_object.c
lustre/tests/sanity-pcc.sh