Whamcloud - gitweb
LU-1095: debug: Clarify a IR message about support.
authorJames Simmons <uja.ornl@gmail.com>
Tue, 31 Jul 2012 19:36:07 +0000 (15:36 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 9 Aug 2012 20:23:21 +0000 (16:23 -0400)
During testing of Imperative Recovery we turned off IR but in the
logs we saw a IR:ON message which is confusing since we set it to
disable on the MGS. The IR:ON message is only to make aware that
IR functionality exist. A better message would be IR: [DIS|EN]ABLED.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I5990b26b326ce912faf6c5d556cb92334748322c
Reviewed-on: http://review.whamcloud.com/2853
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
lustre/mgc/mgc_request.c
lustre/obdclass/lprocfs_status.c
lustre/tests/recovery-small.sh

index bfeedc3..96ef54d 100644 (file)
@@ -418,7 +418,7 @@ int lprocfs_mgc_rd_ir_state(char *page, char **start, off_t off,
         ENTRY;
 
         rc = snprintf(page, count, "imperative_recovery: %s\n",
         ENTRY;
 
         rc = snprintf(page, count, "imperative_recovery: %s\n",
-                      OCD_HAS_FLAG(ocd, IMP_RECOV) ? "ON" : "OFF");
+                     OCD_HAS_FLAG(ocd, IMP_RECOV) ? "ENABLED" : "DISABLED");
         rc += snprintf(page + rc, count - rc, "client_state:\n");
 
         cfs_spin_lock(&config_list_lock);
         rc += snprintf(page + rc, count - rc, "client_state:\n");
 
         cfs_spin_lock(&config_list_lock);
index cf41921..0b4941f 100644 (file)
@@ -2426,11 +2426,13 @@ int lprocfs_obd_rd_recovery_status(char *page, char **start, off_t off,
                                          "last_transno: "LPD64"\n",
                                          obd->obd_next_recovery_transno - 1)<=0)
                         goto out;
                                          "last_transno: "LPD64"\n",
                                          obd->obd_next_recovery_transno - 1)<=0)
                         goto out;
-                if (lprocfs_obd_snprintf(&page, size, &len, "VBR: %s\n",
-                                         obd->obd_version_recov ? "ON" : "OFF")<=0)
+               if (lprocfs_obd_snprintf(&page, size, &len, "VBR: %s\n",
+                                        obd->obd_version_recov ?
+                                        "ENABLED" : "DISABLED") <=0)
                         goto out;
                         goto out;
-                if (lprocfs_obd_snprintf(&page, size, &len, "IR: %s\n",
-                                         obd->obd_no_ir ? "OFF" : "ON") <= 0)
+               if (lprocfs_obd_snprintf(&page, size, &len, "IR: %s\n",
+                                        obd->obd_no_ir ?
+                                        "DISABLED" : "ENABLED") <= 0)
                         goto out;
                 goto fclose;
         }
                         goto out;
                 goto fclose;
         }
index b4cf00a..0f379a7 100755 (executable)
@@ -1175,8 +1175,8 @@ check_cli_ir_state()
         local st
         st=$(do_node $NODE "lctl get_param mgc.*.ir_state |
                             awk '/imperative_recovery:/ { print \\\$2}'")
         local st
         st=$(do_node $NODE "lctl get_param mgc.*.ir_state |
                             awk '/imperative_recovery:/ { print \\\$2}'")
-        [ $st != ON -o $st != OFF ] ||
-                error "Error state $st, must be ON or OFF"
+       [ $st != ON -o $st != OFF -o $st != ENABLED -o $st != DISABLED ] ||
+               error "Error state $st, must be ENABLED or DISABLED"
         echo -n $st
 }
 
         echo -n $st
 }
 
@@ -1421,7 +1421,8 @@ test_104()
         clients_up
 
         local ir_state=$(check_target_ir_state ost1)
         clients_up
 
         local ir_state=$(check_target_ir_state ost1)
-        [ $ir_state = "OFF" ] || error "ir status on ost1 should be OFF"
+       [ $ir_state = "DISABLED" -o $ir_state = "OFF" ] ||
+               error "ir status on ost1 should be DISABLED"
 }
 run_test 104 "IR: ost can disable IR voluntarily"
 
 }
 run_test 104 "IR: ost can disable IR voluntarily"
 
@@ -1443,7 +1444,7 @@ test_105()
 
         # make sure lustre mount at $rcli disabling IR
         local ir_state=$(check_cli_ir_state $rcli)
 
         # make sure lustre mount at $rcli disabling IR
         local ir_state=$(check_cli_ir_state $rcli)
-        [ $ir_state = OFF ] || error "IR state must be OFF at $rcli"
+       [ $ir_state = DISABLED -o $ir_state = "OFF" ] || error "IR state must be DISABLED at $rcli"
 
        # Since the client just mounted, its last_rcvd entry is not on disk.
        # Send an RPC so exp_need_sync forces last_rcvd to commit this export
 
        # Since the client just mounted, its last_rcvd entry is not on disk.
        # Send an RPC so exp_need_sync forces last_rcvd to commit this export
@@ -1455,9 +1456,10 @@ test_105()
         [ $(get_ir_status) = "partial" ] || error "MGS IR state must be partial"
 
         fail ost1
         [ $(get_ir_status) = "partial" ] || error "MGS IR state must be partial"
 
         fail ost1
-        # make sure IR on ost1 is OFF
+       # make sure IR on ost1 is DISABLED
         local ir_state=$(check_target_ir_state ost1)
         local ir_state=$(check_target_ir_state ost1)
-        [ $ir_state = "OFF" ] || error "IR status on ost1 should be OFF"
+       [ $ir_state = "DISABLED" -o $ir_state = "OFF" ] ||
+               error "IR status on ost1 should be DISABLED"
 
         # restore it
         MOUNTOPT=$old_MOUNTOPT
 
         # restore it
         MOUNTOPT=$old_MOUNTOPT
@@ -1468,9 +1470,10 @@ test_105()
         [ $(get_ir_status) = "full" ] || error "MGS IR status must be full"
 
         fail ost1
         [ $(get_ir_status) = "full" ] || error "MGS IR status must be full"
 
         fail ost1
-        # make sure IR on ost1 is ON
+       # make sure IR on ost1 is ENABLED
         local ir_state=$(check_target_ir_state ost1)
         local ir_state=$(check_target_ir_state ost1)
-        [ $ir_state = "ON" ] || error "IR status on ost1 should be OFF"
+       [ $ir_state = "ENABLED" -o $ir_state = "ON" ] ||
+               error "IR status on ost1 should be ENABLED"
 
         return 0
 }
 
         return 0
 }