Merge pull request #856 from cfasnacht/ticket/6404-new_maxallowedpacket_parameter
add new backup dump parameter maxallowedpacket
This commit is contained in:
commit
ce892fb01f
7 changed files with 13 additions and 1 deletions
|
@ -509,6 +509,10 @@ Sets the server backup implementation. Valid values are:
|
||||||
* `mysqlbackup`: Implements backups with MySQL Enterprise Backup from Oracle. Backup type: Physical. To use this type of backup, you'll need the `meb` package, which is available in RPM and TAR formats from Oracle. For Ubuntu, you can use [meb-deb](https://github.com/dveeden/meb-deb) to create a package from an official tarball.
|
* `mysqlbackup`: Implements backups with MySQL Enterprise Backup from Oracle. Backup type: Physical. To use this type of backup, you'll need the `meb` package, which is available in RPM and TAR formats from Oracle. For Ubuntu, you can use [meb-deb](https://github.com/dveeden/meb-deb) to create a package from an official tarball.
|
||||||
* `xtrabackup`: Implements backups with XtraBackup from Percona. Backup type: Physical.
|
* `xtrabackup`: Implements backups with XtraBackup from Percona. Backup type: Physical.
|
||||||
|
|
||||||
|
##### `maxallowedpacket`
|
||||||
|
|
||||||
|
Define the maximum SQL statement size for the backup dump script. The default value is 1MB as this is the default Mysql Server value.
|
||||||
|
|
||||||
#### mysql::server::monitor
|
#### mysql::server::monitor
|
||||||
|
|
||||||
##### `mysql_monitor_username`
|
##### `mysql_monitor_username`
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
class mysql::backup::mysqlbackup (
|
class mysql::backup::mysqlbackup (
|
||||||
$backupuser = '',
|
$backupuser = '',
|
||||||
$backuppassword = '',
|
$backuppassword = '',
|
||||||
|
$maxallowedpacket = '1M',
|
||||||
$backupdir = '',
|
$backupdir = '',
|
||||||
$backupdirmode = '0700',
|
$backupdirmode = '0700',
|
||||||
$backupdirowner = 'root',
|
$backupdirowner = 'root',
|
||||||
|
|
|
@ -3,6 +3,7 @@ class mysql::backup::mysqldump (
|
||||||
$backupuser = '',
|
$backupuser = '',
|
||||||
$backuppassword = '',
|
$backuppassword = '',
|
||||||
$backupdir = '',
|
$backupdir = '',
|
||||||
|
$maxallowedpacket = '1M',
|
||||||
$backupdirmode = '0700',
|
$backupdirmode = '0700',
|
||||||
$backupdirowner = 'root',
|
$backupdirowner = 'root',
|
||||||
$backupdirgroup = $mysql::params::root_group,
|
$backupdirgroup = $mysql::params::root_group,
|
||||||
|
|
|
@ -3,6 +3,7 @@ class mysql::backup::xtrabackup (
|
||||||
$backupuser = '',
|
$backupuser = '',
|
||||||
$backuppassword = '',
|
$backuppassword = '',
|
||||||
$backupdir = '',
|
$backupdir = '',
|
||||||
|
$maxallowedpacket = '1M',
|
||||||
$backupmethod = 'mysqldump',
|
$backupmethod = 'mysqldump',
|
||||||
$backupdirmode = '0700',
|
$backupdirmode = '0700',
|
||||||
$backupdirowner = 'root',
|
$backupdirowner = 'root',
|
||||||
|
|
|
@ -20,6 +20,7 @@ class mysql::server::backup (
|
||||||
$postscript = false,
|
$postscript = false,
|
||||||
$execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
|
$execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
|
||||||
$provider = 'mysqldump',
|
$provider = 'mysqldump',
|
||||||
|
$maxallowedpacket = '1M',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if $prescript and $provider =~ /(mysqldump|mysqlbackup)/ {
|
if $prescript and $provider =~ /(mysqldump|mysqlbackup)/ {
|
||||||
|
@ -47,6 +48,7 @@ class mysql::server::backup (
|
||||||
'prescript' => $prescript,
|
'prescript' => $prescript,
|
||||||
'postscript' => $postscript,
|
'postscript' => $postscript,
|
||||||
'execpath' => $execpath,
|
'execpath' => $execpath,
|
||||||
|
'maxallowedpacket' => $maxallowedpacket,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,12 @@ describe 'mysql::server::backup' do
|
||||||
let(:default_params) {
|
let(:default_params) {
|
||||||
{ 'backupuser' => 'testuser',
|
{ 'backupuser' => 'testuser',
|
||||||
'backuppassword' => 'testpass',
|
'backuppassword' => 'testpass',
|
||||||
|
'maxallowedpacket' => '1M',
|
||||||
'backupdir' => '/tmp',
|
'backupdir' => '/tmp',
|
||||||
'backuprotate' => '25',
|
'backuprotate' => '25',
|
||||||
'delete_before_dump' => true,
|
'delete_before_dump' => true,
|
||||||
'execpath' => '/usr/bin:/usr/sbin:/bin:/sbin:/opt/zimbra/bin',
|
'execpath' => '/usr/bin:/usr/sbin:/bin:/sbin:/opt/zimbra/bin',
|
||||||
|
'maxallowedpacket' => '1M',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,13 @@
|
||||||
|
|
||||||
USER=<%= @backupuser %>
|
USER=<%= @backupuser %>
|
||||||
PASS='<%= @backuppassword %>'
|
PASS='<%= @backuppassword %>'
|
||||||
|
MAX_ALLOWED_PACKET=<%= @maxallowedpacket %>
|
||||||
DIR=<%= @backupdir %>
|
DIR=<%= @backupdir %>
|
||||||
ROTATE=<%= [ Integer(@backuprotate) - 1, 0 ].max %>
|
ROTATE=<%= [ Integer(@backuprotate) - 1, 0 ].max %>
|
||||||
|
|
||||||
# Create temporary mysql cnf file.
|
# Create temporary mysql cnf file.
|
||||||
TMPFILE=`mktemp /tmp/backup.XXXXXX` || exit 1
|
TMPFILE=`mktemp /tmp/backup.XXXXXX` || exit 1
|
||||||
echo -e "[client]\npassword=$PASS\nuser=$USER" > $TMPFILE
|
echo -e "[client]\npassword=$PASS\nuser=$USER\nmax_allowed_packet=$MAX_ALLOWED_PACKET" > $TMPFILE
|
||||||
|
|
||||||
# Ensure backup directory exist.
|
# Ensure backup directory exist.
|
||||||
mkdir -p $DIR
|
mkdir -p $DIR
|
||||||
|
|
Loading…
Reference in a new issue