diff --git a/scripts/deb-install.sh b/scripts/deb-install.sh index 3e74bd48..1de387be 100755 --- a/scripts/deb-install.sh +++ b/scripts/deb-install.sh @@ -50,22 +50,27 @@ set -x # Due to MDEV-14622 and its effect on Spider installation, # Spider has to be installed separately after the server -package_list=$(grep "^Package:" Packages | grep -vE 'galera|spider|columnstore' | awk '{print $2}' | xargs) +package_list=$(grep "^Package:" Packages | + grep -vE 'galera|spider|columnstore' | + awk '{print $2}' | xargs) if grep -qi spider Packages; then - spider_package_list=$(grep "^Package:" Packages | grep 'spider' | awk '{print $2}' | xargs) + spider_package_list=$(grep "^Package:" Packages | + grep 'spider' | awk '{print $2}' | xargs) fi if grep -qi columnstore Packages; then if [[ $arch != "amd64" ]] && [[ $arch != "arm64" ]]; then bb_log_warn "Due to MCOL-4123, Columnstore won't be installed on $arch" else - columnstore_package_list=$(grep "^Package:" Packages | grep 'columnstore' | awk '{print $2}' | xargs) + columnstore_package_list=$(grep "^Package:" Packages | + grep 'columnstore' | awk '{print $2}' | xargs) fi fi # apt get update may be running in the background (Ubuntu start). apt_get_update -sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 apt-get install -y $package_list $columnstore_package_list" +sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 \ + apt-get install -y $package_list $columnstore_package_list" # MDEV-14622: Wait for mysql_upgrade running in the background to finish wait_for_mariadb_upgrade @@ -77,7 +82,8 @@ if [[ $systemdCapability == "yes" ]]; then sudo journalctl -xe --no-pager bb_log_warn "mariadb service isn't running properly after installation" if echo "$package_list" | grep -q columnstore; then - bb_log_info "It is likely to be caused by ColumnStore problems upon installation, getting the logs" + bb_log_info "It is likely to be caused by ColumnStore" + bb_log_info "problems upon installation, getting the logs" set +e # It is done in such a weird way, because Columnstore currently makes its # logs hard to read @@ -99,10 +105,19 @@ fi # Due to MDEV-14622 and its effect on Spider installation, # Spider has to be installed separately after the server if [[ -n $spider_package_list ]]; then - sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 apt-get install -y $spider_package_list" + sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 \ + apt-get install -y $spider_package_list" fi -sudo mariadb --verbose -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test; create user galera identified by 'gal3ra123'; grant all on *.* to galera;" +sudo mariadb --verbose -e "create database test; \ + use test; \ + create table t(a int primary key) engine=innodb; \ + insert into t values (1); \ + select * from t; \ + drop table t; \ + drop database test; \ + create user galera identified by 'gal3ra123'; \ + grant all on *.* to galera;" sudo mariadb -e "select @@version" bb_log_info "test for MDEV-18563, MDEV-18526" set +e @@ -124,13 +139,18 @@ set +e # sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 apt-get install -y mariadb-test" if dpkg -l | grep -i spider >/dev/null; then bb_log_warn "Workaround for MDEV-22979, otherwise server hangs further in SST steps" - sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 apt-get remove --allow-unauthenticated -y mariadb-plugin-spider" || true - sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 apt-get purge --allow-unauthenticated -y mariadb-plugin-spider" || true + sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 \ + apt-get remove --allow-unauthenticated -y mariadb-plugin-spider" || true + sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 \ + apt-get purge --allow-unauthenticated -y mariadb-plugin-spider" || true fi if dpkg -l | grep -i columnstore >/dev/null; then - bb_log_warn "Workaround for a bunch of Columnstore bugs, otherwise mysqldump in SST steps fails when Columnstore returns errors" - sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 apt-get remove --allow-unauthenticated -y mariadb-plugin-columnstore" || true - sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 apt-get purge --allow-unauthenticated -y mariadb-plugin-columnstore" || true + bb_log_warn "Workaround for a bunch of Columnstore bugs" + bb_log_warn "otherwise mysqldump in SST steps fails when Columnstore returns errors" + sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 \ + apt-get remove --allow-unauthenticated -y mariadb-plugin-columnstore" || true + sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 \ + apt-get purge --allow-unauthenticated -y mariadb-plugin-columnstore" || true fi bb_log_ok "all done" diff --git a/scripts/deb-upgrade.sh b/scripts/deb-upgrade.sh index 5d6c598a..f25f348e 100755 --- a/scripts/deb-upgrade.sh +++ b/scripts/deb-upgrade.sh @@ -48,12 +48,17 @@ case $test_mode in all) get_packages_file_mirror if grep -qi columnstore Packages; then - bb_log_warn "due to MCOL-4120 (Columnstore leaves the server shut down) and other bugs Columnstore upgrade is tested separately" + bb_log_warn "due to MCOL-4120 (Columnstore leaves the server shut down)" + bb_log_warn "and other bugs Columnstore upgrade is tested separately" fi - package_list=$(grep "^Package:" Packages | grep -vE 'galera|spider|columnstore' | awk '{print $2}' | sort -u | xargs) + package_list=$(grep "^Package:" Packages | + grep -vE 'galera|spider|columnstore' | + awk '{print $2}' | sort -u | xargs) if grep -qi spider Packages; then bb_log_warn "due to MDEV-14622 Spider will be installed separately after the server" - spider_package_list=$(grep "^Package:" Packages | grep 'spider' | awk '{print $2}' | sort -u | xargs) + spider_package_list=$(grep "^Package:" Packages | + grep 'spider' | awk '{print $2}' | + sort -u | xargs) fi if grep -si tokudb Packages; then # For the sake of installing TokuDB, disable hugepages @@ -105,7 +110,8 @@ apt_get_update # We will wait till they finish, to avoid any clashes with SQL we are going to execute wait_for_mariadb_upgrade -if ! sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 apt-get -o Dpkg::Options::=--force-confnew install --allow-unauthenticated -y $package_list"; then +if ! sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 \ + apt-get -o Dpkg::Options::=--force-confnew install --allow-unauthenticated -y $package_list"; then bb_log_err "Installation of a previous release failed, see the output above" exit 1 fi @@ -113,7 +119,8 @@ fi wait_for_mariadb_upgrade if [[ -n $spider_package_list ]]; then - if ! sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 apt-get -o Dpkg::Options::=--force-confnew install --allow-unauthenticated -y $spider_package_list"; then + if ! sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 \ + apt-get -o Dpkg::Options::=--force-confnew install --allow-unauthenticated -y $spider_package_list"; then bb_log_err "Installation of Spider from the previous release failed, see the output above" exit 1 fi @@ -158,14 +165,16 @@ deb_setup_bb_artifacts_mirror apt_get_update # Install the new packages -if ! sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 apt-get -o Dpkg::Options::=--force-confnew install --allow-unauthenticated -y $package_list"; then +if ! sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 \ + apt-get -o Dpkg::Options::=--force-confnew install --allow-unauthenticated -y $package_list"; then bb_log_err "installation of the new packages failed, see the output above" exit 1 fi wait_for_mariadb_upgrade if [[ -n $spider_package_list ]]; then - if ! sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 apt-get -o Dpkg::Options::=--force-confnew install --allow-unauthenticated -y $spider_package_list"; then + if ! sudo sh -c "DEBIAN_FRONTEND=noninteractive MYSQLD_STARTUP_TIMEOUT=180 \ + apt-get -o Dpkg::Options::=--force-confnew install --allow-unauthenticated -y $spider_package_list"; then bb_log_err "Installation of the new Spider packages failed, see the output above" exit 1 fi diff --git a/scripts/rpm-install.sh b/scripts/rpm-install.sh index fa3bbb7f..0c7a3dec 100755 --- a/scripts/rpm-install.sh +++ b/scripts/rpm-install.sh @@ -56,7 +56,8 @@ else fi set -u -sh -c 'g=/usr/lib*/galera*/libgalera_smm.so; echo -e "[galera]\nwsrep_provider=$g"' | sudo tee /etc/my.cnf.d/galera.cnf +sh -c 'g=/usr/lib*/galera*/libgalera_smm.so; echo -e "[galera]\nwsrep_provider=$g"' | + sudo tee /etc/my.cnf.d/galera.cnf case "$systemdCapability" in yes) if ! sudo systemctl start mariadb; then @@ -69,17 +70,30 @@ case "$systemdCapability" in sudo /etc/init.d/mysql restart ;; *) - bb_log_warn "should never happen, check your configuration (systemdCapability property is not set or is set to a wrong value)" + bb_log_warn "should never happen, check your configuration:" + bb_log_warn "(systemdCapability property is not set or is set to a wrong value)" ;; esac -sudo mariadb -e 'drop database if exists test; create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t;' +sudo mariadb -e "drop database if exists test; \ + create database test; \ + use test; \ + create table t(a int primary key) engine=innodb; \ + insert into t values (1); \ + select * from t; \ + drop table t;" if echo "$pkg_list" | grep -qi columnstore; then - sudo mariadb --verbose -e "create database cs; use cs; create table cs.t_columnstore (a int, b char(8)) engine=Columnstore; insert into cs.t_columnstore select seq, concat('val',seq) from seq_1_to_10; select * from cs.t_columnstore" + sudo mariadb --verbose -e "create database cs; \ + use cs; \ + create table cs.t_columnstore (a int, b char(8)) engine=Columnstore; \ + insert into cs.t_columnstore select seq, concat('val',seq) from seq_1_to_10; \ + select * from cs.t_columnstore" sudo systemctl restart mariadb - sudo mariadb --verbose -e "select * from cs.t_columnstore; update cs.t_columnstore set b = 'updated'" + sudo mariadb --verbose -e "select * from cs.t_columnstore; \ + update cs.t_columnstore set b = 'updated'" sudo systemctl restart mariadb-columnstore - sudo mariadb --verbose -e "update cs.t_columnstore set a = a + 10; select * from cs.t_columnstore" + sudo mariadb --verbose -e "update cs.t_columnstore set a = a + 10; \ + select * from cs.t_columnstore" fi sudo mariadb -e 'show global status like "wsrep%%"' bb_log_info "test for MDEV-18563, MDEV-18526"