Whamcloud - gitweb
LU-7782 scrub: handle slave obj of striped directory
When lookup item under striped directory, we need to locate the
master MDT-object of the striped directory firstly, then the
client will send lookup (getattr_by_name) RPC to the MDT with
some slave MDT-object's FID and the item's name. If the system
is restored from MDT file level backup, then before the OI scrub
completely built the OI files, the OI mappings of the master
MDT-object and slave MDT-object may be invalid. Usually, it is
not a problem for the master MDT-object. Because when locate the
master MDT-object, we will do name based lookup (for the striped
directory itself) firstly, during such process we can setup the
correct OI mapping for the master MDT-object. But it will be
trouble for the slave MDT-object. Because the client will not
trigger name based lookup on the MDT to locate the slave
MDT-object before locating item under the striped directory,
then when osd_fid_lookup(), it will find that the OI mapping
for the slave MDT-object is invalid and does not know what the
right OI mapping is, then the MDT has to return -EINPROGRESS to
the client to notify that the OI scrub is rebuiding the OI file,
related OI mapping is unknown yet, please try again later. And
then client will re-try the RPC again and again until related
OI mapping has been updated. That is quite inefficient.
To resolve above trouble, we will handle it as the following
two cases:
1) The slave MDT-object and the MDT-object are on different
MDTs. It is relative easy. Be as one of remote MDT-objects,
the slave MDT-object is linked under /REMOTE_PARENT_DIR
with the name of its FID string. We can locate the slave
MDT-object via lookup the /REMOTE_PARENT_DIR directly.
2) The slave MDT-object and the MDT-object reside on the same
MDT. Under such case, during lookup the master MDT-object,
we will lookup the slave MDT-object via readdir the master
MDT-object, because the slave MDT-objects information are
stored as sub-directories with the name "${FID}:${index}".
Then when find the local slave MDT-object, its OI mapping
will be recorded. Then subsequent osd_fid_lookup() will
know the correct OI mapping for the slave MDT-object.
The patch also enhance sanity-scrub to avoid DNE in sanity-scrub
on one MDT.
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I0bf12ac981017245e4c2da08176422a993086c18
Reviewed-on: http://review.whamcloud.com/18801
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>