Skip to content

Commit

Permalink
Fixed issues found by buildbot
Browse files Browse the repository at this point in the history
- MDEV-11621 rpl.rpl_gtid_stop_start fails sporadically in buildbot
- MDEV-11620 rpl.rpl_upgrade_master_info fails sporadically in buildbot

The issue above was probably that the build machine was overworked and the
shutdown took longer than 30 resp 10 seconds, which caused MyISAM tables
to be marked as crashed.
Fixed by flushing myisam tables before doing a forced shutdown/kill.
I also increased timeout for forced shutdown from 10 seconds to 60 seconds
to fix other possible issues on slow machines.

Fixed also some compiler warnings
  • Loading branch information
montywi committed Jan 11, 2017
1 parent 1afb170 commit 1628a2a
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 15 deletions.
1 change: 1 addition & 0 deletions client/mysqltest.cc
Expand Up @@ -5156,6 +5156,7 @@ uint get_errcode_from_name(const char *error_name, const char *error_end)
handler_error_names)))
return tmp;
die("Unknown SQL error name '%s'", error_name);
return 0; // Keep compiler happy
}

const char *unknown_error= "<Unknown>";
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/include/rpl_stop_server.inc
Expand Up @@ -47,8 +47,8 @@ if ($rpl_debug)
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect

# Send shutdown to the connected server and give
# it 10 seconds to die before zapping it
shutdown_server 10;
# it 60 seconds to die before zapping it
shutdown_server 60;

--source include/wait_until_disconnected.inc

Expand Down
6 changes: 6 additions & 0 deletions mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
Expand Up @@ -55,6 +55,7 @@ INSERT INTO t1 VALUES(5);
include/save_master_gtid.inc
connection server_2;
include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;
a
1
Expand Down Expand Up @@ -87,6 +88,7 @@ a
connection server_1;
INSERT INTO t1 VALUES (7);
connection server_2;
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;
a
1
Expand Down Expand Up @@ -116,6 +118,7 @@ include/start_slave.inc
connection server_1;
INSERT INTO t1 VALUES (8);
connection server_2;
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;
a
1
Expand All @@ -142,6 +145,7 @@ Error 1286 Unknown storage engine 'InnoDB'
connection server_1;
INSERT INTO t1 VALUES (9);
connection server_2;
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;
a
1
Expand Down Expand Up @@ -171,6 +175,7 @@ domain_id COUNT(*)
connection server_1;
INSERT INTO t1 VALUES (11);
connection server_2;
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
domain_id COUNT(*)
0 2
Expand All @@ -180,6 +185,7 @@ connection server_1;
INSERT INTO t1 VALUES (12);
INSERT INTO t1 VALUES (13);
connection server_2;
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
domain_id COUNT(*)
0 2
Expand Down
5 changes: 5 additions & 0 deletions mysql-test/suite/rpl/r/rpl_upgrade_master_info.result
Expand Up @@ -14,6 +14,7 @@ connection slave;
CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
include/start_slave.inc
include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1;
a
1
Expand All @@ -27,6 +28,7 @@ connection slave;
CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
include/start_slave.inc
include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;
a
1
Expand All @@ -41,6 +43,7 @@ connection slave;
CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
include/start_slave.inc
include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;
a
1
Expand All @@ -56,6 +59,7 @@ connection slave;
CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
include/start_slave.inc
include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;
a
1
Expand All @@ -72,6 +76,7 @@ connection slave;
CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
include/start_slave.inc
include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;
a
1
Expand Down
6 changes: 6 additions & 0 deletions mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
Expand Up @@ -92,6 +92,7 @@ INSERT INTO t1 VALUES(5);

--connection server_2
--source include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;

--echo *** Test that @@gtid_slave_pos and @@gtid_current_pos are correctly loaded even if slave threads have not started. ***
Expand Down Expand Up @@ -136,6 +137,7 @@ INSERT INTO t1 VALUES (7);

--connection server_2
--sync_with_master
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;

# Now we restart the slave server. When it restarts, there is nothing new
Expand Down Expand Up @@ -177,6 +179,7 @@ INSERT INTO t1 VALUES (8);

--connection server_2
--sync_with_master
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;
--source include/stop_slave.inc

Expand Down Expand Up @@ -210,6 +213,7 @@ INSERT INTO t1 VALUES (9);

--connection server_2
--sync_with_master
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;

# Put things back as they were.
Expand Down Expand Up @@ -248,6 +252,7 @@ INSERT INTO t1 VALUES (11);

--connection server_2
--sync_with_master
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;

--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
Expand All @@ -270,6 +275,7 @@ INSERT INTO t1 VALUES (13);

--connection server_2
--sync_with_master
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;


Expand Down
5 changes: 5 additions & 0 deletions mysql-test/suite/rpl/t/rpl_upgrade_master_info.test
Expand Up @@ -29,6 +29,7 @@ INSERT INTO t1 VALUES (1);
eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
--source include/start_slave.inc
--source include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1;

--source include/stop_slave.inc
Expand All @@ -54,6 +55,7 @@ INSERT INTO t1 VALUES (2);
eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
--source include/start_slave.inc
--source include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;

--source include/stop_slave.inc
Expand All @@ -79,6 +81,7 @@ INSERT INTO t1 VALUES (3);
eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
--source include/start_slave.inc
--source include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;

--source include/stop_slave.inc
Expand All @@ -104,6 +107,7 @@ INSERT INTO t1 VALUES (4);
eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
--source include/start_slave.inc
--source include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;

--source include/stop_slave.inc
Expand All @@ -129,6 +133,7 @@ INSERT INTO t1 VALUES (5);
eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
--source include/start_slave.inc
--source include/sync_with_master_gtid.inc
FLUSH NO_WRITE_TO_BINLOG TABLES;
SELECT * FROM t1 ORDER BY a;

--source include/stop_slave.inc
Expand Down
6 changes: 3 additions & 3 deletions sql/compat56.cc
Expand Up @@ -65,7 +65,7 @@ void TIME_from_longlong_time_packed(MYSQL_TIME *ltime, longlong tmp)
long hms;
if ((ltime->neg= (tmp < 0)))
tmp= -tmp;
hms= MY_PACKED_TIME_GET_INT_PART(tmp);
hms= (long) MY_PACKED_TIME_GET_INT_PART(tmp);
ltime->year= (uint) 0;
ltime->month= (uint) 0;
ltime->day= (uint) 0;
Expand Down Expand Up @@ -264,11 +264,11 @@ void TIME_from_longlong_datetime_packed(MYSQL_TIME *ltime, longlong tmp)

ltime->day= ymd % (1 << 5);
ltime->month= ym % 13;
ltime->year= ym / 13;
ltime->year= (uint) (ym / 13);

ltime->second= hms % (1 << 6);
ltime->minute= (hms >> 6) % (1 << 6);
ltime->hour= (hms >> 12);
ltime->hour= (uint) (hms >> 12);

ltime->time_type= MYSQL_TIMESTAMP_DATETIME;
}
Expand Down
2 changes: 1 addition & 1 deletion sql/item_jsonfunc.cc
Expand Up @@ -2307,7 +2307,7 @@ bool Item_func_json_search::fix_fields(THD *thd, Item **ref)
}


static const uint SQR_MAX_BLOB_WIDTH= sqrt(MAX_BLOB_WIDTH);
static const uint SQR_MAX_BLOB_WIDTH= (uint) sqrt(MAX_BLOB_WIDTH);

void Item_func_json_search::fix_length_and_dec()
{
Expand Down
8 changes: 4 additions & 4 deletions sql/log_event.cc
Expand Up @@ -1794,7 +1794,7 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet,
if (fdle->crypto_data.scheme)
{
uchar iv[BINLOG_IV_LENGTH];
fdle->crypto_data.set_iv(iv, my_b_tell(file) - data_len);
fdle->crypto_data.set_iv(iv, (uint32) (my_b_tell(file) - data_len));

char *newpkt= (char*)my_malloc(data_len + ev_offset + 1, MYF(MY_WME));
if (!newpkt)
Expand Down Expand Up @@ -7058,7 +7058,7 @@ Binlog_checkpoint_log_event::Binlog_checkpoint_log_event(
uint8 header_size= description_event->common_header_len;
uint8 post_header_len=
description_event->post_header_len[BINLOG_CHECKPOINT_EVENT-1];
if (event_len < header_size + post_header_len ||
if (event_len < (uint) header_size + (uint) post_header_len ||
post_header_len < BINLOG_CHECKPOINT_HEADER_LEN)
return;
buf+= header_size;
Expand Down Expand Up @@ -7096,7 +7096,7 @@ Gtid_log_event::Gtid_log_event(const char *buf, uint event_len,
{
uint8 header_size= description_event->common_header_len;
uint8 post_header_len= description_event->post_header_len[GTID_EVENT-1];
if (event_len < header_size + post_header_len ||
if (event_len < (uint) header_size + (uint) post_header_len ||
post_header_len < GTID_HEADER_LEN)
return;

Expand Down Expand Up @@ -7421,7 +7421,7 @@ Gtid_list_log_event::Gtid_list_log_event(const char *buf, uint event_len,
uint32 val;
uint8 header_size= description_event->common_header_len;
uint8 post_header_len= description_event->post_header_len[GTID_LIST_EVENT-1];
if (event_len < header_size + post_header_len ||
if (event_len < (uint) header_size + (uint) post_header_len ||
post_header_len < GTID_LIST_HEADER_LEN)
return;

Expand Down
4 changes: 0 additions & 4 deletions storage/innobase/row/row0ftsort.cc
Expand Up @@ -793,7 +793,6 @@ fts_parallel_tokenization(
mem_heap_t* blob_heap = NULL;
fts_doc_t doc;
dict_table_t* table = psort_info->psort_common->new_table;
dict_field_t* idx_field;
fts_tokenize_ctx_t t_ctx;
ulint retried = 0;
dberr_t error = DB_SUCCESS;
Expand Down Expand Up @@ -822,9 +821,6 @@ fts_parallel_tokenization(
doc.charset = fts_index_get_charset(
psort_info->psort_common->dup->index);

idx_field = dict_index_get_nth_field(
psort_info->psort_common->dup->index, 0);

block = psort_info->merge_block;
crypt_block = psort_info->crypt_block;
crypt_data = psort_info->psort_common->crypt_data;
Expand Down
2 changes: 1 addition & 1 deletion storage/mroonga/vendor/groonga/lib/proc.c
Expand Up @@ -713,7 +713,7 @@ grn_select_drilldown(grn_ctx *ctx, grn_obj *table,
{
uint32_t i;
for (i = 0; i < n_keys; i++) {
grn_table_group_result g = {NULL, 0, 0, 1, GRN_TABLE_GROUP_CALC_COUNT, 0};
grn_table_group_result g = {NULL, 0, 0, 1, GRN_TABLE_GROUP_CALC_COUNT, 0, 0 ,0};
uint32_t n_hits;
int offset;
int limit;
Expand Down

0 comments on commit 1628a2a

Please sign in to comment.