diff --git a/oam/install_scripts/columnstore-post-install.in b/oam/install_scripts/columnstore-post-install.in index 59125dd2a..c0d22bf45 100755 --- a/oam/install_scripts/columnstore-post-install.in +++ b/oam/install_scripts/columnstore-post-install.in @@ -302,10 +302,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