Whamcloud - gitweb
LU-1014 mountconf: MGS update timeout upon config update
authorJames Simmons <uja.ornl@gmail.com>
Mon, 30 Jul 2012 12:03:44 +0000 (08:03 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 24 Aug 2012 14:53:12 +0000 (10:53 -0400)
MGS should update obd/ldlm_timeout upon MDS/OST config update. It
will be the largest value of all servers.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: Ia0786475fa5608e06f8c2606f87f98192a870df5
Reviewed-on: http://review.whamcloud.com/2881
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd_support.h
lustre/mgs/mgs_llog.c
lustre/obdclass/class_obd.c
lustre/obdclass/obd_config.c

index bcaa60d..9649e49 100644 (file)
@@ -66,6 +66,8 @@ extern unsigned int obd_dump_on_eviction;
    networking / disk / timings affected by load (use Adaptive Timeouts) */
 extern unsigned int obd_timeout;          /* seconds */
 extern unsigned int ldlm_timeout;         /* seconds */
+extern unsigned int obd_timeout_set;
+extern unsigned int ldlm_timeout_set;
 extern unsigned int at_min;
 extern unsigned int at_max;
 extern unsigned int at_history;
index a710617..00518d2 100644 (file)
@@ -2045,6 +2045,20 @@ static int mgs_write_log_sys(struct obd_device *obd, struct fs_db *fsdb,
        rc = mgs_write_log_direct_all(obd, fsdb, mti,
                                *tmp == '\0' ? NULL : lcfg,
                                mti->mti_fsname, sys);
+       if (rc == 0 && *tmp != '\0') {
+               switch (cmd) {
+               case LCFG_SET_TIMEOUT:
+                       if (!obd_timeout_set || lcfg->lcfg_num > obd_timeout)
+                               class_process_config(lcfg);
+                       break;
+               case LCFG_SET_LDLM_TIMEOUT:
+                       if (!ldlm_timeout_set || lcfg->lcfg_num > ldlm_timeout)
+                               class_process_config(lcfg);
+                       break;
+               default:
+                       break;
+               }
+       }
        *ptr = sep;
        lustre_cfg_free(lcfg);
        return rc;
index 6689678..01996a0 100644 (file)
@@ -82,6 +82,10 @@ unsigned int obd_timeout = OBD_TIMEOUT_DEFAULT;   /* seconds */
 EXPORT_SYMBOL(obd_timeout);
 unsigned int ldlm_timeout = LDLM_TIMEOUT_DEFAULT; /* seconds */
 EXPORT_SYMBOL(ldlm_timeout);
+unsigned int obd_timeout_set;
+EXPORT_SYMBOL(obd_timeout_set);
+unsigned int ldlm_timeout_set;
+EXPORT_SYMBOL(ldlm_timeout_set);
 /* Adaptive timeout defs here instead of ptlrpc module for /proc/sys/ access */
 unsigned int at_min = 0;
 EXPORT_SYMBOL(at_min);
index f67bc3a..e7222da 100644 (file)
@@ -1054,6 +1054,7 @@ int class_process_config(struct lustre_cfg *lcfg)
                 CDEBUG(D_IOCTL, "changing lustre timeout from %d to %d\n",
                        obd_timeout, lcfg->lcfg_num);
                 obd_timeout = max(lcfg->lcfg_num, 1U);
+               obd_timeout_set = 1;
                 GOTO(out, err = 0);
         }
         case LCFG_SET_LDLM_TIMEOUT: {
@@ -1062,7 +1063,7 @@ int class_process_config(struct lustre_cfg *lcfg)
                 ldlm_timeout = max(lcfg->lcfg_num, 1U);
                 if (ldlm_timeout >= obd_timeout)
                         ldlm_timeout = max(obd_timeout / 3, 1U);
-
+               ldlm_timeout_set = 1;
                 GOTO(out, err = 0);
         }
         case LCFG_SET_UPCALL: {