Galera startup crash fix, temporal removal of revert snapshot (Galera does not survive revert)

and add cores saving from tests themselves.
This commit is contained in:
Timofey Turenko 2017-12-21 17:20:41 +02:00
parent 4fd8ebd9eb
commit 5c7845c381
12 changed files with 58 additions and 33 deletions

View File

@ -30,5 +30,13 @@ DROP USER 'maxskysql'@'localhost';
CREATE USER 'maxskysql'@'localhost' IDENTIFIED BY 'skysql';
GRANT ALL ON *.* TO 'maxskysql'@'localhost' WITH GRANT OPTION;
DROP USER 'maxuser'@'%';
CREATE USER 'maxuser'@'%' IDENTIFIED BY 'maxpwd';
GRANT ALL ON *.* TO 'maxuser'@'%' WITH GRANT OPTION;
DROP USER 'maxuser'@'localhost';
CREATE USER 'maxuser'@'localhost' IDENTIFIED BY 'maxpwd';
GRANT ALL ON *.* TO 'maxuser'@'localhost' WITH GRANT OPTION;
RESET MASTER;
EOF

View File

@ -23,6 +23,10 @@ DROP USER 'maxskysql'@'%';
CREATE USER 'maxskysql'@'%' IDENTIFIED BY 'skysql';
GRANT ALL PRIVILEGES ON *.* TO 'maxskysql'@'%' WITH GRANT OPTION;
DROP USER 'maxskysql'@'localhost';
CREATE USER 'maxskysql'@'localhost' IDENTIFIED BY 'skysql';
GRANT ALL ON *.* TO 'maxskysql'@'localhost' WITH GRANT OPTION;
DROP USER 'repl'@'%';
CREATE USER 'repl'@'%' IDENTIFIED BY 'repl';
GRANT ALL PRIVILEGES ON *.* TO 'repl'@'%' WITH GRANT OPTION;
@ -35,6 +39,16 @@ DROP USER 'skysql'@'localhost';
CREATE USER 'skysql'@'localhost' IDENTIFIED BY 'skysql';
GRANT ALL PRIVILEGES ON *.* TO 'skysql'@'localhost' WITH GRANT OPTION;
DROP USER 'maxuser'@'%';
CREATE USER 'maxuser'@'%' IDENTIFIED BY 'maxpwd';
GRANT ALL ON *.* TO 'maxuser'@'%' WITH GRANT OPTION;
DROP USER 'maxuser'@'localhost';
CREATE USER 'maxuser'@'localhost' IDENTIFIED BY 'maxpwd';
GRANT ALL ON *.* TO 'maxuser'@'localhost' WITH GRANT OPTION;
DROP DATABASE IF EXISTS test;
CREATE DATABASE test;
EOF

View File

@ -5,3 +5,4 @@ echo "grant all privileges on *.* to '$node_user'@'%' identified by '$node_pass
echo "grant all privileges on *.* to '$node_user'@'%' identified by '$node_password' require ssl WITH GRANT OPTION" | sudo mysql $1
echo "grant all privileges on *.* to 'maxskysql'@'%' identified by 'skysql' require ssl WITH GRANT OPTION" | sudo mysql $1
echo "grant all privileges on *.* to 'maxuser'@'%' identified by 'maxpwd' require ssl WITH GRANT OPTION" | sudo mysql $1

View File

@ -428,8 +428,8 @@ int Galera_nodes::start_galera()
if (start_node(0, (char *) " --wsrep-cluster-address=gcomm://") != 0)
{
cleanup_db_node(i);
prepare_server(i);
cleanup_db_node(0);
prepare_server(0);
local_result += start_node(0, (char *) " --wsrep-cluster-address=gcomm://");
}

View File

@ -1,4 +1,4 @@
#create user repl@'%' identified by 'repl';
grant replication slave on *.* to repl@'%' identified by 'repl';
#create user repl@'%' identified by 'repl';
grant replication slave on *.* to repl@'%' identified by 'repl';
FLUSH PRIVILEGES;

View File

@ -1,6 +1,6 @@
#create user skysql@'%' identified by 'skysql';
#create user skysql@'localhost' identified by 'skysql';
GRANT ALL PRIVILEGES ON *.* TO skysql@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO skysql@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO skysql@'localhost' WITH GRANT OPTION;
#create user maxuser@'%' identified by 'maxpwd';

View File

@ -16,18 +16,16 @@ export repo_dir=$dir/repo.d/
export provider=`${mdbci_dir}/mdbci show provider $box --silent 2> /dev/null`
export backend_box=${backend_box:-"centos_7_"$provider}
if [ "$product" == "mysql" ] ; then
export cnf_path=${script_dir}/cnf/mysql56
fi
mkdir -p ${MDBCI_VM_PATH}/$name
cd ${MDBCI_VM_PATH}/$name
vagrant destroy -f
cd $dir
mkdir ${MDBCI_VM_PATH}/$name/cnf
cp -r ${cnf_path}/* ${MDBCI_VM_PATH}/$name/cnf/
export cnd_path="${MDBCI_VM_PATH}/$name/cnf/"
export cnf_path="${MDBCI_VM_PATH}/$name/cnf/"
if [ "$product" == "mysql" ] ; then
export cnf_path=${MDBCI_VM_PATH}/$name/cnf/mysql56/
fi
eval "cat <<EOF
$(<${script_dir}/templates/${template}.json.template)
@ -35,6 +33,10 @@ $(<${script_dir}/templates/${template}.json.template)
${mdbci_dir}/mdbci --override --template ${MDBCI_VM_PATH}/${name}.json --repo-dir ${repo_dir} generate $name
mkdir ${MDBCI_VM_PATH}/$name/cnf
cp -r ${script_dir}/cnf/* ${MDBCI_VM_PATH}/$name/cnf/
while [ -f ~/vagrant_lock ]
do
echo "vagrant is locked, waiting ..."

View File

@ -7,4 +7,4 @@ cd $dir
rm -rf ${MDBCI_VM_PATH}/${name}
rm -rf ${MDBCI_VM_PATH}/${name}.json
rm -rf ${MDBCI_VM_PATH}/${name}_network_config
rm -rf ${MDBCI_VM_PATH}/${name}_network_config

View File

@ -6,34 +6,34 @@
# see lists of supported boxes
# https://github.com/mariadb-corporation/mdbci/tree/integration/BOXES
# $template - name of MDBCI json template file
# $template - name of MDBCI json template file
# Template file have to be in ./templates/, file name
# have to be '$template.json.template
# Template file can contain references to any variables -
# all ${variable_name} will be replaced with values
# $name - name of test run. It can be any string of leytters or digits
# If it is not defined, name will be automatically genereted
# If it is not defined, name will be automatically genereted
# using $box and current date and time
# $ci_url - URL to Maxscale CI repository
# $ci_url - URL to Maxscale CI repository
# (default "http://max-tst-01.mariadb.com/ci-repository/")
# if build is done also locally and binaries are not uploaded to
# max-tst-01.mariadb.com $ci_url should toint to local web server
# e.g. http://192.168.122.1/repository (IP should be a host IP in the
# e.g. http://192.168.122.1/repository (IP should be a host IP in the
# virtual network (not 127.0.0.1))
# $product - 'mariadb' or 'mysql'
# $version - version of backend DB (e.g. '10.1', '10.2')
# $galera_version - version of Galera backend DB
# same as $version by default
# $galera_version - version of Galera backend DB
# same as $version by default
# $target - name of binary repository
# $target - name of binary repository
# (name of subdirectroy http://max-tst-01.mariadb.com/ci-repository/)
# $team_keys - path to the file with open ssh keys to be
# $team_keys - path to the file with open ssh keys to be
# installed on all VMs (default ${HOME}/team_keys)
# $don_not_destroy_vm - if 'yes' VM won't be destored afther the test
@ -61,6 +61,7 @@ export name=`echo $name | sed "s/?//g"`
${script_dir}/create_config.sh
res=$?
ulimit -c unlimited
if [ $res == 0 ] ; then
# . ${script_dir}/configure_backend.sh
. ${script_dir}/set_env.sh $name
@ -75,7 +76,7 @@ if [ $res == 0 ] ; then
if [ $? != 0 ]; then
echo "Backend broken!"
if [ "${do_not_destroy_vm}" != "yes" ] ; then
${script_dir}/destroy.sh
${script_dir}/destroy.sh
fi
rm ~/vagrant_lock
exit 1
@ -83,9 +84,8 @@ if [ $res == 0 ] ; then
${mdbci_dir}/mdbci snapshot take --path-to-nodes $name --snapshot-name clean
ctest -VV -D Nightly ${test_set}
fi
cp core.* ${logs_publish_dir}
cd $dir
${script_dir}/copy_logs.sh
else
echo "Failed to create VMs, exiting"
if [ "${do_not_destroy_vm}" != "yes" ] ; then
@ -99,4 +99,3 @@ if [ "${do_not_destroy_vm}" != "yes" ] ; then
${script_dir}/destroy.sh
echo "clean up done!"
fi

View File

@ -9,7 +9,7 @@ function checkExitStatus {
rm $lockFilePath
echo "Snapshot lock file was deleted due to an error"
exit 1
fi
fi
}
set -x
@ -52,9 +52,9 @@ if [ $? != 0 ]; then
${MDBCI_VM_PATH}/scripts/clean_vms.sh $name
${script_dir}/create_config.sh
checkExitStatus $? "Error creating configuration" $snapshot_lock_file
checkExitStatus $? "Error creating configuration" $snapshot_lock_file
. ${script_dir}/configure_backend.sh
echo "Creating snapshot from new config"
$HOME/mdbci/mdbci snapshot take --path-to-nodes $name --snapshot-name $snapshot_name
fi
@ -67,7 +67,7 @@ ${mdbci_dir}/repository-config/maxscale-ci.sh $target repo.d
${mdbci_dir}/mdbci sudo --command 'yum remove maxscale -y' $name/maxscale
${mdbci_dir}/mdbci sudo --command 'yum clean all' $name/maxscale
${mdbci_dir}/mdbci setup_repo --product maxscale $name/maxscale --repo-dir $repo_dir
${mdbci_dir}/mdbci setup_repo --product maxscale $name/maxscale --repo-dir $repo_dir
${mdbci_dir}/mdbci install_product --product maxscale $name/maxscale --repo-dir $repo_dir
checkExitStatus $? "Error installing Maxscale" $snapshot_lock_file
@ -80,11 +80,12 @@ make
./check_backend --restart-galera
checkExitStatus $? "Failed to check backends" $snapshot_lock_file
ulimit -c unlimited
ctest $test_set -VV -D Nightly
cp core.* ${logs_publish_dir}
${script_dir}/copy_logs.sh
# Removing snapshot_lock
rm ${snapshot_lock_file}

View File

@ -21,7 +21,6 @@ export product=${product:-"mariadb"}
export version=${version:-"10.2"}
export target=${target:-"develop"}
export vm_memory=${vm_memory:-"2048"}
export cnf_path=${script_dir}/cnf
export JOB_NAME=${JOB_NAME:-"local_test"}
export BUILD_NUMBER=${BUILD_NUMBER:-`date '+%Y%m%d%H%M'`}
export BUILD_TAG=${BUILD_TAG:-jenkins-${JOB_NAME}-${BUILD_NUMBER}}

View File

@ -316,6 +316,7 @@ TestConnections::~TestConnections()
copy_all_logs();
/* Temporary commnted out due to Galera failure in case of revert
if (global_result != 0 )
{
if (no_vm_revert)
@ -327,7 +328,7 @@ TestConnections::~TestConnections()
tprintf("Reverting snapshot\n");
revert_snapshot((char*) "clean");
}
}
}*/
delete repl;
if (!no_galera)