Whamcloud - gitweb
LU-4684 lmv: support accessing migrating directory 04/31504/31
authorLai Siyao <lai.siyao@intel.com>
Thu, 1 Mar 2018 02:34:19 +0000 (10:34 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 1 Oct 2018 14:00:14 +0000 (14:00 +0000)
commit976b609abcdf5adc29f55b742ff6b1307b2b6484
treec52a22e0a0fcd92deecd99f467799596c08de3f3
parent97381ffc9231a9e8b997fd3b4d66c9c5ade1b4d0
LU-4684 lmv: support accessing migrating directory

Migrating directory contains stripes of both old and new layout, and
its sub files may be located on either one. To avoid race between
access and new creations, there are 4 rules to access migrating
directory:
1. always create new file under new layout.
2. any operation that tries to create new file under old layout will
   be rejected, e.g., 'mv a <migrating_dir>/b', if b exists and is
   under old layout, this rename should fail with -EBUSY.
3. operations that access file by name should try old layout first,
   if file doesn't exist, then it will retry new layout, such
   operations include: lookup, getattr_name, unlink, open-by-name,
   link, rename.
4. according to rule 1, open(O_CREAT | O_EXCL) and create() will
   create new file under new layout, but they should check existing
   file in one transaction, however this can't be done for old
   layout, so check existing file under old layout on client side,
   then issue the open/create request to new layout.

Disable sanity 230d for ZFS backend because it will trigger lots of
sync, which may cause system hung.

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Icd587eb17f4c6dc2234dcc3c7ba40759bc3e8d31
Reviewed-on: https://review.whamcloud.com/31504
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_lmv.h
lustre/include/obd.h
lustre/lmv/lmv_intent.c
lustre/lmv/lmv_internal.h
lustre/lmv/lmv_obd.c
lustre/tests/conf-sanity.sh
lustre/tests/recovery-small.sh
lustre/tests/sanity-hsm.sh
lustre/tests/sanity-lfsck.sh
lustre/tests/sanity.sh
lustre/tests/sanityn.sh