MDEV-34943 Disable replication start on initialization

START REPLIA was issued during initializing which mean that
even before /docker-entrypoint/initdb.d there was initializtion
going on.

Entrypoints that needed data initialzation didn't complete with
this nicely. Also if there wasn't any initialization there
would be little time for the replication to acheive anything
before being shutdown ready for the final start.

Moved --skip-slave-start to the default docker_temp_server_start
implementation.

Technically this is a compaibility break that is likely to be
of significants if:
* /docker-entrypoint/initdb.d contains a script waiting
  for replication to catch up.

The recitifcation to the previous behaviour is:
/docker-entrypoint/initdb.d contains a SQL to START REPLICA.
Recommend also having another script that is:

until healthcheck.sh --replication_io \
                     --replication_sql \
                     --replication_seconds_behind_master=0 \
                     --replication
                     --no-connect;
do
  sleep 1
done

Closes #614
This commit is contained in:
Daniel Black 2024-09-04 13:44:06 +10:00
parent 5141284394
commit 70d5dbb805
11 changed files with 33 additions and 77 deletions

View File

@ -121,6 +121,7 @@ mysql_get_config() {
docker_temp_server_start() { docker_temp_server_start() {
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
--expire-logs-days=0 \ --expire-logs-days=0 \
--skip-slave-start \
--loose-innodb_buffer_pool_load_at_startup=0 \ --loose-innodb_buffer_pool_load_at_startup=0 \
& &
declare -g MARIADB_PID declare -g MARIADB_PID
@ -458,7 +459,6 @@ docker_setup_db() {
# To create replica user # To create replica user
local createReplicaUser= local createReplicaUser=
local changeMasterTo= local changeMasterTo=
local startReplica=
if [ -n "$MARIADB_REPLICATION_USER" ] ; then if [ -n "$MARIADB_REPLICATION_USER" ] ; then
if [ -z "$MARIADB_MASTER_HOST" ]; then if [ -z "$MARIADB_MASTER_HOST" ]; then
# on master # on master
@ -471,7 +471,6 @@ docker_setup_db() {
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value. # SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;" changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
startReplica="START REPLICA;"
fi fi
fi fi
@ -502,7 +501,6 @@ docker_setup_db() {
${userGrants} ${userGrants}
${changeMasterTo} ${changeMasterTo}
${startReplica}
EOSQL EOSQL
} }
@ -598,8 +596,7 @@ docker_mariadb_upgrade() {
fi fi
mysql_note "Starting temporary server" mysql_note "Starting temporary server"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
mysql_note "Temporary server started." mysql_note "Temporary server started."
docker_mariadb_backup_system docker_mariadb_backup_system
@ -624,8 +621,7 @@ EOSQL
# need a restart as FLUSH PRIVILEGES isn't reversable # need a restart as FLUSH PRIVILEGES isn't reversable
mysql_note "Restarting temporary server for upgrade" mysql_note "Restarting temporary server for upgrade"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
else else
return 0 return 0
fi fi

View File

@ -121,6 +121,7 @@ mysql_get_config() {
docker_temp_server_start() { docker_temp_server_start() {
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
--expire-logs-days=0 \ --expire-logs-days=0 \
--skip-slave-start \
--loose-innodb_buffer_pool_load_at_startup=0 \ --loose-innodb_buffer_pool_load_at_startup=0 \
& &
declare -g MARIADB_PID declare -g MARIADB_PID
@ -458,7 +459,6 @@ docker_setup_db() {
# To create replica user # To create replica user
local createReplicaUser= local createReplicaUser=
local changeMasterTo= local changeMasterTo=
local startReplica=
if [ -n "$MARIADB_REPLICATION_USER" ] ; then if [ -n "$MARIADB_REPLICATION_USER" ] ; then
if [ -z "$MARIADB_MASTER_HOST" ]; then if [ -z "$MARIADB_MASTER_HOST" ]; then
# on master # on master
@ -471,7 +471,6 @@ docker_setup_db() {
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value. # SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;" changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
startReplica="START REPLICA;"
fi fi
fi fi
@ -502,7 +501,6 @@ docker_setup_db() {
${userGrants} ${userGrants}
${changeMasterTo} ${changeMasterTo}
${startReplica}
EOSQL EOSQL
} }
@ -598,8 +596,7 @@ docker_mariadb_upgrade() {
fi fi
mysql_note "Starting temporary server" mysql_note "Starting temporary server"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
mysql_note "Temporary server started." mysql_note "Temporary server started."
docker_mariadb_backup_system docker_mariadb_backup_system
@ -624,8 +621,7 @@ EOSQL
# need a restart as FLUSH PRIVILEGES isn't reversable # need a restart as FLUSH PRIVILEGES isn't reversable
mysql_note "Restarting temporary server for upgrade" mysql_note "Restarting temporary server for upgrade"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
else else
return 0 return 0
fi fi

View File

@ -121,6 +121,7 @@ mysql_get_config() {
docker_temp_server_start() { docker_temp_server_start() {
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
--expire-logs-days=0 \ --expire-logs-days=0 \
--skip-slave-start \
--loose-innodb_buffer_pool_load_at_startup=0 \ --loose-innodb_buffer_pool_load_at_startup=0 \
& &
declare -g MARIADB_PID declare -g MARIADB_PID
@ -449,7 +450,6 @@ docker_setup_db() {
# To create replica user # To create replica user
local createReplicaUser= local createReplicaUser=
local changeMasterTo= local changeMasterTo=
local startReplica=
if [ -n "$MARIADB_REPLICATION_USER" ] ; then if [ -n "$MARIADB_REPLICATION_USER" ] ; then
if [ -z "$MARIADB_MASTER_HOST" ]; then if [ -z "$MARIADB_MASTER_HOST" ]; then
# on master # on master
@ -462,7 +462,6 @@ docker_setup_db() {
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value. # SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;" changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
startReplica="START REPLICA;"
fi fi
fi fi
@ -493,7 +492,6 @@ docker_setup_db() {
${userGrants} ${userGrants}
${changeMasterTo} ${changeMasterTo}
${startReplica}
EOSQL EOSQL
} }
@ -589,8 +587,7 @@ docker_mariadb_upgrade() {
fi fi
mysql_note "Starting temporary server" mysql_note "Starting temporary server"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
mysql_note "Temporary server started." mysql_note "Temporary server started."
docker_mariadb_backup_system docker_mariadb_backup_system
@ -615,8 +612,7 @@ EOSQL
# need a restart as FLUSH PRIVILEGES isn't reversable # need a restart as FLUSH PRIVILEGES isn't reversable
mysql_note "Restarting temporary server for upgrade" mysql_note "Restarting temporary server for upgrade"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
else else
return 0 return 0
fi fi

View File

@ -121,6 +121,7 @@ mysql_get_config() {
docker_temp_server_start() { docker_temp_server_start() {
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
--expire-logs-days=0 \ --expire-logs-days=0 \
--skip-slave-start \
--loose-innodb_buffer_pool_load_at_startup=0 \ --loose-innodb_buffer_pool_load_at_startup=0 \
& &
declare -g MARIADB_PID declare -g MARIADB_PID
@ -450,7 +451,6 @@ docker_setup_db() {
# To create replica user # To create replica user
local createReplicaUser= local createReplicaUser=
local changeMasterTo= local changeMasterTo=
local startReplica=
if [ -n "$MARIADB_REPLICATION_USER" ] ; then if [ -n "$MARIADB_REPLICATION_USER" ] ; then
if [ -z "$MARIADB_MASTER_HOST" ]; then if [ -z "$MARIADB_MASTER_HOST" ]; then
# on master # on master
@ -463,7 +463,6 @@ docker_setup_db() {
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value. # SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;" changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
startReplica="START REPLICA;"
fi fi
fi fi
@ -494,7 +493,6 @@ docker_setup_db() {
${userGrants} ${userGrants}
${changeMasterTo} ${changeMasterTo}
${startReplica}
EOSQL EOSQL
} }
@ -590,8 +588,7 @@ docker_mariadb_upgrade() {
fi fi
mysql_note "Starting temporary server" mysql_note "Starting temporary server"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
mysql_note "Temporary server started." mysql_note "Temporary server started."
docker_mariadb_backup_system docker_mariadb_backup_system
@ -616,8 +613,7 @@ EOSQL
# need a restart as FLUSH PRIVILEGES isn't reversable # need a restart as FLUSH PRIVILEGES isn't reversable
mysql_note "Restarting temporary server for upgrade" mysql_note "Restarting temporary server for upgrade"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
else else
return 0 return 0
fi fi

View File

@ -121,6 +121,7 @@ mysql_get_config() {
docker_temp_server_start() { docker_temp_server_start() {
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
--expire-logs-days=0 \ --expire-logs-days=0 \
--skip-slave-start \
--loose-innodb_buffer_pool_load_at_startup=0 \ --loose-innodb_buffer_pool_load_at_startup=0 \
& &
declare -g MARIADB_PID declare -g MARIADB_PID
@ -450,7 +451,6 @@ docker_setup_db() {
# To create replica user # To create replica user
local createReplicaUser= local createReplicaUser=
local changeMasterTo= local changeMasterTo=
local startReplica=
if [ -n "$MARIADB_REPLICATION_USER" ] ; then if [ -n "$MARIADB_REPLICATION_USER" ] ; then
if [ -z "$MARIADB_MASTER_HOST" ]; then if [ -z "$MARIADB_MASTER_HOST" ]; then
# on master # on master
@ -463,7 +463,6 @@ docker_setup_db() {
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value. # SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;" changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
startReplica="START REPLICA;"
fi fi
fi fi
@ -494,7 +493,6 @@ docker_setup_db() {
${userGrants} ${userGrants}
${changeMasterTo} ${changeMasterTo}
${startReplica}
EOSQL EOSQL
} }
@ -590,8 +588,7 @@ docker_mariadb_upgrade() {
fi fi
mysql_note "Starting temporary server" mysql_note "Starting temporary server"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
mysql_note "Temporary server started." mysql_note "Temporary server started."
docker_mariadb_backup_system docker_mariadb_backup_system
@ -616,8 +613,7 @@ EOSQL
# need a restart as FLUSH PRIVILEGES isn't reversable # need a restart as FLUSH PRIVILEGES isn't reversable
mysql_note "Restarting temporary server for upgrade" mysql_note "Restarting temporary server for upgrade"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
else else
return 0 return 0
fi fi

View File

@ -121,6 +121,7 @@ mysql_get_config() {
docker_temp_server_start() { docker_temp_server_start() {
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
--expire-logs-days=0 \ --expire-logs-days=0 \
--skip-slave-start \
--loose-innodb_buffer_pool_load_at_startup=0 \ --loose-innodb_buffer_pool_load_at_startup=0 \
& &
declare -g MARIADB_PID declare -g MARIADB_PID
@ -458,7 +459,6 @@ docker_setup_db() {
# To create replica user # To create replica user
local createReplicaUser= local createReplicaUser=
local changeMasterTo= local changeMasterTo=
local startReplica=
if [ -n "$MARIADB_REPLICATION_USER" ] ; then if [ -n "$MARIADB_REPLICATION_USER" ] ; then
if [ -z "$MARIADB_MASTER_HOST" ]; then if [ -z "$MARIADB_MASTER_HOST" ]; then
# on master # on master
@ -471,7 +471,6 @@ docker_setup_db() {
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value. # SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;" changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
startReplica="START REPLICA;"
fi fi
fi fi
@ -502,7 +501,6 @@ docker_setup_db() {
${userGrants} ${userGrants}
${changeMasterTo} ${changeMasterTo}
${startReplica}
EOSQL EOSQL
} }
@ -598,8 +596,7 @@ docker_mariadb_upgrade() {
fi fi
mysql_note "Starting temporary server" mysql_note "Starting temporary server"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
mysql_note "Temporary server started." mysql_note "Temporary server started."
docker_mariadb_backup_system docker_mariadb_backup_system
@ -624,8 +621,7 @@ EOSQL
# need a restart as FLUSH PRIVILEGES isn't reversable # need a restart as FLUSH PRIVILEGES isn't reversable
mysql_note "Restarting temporary server for upgrade" mysql_note "Restarting temporary server for upgrade"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
else else
return 0 return 0
fi fi

View File

@ -121,6 +121,7 @@ mysql_get_config() {
docker_temp_server_start() { docker_temp_server_start() {
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
--expire-logs-days=0 \ --expire-logs-days=0 \
--skip-slave-start \
--loose-innodb_buffer_pool_load_at_startup=0 \ --loose-innodb_buffer_pool_load_at_startup=0 \
--skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \ --skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \
& &
@ -460,7 +461,6 @@ docker_setup_db() {
# To create replica user # To create replica user
local createReplicaUser= local createReplicaUser=
local changeMasterTo= local changeMasterTo=
local startReplica=
if [ -n "$MARIADB_REPLICATION_USER" ] ; then if [ -n "$MARIADB_REPLICATION_USER" ] ; then
if [ -z "$MARIADB_MASTER_HOST" ]; then if [ -z "$MARIADB_MASTER_HOST" ]; then
# on master # on master
@ -473,7 +473,6 @@ docker_setup_db() {
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value. # SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;" changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
startReplica="START REPLICA;"
fi fi
fi fi
@ -504,7 +503,6 @@ docker_setup_db() {
${userGrants} ${userGrants}
${changeMasterTo} ${changeMasterTo}
${startReplica}
EOSQL EOSQL
} }
@ -600,8 +598,7 @@ docker_mariadb_upgrade() {
fi fi
mysql_note "Starting temporary server" mysql_note "Starting temporary server"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
mysql_note "Temporary server started." mysql_note "Temporary server started."
docker_mariadb_backup_system docker_mariadb_backup_system
@ -626,8 +623,7 @@ EOSQL
# need a restart as FLUSH PRIVILEGES isn't reversable # need a restart as FLUSH PRIVILEGES isn't reversable
mysql_note "Restarting temporary server for upgrade" mysql_note "Restarting temporary server for upgrade"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
else else
return 0 return 0
fi fi

View File

@ -121,6 +121,7 @@ mysql_get_config() {
docker_temp_server_start() { docker_temp_server_start() {
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
--expire-logs-days=0 \ --expire-logs-days=0 \
--skip-slave-start \
--loose-innodb_buffer_pool_load_at_startup=0 \ --loose-innodb_buffer_pool_load_at_startup=0 \
--skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \ --skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \
& &
@ -460,7 +461,6 @@ docker_setup_db() {
# To create replica user # To create replica user
local createReplicaUser= local createReplicaUser=
local changeMasterTo= local changeMasterTo=
local startReplica=
if [ -n "$MARIADB_REPLICATION_USER" ] ; then if [ -n "$MARIADB_REPLICATION_USER" ] ; then
if [ -z "$MARIADB_MASTER_HOST" ]; then if [ -z "$MARIADB_MASTER_HOST" ]; then
# on master # on master
@ -473,7 +473,6 @@ docker_setup_db() {
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value. # SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;" changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
startReplica="START REPLICA;"
fi fi
fi fi
@ -504,7 +503,6 @@ docker_setup_db() {
${userGrants} ${userGrants}
${changeMasterTo} ${changeMasterTo}
${startReplica}
EOSQL EOSQL
} }
@ -600,8 +598,7 @@ docker_mariadb_upgrade() {
fi fi
mysql_note "Starting temporary server" mysql_note "Starting temporary server"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
mysql_note "Temporary server started." mysql_note "Temporary server started."
docker_mariadb_backup_system docker_mariadb_backup_system
@ -626,8 +623,7 @@ EOSQL
# need a restart as FLUSH PRIVILEGES isn't reversable # need a restart as FLUSH PRIVILEGES isn't reversable
mysql_note "Restarting temporary server for upgrade" mysql_note "Restarting temporary server for upgrade"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
else else
return 0 return 0
fi fi

View File

@ -121,6 +121,7 @@ mysql_get_config() {
docker_temp_server_start() { docker_temp_server_start() {
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
--expire-logs-days=0 \ --expire-logs-days=0 \
--skip-slave-start \
--loose-innodb_buffer_pool_load_at_startup=0 \ --loose-innodb_buffer_pool_load_at_startup=0 \
--skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \ --skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \
& &
@ -460,7 +461,6 @@ docker_setup_db() {
# To create replica user # To create replica user
local createReplicaUser= local createReplicaUser=
local changeMasterTo= local changeMasterTo=
local startReplica=
if [ -n "$MARIADB_REPLICATION_USER" ] ; then if [ -n "$MARIADB_REPLICATION_USER" ] ; then
if [ -z "$MARIADB_MASTER_HOST" ]; then if [ -z "$MARIADB_MASTER_HOST" ]; then
# on master # on master
@ -473,7 +473,6 @@ docker_setup_db() {
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value. # SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;" changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
startReplica="START REPLICA;"
fi fi
fi fi
@ -504,7 +503,6 @@ docker_setup_db() {
${userGrants} ${userGrants}
${changeMasterTo} ${changeMasterTo}
${startReplica}
EOSQL EOSQL
} }
@ -600,8 +598,7 @@ docker_mariadb_upgrade() {
fi fi
mysql_note "Starting temporary server" mysql_note "Starting temporary server"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
mysql_note "Temporary server started." mysql_note "Temporary server started."
docker_mariadb_backup_system docker_mariadb_backup_system
@ -626,8 +623,7 @@ EOSQL
# need a restart as FLUSH PRIVILEGES isn't reversable # need a restart as FLUSH PRIVILEGES isn't reversable
mysql_note "Restarting temporary server for upgrade" mysql_note "Restarting temporary server for upgrade"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
else else
return 0 return 0
fi fi

View File

@ -121,6 +121,7 @@ mysql_get_config() {
docker_temp_server_start() { docker_temp_server_start() {
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
--expire-logs-days=0 \ --expire-logs-days=0 \
--skip-slave-start \
--loose-innodb_buffer_pool_load_at_startup=0 \ --loose-innodb_buffer_pool_load_at_startup=0 \
--skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \ --skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \
& &
@ -460,7 +461,6 @@ docker_setup_db() {
# To create replica user # To create replica user
local createReplicaUser= local createReplicaUser=
local changeMasterTo= local changeMasterTo=
local startReplica=
if [ -n "$MARIADB_REPLICATION_USER" ] ; then if [ -n "$MARIADB_REPLICATION_USER" ] ; then
if [ -z "$MARIADB_MASTER_HOST" ]; then if [ -z "$MARIADB_MASTER_HOST" ]; then
# on master # on master
@ -473,7 +473,6 @@ docker_setup_db() {
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value. # SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;" changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
startReplica="START REPLICA;"
fi fi
fi fi
@ -504,7 +503,6 @@ docker_setup_db() {
${userGrants} ${userGrants}
${changeMasterTo} ${changeMasterTo}
${startReplica}
EOSQL EOSQL
} }
@ -600,8 +598,7 @@ docker_mariadb_upgrade() {
fi fi
mysql_note "Starting temporary server" mysql_note "Starting temporary server"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
mysql_note "Temporary server started." mysql_note "Temporary server started."
docker_mariadb_backup_system docker_mariadb_backup_system
@ -626,8 +623,7 @@ EOSQL
# need a restart as FLUSH PRIVILEGES isn't reversable # need a restart as FLUSH PRIVILEGES isn't reversable
mysql_note "Restarting temporary server for upgrade" mysql_note "Restarting temporary server for upgrade"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
else else
return 0 return 0
fi fi

View File

@ -121,6 +121,7 @@ mysql_get_config() {
docker_temp_server_start() { docker_temp_server_start() {
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \ "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
--expire-logs-days=0 \ --expire-logs-days=0 \
--skip-slave-start \
--loose-innodb_buffer_pool_load_at_startup=0 \ --loose-innodb_buffer_pool_load_at_startup=0 \
--skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \ --skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \
& &
@ -460,7 +461,6 @@ docker_setup_db() {
# To create replica user # To create replica user
local createReplicaUser= local createReplicaUser=
local changeMasterTo= local changeMasterTo=
local startReplica=
if [ -n "$MARIADB_REPLICATION_USER" ] ; then if [ -n "$MARIADB_REPLICATION_USER" ] ; then
if [ -z "$MARIADB_MASTER_HOST" ]; then if [ -z "$MARIADB_MASTER_HOST" ]; then
# on master # on master
@ -473,7 +473,6 @@ docker_setup_db() {
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value. # SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
# shellcheck disable=SC2153 # shellcheck disable=SC2153
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;" changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
startReplica="START REPLICA;"
fi fi
fi fi
@ -504,7 +503,6 @@ docker_setup_db() {
${userGrants} ${userGrants}
${changeMasterTo} ${changeMasterTo}
${startReplica}
EOSQL EOSQL
} }
@ -600,8 +598,7 @@ docker_mariadb_upgrade() {
fi fi
mysql_note "Starting temporary server" mysql_note "Starting temporary server"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
mysql_note "Temporary server started." mysql_note "Temporary server started."
docker_mariadb_backup_system docker_mariadb_backup_system
@ -626,8 +623,7 @@ EOSQL
# need a restart as FLUSH PRIVILEGES isn't reversable # need a restart as FLUSH PRIVILEGES isn't reversable
mysql_note "Restarting temporary server for upgrade" mysql_note "Restarting temporary server for upgrade"
docker_temp_server_start "$@" --skip-grant-tables \ docker_temp_server_start "$@" --skip-grant-tables \
--loose-innodb_buffer_pool_dump_at_shutdown=0 \ --loose-innodb_buffer_pool_dump_at_shutdown=0
--skip-slave-start
else else
return 0 return 0
fi fi