Skip to content

Commit cd13b8f

Browse files
committed
PSTRESS-162: pstress-run - Introduce RR_MODE=2 to store rr data inside pstress step directory
1 parent 9f1c0ea commit cd13b8f

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

pstress/pstress-run-80.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,5 +215,6 @@ GR_CLUSTER_CONFIG=${SCRIPT_PWD}/pstress-cluster-run.cfg
215215
################################################################################
216216
# To record and replay crashes, run pstress in RR mode #
217217
# To enable set RR_MODE=1 #
218+
# Use RR_MODE=2 to enable rr and store rr data inside pstress step directory #
218219
################################################################################
219220
RR_MODE=0

pstress/pstress-run-PXC80.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,5 +248,6 @@ PXC_WSREP_PROVIDER_MAX_NR_OF_RND_OPTS_TO_ADD=2
248248
################################################################################
249249
# To record and replay crashes, run pstress in RR mode #
250250
# To enable set RR_MODE=1 #
251+
# Use RR_MODE=2 to enable rr and store rr data inside pstress step directory #
251252
################################################################################
252253
RR_MODE=0

pstress/pstress-run-rocksdb.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,5 +156,7 @@ MYEXTRA=
156156
################################################################################
157157
# To record and replay crashes, run pstress in RR mode #
158158
# To enable set RR_MODE=1 #
159+
# Use RR_MODE=2 to enable rr and store rr data inside pstress step directory #
159160
################################################################################
161+
160162
RR_MODE=0

pstress/pstress-run.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ EOF
481481
}
482482

483483
# Incase, user starts pstress in RR mode, check if RR is installed on the machine
484-
if [ $RR_MODE -eq 1 ]; then
484+
if [ $RR_MODE -ge 1 ]; then
485485
echoit "Running pstress in RR mode. It is expected that pstress executions will be slower"
486486
if [[ ! -e `which rr` ]];then
487487
echo "rr package is not installed. Exiting"
@@ -814,23 +814,23 @@ pxc_startup(){
814814
sed -i "2i wsrep_cluster_address=gcomm://${PXC_LADDRS[1]},${PXC_LADDRS[2]},${PXC_LADDRS[3]}" ${DATADIR}/n3.cnf
815815

816816
get_error_socket_file 1
817-
if [ $RR_MODE -eq 1 ]; then
817+
if [ $RR_MODE -ge 1 ]; then
818818
rr ${MYSQLD_BIN} --defaults-file=${DATADIR}/n1.cnf $STARTUP_OPTION $MYEXTRA $PXC_MYEXTRA --wsrep-new-cluster > ${ERR_FILE} 2>&1 &
819819
elif [ $RR_MODE -eq 0 ]; then
820820
${MYSQLD_BIN} --defaults-file=${DATADIR}/n1.cnf $STARTUP_OPTION $MYEXTRA $PXC_MYEXTRA --wsrep-new-cluster > ${ERR_FILE} 2>&1 &
821821
fi
822822
pxc_startup_status 1
823823

824824
get_error_socket_file 2
825-
if [ $RR_MODE -eq 1 ]; then
825+
if [ $RR_MODE -ge 1 ]; then
826826
rr ${MYSQLD_BIN} --defaults-file=${DATADIR}/n2.cnf $STARTUP_OPTION $MYEXTRA $PXC_MYEXTRA > ${ERR_FILE} 2>&1 &
827827
elif [ $RR_MODE -eq 0 ]; then
828828
${MYSQLD_BIN} --defaults-file=${DATADIR}/n2.cnf $STARTUP_OPTION $MYEXTRA $PXC_MYEXTRA > ${ERR_FILE} 2>&1 &
829829
fi
830830
pxc_startup_status 2
831831

832832
get_error_socket_file 3
833-
if [ $RR_MODE -eq 1 ]; then
833+
if [ $RR_MODE -ge 1 ]; then
834834
rr ${MYSQLD_BIN} --defaults-file=${DATADIR}/n3.cnf $STARTUP_OPTION $MYEXTRA $PXC_MYEXTRA > ${ERR_FILE} 2>&1 &
835835
elif [ $RR_MODE -eq 0 ]; then
836836
${MYSQLD_BIN} --defaults-file=${DATADIR}/n3.cnf $STARTUP_OPTION $MYEXTRA $PXC_MYEXTRA > ${ERR_FILE} 2>&1 &
@@ -1267,8 +1267,14 @@ pstress_test(){
12671267
--log-output=none --log-error-verbosity=3 --log-error=${RUNDIR}/${TRIAL}/log/master.err"
12681268
fi
12691269

1270-
if [ $RR_MODE -eq 1 ]; then
1271-
CMD="${INLINE_ENV_VARS} rr $CMD"
1270+
if [ $RR_MODE -ge 1 ]; then
1271+
if [ $RR_MODE -eq 2 ]; then
1272+
RR_TRACE_DIR=${RUNDIR}/${TRIAL}/rr_data
1273+
mkdir -p ${RR_TRACE_DIR}
1274+
CMD="env ${INLINE_ENV_VARS} _RR_TRACE_DIR=${RR_TRACE_DIR} rr $CMD"
1275+
else
1276+
CMD="${INLINE_ENV_VARS} rr $CMD"
1277+
fi
12721278
else
12731279
CMD="${INLINE_ENV_VARS} $CMD"
12741280
fi

0 commit comments

Comments
 (0)