diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 07b7ca9340ec253679c131e1223f0126171486c6..fa1832159c6fd4a772a22ff97a9bbb80980a5cd4 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -17,6 +17,15 @@ tbd Cluster File Systems, Inc. <info@clusterfs.com> should be installed. It is versioned separately from Lustre and may be released separately in future. +Severity : minor +Frequency : only at startup +Bugzilla : 11778 +Description: Delay client connections to MDT until fist MDT->OST connect +Details : If a client tried to create a new file before the MDT had + connected to any OSTs, the create would return EIO. Now + the client will simply block until the MDT connects to the + first OST and the create can succeed. + Severity : normal Frequency : only for SLES9 Bugzilla : 12543 diff --git a/lustre/include/obd.h b/lustre/include/obd.h index b3883179b1fcea42d4bfe366297998ed487c0d97..7484762a343fc7b42744c55fb28853e1f4345a8f 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -447,7 +447,6 @@ struct mds_obd { obd_id *mds_lov_objids; int mds_lov_objids_size; __u32 mds_lov_objids_in_file; - unsigned int mds_lov_objids_dirty:1; int mds_lov_nextid_set; struct file *mds_lov_objid_filp; struct file *mds_health_check_filp; @@ -458,8 +457,11 @@ struct mds_obd { struct semaphore mds_qonoff_sem; struct semaphore mds_health_sem; unsigned long mds_lov_objids_valid:1, + mds_lov_objids_dirty:1, mds_fl_user_xattr:1, - mds_fl_acl:1; + mds_fl_acl:1, + mds_fl_cfglog:1, + mds_fl_synced:1; }; struct echo_obd { @@ -680,6 +682,9 @@ enum obd_notify_event { OBD_NOTIFY_CONFIG }; +#define CONFIG_LOG 0x1 /* finished processing config log */ +#define CONFIG_SYNC 0x2 /* mdt synced 1 ost */ + /* * Data structure used to pass obd_notify()-event to non-obd listeners (llite * and liblustre being main examples). diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 36e1617b1d48c3be82cb95a0b936d08a1cbad087..4df5c5b41c6ca33645167506de151d5acaf3828f 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -632,6 +632,18 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, } +/* Collect the preconditions we need to allow client connects */ +static void mds_allow_cli(struct obd_device *obd, unsigned int flag) +{ + if (flag & CONFIG_LOG) + obd->u.mds.mds_fl_cfglog = 1; + if (flag & CONFIG_SYNC) + obd->u.mds.mds_fl_synced = 1; + if (obd->u.mds.mds_fl_cfglog && obd->u.mds.mds_fl_synced) + /* Open for clients */ + obd->obd_no_conn = 0; +} + struct mds_lov_sync_info { struct obd_device *mlsi_obd; /* the lov device to sync */ struct obd_device *mlsi_watched; /* target osc */ @@ -705,7 +717,12 @@ out: rc); obd_notify(mds->mds_osc_obd, watched, OBD_NOTIFY_INACTIVE, NULL); + } else { + /* We've successfully synced at least 1 OST and are ready + to handle client requests */ + mds_allow_cli(obd, CONFIG_SYNC); } + class_decref(obd); return rc; } @@ -792,8 +809,7 @@ int mds_notify(struct obd_device *obd, struct obd_device *watched, case OBD_NOTIFY_SYNC_NONBLOCK: break; case OBD_NOTIFY_CONFIG: - /* Open for clients */ - obd->obd_no_conn = 0; + mds_allow_cli(obd, (unsigned int)data); default: RETURN(0); } @@ -816,6 +832,7 @@ int mds_notify(struct obd_device *obd, struct obd_device *watched, mutex_down(&obd->obd_dev_sem); rc = mds_lov_update_desc(obd, obd->u.mds.mds_osc_exp); mutex_up(&obd->obd_dev_sem); + mds_allow_cli(obd, CONFIG_SYNC); RETURN(rc); } diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index e5ce038304a051f3a9501808d0ee4f96e6acc1a1..79e0aa7461e81d69c846a796b6fbc6c0a2dea62b 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -726,8 +726,8 @@ static int lustre_stop_mgc(struct super_block *sb) { struct lustre_sb_info *lsi = s2lsi(sb); struct obd_device *obd; - char *niduuid, *ptr = 0; - int i, rc = 0, len; + char *niduuid = 0, *ptr = 0; + int i, rc = 0, len = 0; ENTRY; if (!lsi) @@ -1099,7 +1099,7 @@ out_mgc: } /* log has been fully processed */ - obd_notify(obd, NULL, OBD_NOTIFY_CONFIG, 0); + obd_notify(obd, NULL, OBD_NOTIFY_CONFIG, (void *)CONFIG_LOG); } RETURN(rc); diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 9a71dd027daac2048e0e168f6a5edabecaf53b17..cc0ed116056118c1a959741891f948ba614df833 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -294,8 +294,6 @@ run_test 5d "mount with ost down" test_5e() { start_ost start_mds - # give MDS a chance to connect to OSTs (bz 10476) - sleep 5 #define OBD_FAIL_PTLRPC_DELAY_SEND 0x506 do_facet client "sysctl -w lustre.fail_loc=0x80000506" @@ -768,26 +766,21 @@ test_22() { #reformat to remove all logs reformat start_mds - echo Client mount before any osts are in the logs + + echo Client mount with a running ost + start_ost mount_client $MOUNT - check_mount && return 41 + check_mount || return 41 + umount_client $MOUNT pass echo Client mount with ost in logs, but none running - start_ost stop_ost mount_client $MOUNT # check_mount will block trying to contact ost umount_client $MOUNT pass - echo Client mount with a running ost - start_ost - mount_client $MOUNT - sleep 5 #bz10476 - check_mount || return 41 - pass - cleanup } run_test 22 "start a client before osts (should return errs)" @@ -1081,15 +1074,6 @@ test_32a() { $LCTL conf_param lustre-MDT0000.failover.node=$NID || return 10 echo "ok." - # With a new good MDT failover nid, we should be able to mount a client - # (but it cant talk to OST) - local OLDMOUNTOPT=$MOUNTOPT - MOUNTOPT="exclude=lustre-OST0000" - mount_client $MOUNT - MOUNTOPT=$OLDMOUNTOPT - set_and_check "cat $LPROC/mdc/*/max_rpcs_in_flight" "lustre-MDT0000.mdc.max_rpcs_in_flight" || return 11 - - zconf_umount `hostname` $MOUNT -f cleanup_nocli # mount a second time to make sure we didnt leave upgrade flag on diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index f688bea383e19a9c89614d20be44833610fc7905..a55f51b144b41d9a704be6ad6a11c7f292cb629b 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2095,6 +2095,7 @@ test_51() { FNUM=$(($FNUM + 1)) echo -n "+" done + echo ls -l $DIR/d51 > /dev/null || error } run_test 51 "special situations: split htree with empty entry =="