Add p option to specify max_allowed_packet size

This commit is contained in:
kolzeq
2021-03-25 16:30:08 +01:00
parent 3326a85942
commit da346d0051
5 changed files with 16 additions and 7 deletions

View File

@ -11,7 +11,7 @@ git-crypt unlock /path/to/testing_machine_key.txt
```
git clone https://github.com/rusher/connector-test-machine.git
source connector-test-machine/launch.sh -tTYPE -vVERSION -dDATABASE -nNATIVE
source connector-test-machine/launch.sh -tTYPE -vVERSION -dDATABASE -nNATIVE -pPACKET_SIZE -lLOCAL
```
possible TYPE value :
@ -26,7 +26,11 @@ possible TYPE value :
version is mandatory for non skysql env.
NATIVE permits to indicate if MySQL must use 'mysql_native_password' as default authentication plugin. Possible value "1" or "0". Default value "1".
Optional options :
* PACKET_SIZE permitting to set max_allowed_packet in mb (default 20 if not set)
* LOCAL permit to install MariaDB server locally (not using docker, permitting unix socket testing)
* NATIVE permits to indicate if MySQL must use 'mysql_native_password' as default authentication plugin. Possible value "1" or "0". Default value "1".
environment key CONNECTOR_TEST_SECRET_KEY must be set for skysql and enterprise.

View File

@ -75,6 +75,9 @@ install_local () {
# configuration addition (ssl mostly)
sudo cp $PROJ_PATH/travis/unix.cnf /etc/mysql/conf.d/unix.cnf
sudo echo 'max_allowed_packet=${PACKET_SIZE}M' >> /etc/mysql/conf.d/unix.cnf
sudo echo 'innodb_log_file_size=${PACKET_SIZE}0M' >> /etc/mysql/conf.d/unix.cnf
sudo ls -lrt /etc/mysql/conf.d/
sudo chmod +xr /etc/mysql/conf.d/unix.cnf
tail /etc/mysql/conf.d/unix.cnf
@ -189,13 +192,15 @@ launch_docker () {
export PROJ_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo "parsing parameters"
while getopts ":t:v:d:n:l:debug:" flag; do
PACKET_SIZE=20
while getopts ":t:v:d:n:l:p:debug:" flag; do
case "${flag}" in
t) TYPE=${OPTARG};;
v) VERSION=${OPTARG};;
d) DATABASE=${OPTARG};;
n) NATIVE=${OPTARG};;
l) LOCAL=${OPTARG};;
p) PACKET_SIZE=${OPTARG};;
debug) DEBUG=${OPTARG};;
esac
done
@ -208,6 +213,7 @@ echo "DEBUG: ${DEBUG}"
echo "NATIVE: ${NATIVE}"
echo "LOCAL: ${LOCAL}"
echo "PROJ_PATH: ${PROJ_PATH}"
echo "PACKET_SIZE: ${PACKET_SIZE}"
export TEST_DB_DATABASE=$DATABASE
export TYPE_VERS=$"$TYPE:$VERSION"

View File

@ -2,7 +2,7 @@ version: '2.1'
services:
db:
image: $TYPE_VERS
command: --max-connections=500 --max-allowed-packet=20M --innodb-log-file-size=200M --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --ssl-ca=/etc/sslcert/ca.crt --ssl-cert=/etc/sslcert/server.crt --ssl-key=/etc/sslcert/server.key --bind-address=0.0.0.0 --performance-schema=ON $ADDITIONAL_CONF
command: --max-connections=500 --max-allowed-packet=${PACKET_SIZE}M --innodb-log-file-size=${PACKET_SIZE}0M --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --ssl-ca=/etc/sslcert/ca.crt --ssl-cert=/etc/sslcert/server.crt --ssl-key=/etc/sslcert/server.key --bind-address=0.0.0.0 --performance-schema=ON $ADDITIONAL_CONF
ports:
- 3305:3306
volumes:

View File

@ -2,7 +2,7 @@ version: '2.1'
services:
db:
image: mariadb:10.5
command: --max-connections=500 --max-allowed-packet=20m --innodb-log-file-size=200M --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --ssl-ca=/etc/sslcert/ca.crt --ssl-cert=/etc/sslcert/server.crt --ssl-key=/etc/sslcert/server.key --bind-address=0.0.0.0
command: --max-connections=500 --max-allowed-packet=${PACKET_SIZE}M --innodb-log-file-size=${PACKET_SIZE}0M --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --ssl-ca=/etc/sslcert/ca.crt --ssl-cert=/etc/sslcert/server.crt --ssl-key=/etc/sslcert/server.key --bind-address=0.0.0.0
ports:
- 3305:3306
volumes:

View File

@ -1,9 +1,8 @@
[mysqld]
max_connections=500
max_allowed_packet=20M
innodb_log_file_size=200M
character_set_server=utf8mb4
collation_server=utf8mb4_unicode_ci
ssl_ca=/etc/ssl/mariadb/ca.crt
ssl_cert=/etc/ssl/mariadb/server.crt
ssl_key=/etc/ssl/mariadb/server.key