Set USE_OFD=yes by default in order to start testing the ofd module in
preference to the obdfilter module. Force LOAD_MODULES_REMOTE to be
set to avoid obdfilter being loaded by modprobe remotely on mount.
There was a bug in comma_list() appending a space to the list of
nodes, which caused do_rpc_nodes() to be unhappy when a nearly-empty
list of nodes was being passed by callers. Rework this function, and
clean up other callers to just pass the nodes and let do_rpc_nodes()
detect this case and skip any remote execution.
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I896c9c9b7216c418b635e893202810333d8ef871
Reviewed-on: http://review.whamcloud.com/4171
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
# LOAD_MODULES_REMOTE is true or b) modprobe(8) is configured to
# blacklist the undesired (and aliased the other, if necessary).
#
# LOAD_MODULES_REMOTE is true or b) modprobe(8) is configured to
# blacklist the undesired (and aliased the other, if necessary).
#
-USE_OFD=${USE_OFD:-no}
-LOAD_MODULES_REMOTE=${LOAD_MODULES_REMOTE:-false}
+USE_OFD=${USE_OFD:-yes}
+LOAD_MODULES_REMOTE=${LOAD_MODULES_REMOTE:-true}
STRIPE_BYTES=${STRIPE_BYTES:-1048576}
STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0}
STRIPE_BYTES=${STRIPE_BYTES:-1048576}
STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0}
IDENTITY_UPCALL=false
;;
esac
IDENTITY_UPCALL=false
;;
esac
+ USE_OFD=${USE_OFD:-yes}
+ [ "$USE_OFD" = "yes" ] && LOAD_MODULES_REMOTE=true
+
export LOAD_MODULES_REMOTE=${LOAD_MODULES_REMOTE:-false}
# Paths on remote nodes, if different
export LOAD_MODULES_REMOTE=${LOAD_MODULES_REMOTE:-false}
# Paths on remote nodes, if different
# bug 19124
# load modules on remote nodes optionally
# lustre-tests have to be installed on these nodes
# bug 19124
# load modules on remote nodes optionally
# lustre-tests have to be installed on these nodes
- if $LOAD_MODULES_REMOTE ; then
+ if $LOAD_MODULES_REMOTE; then
local list=$(comma_list $(remote_nodes_list))
local list=$(comma_list $(remote_nodes_list))
- echo loading modules on $list
- do_rpc_nodes $list load_modules_local
+ if [ -n "$list" ]; then
+ echo "loading modules on: '$list'"
+ do_rpc_nodes "$list" load_modules_local
+ fi
$LUSTRE_RMMOD ldiskfs || return 2
$LUSTRE_RMMOD ldiskfs || return 2
- if $LOAD_MODULES_REMOTE ; then
+ if $LOAD_MODULES_REMOTE; then
local list=$(comma_list $(remote_nodes_list))
local list=$(comma_list $(remote_nodes_list))
- if [ ! -z $list ]; then
- echo unloading modules on $list
- do_rpc_nodes $list $LUSTRE_RMMOD ldiskfs
- do_rpc_nodes $list check_mem_leak
+ if [ -n "$list" ]; then
+ echo "unloading modules on: '$list'"
+ do_rpc_nodes "$list" $LUSTRE_RMMOD ldiskfs
+ do_rpc_nodes "$list" check_mem_leak
}
set_default_debug_nodes () {
}
set_default_debug_nodes () {
- if [[ ,$nodes, = *,$HOSTNAME,* ]]; then
- nodes=$(exclude_items_from_list "$nodes" "$HOSTNAME")
- set_default_debug
- fi
+ if [[ ,$nodes, = *,$HOSTNAME,* ]]; then
+ nodes=$(exclude_items_from_list "$nodes" "$HOSTNAME")
+ set_default_debug
+ fi
- [[ -n $nodes ]] && do_rpc_nodes $nodes set_default_debug \
- \\\"$PTLDEBUG\\\" \\\"$SUBSYSTEM\\\" $DEBUG_SIZE || true
+ do_rpc_nodes "$nodes" set_default_debug \
+ \\\"$PTLDEBUG\\\" \\\"$SUBSYSTEM\\\" $DEBUG_SIZE || true
}
set_default_debug_facet () {
}
set_default_debug_facet () {
}
check_progs_installed () {
}
check_progs_installed () {
- do_rpc_nodes $nodes _check_progs_installed $@
+ do_rpc_nodes "$nodes" _check_progs_installed $@
}
# recovery-scale functions
}
# recovery-scale functions
fi
echo affected facets: $facets
fi
echo affected facets: $facets
- # we can use "for" here because we are waiting the slowest
- for facet in ${facets//,/ }; do
- local var_svc=${facet}_svc
- local param="*.${!var_svc}.recovery_status"
+ # we can use "for" here because we are waiting the slowest
+ for facet in ${facets//,/ }; do
+ local var_svc=${facet}_svc
+ local param="*.${!var_svc}.recovery_status"
- local host=$(facet_active_host $facet)
- do_rpc_nodes $host _wait_recovery_complete $param $MAX
- done
+ local host=$(facet_active_host $facet)
+ do_rpc_nodes "$host" _wait_recovery_complete $param $MAX
+ done
}
check_config_clients () {
}
check_config_clients () {
- local clients=${CLIENTS:-$HOSTNAME}
- local mntpt=$1
+ local clients=${CLIENTS:-$HOSTNAME}
+ local mntpt=$1
- nfs_client_mode && return
+ nfs_client_mode && return
- do_rpc_nodes $clients check_config_client $mntpt
+ do_rpc_nodes "$clients" check_config_client $mntpt
- sanity_mount_check ||
- error "environments are insane!"
+ sanity_mount_check || error "environments are insane!"
# verify a directory is shared among nodes.
check_shared_dir() {
# verify a directory is shared among nodes.
check_shared_dir() {
- [ -z "$dir" ] && return 1
- do_rpc_nodes $(comma_list $(nodes_list)) check_logdir $dir
- check_write_access $dir || return 1
- return 0
+ [ -z "$dir" ] && return 1
+ do_rpc_nodes "$(comma_list $(nodes_list))" check_logdir $dir
+ check_write_access $dir || return 1
+ return 0
}
# Run e2fsck on MDT and OST(s) to generate databases used for lfsck.
}
# Run e2fsck on MDT and OST(s) to generate databases used for lfsck.
+# Convert a space-delimited list to a comma-delimited list. If the input is
+# only whitespace, ensure the output is empty (i.e. "") so [ -n $list ] works
- # the sed converts spaces to commas, but leaves the last space
- # alone, so the line doesn't end with a comma.
- echo "$*" | tr -s " " "\n" | sort -b -u | tr "\n" " " | sed 's/ \([^$]\)/,\1/g'
+ # echo is used to convert newlines to spaces, since it doesn't
+ # introduce a trailing space as using "tr '\n' ' '" does
+ echo $(tr -s " " "\n" <<< $* | sort -b -u) | tr ' ' ','
- local rnodes=$(nodes_list)
- rnodes=$(echo " $rnodes " | sed -re "s/\s+$HOSTNAME\s+/ /g")
- echo $rnodes
+ echo $(nodes_list) | sed -re "s/\<$HOSTNAME\>//g"
}
init_clients_lists () {
}
init_clients_lists () {
- local rnodes=${1:-$(comma_list $(remote_nodes_list))}
- local C=$CATASTROPHE
- [ -f $C ] && [ $(cat $C) -ne 0 ] && return 1
+ local rnodes=${1:-$(comma_list $(remote_nodes_list))}
+ local C=$CATASTROPHE
+ [ -f $C ] && [ $(cat $C) -ne 0 ] && return 1
+
+ [ -z "$rnodes" ] && return 0
- if [ $rnodes ]; then
- do_nodes $rnodes "rc=\\\$([ -f $C ] && echo \\\$(< $C) || echo 0);
-if [ \\\$rc -ne 0 ]; then echo \\\$(hostname): \\\$rc; fi
-exit \\\$rc;"
- fi
+ do_nodes "$rnodes" "rc=\\\$([ -f $C ] && echo \\\$(< $C) || echo 0);
+ if [ \\\$rc -ne 0 ]; then echo \\\$(hostname): \\\$rc; fi
+ exit \\\$rc;"
}
# CMD: determine mds index where directory inode presents
}
# CMD: determine mds index where directory inode presents
# 2. wait the deadline of client 2nd request
local maxtime=$(( 2 * $(request_timeout $facet)))
# 2. wait the deadline of client 2nd request
local maxtime=$(( 2 * $(request_timeout $facet)))
- if ! do_rpc_nodes $(facet_host $facet) \
- _wait_import_state $expected $param $maxtime; then
- error "import is not in ${expected} state"
- return 1
- fi
+ if ! do_rpc_nodes "$(facet_host $facet)" \
+ _wait_import_state $expected $param $maxtime; then
+ error "import is not in ${expected} state"
+ return 1
+ fi
}
get_clientmdc_proc_path() {
}
get_clientmdc_proc_path() {
+ local list=$1
+ shift
+
+ [ -z "$list" ] && return 0
- # Add paths to lustre tests for 32 and 64 bit systems.
- local RPATH="PATH=$RLUSTRE/tests:/usr/lib/lustre/tests:/usr/lib64/lustre/tests:$PATH"
- do_nodesv $list "${RPATH} NAME=${NAME} sh rpc.sh $@ "
+ # Add paths to lustre tests for 32 and 64 bit systems.
+ local RPATH="PATH=$RLUSTRE/tests:/usr/lib/lustre/tests:/usr/lib64/lustre/tests:$PATH"
+ do_nodesv $list "${RPATH} NAME=${NAME} sh rpc.sh $@ "
}
wait_clients_import_state () {
}
wait_clients_import_state () {
local params=$(expand_list $params $proc_path)
done
local params=$(expand_list $params $proc_path)
done
- if ! do_rpc_nodes $list wait_import_state $expected $params; then
- error "import is not in ${expected} state"
- return 1
- fi
+ if ! do_rpc_nodes "$list" wait_import_state $expected $params; then
+ error "import is not in ${expected} state"
+ return 1
+ fi