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 <hongchao.zhang@intel.com>
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 <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
static int ofd_create_hdl(struct tgt_session_info *tsi)
{
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;
struct ost_body *repbody;
const struct obdo *oa = &tsi->tsi_ost_body->oa;
struct obdo *rep_oa;
" at "LPU64"\n", ofd_name(ofd),
count, seq, next_id);
" 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,
CDEBUG(D_HA, "%s: Slow creates, %d/%d objects"
" created at a rate of %d/s\n",
ofd_name(ofd), created, diff + created,
+
+ 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 */
if (created > 0)
/* some objects got created, we can return
* them, even if last creation failed */
d->opd_pre_grow_slow = 0;
}
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);
d->opd_pre_last_created_fid = *fid;
spin_unlock(&d->opd_pre_lock);