Whamcloud - gitweb
LU-12373 pcc: uncache the pcc copies when remove a PCC backend 52/38352/25
authorQian Yingjin <qian@ddn.com>
Fri, 14 Jun 2019 09:29:55 +0000 (05:29 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 5 Jun 2024 04:47:52 +0000 (04:47 +0000)
commitc74878caa79305f77ba93eaa876bcc433dacc556
tree7ce423711be0fdf194aa3bfc1d5d0f79f780e344
parenta0b283dcd3846f5ab5a7ba9e2e83b7f5d6db40c1
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.

EX-2579 pcc: support a flatter HSM archive format

Add versioning (v1 and V2) to the HSM (PCC) archive format (directory
layout):
v1: (oid & 0xffff)/-/-/-/-/-/FID
v2: ((oid ^ seq) & 0xffff)/FID

v1 is the original layout and the default. v2 is the new layout which
should be selected for new installs.
Was-Change-Id: If660f3cf4c02469bb23e65a44f86f0346367adf6

LU-12373 pcc: delete stale PCC copy when remove PCC backend

By default, when removing a PCC backend from a client, the action
is to scan the PCC backend FS, uncache (detach and remove) all
scanned PCC copies from PCC by FIDs.

However, during the tests, we found that some old stale PCC copies
are not removed when an adminstrator runs "lctl pcc del|clear".
The reason is that these PCC copies are already detached from PCC
when running the commands.

This patch fixes this bug: when removing a PCC backend from a
client, it will also delete all non-cached PCC copies from PCC
backend to free up the space.
Was-Change-Id: Id829abe7e6cb1294e6baea76452f4a9178711451

EX-bug-id: EX-2579
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/c/fs/lustre-release/+/38352
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
21 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/ptlrpc/wiretest.c
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
lustre/utils/wirecheck.c
lustre/utils/wiretest.c