diff --git a/10conf-d.yml b/10conf-d.yml index cf3e775..0eda438 100644 --- a/10conf-d.yml +++ b/10conf-d.yml @@ -112,11 +112,17 @@ data: #echo " It may not be safe to bootstrap the cluster from this node. It was not the last one to leave the cluster and may not contain all the updates. To force cluster bootstrap with this node, edit the grastate.dat file manually and set safe_to_bootstrap to 1 ." echo "Or to try a regular start (for example after recovery + manual intervention), run:" echo " $SUGGEST_EXEC_COMMAND touch /tmp/confirm-resume" - echo "Waiting for response ..." + if [ $HOST_ID -eq 0 ] && [ ! -z "$AUTO_RECOVERY_MODE" ]; then + # The !=0 hosts are assumed to start normally, with Parallel pod management policy + echo "The AUTO_RECOVERY_MODE env was set to $AUTO_RECOVERY_MODE, will trigger that choice" + touch /tmp/$AUTO_RECOVERY_MODE + else + echo "Waiting for response ..." + fi while [ ! -f /tmp/confirm-resume ]; do - sleep 1 if [ "$AUTO_NEW_CLUSTER" = "true" ]; then echo "The AUTO_NEW_CLUSTER env was set to $AUTO_NEW_CLUSTER, will proceed without confirmation" + echo "NOTE this env is deprecated, use AUTO_RECOVERY_MODE instead" wsrepNewCluster touch /tmp/confirm-resume elif [ -f /tmp/confirm-new-cluster ]; then @@ -133,6 +139,7 @@ data: wsrepRecover touch /tmp/confirm-resume fi + sleep 1 done rm /tmp/confirm-* set -x diff --git a/50mariadb.yml b/50mariadb.yml index e3cf992..778bd87 100644 --- a/50mariadb.yml +++ b/50mariadb.yml @@ -37,8 +37,8 @@ spec: fieldPath: metadata.namespace - name: DATADIR value: /data/db - - name: AUTO_NEW_CLUSTER - value: "false" + - name: AUTO_RECOVERY_MODE + value: confirm-force-bootstrap - name: WSREP_CLUSTER_ADDRESS value: "gcomm://mariadb-0.mariadb,mariadb-1.mariadb,mariadb-2.mariadb" workingDir: /etc/mysql/conf.d-configmap