From d07d9c5ed0aa1d6614944c7d1e0ca55cba301dc4 Mon Sep 17 00:00:00 2001 From: Sergey Cheremencev Date: Fri, 24 Aug 2018 17:03:45 +0300 Subject: [PATCH] LU-11760 ofd: formatted OST recognition change Modern system is fast enough to create above 100 000(5 * OST_MAX_PRECREATE) objects during commit interval. Increase the difference between MDS last_used ID and OST LAST_ID to 500 000 to avoid gaps after OST failover. Cray-bug-id: LUS-6399 Change-Id: If36e04878d13f27f5229b488781440a159ddff7d Signed-off-by: Sergey Cheremencev Reviewed-on: https://es-gerrit.dev.cray.com/153866 Reviewed-by: Alexander Boyko Reviewed-by: Alexander Zarochentsev Tested-by: Elena Gryaznova Reviewed-on: https://review.whamcloud.com/33833 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alexandr Boyko Reviewed-by: Oleg Drokin --- lustre/ofd/ofd_dev.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index 1f0fbdc..e63a8d7 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -1645,19 +1645,23 @@ static int ofd_create_hdl(struct tgt_session_info *tsi) * in place of an old one at the same index. Instead of * precreating potentially millions of deleted old objects * (possibly filling the OST), only precreate the last batch. - * LFSCK will eventually clean up any orphans. LU-14 */ - if (diff > 5 * OST_MAX_PRECREATE) { + * LFSCK will eventually clean up any orphans. LU-14 + * 500000 is a theoretical maximum number of objects that could + * be created(but not stored on disk in case of failover) + * during default journal commit interval - 5 seconds. */ + if (diff > 500000) { diff = OST_MAX_PRECREATE / 2; LCONSOLE_WARN("%s: Too many FIDs to precreate " + "precreate FID"DOSTID" LAST_ID"DOSTID "OST replaced or reformatted: " - "LFSCK will clean up", - ofd_name(ofd)); + "LFSCK will clean up\n", + ofd_name(ofd), POSTID(&oa->o_oi), + POSTID(&oseq->os_oi)); - CDEBUG(D_HA, "%s: precreate FID "DOSTID" is over " - "%u larger than the LAST_ID "DOSTID", only " + CDEBUG(D_HA, "%s: precreate FID "DOSTID" is over 500000" + "larger than the LAST_ID "DOSTID", only " "precreating the last %lld objects.\n", ofd_name(ofd), POSTID(&oa->o_oi), - 5 * OST_MAX_PRECREATE, POSTID(&oseq->os_oi), diff); ofd_seq_last_oid_set(oseq, ostid_id(&oa->o_oi) - diff); } -- 1.8.3.1