From 30936192d63145a950c49d6c79cd9d3c9ae07d47 Mon Sep 17 00:00:00 2001 From: Jose Rojas Date: Mon, 31 Aug 2020 16:50:19 +0000 Subject: [PATCH] MCOL-4227 Related. Prevent cluster using shared storage from intializing more than once --- oam/install_scripts/columnstore-post-install.in | 15 +++++++++++---- oam/install_scripts/columnstore-pre-uninstall.in | 5 +++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/oam/install_scripts/columnstore-post-install.in b/oam/install_scripts/columnstore-post-install.in index 6a9caafc7..ea8daf0b6 100755 --- a/oam/install_scripts/columnstore-post-install.in +++ b/oam/install_scripts/columnstore-post-install.in @@ -286,10 +286,17 @@ fi systemctl cat mariadb-columnstore.service > /dev/null 2>&1 if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then - echo "Populating the engine initial system catalog." - systemctl start mariadb-columnstore - sleep 5 - dbbuilder 7 > $tmpDir/dbbuilder.log 2>&1 + # prevent clusters using shared storage from initializing columnstore more than once + IFLAG=/var/lib/columnstore/storagemanager/cs-initialized + mkdir -p /var/lib/columnstore/storagemanager + + if [ ! -e $IFLAG ]; then + touch $IFLAG + echo "Populating the engine initial system catalog." + systemctl start mariadb-columnstore + sleep 5 + dbbuilder 7 > $tmpDir/dbbuilder.log 2>&1 + fi fi if [ $stop_mysqld -eq 1 ];then diff --git a/oam/install_scripts/columnstore-pre-uninstall.in b/oam/install_scripts/columnstore-pre-uninstall.in index a23fe2138..600c88015 100755 --- a/oam/install_scripts/columnstore-pre-uninstall.in +++ b/oam/install_scripts/columnstore-pre-uninstall.in @@ -109,6 +109,11 @@ if [ -n "$systemctl" ] && [ $(running_systemd) -eq 0 ]; then rm -f /lib/systemd/system/mcs-storagemanager.service systemctl daemon-reload + # remove flag to prevent clusters using shared storage from initializing columnstore more than once + IFLAG=/var/lib/columnstore/storagemanager/cs-initialized + if [ -e $IFLAG ]; then + rm $IFLAG + fi else chkconfig=`which chkconfig 2>/dev/null` if [ -n "$chkconfig" ]; then