Whamcloud - gitweb
LU-12373 pcc: uncache the pcc copies when remove a PCC backend
authorQian Yingjin <qian@ddn.com>
Fri, 14 Jun 2019 09:29:55 +0000 (05:29 -0400)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 25 Mar 2021 14:14:29 +0000 (14:14 +0000)
commit871da48984054628ab73c35994baf12e37ab9573
tree92e2141b90c493ec457f7173e31d6ac13e1b0cdc
parenta0567ad67d896d2d1f06338a2e27ecf973c946b9
LU-12373 pcc: uncache the pcc copies when remove a PCC backend

Currently when remove a PCC backend from a client, it does not
make any special handling for previously cached files at all.
Users can still use PCC caching service for these files. This
may not what users want. The reason is as follows:

1) For RW-PCC cached files, it does not restore the data back
into Lustre OSTs of the main filesystem. Although the PCC
backend falls back as a tranditional HSM storage solution
since the lhsmtool_posix copytool is still running at this
client. But this is dangerous, and likly to cause user data
to be lost if the PCC device may be permanently unavailable.

2) The space used by these PCC cached files may not released.

In this patch, when remove a PCC backend from a client, the
default action is to scan the PCC backend fs, uncache
(detach and remove) the PCC copy from PCC by FID.

We also add an option "--keep|-k" for PCC backend removal.
It behaves as before, just remove the PCC backend, but
retain the data on the cache.

This patch also introduces a common library to scan the HSM
backend.

Test-Parameters: clientcount=3 testlist=sanity-pcc,sanity-pcc,sanity-pcc
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: Ib4db36137c025fd78c7022c8b8c39b63e3b9ad4d
Reviewed-on: https://review.whamcloud.com/41919
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
18 files changed:
lustre/doc/Makefile.am
lustre/doc/lctl-pcc.8
lustre/doc/llapi_pcc_clear.3 [new file with mode: 0644]
lustre/doc/llapi_pcc_del.3 [new file with mode: 0644]
lustre/doc/llapi_pcc_detach_fid_fd.3
lustre/include/lustre/lustreapi.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/pcc.c
lustre/llite/pcc.h
lustre/tests/sanity-pcc.sh
lustre/utils/Makefile.am
lustre/utils/lfs.c
lustre/utils/libhsm_scanner.c [new file with mode: 0644]
lustre/utils/libhsm_scanner.h [new file with mode: 0644]
lustre/utils/liblustreapi_pcc.c
lustre/utils/obd.c