From: Hongchao Zhang Date: Sat, 24 May 2014 07:53:28 +0000 (+0800) Subject: LU-4621 ofd: create same count of objects X-Git-Tag: 2.6.0-RC1~9 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=446eb3dda264c24acdeeea3158bba55a16c8c5e1 LU-4621 ofd: create same count of objects when replaying the creation request (precreation) from OSP, OFD should create the same count of objects as it created when it processed the request initially, else it could cause "-ENOENT" problem for the following replay requests coming from the clients. Change-Id: I64f61f82f6a662ccc564599468466549a55b55d0 Signed-off-by: Hongchao Zhang Test-Parameters: alwaysuploadlogs envdefinitions=SLOW=yes \ clientdistro=el6 ossdistro=el6 mdsdistro=el6 clientarch=x86_64 \ ossarch=x86_64 mdsarch=x86_64 \ clientcount=4 osscount=2 mdscount=2 \ austeroptions=-R failover=true iscsi=1 \ testlist=recovery-mds-scale Reviewed-on: http://review.whamcloud.com/10626 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: wangdi Reviewed-by: Oleg Drokin --- diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index 25debd1..774ec02 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -1208,6 +1208,7 @@ out_put: static int ofd_create_hdl(struct tgt_session_info *tsi) { + struct ptlrpc_request *req = tgt_ses_req(tsi); struct ost_body *repbody; const struct obdo *oa = &tsi->tsi_ost_body->oa; struct obdo *rep_oa; @@ -1378,7 +1379,8 @@ static int ofd_create_hdl(struct tgt_session_info *tsi) " at "LPU64"\n", ofd_name(ofd), count, seq, next_id); - if (cfs_time_after(jiffies, enough_time)) { + if (!(lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) + && cfs_time_after(jiffies, enough_time)) { CDEBUG(D_HA, "%s: Slow creates, %d/%d objects" " created at a rate of %d/s\n", ofd_name(ofd), created, diff + created, @@ -1395,6 +1397,14 @@ static int ofd_create_hdl(struct tgt_session_info *tsi) break; } } + + if (diff > 0 && + lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) + LCONSOLE_WARN("%s: can't create the same count of" + " objects when replaying the request" + " (diff is %d). see LU-4621\n", + ofd_name(ofd), diff); + if (created > 0) /* some objects got created, we can return * them, even if last creation failed */ diff --git a/lustre/osp/osp_precreate.c b/lustre/osp/osp_precreate.c index e6f81cd..7c28e1a 100644 --- a/lustre/osp/osp_precreate.c +++ b/lustre/osp/osp_precreate.c @@ -495,6 +495,9 @@ static int osp_precreate_send(const struct lu_env *env, struct osp_device *d) d->opd_pre_grow_slow = 0; } + body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY); + fid_to_ostid(fid, &body->oa.o_oi); + d->opd_pre_last_created_fid = *fid; spin_unlock(&d->opd_pre_lock);