Skip to content
  • Lai Siyao's avatar
    LU-4684 migrate: migrate striped directory · 169738e3
    Lai Siyao authored
    
    
    Migrate striped directory in below steps:
    1. create target object if needed: if source is directory, a
       target object is always created, otherwise if source is
       already located on the target MDT, or source still has
       link on source MDT, then skip creating.
    	a) if source is directory, detach source stripes and
    	   attach them to target.
    	b) migrate source xattrs to target.
    	c) if source is regular file, update PFID to target
    	   fid.
    	d) update fid to target for all links of source
    2. update namespace
    	a) migrate dirent from source parent to target parent.
    	b) update linkea parent fid to target parent.
    	c) destroy source object.
    
    This implementation improves following fields:
    1. all involved objects are locked to avoid race.
    2. directory migration doesn't migrate its dir entries, instead
       it's done in each sub file migration, this avoids timeout in
       migrating dir entries for large directory, and also avoids
       touching dir entries without lock.
    3. file/dir is migrated in one transaction, so migrate recovery
       is the same as others.
    4. migrating directory can be accessed (modifiable) like normal
       directory.
    5. if migration of sub files under a directory fails, user can
       redo migrate to finish migration of this directory.
    
    Disable migrate in racer.sh.
    
    Signed-off-by: default avatarLai Siyao <lai.siyao@whamcloud.com>
    Change-Id: I7906e50a0bf55375eafdf2cf5500979dd2d94d48
    Reviewed-on: https://review.whamcloud.com/31427
    
    
    Tested-by: Jenkins
    Tested-by: default avatarMaloo <hpdd-maloo@intel.com>
    Reviewed-by: default avatarAndreas Dilger <adilger@whamcloud.com>
    Reviewed-by: default avatarFan Yong <fan.yong@intel.com>
    Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
    169738e3