It's possible that precreate succeeded on OST, but MDT didn't get the
reply, and assumed failure. In this case, the LAST_ID on MDT is
smaller than that on OST, instead of report error and stop precreate,
it's better to move precreate window forward.
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Ia6ca418ec0ea6797b7eccc1610879331307fad07
Reviewed-on: https://review.whamcloud.com/44984
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
GOTO(out, rc = -EINVAL);
}
- if (diff < 0) {
+ if (diff <= -OST_MAX_PRECREATE) {
/* LU-5648 */
CERROR("%s: invalid precreate request for "
DOSTID", last_id %llu. "
ofd_name(ofd), POSTID(&oa->o_oi),
ofd_seq_last_oid(oseq));
GOTO(out, rc = -EINVAL);
+ } else if (diff < 0) {
+ LCONSOLE(D_INFO,
+ "%s: MDS LAST_ID "DFID" (%llu) is %lld behind OST LAST_ID "DFID" (%llu), trust the OST\n",
+ ofd_name(ofd), PFID(&oa->o_oi.oi_fid),
+ oid, -diff, PFID(&oseq->os_oi.oi_fid),
+ ofd_seq_last_oid(oseq));
+ /* Let MDS know that we are so far ahead. */
+ rc = ostid_set_id(&rep_oa->o_oi,
+ ofd_seq_last_oid(oseq) + 1);
}
}
}