Skip to content
  • Qian Yingjin's avatar
    LU-13030 pcc: auto attach not work after client cache clear · a5ef2d6e
    Qian Yingjin authored
    
    
    When the inode of a PCC cached file in unused state was evicted
    from icache due to memory pressure or manual icache cleanup (i.e.
    "echo 3 > /proc/sys/vm/drop_caches"), this file will be detached
    from PCC also, and all PCC state for this file is cleared.
    In the current design, PCC only tries to auto attache the file
    once attached into PCC according to the in-memery PCC state. Thus
    later IO for the file is not directed to PCC and will trigger the
    data restore.
    
    If this is a not desired result for the user, then we need to try
    to auto attach file that was never attached into PCC or once
    attached but detached as a result of shrinking its inode from
    icache.
    
    Although the candidates to try auto attach are increased, but only
    the file in HSM released state (which can directly get from file
    layout) will be checked.
    
    This bug is easy reproduced on rhel8. It seems that the command
    "echo 3 > /proc/sys/vm/drop_caches" will drop all unused inodes
    from icache, but it is not true for rhel7.
    
    This patch also adds the check for the input parameter @rwid,
    which should be non zero value and same as the archive ID.
    
    Test-Parameters: clientdistro=el8 testlist=sanity-pcc,sanity-pcc
    Signed-off-by: default avatarQian Yingjin <qian@ddn.com>
    Change-Id: Ibb4c7c624de089766f4a56ef08ff0e2088d2e859
    Reviewed-on: https://review.whamcloud.com/36892
    
    
    Tested-by: default avatarjenkins <devops@whamcloud.com>
    Reviewed-by: default avatarAndreas Dilger <adilger@whamcloud.com>
    Reviewed-by: default avatarLi Xi <lixi@ddn.com>
    Tested-by: default avatarMaloo <maloo@whamcloud.com>
    Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
    a5ef2d6e