3714 Luis Soares 2012-03-05 [merge]
BUG#13681205
Automerge with latest mysql-trunk.
modified:
mysql-test/suite/rpl/r/rpl_mts_debug.result
mysql-test/suite/rpl/t/rpl_mts_debug.test
mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result
sql/rpl_rli_pdb.cc
sql/rpl_slave.cc
sql/rpl_slave.h
3713 brajmohan saxena 2012-03-05
Bug 12635232 - VALGRIND WARNINGS: IS_IPV6, IS_IPV4, INET6_ATON,
INET6_NTOA + MULTIBYTE CHARSET
Problem : valgrind warnings due to some wrong checking of character
values before checking charcter string boundaries.
Solution: checking string length before evaluating character
string values.
added:
mysql-test/include/ctype_inet.inc
modified:
mysql-test/r/ctype_ascii.result
mysql-test/r/ctype_big5.result
mysql-test/r/ctype_binary.result
mysql-test/r/ctype_cp1250_ch.result
mysql-test/r/ctype_cp1251.result
mysql-test/r/ctype_eucjpms.result
mysql-test/r/ctype_euckr.result
mysql-test/r/ctype_gb2312.result
mysql-test/r/ctype_gbk.result
mysql-test/r/ctype_latin1.result
mysql-test/r/ctype_latin2.result
mysql-test/r/ctype_sjis.result
mysql-test/r/ctype_tis620.result
mysql-test/r/ctype_ujis.result
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8mb4.result
mysql-test/t/ctype_ascii.test
mysql-test/t/ctype_big5.test
mysql-test/t/ctype_binary.test
mysql-test/t/ctype_cp1250_ch.test
mysql-test/t/ctype_cp1251.test
mysql-test/t/ctype_eucjpms.test
mysql-test/t/ctype_euckr.test
mysql-test/t/ctype_gb2312.test
mysql-test/t/ctype_gbk.test
mysql-test/t/ctype_latin1.test
mysql-test/t/ctype_latin2.test
mysql-test/t/ctype_sjis.test
mysql-test/t/ctype_tis620.test
mysql-test/t/ctype_ujis.test
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8mb4.test
sql/item_inetfunc.cc
=== modified file 'mysql-test/suite/rpl/r/rpl_mts_debug.result'
--- a/mysql-test/suite/rpl/r/rpl_mts_debug.result 2011-12-16 15:53:16 +0000
+++ b/mysql-test/suite/rpl/r/rpl_mts_debug.result 2012-03-05 16:35:12 +0000
@@ -36,4 +36,26 @@ set @@global.slave_checkpoint_group= @sa
set @@global.slave_parallel_workers= @save.slave_parallel_workers;
set @@global.debug= @save.debug;
include/start_slave.inc
+include/rpl_reset.inc
+include/stop_slave.inc
+call mtr.add_suppression("option 'slave_checkpoint_group': unsigned value 524281 adjusted to 524280");
+call mtr.add_suppression("Failed during slave worker thread create");
+call mtr.add_suppression("Slave SQL: Failed during slave workers initialization, Error_code: 1593");
+SET GLOBAL slave_parallel_workers= 2;
+SET GLOBAL slave_checkpoint_group=524281;
+Warnings:
+Warning 1292 Truncated incorrect slave_checkpoint_group value: '524281'
+include/start_slave.inc
+include/assert.inc [Assert that slave_checkpoint_group was truncated to a valid value.]
+include/check_slave_is_running.inc
+include/rpl_reset.inc
+include/stop_slave.inc
+SET GLOBAL debug= "d,inject_init_worker_init_info_fault";
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error.inc [errno=1593]
+SET GLOBAL debug="";
+SET GLOBAL slave_checkpoint_group= 512;
+SET GLOBAL slave_parallel_workers= 0;
+include/start_slave.inc
+include/rpl_reset.inc
include/rpl_end.inc
=== modified file 'mysql-test/suite/rpl/t/rpl_mts_debug.test'
--- a/mysql-test/suite/rpl/t/rpl_mts_debug.test 2011-12-16 15:53:16 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mts_debug.test 2012-03-05 16:35:12 +0000
@@ -73,7 +73,7 @@ set @save.slave_parallel_workers= @@glob
# The following assignment can work only with debug builds.
# It sets opt_slave_checkpoint_group to one more to its VALID_RANGE() maximum.
-# set @@global.slave_checkpoint_group= 524287 + 1;
+# set @@global.slave_checkpoint_group= 524280 + 1;
set @save.debug= @@global.debug;
SET @@global.debug= "d,mts_worker_thread_fails";
@@ -89,5 +89,60 @@ set @@global.debug= @save.debug;
source include/start_slave.inc;
+#
+# BUG#13681205 : REPLICATION FAILS DURING SLAVE WORKERS INITIALIZATION,
+# CRASHES SLAVE
+#
+# This test checks that the slave starts correctly, even
+# if we set the maximum of slave_checkpoint_group higher
+# than the maximum (the server adjusts it to the proper
+# value).
+#
+--connection master
+--source include/rpl_reset.inc
+
+--connection slave
+--source include/stop_slave.inc
+call mtr.add_suppression("option 'slave_checkpoint_group': unsigned value 524281 adjusted to 524280");
+call mtr.add_suppression("Failed during slave worker thread create");
+call mtr.add_suppression("Slave SQL: Failed during slave workers initialization, Error_code: 1593");
+
+--let $saved_slave_checkpoint_group= `SELECT @@global.slave_checkpoint_group`
+--let $saved_slave_parallel_workers= `SELECT @@global.slave_parallel_workers`
+SET GLOBAL slave_parallel_workers= 2;
+SET GLOBAL slave_checkpoint_group=524281;
+
+## TEST #1
+
+# check that slave will start with the slave_checkpoint_group
+# if include/start_slave.inc does not timeout then the slave was able to start correctly
+--source include/start_slave.inc
+
+--let $assert_cond= @@slave_checkpoint_group=524280
+--let $assert_text= Assert that slave_checkpoint_group was truncated to a valid value.
+--source include/assert.inc
+
+--source include/check_slave_is_running.inc
+
+--source include/rpl_reset.inc
+
+## TEST #2
+#
+# Check that even if the initialization of the info storage
+# fails the server won't crash.
+
+--source include/stop_slave.inc
+--let $saved_debug=`SELECT @global.debug`
+SET GLOBAL debug= "d,inject_init_worker_init_info_fault";
+START SLAVE SQL_THREAD;
+--let $slave_sql_errno=1593
+--source include/wait_for_slave_sql_error.inc
+--eval SET GLOBAL debug="$saved_debug"
+
+## clean up
+--eval SET GLOBAL slave_checkpoint_group= $saved_slave_checkpoint_group
+--eval SET GLOBAL slave_parallel_workers= $saved_slave_parallel_workers
+--source include/start_slave.inc
+--source include/rpl_reset.inc
--source include/rpl_end.inc
=== modified file 'mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result'
--- a/mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result 2011-11-24 18:26:55 +0000
+++ b/mysql-test/suite/sys_vars/r/slave_checkpoint_group_basic.result 2012-03-05 16:35:12 +0000
@@ -39,7 +39,7 @@ Warnings:
Warning 1292 Truncated incorrect slave_checkpoint_group value: '18446744073709551615'
select @@global.slave_checkpoint_group as "truncated to the maximum" ;
truncated to the maximum
-524287
+524280
SET @@global.slave_checkpoint_group = @start_global_value;
SELECT @@global.slave_checkpoint_group;
@@global.slave_checkpoint_group
=== modified file 'sql/rpl_rli_pdb.cc'
--- a/sql/rpl_rli_pdb.cc 2012-01-23 09:58:04 +0000
+++ b/sql/rpl_rli_pdb.cc 2012-03-05 16:35:12 +0000
@@ -114,12 +114,14 @@ Slave_worker::~Slave_worker()
*/
int Slave_worker::init_worker(Relay_log_info * rli, ulong i)
{
+ DBUG_ENTER("Slave_worker::init_worker");
uint k;
Slave_job_item empty= {NULL};
c_rli= rli;
- if (init_info())
- return 1;
+ if (init_info() ||
+ DBUG_EVALUATE_IF("inject_init_worker_init_info_fault", true, false))
+ DBUG_RETURN(1);
id= i;
curr_group_exec_parts.elements= 0;
@@ -132,22 +134,23 @@ int Slave_worker::init_worker(Relay_log_
end_group_sets_max_dbs= false;
last_group_done_index= c_rli->gaq->size; // out of range
+ DBUG_ASSERT(!jobs.inited_queue);
jobs.avail= 0;
jobs.len= 0;
jobs.overfill= FALSE; // todo: move into Slave_jobs_queue constructor
jobs.waited_overfill= 0;
jobs.entry= jobs.size= c_rli->mts_slave_worker_queue_len_max;
+ jobs.inited_queue= true;
curr_group_seen_begin= curr_group_seen_gtid= false;
my_init_dynamic_array(&jobs.Q, sizeof(Slave_job_item), jobs.size, 0);
for (k= 0; k < jobs.size; k++)
insert_dynamic(&jobs.Q, (uchar*) &empty);
-
DBUG_ASSERT(jobs.Q.elements == jobs.size);
wq_overrun_set= FALSE;
- return 0;
+ DBUG_RETURN(0);
}
int Slave_worker::init_info()
=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc 2012-02-21 00:34:41 +0000
+++ b/sql/rpl_slave.cc 2012-03-05 16:35:12 +0000
@@ -4683,7 +4683,8 @@ err:
if (error && w)
{
w->end_info();
- delete_dynamic(&w->jobs.Q);
+ if (w->jobs.inited_queue)
+ delete_dynamic(&(w->jobs.Q));
delete w;
/*
Any failure after dynarray inserted must follow with deletion
=== modified file 'sql/rpl_slave.h'
--- a/sql/rpl_slave.h 2012-01-16 22:21:16 +0000
+++ b/sql/rpl_slave.h 2012-03-05 16:35:12 +0000
@@ -57,7 +57,14 @@ typedef enum { SLAVE_THD_IO, SLAVE_THD_S
#define MTS_WORKER_UNDEF ((ulong) -1)
#define MTS_MAX_WORKERS 1024
-#define MTS_MAX_BITS_IN_GROUP ((1L << 19) - 1) /* 524287 */
+
+/*
+ When using tables to store the slave workers bitmaps,
+ we use a BLOB field. The maximum size of a BLOB is:
+
+ 2^16-1 = 65535 bytes => (2^16-1) * 8 = 524280 bits
+*/
+#define MTS_MAX_BITS_IN_GROUP ((1L << 19) - 8) /* 524280 */
// Forward declarations
class Relay_log_info;
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (luis.soares:3713 to 3714) Bug#13681205 | Luis Soares | 5 Mar |