Whamcloud - gitweb
LU-13023 pcc: Incorrect size after re-attach
authorQian Yingjin <qian@ddn.com>
Wed, 27 Nov 2019 15:28:24 +0000 (23:28 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 3 Dec 2019 19:02:35 +0000 (14:02 -0500)
commit10e6d668b63e77ee9bea44e2b1a263af538abd93
treeae28cd0f66e681439110139a19e0d88fd9fb6043
parent3cb7636a04921c2b6d1ccb1db4848af1ca9d1701
LU-13023 pcc: Incorrect size after re-attach

The following test case will result in incorrect size for PCC copy:
- Attach a file with size of s1 (s2 > 0) into PCC;
- Detach this file with --keep option, and the data will retain
  on PCC;
- Truncate this file locally or on an remote client to a new size
  s2 (s2 < s1);
- Re-attach the file again. The size of PCC copy is still s1.

To solve this problem, it need to truncate the size of the PCC copy
to the same size of the Lustre copy which will be HSM released
later after finished the data copy (archive) phase.
This patch also adds the handle for the signal pending when the
attach process is killed by an administrator.

Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I18f2c883454450bf5dc2f2b3600e2685d8f8f130
Reviewed-on: https://review.whamcloud.com/36884
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/pcc.c
lustre/tests/sanity-pcc.sh