Whamcloud - gitweb
LU-6475 mdt: race between open and migrate 97/14497/19
authorwang di <di.wang@intel.com>
Sun, 10 May 2015 23:40:46 +0000 (16:40 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 24 Aug 2015 14:12:22 +0000 (14:12 +0000)
commit220e6cbfa65c570641b515723df727b205b0e92a
tree5452d983f2006944bd23577a39b5d96ea77cdbe9
parent336589a1dbd6923c26233222407bea60f57dd0e6
LU-6475 mdt: race between open and migrate

During intent open, if it founds the parent has been
migrated to another MDT, it should retry the open
request with the new object, so it needs to keep the
old object in the orphan list, which will be cleanup
during next recovery. Note: if the client still using
the old FID after next recovery, it will return -ENOENT
for the application.

Reset parent FID on OST object after migration, which
also make sanity-lfsck.sh 15c obsolete, because that
test suppose to fix the parent FID of the OST object
after migration.

And also enqueue the lease lock of the migrating file,
then compare the lease before migration to make sure
no other clients open the file at the same time.

Add sanityn.sh 80b to test race between open/stat and
migration.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Iad3e5006079e9f72b338680e17448c39c6d1af98
Reviewed-on: http://review.whamcloud.com/14497
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
22 files changed:
lustre/include/dt_object.h
lustre/include/lustre_req_layout.h
lustre/include/md_object.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/lod/lod_object.c
lustre/lod/lod_sub_object.c
lustre/mdc/mdc_lib.c
lustre/mdc/mdc_reint.c
lustre/mdd/mdd_dir.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lib.c
lustre/mdt/mdt_open.c
lustre/mdt/mdt_reint.c
lustre/osp/osp_trans.c
lustre/ptlrpc/layout.c
lustre/target/update_trans.c
lustre/tests/sanity-lfsck.sh
lustre/tests/sanity.sh
lustre/tests/sanityn.sh