Whamcloud - gitweb
- fast fix of mountconf bug when mds is set up before osc are added.
authortappro <tappro>
Sat, 7 Oct 2006 22:08:21 +0000 (22:08 +0000)
committertappro <tappro>
Sat, 7 Oct 2006 22:08:21 +0000 (22:08 +0000)
  This issues the race between recovery can start but not all osc are added yet.
  Fix adds obd_configured flag to track when config llog parsing is finished and MDS is really  set up and ready for recovery.

lustre/include/obd.h
lustre/ldlm/ldlm_lib.c
lustre/mds/mds_lov.c
lustre/obdclass/obd_config.c

index f52abc2..072e819 100644 (file)
@@ -878,7 +878,8 @@ struct obd_device {
                      obd_starting:1,      /* started setup */
                      obd_force:1,         /* cleanup with > 0 obd refcount */
                      obd_fail:1,          /* cleanup with failover */
-                     obd_async_recov:1;   /* allow asyncronous orphan cleanup */
+                     obd_async_recov:1,   /* allow asyncronous orphan cleanup */
+                     obd_configured:1;    /* config llog parsed completely */
         atomic_t obd_refcount;
         cfs_waitq_t             obd_refcount_waitq;
         cfs_proc_dir_entry_t   *obd_proc_entry;
index 8400b01..74911f3 100644 (file)
@@ -720,7 +720,7 @@ int target_handle_connect(struct ptlrpc_request *req)
 
         if (target->obd_recovering) {
                 lustre_msg_add_op_flags(req->rq_repmsg, MSG_CONNECT_RECOVERING);
-                target_start_recovery_timer(target/*, handler*/);
+                target_start_recovery_timer(target);
         }
 
         /* Tell the client if we support replayable requests */
@@ -1309,7 +1309,8 @@ static int check_for_clients(struct obd_device *obd)
         if (obd->obd_abort_recovery)
                 return 1;
         LASSERT(obd->obd_connected_clients <= obd->obd_max_recoverable_clients);
-        if (obd->obd_connected_clients == obd->obd_max_recoverable_clients)
+        if (obd->obd_configured &&
+            obd->obd_connected_clients == obd->obd_max_recoverable_clients)
                 return 1;
         return 0;
 }
index 3d66ec8..e965887 100644 (file)
@@ -237,6 +237,12 @@ static int mds_lov_update_desc(struct obd_device *obd, struct obd_export *lov)
         CDEBUG(D_CONFIG, "updated max_mdsize/max_cookiesize: %d/%d\n",
                mds->mds_max_mdsize, mds->mds_max_cookiesize);
 
+        /*XXX this notifies the MDD until lov handling use old mds code */
+        if (obd->obd_upcall.onu_owner) {
+                 LASSERT(obd->obd_upcall.onu_upcall != NULL);
+                 rc = obd->obd_upcall.onu_upcall(NULL, NULL, 0,
+                                                 obd->obd_upcall.onu_owner);
+        }
 out:
         OBD_FREE(ld, sizeof(*ld));
         RETURN(rc);
index 397ee21..681847d 100644 (file)
@@ -1057,6 +1057,23 @@ out:
         RETURN(rc);
 }
 
+void class_config_notify_end(const char *name)
+{
+        ENTRY;
+        struct obd_device *obd;
+
+        /*XXX: This is fast fix to mountconf issue when osc are set up
+         * while recovery is in progress already.
+         * The MDS should wait the end of config llog parsing before starting
+         * recovery. This is done via obd_configured flag for now
+         */
+        obd = class_name2obd(name);
+        if (obd) {
+                obd->obd_configured = 1;
+        }
+        EXIT;
+}
+
 int class_config_parse_llog(struct llog_ctxt *ctxt, char *name,
                             struct config_llog_instance *cfg)
 {
@@ -1081,6 +1098,8 @@ int class_config_parse_llog(struct llog_ctxt *ctxt, char *name,
 
         rc = llog_process(llh, class_config_llog_handler, cfg, &cd);
 
+        class_config_notify_end(name);
+
         CDEBUG(D_CONFIG, "Processed log %s gen %d-%d (rc=%d)\n", name, 
                cd.first_idx + 1, cd.last_idx, rc);
         if (cfg)