diff options
author | unknown <lars@mysql.com/black.(none)> | 2006-11-13 12:44:53 +0100 |
---|---|---|
committer | unknown <lars@mysql.com/black.(none)> | 2006-11-13 12:44:53 +0100 |
commit | 181c9b4dd4c23c5ef4d8c2562c055e35b6267bfe (patch) | |
tree | 2e35d48c7436cf853a6515a4dccc4e72660d82f3 /sql/slave.cc | |
parent | 383fbde53239a9d4fd4e444a0b6d8942305f74f5 (diff) | |
parent | 7614eb0d1db4819ec6f1c3c59196d1dcb0d0c8d5 (diff) | |
download | mariadb-git-181c9b4dd4c23c5ef4d8c2562c055e35b6267bfe.tar.gz |
Merge mysql.com:/home/bkroot/mysql-5.0-rpl
into mysql.com:/home/bk/MERGE/mysql-5.0-merge
BitKeeper/etc/collapsed:
auto-union
sql/mysql_priv.h:
Auto merged
sql/slave.cc:
Auto merged
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index e3497a4f0ac..25ea918f02f 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3347,9 +3347,9 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) const char *errmsg; /* We were in a transaction which has been rolled back because of a - deadlock (currently, InnoDB deadlock detected by InnoDB) or lock - wait timeout (innodb_lock_wait_timeout exceeded); let's seek back to - BEGIN log event and retry it all again. + Sonera deadlock. if lock wait timeout (innodb_lock_wait_timeout exceeded) + there is no rollback since 5.0.13 (ref: manual). + let's seek back to BEGIN log event and retry it all again. We have to not only seek but also a) init_master_info(), to seek back to hot relay log's start for later (for when we will come back to this hot log after re-processing the @@ -3371,6 +3371,7 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) else { exec_res= 0; + end_trans(thd, ROLLBACK); /* chance for concurrent connection to get more locks */ safe_sleep(thd, min(rli->trans_retries, MAX_SLAVE_RETRY_PAUSE), (CHECK_KILLED_FUNC)sql_slave_killed, (void*)rli); @@ -3388,9 +3389,17 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) "the slave_transaction_retries variable.", slave_trans_retries); } - if (!((thd->options & OPTION_BEGIN) && opt_using_transactions)) - rli->trans_retries= 0; // restart from fresh - } + else if (!((thd->options & OPTION_BEGIN) && opt_using_transactions)) + { + /* + Only reset the retry counter if the event succeeded or + failed with a non-transient error. On a successful event, + the execution will proceed as usual; in the case of a + non-transient error, the slave will stop with an error. + */ + rli->trans_retries= 0; // restart from fresh + } + } return exec_res; } else |