diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2015-03-30 14:33:44 +0200 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2015-03-30 14:33:44 +0200 |
commit | 880f2273fdc39cd1a2ab28f448cdfbf3d6581af2 (patch) | |
tree | d1b0f8d7d6ed0243895fac84285d5a7e95287b91 /sql/rpl_parallel.h | |
parent | a4082918c8942b4c72b8f2a65cb237aeaaf10b3e (diff) | |
download | mariadb-git-880f2273fdc39cd1a2ab28f448cdfbf3d6581af2.tar.gz |
MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging
This patch fixes a bug in the error handling in parallel replication, when one
worker thread gets a failure and other worker threads processing later
transactions have to rollback and abort.
The problem was with the lifetime of group_commit_orderer objects (GCOs).
A GCO is freed when we register that its last event group has committed. This
relies on register_wait_for_prior_commit() and wait_for_prior_commit() to
ensure that the fact that T2 has committed implies that any earlier T1 has
also committed, and can thus no longer execute mark_start_commit().
However, in the error case, the code was skipping the
register_wait_for_prior_commit() and wait_for_prior_commit() calls. Thus
commit ordering was not guaranteed, and a GCO could be freed too early. Then a
later mark_start_commit() would reference deallocated GCO, which could lead to
lost wakeup (causing slave threads to hang) or other corruption.
This patch makes also the error case respect commit order. This way, also the
error case gets the GCO lifetime correct, and the hang no longer occurs.
Diffstat (limited to 'sql/rpl_parallel.h')
-rw-r--r-- | sql/rpl_parallel.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h index 2604cd98527..256dffe9828 100644 --- a/sql/rpl_parallel.h +++ b/sql/rpl_parallel.h @@ -53,7 +53,7 @@ struct group_commit_orderer { group_commit_orderer *prev_gco; group_commit_orderer *next_gco; /* - The sub_id of last event group in this the previous GCO. + The sub_id of last event group in the previous GCO. Only valid if prev_gco != NULL. */ uint64 prior_sub_id; |