From e81235969430cd05feb10eb59d00f93448c7c0d9 Mon Sep 17 00:00:00 2001 From: wang di Date: Wed, 2 Apr 2014 09:57:00 -0700 Subject: [PATCH] LU-4855 fld: refer to MDT0 for fld lookup in some cases It is possible that when fld client is trying to lookup seq on one of MDT, but the connection between the client and the MDT is not being initialized yet, especially during striped dir creation, because client will only send create req to the master MDT, then master MDT will distribute the operation to all of other MDT, instead of client distributing these requests, which will usually trigger the connection. In this case, we will send the fld request to MDT0, since it has all of location information. Signed-off-by: wang di Change-Id: I577ada2a782ecbdc863d05e8d007c0914a1e7837 Reviewed-on: http://review.whamcloud.com/9877 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Fan Yong Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/fld/fld_request.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lustre/fld/fld_request.c b/lustre/fld/fld_request.c index 6a4986e..92e47ff 100644 --- a/lustre/fld/fld_request.c +++ b/lustre/fld/fld_request.c @@ -84,11 +84,20 @@ fld_rrb_scan(struct lu_client_fld *fld, seqno_t seq) else hash = 0; +again: cfs_list_for_each_entry(target, &fld->lcf_targets, ft_chain) { if (target->ft_idx == hash) RETURN(target); } + if (hash != 0) { + /* It is possible the remote target(MDT) are not connected to + * with client yet, so we will refer this to MDT0, which should + * be connected during mount */ + hash = 0; + goto again; + } + CERROR("%s: Can't find target by hash %d (seq "LPX64"). " "Targets (%d):\n", fld->lcf_name, hash, seq, fld->lcf_count); -- 1.8.3.1