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

Merge pull request #1071 from mariadb-corporation/fix-upgrade

Fix Upgrade
This commit is contained in:
Patrick LeBlanc
2020-02-26 21:31:55 -06:00
committed by Patrick LeBlanc
parent a6d0a0c5cb
commit 01240cc9e0
6 changed files with 20 additions and 5 deletions

View File

@@ -407,6 +407,7 @@ IF (INSTALL_LAYOUT)
SETA(CPACK_RPM_columnstore-platform_PACKAGE_REQUIRES "expect" "boost >= 1.53.0" "MariaDB-columnstore-libs" "snappy" "jemalloc" "net-tools" PARENT_SCOPE) SETA(CPACK_RPM_columnstore-platform_PACKAGE_REQUIRES "expect" "boost >= 1.53.0" "MariaDB-columnstore-libs" "snappy" "jemalloc" "net-tools" PARENT_SCOPE)
endif() endif()
SET(CPACK_RPM_columnstore-platform_PRE_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/preInstall_platform.sh PARENT_SCOPE)
SET(CPACK_RPM_columnstore-platform_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/postInstall_platform.sh PARENT_SCOPE) SET(CPACK_RPM_columnstore-platform_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/postInstall_platform.sh PARENT_SCOPE)
SET(CPACK_RPM_columnstore-platform_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/preUn_platform.sh PARENT_SCOPE) SET(CPACK_RPM_columnstore-platform_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/preUn_platform.sh PARENT_SCOPE)

View File

@@ -0,0 +1,7 @@
if [ "$1" == "2" ]; then
#Perform tasks to prepare for the upgrade installation
mcsadmin shutdown y > /dev/null 2>&1
columnstore-pre-uninstall
fi
exit 0

View File

@@ -98,6 +98,7 @@ endif()
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "MariaDB-columnstore-libs") SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "MariaDB-columnstore-libs")
SET(CPACK_RPM_columnstore-platform_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preInstall_platform.sh)
SET(CPACK_RPM_columnstore-platform_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_platform.sh) SET(CPACK_RPM_columnstore-platform_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_platform.sh)
SET(CPACK_RPM_columnstore-libs_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_libs.sh) SET(CPACK_RPM_columnstore-libs_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_libs.sh)
SET(CPACK_RPM_columnstore-engine_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_storage_engine.sh) SET(CPACK_RPM_columnstore-engine_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_storage_engine.sh)

View File

@@ -31,6 +31,11 @@ if [ ! -f @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml ]; then
exit 1 exit 1
fi fi
if [ -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave ]; then
/bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.new
/bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf
fi
touch /dev/shm/columnstore-test && rm /dev/shm/columnstore-test touch /dev/shm/columnstore-test && rm /dev/shm/columnstore-test
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
echo "User $user will need R/W access to /dev/shm." echo "User $user will need R/W access to /dev/shm."

View File

@@ -94,6 +94,7 @@ fi
if [ $quiet != 1 ]; then if [ $quiet != 1 ]; then
#make copy of Columnstore.xml #make copy of Columnstore.xml
/bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml.rpmsave > /dev/null 2>&1 /bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml.rpmsave > /dev/null 2>&1
/bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave > /dev/null 2>&1
/bin/cp -f @MARIADB_MYCNFDIR@/columnstore.cnf @MARIADB_MYCNFDIR@/columnstore.cnf.rpmsave > /dev/null 2>&1 /bin/cp -f @MARIADB_MYCNFDIR@/columnstore.cnf @MARIADB_MYCNFDIR@/columnstore.cnf.rpmsave > /dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/myCnf-include-args.text @ENGINE_SUPPORTDIR@/myCnf-include-args.text.rpmsave >& /dev/null cp @ENGINE_SUPPORTDIR@/myCnf-include-args.text @ENGINE_SUPPORTDIR@/myCnf-include-args.text.rpmsave >& /dev/null
rm -f @ENGINE_SYSCONFDIR@/columnstore/AlarmConfig.xml.installSave rm -f @ENGINE_SYSCONFDIR@/columnstore/AlarmConfig.xml.installSave

View File

@@ -2781,7 +2781,7 @@ int processCommand(string* arguments)
if ( DBRootStorageType == "hdfs") if ( DBRootStorageType == "hdfs")
{ {
string logFile = tmpDir + "/cc-restart.pdsh"; string logFile = tmpDir + "/cc-restart.pdsh";
cmd = "pdsh -a 'columnstore restart' > " + logFile + " 2>&1"; cmd = "pdsh -a 'columnstore start' > " + logFile + " 2>&1";
system(cmd.c_str()); system(cmd.c_str());
if (oam.checkLogStatus(logFile, "exit") ) if (oam.checkLogStatus(logFile, "exit") )
@@ -2818,12 +2818,12 @@ int processCommand(string* arguments)
if ( modulename == localModule ) if ( modulename == localModule )
{ {
cmd = "columnstore restart > " + tmpDir + "/start.log 2>&1"; cmd = "columnstore start > " + tmpDir + "/startSystem.log 2>&1";
int rtnCode = system(cmd.c_str()); int rtnCode = system(cmd.c_str());
if (geteuid() == 0 && WEXITSTATUS(rtnCode) != 0) if (geteuid() == 0 && WEXITSTATUS(rtnCode) != 0)
{ {
cout << endl << "error with running 'columnstore restart' on local module " << endl; cout << endl << "error with running 'columnstore start' on local module " << endl;
cout << endl << "**** startSystem Failed" << endl; cout << endl << "**** startSystem Failed" << endl;
break; break;
} }
@@ -2836,7 +2836,7 @@ int processCommand(string* arguments)
for ( ; pt1 != (*pt).hostConfigList.end() ; pt1++) for ( ; pt1 != (*pt).hostConfigList.end() ; pt1++)
{ {
//run remote command script //run remote command script
cmd = "remote_command.sh " + (*pt1).IPAddr + " " + password + " 'columnstore restart' 0"; cmd = "remote_command.sh " + (*pt1).IPAddr + " " + password + " 'columnstore start' 0";
int rtnCode = system(cmd.c_str()); int rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) < 0) if (WEXITSTATUS(rtnCode) < 0)
@@ -2885,7 +2885,7 @@ int processCommand(string* arguments)
//just kick off local server //just kick off local server
cout << endl << " System being started, please wait..."; cout << endl << " System being started, please wait...";
cout.flush(); cout.flush();
cmd = "columnstore restart > " + tmpDir + "/start.log 2>&1"; cmd = "columnstore start > " + tmpDir + "/startSystem.log 2>&1";
int rtnCode = system(cmd.c_str()); int rtnCode = system(cmd.c_str());
if (geteuid() == 0 && WEXITSTATUS(rtnCode) != 0) if (geteuid() == 0 && WEXITSTATUS(rtnCode) != 0)