Skip to content

Commit 7064d21

Browse files
committed
Added support for the safe_to_bootstrap value from grastate.dat
1 parent 011e7a6 commit 7064d21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docker-entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,12 @@ wsrep_enable_new_cluster() {
456456
local wsrepdir="$(mysql_get_config 'wsrep-data-home-dir' "$@")"
457457
local wsrepaddr="$(wsrep_address_normalize "$(mysql_get_config 'wsrep-node-address' "$@")")"
458458

459+
if [ -s "$wsrepdir/grastate.dat" ]; then
460+
if [[ "$(cat "$wsrepdir/grastate.dat" | grep -i safe_to_bootstrap)" =~ 1 ]]; then
461+
return 0
462+
fi
463+
fi
464+
459465
if [ -z "$address" ] || [ -n "$WSREP_SKIP_AUTO_BOOTSTRAP" ] || [ -s "$wsrepdir/gvwstate.dat" ]; then
460466
return 1
461467
fi

0 commit comments

Comments
 (0)