summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/mysqltest.cc7
-rwxr-xr-xmysql-test/mysql-test-run.pl2
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev6020.test4
-rw-r--r--sql/mdl.cc20
-rw-r--r--sql/rpl_rli.cc6
5 files changed, 29 insertions, 10 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 84d5abc1a67..66bcb6462e7 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -181,6 +181,7 @@ static uint my_end_arg= 0;
static uint opt_tail_lines= 0;
static uint opt_connect_timeout= 0;
+static uint opt_wait_for_pos_timeout= 0;
static char delimiter[MAX_DELIMITER_LENGTH]= ";";
static uint delimiter_length= 1;
@@ -4659,7 +4660,7 @@ void do_sync_with_master2(struct st_command *command, long offset,
MYSQL_ROW row;
MYSQL *mysql= cur_con->mysql;
char query_buf[FN_REFLEN+128];
- int timeout= 300; /* seconds */
+ int timeout= opt_wait_for_pos_timeout;
if (!master_pos.file[0])
die("Calling 'sync_with_master' without calling 'save_master_pos'");
@@ -7098,6 +7099,10 @@ static struct my_option my_long_options[] =
"Number of seconds before connection timeout.",
&opt_connect_timeout, &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
120, 0, 3600 * 12, 0, 0, 0},
+ {"wait_for_pos_timeout", 0,
+ "Number of seconds to wait for master_pos_wait",
+ &opt_wait_for_pos_timeout, &opt_wait_for_pos_timeout, 0, GET_UINT,
+ REQUIRED_ARG, 300, 0, 3600 * 12, 0, 0, 0},
{"plugin_dir", 0, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 07bf941de05..f3b733a1eac 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -5899,7 +5899,7 @@ sub start_mysqltest ($) {
{
# We are running server under valgrind, which causes some replication
# test to be much slower, notable rpl_mdev6020. Increase timeout.
- mtr_add_arg($args, "--wait-for-pos-timeout=1500");
+ mtr_add_arg($args, "--wait-for-pos-timeout=0");
}
if ( $opt_ssl )
diff --git a/mysql-test/suite/rpl/t/rpl_mdev6020.test b/mysql-test/suite/rpl/t/rpl_mdev6020.test
index 2fd342f5eda..8484e3e11c0 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev6020.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev6020.test
@@ -1,8 +1,10 @@
+# Running this with valgrind can take > 5000 seconds with xtradb
+--source include/not_valgrind.inc
+
--source include/have_innodb.inc
--source include/have_partition.inc
--source include/have_binlog_format_mixed_or_row.inc
--source include/master-slave.inc
-
--connection slave
--source include/stop_slave.inc
diff --git a/sql/mdl.cc b/sql/mdl.cc
index 37699f1847b..57d5d8e7283 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -443,7 +443,9 @@ public:
virtual void notify_conflicting_locks(MDL_context *ctx) = 0;
virtual bitmap_t hog_lock_types_bitmap() const = 0;
+#ifndef DBUG_OFF
bool check_if_conflicting_replication_locks(MDL_context *ctx);
+#endif
/** List of granted tickets for this lock. */
Ticket_list m_granted;
@@ -2303,16 +2305,23 @@ void MDL_scoped_lock::notify_conflicting_locks(MDL_context *ctx)
and trying to get an exclusive lock for the table.
*/
+#ifndef DBUG_OFF
bool MDL_lock::check_if_conflicting_replication_locks(MDL_context *ctx)
{
Ticket_iterator it(m_granted);
MDL_ticket *conflicting_ticket;
+ rpl_group_info *rgi_slave= ctx->get_thd()->rgi_slave;
+
+ if (!rgi_slave->gtid_sub_id)
+ return 0;
while ((conflicting_ticket= it++))
{
if (conflicting_ticket->get_ctx() != ctx)
{
MDL_context *conflicting_ctx= conflicting_ticket->get_ctx();
+ rpl_group_info *conflicting_rgi_slave;
+ conflicting_rgi_slave= conflicting_ctx->get_thd()->rgi_slave;
/*
If the conflicting thread is another parallel replication
@@ -2320,15 +2329,18 @@ bool MDL_lock::check_if_conflicting_replication_locks(MDL_context *ctx)
the current transaction has started too early and something is
seriously wrong.
*/
- if (conflicting_ctx->get_thd()->rgi_slave &&
- conflicting_ctx->get_thd()->rgi_slave->rli ==
- ctx->get_thd()->rgi_slave->rli &&
- !conflicting_ctx->get_thd()->rgi_slave->did_mark_start_commit)
+ if (conflicting_rgi_slave &&
+ conflicting_rgi_slave->gtid_sub_id &&
+ conflicting_rgi_slave->rli == rgi_slave->rli &&
+ conflicting_rgi_slave->current_gtid.domain_id ==
+ rgi_slave->current_gtid.domain_id &&
+ !conflicting_rgi_slave->did_mark_start_commit)
return 1; // Fatal error
}
}
return 0;
}
+#endif
/**
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 1fc92d4ecec..4aed8cdcd94 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -1921,8 +1921,8 @@ rpl_group_info::mark_start_commit_no_lock()
{
if (did_mark_start_commit)
return;
- mark_start_commit_inner(parallel_entry, gco, this);
did_mark_start_commit= true;
+ mark_start_commit_inner(parallel_entry, gco, this);
}
@@ -1933,12 +1933,12 @@ rpl_group_info::mark_start_commit()
if (did_mark_start_commit)
return;
+ did_mark_start_commit= true;
e= this->parallel_entry;
mysql_mutex_lock(&e->LOCK_parallel_entry);
mark_start_commit_inner(e, gco, this);
mysql_mutex_unlock(&e->LOCK_parallel_entry);
- did_mark_start_commit= true;
}
@@ -1981,12 +1981,12 @@ rpl_group_info::unmark_start_commit()
if (!did_mark_start_commit)
return;
+ did_mark_start_commit= false;
e= this->parallel_entry;
mysql_mutex_lock(&e->LOCK_parallel_entry);
--e->count_committing_event_groups;
mysql_mutex_unlock(&e->LOCK_parallel_entry);
- did_mark_start_commit= false;
}