Skip to content

Commit

Permalink
Fix bugs with phys_rep_perf testcase
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Hannum <[email protected]>
  • Loading branch information
markhannum committed Dec 14, 2024
1 parent b10d094 commit fb68aa7
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions tests/phys_rep_perf.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ function cleanup_internal()

if [[ -n "$CLUSTER" ]]; then
for node in $CLUSTER; do
pid=$(ssh $node "cat ${METADIR}/${META_DBNAME}.pid" < /dev/null)
ssh $node "kill -$sig $$pid" < /dev/null
pid=$(ssh -o StrictHostKeyChecking=no $node "cat ${METADIR}/${META_DBNAME}.pid" < /dev/null)
ssh -o StrictHostKeyChecking=no $node "kill -$sig $$pid" < /dev/null
done

pid=$(ssh $FIRSTNODE "cat ${DBDIR}/${PHYSREP}/${PHYSREP}.pid" < /dev/null)
ssh $FIRSTNODE "kill -$sig $$pid" < /dev/null
pid=$(ssh -o StrictHostKeyChecking=no $FIRSTNODE "cat ${DBDIR}/${PHYSREP}/${PHYSREP}.pid" < /dev/null)
ssh -o StrictHostKeyChecking=no $FIRSTNODE "kill -$sig $$pid" < /dev/null
else
node=$(hostname)
kill -$sig $(cat ${METADIR}/${META_DBNAME}.pid)
Expand Down Expand Up @@ -255,8 +255,8 @@ function fix_lrl_and_restart_source_nodes

else
for node in $CLUSTER; do
ssh ${node} "echo physrep_metadb ${META_DBNAME} $FIRSTNODE >> ${DBDIR}/${DBNAME}.lrl" < /dev/null
ssh ${node} "echo physrep_debug 1 >> ${DBDIR}/${DBNAME}.lrl" < /dev/null
ssh -o StrictHostKeyChecking=no ${node} "echo physrep_metadb ${META_DBNAME} $FIRSTNODE >> ${DBDIR}/${DBNAME}.lrl" < /dev/null
ssh -o StrictHostKeyChecking=no ${node} "echo physrep_debug 1 >> ${DBDIR}/${DBNAME}.lrl" < /dev/null
echo "physrep_metadb ${META_DBNAME} $FIRSTNODE" >> ${DBDIR}/${DBNAME}.lrl
echo "physrep_debug 1" >> ${DBDIR}/${DBNAME}.lrl
kill_restart_node $node 10 &
Expand Down Expand Up @@ -309,7 +309,7 @@ END
FIRSTNODE=""
for node in $CLUSTER; do
logfile=$TESTDIR/logs/${META_DBNAME}.${node}.log
ssh ${node} "mkdir -p $METADIR" < /dev/null
ssh -o StrictHostKeyChecking=no ${node} "mkdir -p $METADIR" < /dev/null

if [[ -z "$FIRSTNODE" ]]; then
FIRSTNODE=$node
Expand All @@ -331,18 +331,19 @@ physrep_update_registry_interval 1
physrep_keepalive_v2 1
END
scp $METADIR/${META_DBNAME}.lrl ${node}:$METADIR/${META_DBNAME}.lrl
ssh ${node} "$COMDB2_EXE ${META_DBNAME} --create --lrl ${METADIR}/${META_DBNAME}.lrl --pidfile ${METADIR}/${META_DBNAME}.pid >> $logfile 2>&1" < /dev/null
ssh -o StrictHostKeyChecking=no ${node} "$COMDB2_EXE ${META_DBNAME} --create --lrl ${METADIR}/${META_DBNAME}.lrl --pidfile ${METADIR}/${META_DBNAME}.pid >> $logfile 2>&1" < /dev/null
else
ssh $node "${COPYCOMDB2_EXE} -x ${COMDB2_EXE} $FIRSTNODE:${METADIR}/${META_DBNAME}.lrl $METADIR/" >> $logfile 2>&1 < /dev/null
ssh -o StrictHostKeyChecking=no $node "export comdb2ar=${COMDB2AR_EXE} ; ${COPYCOMDB2_EXE} -x ${COMDB2_EXE} $FIRSTNODE:${METADIR}/${META_DBNAME}.lrl $METADIR $METADIR" >> $logfile 2>&1 < /dev/null
if [[ ! $? -eq 0 ]]; then
cat $logfile
cleanfailexit "copycomdb2 failed for $node"
fi
fi
done

for node in $CLUSTER; do
logfile=$TESTDIR/logs/${META_DBNAME}.${node}.log
ssh ${node} "$COMDB2_EXE ${META_DBNAME} --lrl ${METADIR}/${META_DBNAME}.lrl --pidfile ${METADIR}/${META_DBNAME}.pid" >> $logfile 2>&1 < /dev/null &
ssh -o StrictHostKeyChecking=no ${node} "$COMDB2_EXE ${META_DBNAME} --lrl ${METADIR}/${META_DBNAME}.lrl --pidfile ${METADIR}/${META_DBNAME}.pid" >> $logfile 2>&1 < /dev/null &
PIDLIST="${PIDLIST} $!"
done

Expand Down Expand Up @@ -379,12 +380,12 @@ function setup_standalone_physrep()
else
node=$FIRSTNODE
logfile=$TESTDIR/logs/${PHYSREP}.$FIRSTNODE.log
ssh ${node} "${COPYCOMDB2_EXE} -x ${COMDB2_EXE} -H ${PHYSREP} -y @${FIRSTNODE} ${FIRSTNODE}:${DBDIR}/${DBNAME}.lrl $PHYSDIR $PHYSDIR" >> $logfile 2>&1 < /dev/null
ssh -o StrictHostKeyChecking=no ${node} "export comdb2ar=${COMDB2AR_EXE} ; ${COPYCOMDB2_EXE} -x ${COMDB2_EXE} -H ${PHYSREP} -y @${FIRSTNODE} ${FIRSTNODE}:${DBDIR}/${DBNAME}.lrl $PHYSDIR $PHYSDIR" >> $logfile 2>&1 < /dev/null
if [[ $? -ne 0 ]]; then
cleanfailexit "failed creating physrep for $node"
fi

ssh ${node} "$COMDB2_EXE ${PHYSREP} --lrl $PHYSDIR/${PHYSREP}.lrl --pidfile $PHYSDIR/${PHYSREP}.pid" >> $logfile 2>&1 < /dev/null &
ssh -o StrictHostKeyChecking=no ${node} "$COMDB2_EXE ${PHYSREP} --lrl $PHYSDIR/${PHYSREP}.lrl --pidfile $PHYSDIR/${PHYSREP}.pid" >> $logfile 2>&1 < /dev/null &
PIDLIST="${PIDLIST} $!"
out=""
while [[ "$out" != "1" ]]; do
Expand Down

0 comments on commit fb68aa7

Please sign in to comment.