From a9c280ffbf4696d02dec1a627b1ccb04fe5e8278 Mon Sep 17 00:00:00 2001 From: yury Date: Wed, 1 Oct 2008 14:11:55 +0000 Subject: [PATCH] b=17194 r=adilger,oleg during abort recovery starts, stale export processing is slow --- lustre/obdfilter/filter.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index e08358d..8c36124 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -465,12 +465,13 @@ static int filter_client_add(struct obd_device *obd, struct obd_export *exp, RETURN(0); } +struct lsd_client_data zero_lcd; /* globals are implicitly zeroed */ + static int filter_client_free(struct obd_export *exp) { struct filter_export_data *fed = &exp->exp_filter_data; struct filter_obd *filter = &exp->exp_obd->u.filter; struct obd_device *obd = exp->exp_obd; - struct lsd_client_data zero_lcd; struct lvfs_run_ctxt saved; int rc; loff_t off; @@ -507,24 +508,27 @@ static int filter_client_free(struct obd_export *exp) } if (!(exp->exp_flags & OBD_OPT_FAILOVER)) { - memset(&zero_lcd, 0, sizeof(zero_lcd)); + /* Don't force sync on disconnect if aborting recovery, + * or it does num_clients * num_osts. b=17194 */ + int need_sync = (!exp->exp_libclient || exp->exp_need_sync) && + !(exp->exp_flags&OBD_OPT_ABORT_RECOV); + push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); rc = fsfilt_write_record(obd, filter->fo_rcvd_filp, &zero_lcd, - sizeof(zero_lcd), &off, - (!exp->exp_libclient || - exp->exp_need_sync)); + sizeof(zero_lcd), &off, 0); + /* Make sure the server's last_transno is up to date. Do this + * after the client is freed so we know all the client's + * transactions have been committed. */ if (rc == 0) - /* update server's transno */ filter_update_server_data(obd, filter->fo_rcvd_filp, - filter->fo_fsd, - !exp->exp_libclient); + filter->fo_fsd, need_sync); pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); CDEBUG(rc == 0 ? D_INFO : D_ERROR, - "zeroing out client %s at idx %u (%llu) in %s rc %d\n", + "zero out client %s at idx %u/%llu in %s %ssync rc %d\n", fed->fed_lcd->lcd_uuid, fed->fed_lr_idx, fed->fed_lr_off, - LAST_RCVD, rc); + LAST_RCVD, need_sync ? "" : "a", rc); } if (!test_and_clear_bit(fed->fed_lr_idx, filter->fo_last_rcvd_slots)) { -- 1.8.3.1