diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2015-06-29 11:41:06 +0200 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2015-06-29 11:52:03 +0200 |
commit | 888b6cd31c256785f6c4dfc97d3107332e900aee (patch) | |
tree | a6bd6606e8130a230c81a19adeaf901a73f24cba /sql/sql_class.cc | |
parent | a6087e7dc1ef3561d8189c8db15e9591d0f9b520 (diff) | |
download | mariadb-git-10.0-custombld.tar.gz |
MDEV-8302: Duplicate key with parallel replication10.0-custombld
Intermediate patch to try to track down the root cause of the problem by
running a custom binary on the user's actual load.
This patch adds some printouts in the error log, all prefixed with
"MDEV8302:", that will hopefully trigger when the error condition occurs and
give more information about what is happening.
In addition, this patch implements what might or might not be a fix for the
error (along with a printout to show if the fix actually triggers).
The fix is to add a check for thd->killed just before a transaction does
mark_start_commit(). This could help reduce the chance of a transaction
detecting a deadlock kill only after running mark_start_commit(), which
might be a source of the original duplicate key problem (though no concrete
sequence of events is currently known to be able to cause this condition).
Finally, this patch marks the generated binaries with a -mdev8302a version
postfix to help identify them.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index cf0c4a1b84f..f7416fcce6d 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -4309,6 +4309,14 @@ thd_report_wait_for(MYSQL_THD thd, MYSQL_THD other_thd) cause replication to rollback (and later re-try) the other transaction, releasing the lock for this transaction so replication can proceed. */ + fprintf(stderr, "MDEV8302: Deadlock kill GTID %u-%u-%lu (subid %lu " + "in_commit=%d) due to blocking GTID %u-%u-%lu (subid %lu " + "in_commit=%d)\n", other_rgi->current_gtid.domain_id, + other_rgi->current_gtid.server_id, + (ulong)other_rgi->current_gtid.seq_no, (ulong)other_rgi->gtid_sub_id, + (int)other_rgi->did_mark_start_commit, rgi->current_gtid.domain_id, + rgi->current_gtid.server_id, (ulong)rgi->current_gtid.seq_no, + (ulong)rgi->gtid_sub_id, (int)rgi->did_mark_start_commit); other_rgi->killed_for_retry= true; mysql_mutex_lock(&other_thd->LOCK_thd_data); other_thd->awake(KILL_CONNECTION); |