start_ost() {
echo "start ost1 service on `facet_active_host ost1`"
start ost1 $(ostdevname 1) $OST_MOUNT_OPTS "$@" || return 95
- wait_clients_import_state ${CLIENTS:-$HOSTNAME} ost1 FULL
+ wait_clients_import_ready ${CLIENTS:-$HOSTNAME} ost1
}
stop_ost() {
start_ost2() {
echo "start ost2 service on `facet_active_host ost2`"
start ost2 $(ostdevname 2) $OST_MOUNT_OPTS "$@" || return 92
- wait_clients_import_state ${CLIENTS:-$HOSTNAME} ost2 FULL
+ wait_clients_import_ready ${CLIENTS:-$HOSTNAME} ost2
}
stop_ost2() {
sleep 25
start_ost
- wait_osc_import_state client ost1 FULL
+ wait_osc_import_ready client ost1
touch $dir/$tfile || error "Can't create file"
cleanup
mount_client $MOUNT || error "mount client failed"
wait_osc_import_state mds1 ost1 FULL
- wait_osc_import_state client ost1 FULL
- wait_osc_import_state client ost2 FULL
+ wait_osc_import_ready client ost1
+ wait_osc_import_ready client ost2
$LFS setstripe -i 0 $DIR/$tfile.0 ||
error "problem creating $tfile.0 on OST0000"
exit 7
fi
- local want="FULL\|IDLE"
- log "Checking clients are in $want state before next failover"
- wait_clients_import_state $NODES_TO_USE $serverfacet "$want" ||
- echo "Client import not $want, please consider to" \
+ log "Checking clients are in FULL or IDLE state before next failover"
+ wait_clients_import_ready $NODES_TO_USE $serverfacet ||
+ echo "Client import is not ready, please consider to" \
"increase SERVER_FAILOVER_PERIOD=" \
"$SERVER_FAILOVER_PERIOD!"
export SK_NO_KEY=$SK_NO_KEY_save
# to initiate all OSC idling connections
clients_up
- wait_clients_import_state "$clients" "$facets" "\(FULL\|IDLE\)"
+ wait_clients_import_ready "$clients" "$facets"
clients_up || error "post-failover stat: $?"
}
fi
}
+wait_clients_import_ready() {
+ wait_clients_import_state "$1" "$2" "\(FULL\|IDLE\)"
+}
+
wait_osp_active() {
local facet=$1
local tgt_name=$2