1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-10 01:22:48 +03:00

Removed the last call of postConfigure(RIP). Changed dangerous default setting see MDEV-22197.

This commit is contained in:
Roman Nozdrin
2020-06-03 16:31:56 +00:00
parent 5440977f45
commit ccdfe98409
4 changed files with 64 additions and 27 deletions

View File

@@ -1,6 +1,4 @@
[mysqld] [mysqld]
lower_case_table_names=1
plugin-load-add=ha_columnstore.so plugin-load-add=ha_columnstore.so
# Enable compression by default on create, set to NONE to turn off # Enable compression by default on create, set to NONE to turn off

View File

@@ -1,15 +1,9 @@
#!/bin/bash #!/bin/bash
#
# $Id$
#
rpmmode=install
pwprompt=" " pwprompt=" "
for arg in "$@"; do for arg in "$@"; do
if [ `expr -- "$arg" : '--rpmmode='` -eq 10 ]; then if [ `expr -- "$arg" : '--tmpdir='` -eq 9 ]; then
rpmmode="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--tmpdir='` -eq 9 ]; then
tmpdir="`echo $arg | awk -F= '{print $2}'`" tmpdir="`echo $arg | awk -F= '{print $2}'`"
else else
echo "ignoring unknown argument: $arg" 1>&2 echo "ignoring unknown argument: $arg" 1>&2

View File

@@ -5,13 +5,43 @@
# Post-install steps for columnstore install # Post-install steps for columnstore install
running_systemd() { running_systemd() {
if [ "$(ps --no-headers -o comm 1)" == "systemd" ]; then if [ "$(ps --no-headers -o comm 1)" = "systemd" ]; then
echo 0 echo 0
else else
echo 1 echo 1
fi fi
} }
checkForError() {
# check for password error
grep "ERROR 1045" ${tmpDir}/mysql_install.log > ${tmpDir}/error.check
if [ `cat ${tmpDir}/error.check | wc -c` -ne 0 ]; then
echo "MySQL Password file missing or incorrect, check .my.cnf file"
rm -f ${tmpDir}/error.check
exit 2;
fi
rm -f ${tmpDir}/error.check
#---------------------------------------------------------------------------
# See if engine columnstore exist
#---------------------------------------------------------------------------
echo "checking for engine columnstore..."
su -s /bin/sh -c 'mysql --execute="show engines"' mysql 2> ${tmpDir}/post-mysql-install.log | grep -i columnstore
#
# Add compressiontype column to SYSCOLUMN if applicable
#
if [ $? -ne 0 ]; then
echo "columnstore doesn't exist"
exit 1
fi
echo "columnstore exist"
return 0;
}
rpmmode=install rpmmode=install
user=`whoami 2>/dev/null` user=`whoami 2>/dev/null`
@@ -174,36 +204,48 @@ mkdir $lockdir >/dev/null 2>&1
rm -f $lockdir/columnstore rm -f $lockdir/columnstore
#check and get amazon env variables # This was the last place of postConfigure. RIP
aws=`which aws 2>/dev/null`
if [ -z "aws" ]; then /usr/sbin/install_mcs_mysql.sh --tmpdir=$tmpDir
MCSgetCredentials.sh >/dev/null 2>&1
# Restart MDB to enable plugin
systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
systemctl restart mariadb.service > /dev/null 2>&1
else
pkill mysqld > /dev/null 2>&1
/usr/bin/mysqld_safe &
fi fi
postConfigure checkForError
if [ $? -ne 0 ]; then
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"
fi
systemctl cat mariadb-columnstore.service > /dev/null 2>&1 systemctl cat mariadb-columnstore.service > /dev/null 2>&1
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
systemctl start mariadb-columnstore systemctl start mcs-loadbrm
systemctl start mcs-workernode
# Wait for all columnstore to be ready, DDLProc is final process in startup order systemctl start mcs-controllernode
while [ -z "$(pgrep -x DDLProc)" ]; systemctl start mcs-primproc
do systemctl start mcs-exemgr
sleep 1 systemctl start mcs-storagemanager
done systemctl start mcs-writeengineserver
systemctl start mcs-ddlproc
systemctl start mcs-dmlproc
dbbuilder 7 > $tmpDir/dbbuilder.log
fi fi
dbbuilder 7 > $tmpDir/dbbuilder.log
if [ $stop_mysqld -eq 1 ];then if [ $stop_mysqld -eq 1 ];then
# Make sure we stop mariadb since it wasn't running prior to columnstore installation # Make sure we stop mariadb since it wasn't running prior to columnstore installation
systemctl cat mariadb.service > /dev/null 2>&1 systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
systemctl stop mariadb.service > /dev/null 2>&1 systemctl stop mariadb.service > /dev/null 2>&1
else else
pkill mysqld pkill mysqld > /dev/null 2>&1
fi fi
fi fi
sleep 2 sleep 2
exit 0 exit 0

View File

@@ -17,7 +17,7 @@ systemctl cat mariadb-columnstore.service > /dev/null 2>&1
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
systemctl stop mariadb-columnstore >/dev/null 2>&1 systemctl stop mariadb-columnstore >/dev/null 2>&1
else else
PROGS='StorageManager workernode controllernode PrimProc ExeMgr DMLProc DDLProc WriteEngineServer' PROGS='workernode controllernode PrimProc ExeMgr DMLProc DDLProc WriteEngineServer StorageManager'
kill $(pidof $PROGS) > /dev/null kill $(pidof $PROGS) > /dev/null
sleep 3 sleep 3
kill -9 $(pidof $PROGS) > /dev/null kill -9 $(pidof $PROGS) > /dev/null
@@ -118,6 +118,9 @@ rm -f @ENGINE_SYSCONFDIR@/columnstore/AlarmConfig.xml.installSave
#remove OAMdbrootCheck file #remove OAMdbrootCheck file
rm -f /var/lib/columnstore/data*/OAMdbrootCheck > /dev/null 2>&1 rm -f /var/lib/columnstore/data*/OAMdbrootCheck > /dev/null 2>&1
rm -f /etc/rsyslog.d/49-columnstore.conf > /dev/null 2>&1
rm -rf /tmp/columnstore_tmp_files > /dev/null 2>&1
#tell user to run post configure script #tell user to run post configure script
echo " " echo " "
echo "Mariab Columnstore uninstall completed" echo "Mariab Columnstore uninstall completed"