Skip to content
Snippets Groups Projects
Commit 3ddfc288 authored by deen's avatar deen
Browse files

Refactor start to encapsulate facet specific data.

b=12375
i=deen
i=grev
parent 1151b08a
No related branches found
No related tags found
No related merge requests found
...@@ -397,30 +397,41 @@ ostdevlabel() { ...@@ -397,30 +397,41 @@ ostdevlabel() {
} }
# Facet functions # Facet functions
mount_facet() {
local facet=$1
shift
local dev=${facet}_dev
local opt=${facet}_opt
echo "Starting ${facet}: ${!opt} $@ ${!dev} ${MOUNT%/*}/${facet}"
do_facet ${facet} mount -t lustre ${!opt} $@ ${!dev} ${MOUNT%/*}/${facet}
RC=${PIPESTATUS[0]}
if [ $RC -ne 0 ]; then
echo "mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}"
echo "Start of ${device} on ${facet} failed ${RC}"
else
do_facet ${facet} "sysctl -w lnet.debug=$PTLDEBUG; \
sysctl -w lnet.subsystem_debug=${SUBSYSTEM# }; \
sysctl -w lnet.debug_mb=${DEBUG_SIZE}; \
sync"
fi
return $RC
}
# start facet device options # start facet device options
start() { start() {
facet=$1 facet=$1
shift shift
device=$1 device=$1
shift shift
echo "Starting ${facet}: $@ ${device} ${MOUNT%/*}/${facet}" eval export ${facet}_dev=${device}
eval export ${facet}_opt=\"$@\"
do_facet ${facet} mkdir -p ${MOUNT%/*}/${facet} do_facet ${facet} mkdir -p ${MOUNT%/*}/${facet}
do_facet ${facet} mount -t lustre $@ ${device} ${MOUNT%/*}/${facet} mount_facet ${facet}
RC=${PIPESTATUS[0]} RC=$?
if [ $RC -ne 0 ]; then if [ $RC -eq 0 ]; then
echo mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}
echo Start of ${device} on ${facet} failed ${RC}
else
do_facet ${facet} "sysctl -w lnet.debug=$PTLDEBUG; \
sysctl -w lnet.subsystem_debug=${SUBSYSTEM# }; \
sysctl -w lnet.debug_mb=${DEBUG_SIZE}"
do_facet ${facet} sync
label=$(do_facet ${facet} "e2label ${device}") label=$(do_facet ${facet} "e2label ${device}")
[ -z "$label" ] && echo no label for ${device} && exit 1 [ -z "$label" ] && echo no label for ${device} && exit 1
eval export ${facet}_svc=${label} eval export ${facet}_svc=${label}
eval export ${facet}_dev=${device}
eval export ${facet}_opt=\"$@\"
echo Started ${label} echo Started ${label}
fi fi
return $RC return $RC
...@@ -628,9 +639,7 @@ facet_failover() { ...@@ -628,9 +639,7 @@ facet_failover() {
TO=`facet_active_host $facet` TO=`facet_active_host $facet`
echo "Failover $facet to $TO" echo "Failover $facet to $TO"
wait_for $facet wait_for $facet
local dev=${facet}_dev mount_facet $facet || error "Restart of $facet failed"
local opt=${facet}_opt
start $facet ${!dev} ${!opt} || error "Restart of $facet failed"
} }
obd_name() { obd_name() {
...@@ -683,11 +692,7 @@ fail_abort() { ...@@ -683,11 +692,7 @@ fail_abort() {
local facet=$1 local facet=$1
stop $facet stop $facet
change_active $facet change_active $facet
local svc=${facet}_svc mount_facet $facet -o abort_recovery
local dev=${facet}_dev
local opt=${facet}_opt
start $facet ${!dev} ${!opt}
do_facet $facet lctl --device %${!svc} abort_recovery
df $MOUNT || echo "first df failed: $?" df $MOUNT || echo "first df failed: $?"
sleep 1 sleep 1
df $MOUNT || error "post-failover df: $?" df $MOUNT || error "post-failover df: $?"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment