Whamcloud - gitweb
LU-4684 migrate: migrate striped directory 27/31427/26
authorLai Siyao <lai.siyao@intel.com>
Mon, 22 Jan 2018 18:34:54 +0000 (02:34 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 17 Sep 2018 04:05:23 +0000 (04:05 +0000)
commit169738e30a7e0b57f27a517d78d2c928b3bb0f5c
tree84f5665593a648ddff23d3ec45c15f216947ea7e
parent8ad9453ee66ec1beaff9c8711cf732a861176a6f
LU-4684 migrate: migrate striped directory

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: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: I7906e50a0bf55375eafdf2cf5500979dd2d94d48
Reviewed-on: https://review.whamcloud.com/31427
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
35 files changed:
lustre/include/lu_object.h
lustre/include/lustre_lmv.h
lustre/include/md_object.h
lustre/include/obd_support.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/lfsck/lfsck_internal.h
lustre/lfsck/lfsck_striped_dir.c
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/lmv/lmv_internal.h
lustre/lmv/lmv_obd.c
lustre/lod/lod_internal.h
lustre/lod/lod_object.c
lustre/mdc/mdc_internal.h
lustre/mdc/mdc_lib.c
lustre/mdc/mdc_reint.c
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_object.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lib.c
lustre/mdt/mdt_lproc.c
lustre/mdt/mdt_reint.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/osd_index.c
lustre/osd-zfs/osd_xattr.c
lustre/ptlrpc/wiretest.c
lustre/tests/racer.sh
lustre/tests/recovery-small.sh
lustre/tests/sanity-lfsck.sh
lustre/tests/sanity.sh
lustre/utils/liblustreapi.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c