Whamcloud - gitweb
LU-4065 tests: hsm copytool_cleanup improvement 83/12783/5
authorSergey Cheremencev <sergey.cheremencev@seagate.com>
Sun, 16 Nov 2014 12:01:35 +0000 (16:01 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 2 Oct 2015 04:14:38 +0000 (04:14 +0000)
hsm shutdown from copytool_cleanup could race with
cdt_set_mount_state enabled. Because set_param -P
doesn't wait when configuration "params" will be
retrieved and applied from server.

Xyratex-bug-id: MRP-2037
Change-Id: I2f274c933986439deae04cd252b4dd9c8442ef1f
Signed-off-by: Sergey Cheremencev <sergey.cheremencev@seagate.com>
Reviewed-on: http://review.whamcloud.com/12783
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity-hsm.sh

index 172170d..721cb2c 100755 (executable)
@@ -484,6 +484,13 @@ cdt_clear_mount_state() {
 
 cdt_set_mount_state() {
        mdts_set_param "-P" hsm_control "$1"
 
 cdt_set_mount_state() {
        mdts_set_param "-P" hsm_control "$1"
+       # set_param -P is asynchronous operation and could race with set_param.
+       # In such case configs could be retrieved and applied at mgc after
+       # set_param -P completion. Sleep here to avoid race with set_param.
+       # We need at least 20 seconds. 10 for mgc_requeue_thread to wake up
+       # MGC_TIMEOUT_MIN_SECONDS + MGC_TIMEOUT_RAND_CENTISEC(5 + 5)
+       # and 10 seconds to retrieve config from server.
+       sleep 20
 }
 
 cdt_check_state() {
 }
 
 cdt_check_state() {