Avoid reproducable mysqld crashes with signal 11

mysqld clears the transaction cache by calling
thd->binlog_flush_pending_rows_event(1);

It crashes mysqld if wsrep_emulate_bin_log is ON and binlogs are
disabled.

https://github.com/codership/mysql-wsrep/issues/112

This patch worksaround this bug by enabling binlogs and setting low
rotation values to avoid running out of disk space.

Please revert this patch after the upstream bug is fixed.

DocImpact: mysql binary logs enabled by default and new mysql hiera
options have been added to allow for configuration of binlog retention.
Closes-Bug: #1541338
Partial-Bug: #1558632

Change-Id: I7c7a4dcf4ab6b8b17e7d4be5fe05088b6917d15b
This commit is contained in:
Dmitry Bilunov 2016-03-17 19:43:32 +03:00
parent 31591691dd
commit a3fdf7faf7
2 changed files with 41 additions and 10 deletions

View File

@ -30,7 +30,13 @@ $custom_setup_class = hiera('mysql_custom_setup_class', 'galera')
# Get galera gcache factor based on cluster node's count # Get galera gcache factor based on cluster node's count
$galera_gcache_factor = count(keys($network_metadata['nodes'])) $galera_gcache_factor = count(keys($network_metadata['nodes']))
$galera_binary_logs = hiera('galera_binary_logs', false) # FIXME(dbilunov): enable binary logs to avoid mysqld crashes (LP#1541338).
# Revert this option to false after the upstream bug is resolved.
# https://github.com/codership/mysql-wsrep/issues/112
$mysql_binary_logs = hiera('mysql_binary_logs', true)
$log_bin = pick($mysql_hash['log_bin'], 'mysql-bin')
$expire_logs_days = pick($mysql_hash['expire_logs_days'], '1')
$max_binlog_size = pick($mysql_hash['max_binlog_size'], '64M')
$status_user = 'clustercheck' $status_user = 'clustercheck'
$status_password = $mysql_hash['wsrep_password'] $status_password = $mysql_hash['wsrep_password']
@ -151,12 +157,12 @@ if $enabled {
} }
# this is configurable via hiera # this is configurable via hiera
if $galera_binary_logs { if $mysql_binary_logs {
$binary_logs_options = { $binary_logs_options = {
'mysqld' => { 'mysqld' => {
'log_bin' => 'mysql-bin', 'log_bin' => $log_bin,
'expire_logs_days' => '1', 'expire_logs_days' => $expire_logs_days,
'max_binlog_size' => '512M', 'max_binlog_size' => $max_binlog_size,
}, },
} }
} }
@ -166,9 +172,8 @@ if $enabled {
'port' => $backend_port, 'port' => $backend_port,
'max_connections' => $max_connections, 'max_connections' => $max_connections,
'pid-file' => undef, 'pid-file' => undef,
'log_bin' => undef,
'expire_logs_days' => undef, 'expire_logs_days' => undef,
'max_binlog_size' => undef, 'log_bin' => undef,
'collation-server' => 'utf8_general_ci', 'collation-server' => 'utf8_general_ci',
'init-connect' => 'SET NAMES utf8', 'init-connect' => 'SET NAMES utf8',
'character-set-server' => 'utf8', 'character-set-server' => 'utf8',

View File

@ -35,6 +35,10 @@ describe manifest do
access_networks = ['240.0.0.0/255.255.0.0'] + other_networks.split(' ') access_networks = ['240.0.0.0/255.255.0.0'] + other_networks.split(' ')
end end
let(:mysql_hash) do
Noop.hiera 'mysql', {}
end
let(:database_nodes) do let(:database_nodes) do
Noop.hiera('database_nodes') Noop.hiera('database_nodes')
end end
@ -47,6 +51,22 @@ describe manifest do
(Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', database_nodes, 'mgmt/database').values (Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', database_nodes, 'mgmt/database').values
end end
let(:mysql_binary_logs) do
Noop.hiera 'mysql_binary_logs', true
end
let(:log_bin) do
Noop.puppet_function 'pick', mysql_hash['log_bin'], 'mysql-bin'
end
let(:expire_logs_days) do
Noop.puppet_function 'pick', mysql_hash['expire_logs_days'], '1'
end
let(:max_binlog_size) do
Noop.puppet_function 'pick', mysql_hash['max_binlog_size'], '64M'
end
let(:primary_controller) do let(:primary_controller) do
Noop.hiera('primary_controller') Noop.hiera('primary_controller')
end end
@ -192,9 +212,15 @@ describe manifest do
) )
end end
it 'should exclude mysql binary logging by default' do it 'should configure mysql binary logging by default' do
expect(subject).to contain_class('galera').without_override_options( expect(subject).to contain_class('galera').with_override_options(
/"logbin"=>"mysql-bin"/ /"log_bin"=>"mysql-bin"/
)
expect(subject).to contain_class('galera').with_override_options(
/"expire_logs_days"=>"#{expire_logs_days}"/
)
expect(subject).to contain_class('galera').with_override_options(
/"max_binlog_size"=>"#{max_binlog_size}"/
) )
end end