mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
branches/zip: Undo changes commited in r1832.
These should have gone to branches/fts. Spotted by: Marko and Ken
This commit is contained in:
@@ -1911,12 +1911,7 @@ retry:
|
||||
trx->mysql_log_file_name = mysql_bin_log_file_name();
|
||||
trx->mysql_log_offset = (ib_longlong) mysql_bin_log_file_pos();
|
||||
|
||||
/* Don't do write + flush right now. For group commit
|
||||
to work we want to do the flush after releasing the
|
||||
prepare_commit_mutex. */
|
||||
trx->flush_log_later = TRUE;
|
||||
innobase_commit_low(trx);
|
||||
trx->flush_log_later = FALSE;
|
||||
|
||||
if (srv_commit_concurrency > 0) {
|
||||
pthread_mutex_lock(&commit_cond_m);
|
||||
@@ -1930,8 +1925,6 @@ retry:
|
||||
pthread_mutex_unlock(&prepare_commit_mutex);
|
||||
}
|
||||
|
||||
/* Now do a write + flush of logs. */
|
||||
trx_commit_complete_for_mysql(trx);
|
||||
trx->active_trans = 0;
|
||||
|
||||
} else {
|
||||
@@ -7740,7 +7733,32 @@ innobase_xa_prepare(
|
||||
int error = 0;
|
||||
trx_t* trx = check_trx_exists(thd);
|
||||
|
||||
if (thd_sql_command(thd) != SQLCOM_XA_PREPARE &&
|
||||
(all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
|
||||
{
|
||||
|
||||
/* For ibbackup to work the order of transactions in binlog
|
||||
and InnoDB must be the same. Consider the situation
|
||||
|
||||
thread1> prepare; write to binlog; ...
|
||||
<context switch>
|
||||
thread2> prepare; write to binlog; commit
|
||||
thread1> ... commit
|
||||
|
||||
To ensure this will not happen we're taking the mutex on
|
||||
prepare, and releasing it on commit.
|
||||
|
||||
Note: only do it for normal commits, done via ha_commit_trans.
|
||||
If 2pc protocol is executed by external transaction
|
||||
coordinator, it will be just a regular MySQL client
|
||||
executing XA PREPARE and XA COMMIT commands.
|
||||
In this case we cannot know how many minutes or hours
|
||||
will be between XA PREPARE and XA COMMIT, and we don't want
|
||||
to block for undefined period of time.
|
||||
*/
|
||||
pthread_mutex_lock(&prepare_commit_mutex);
|
||||
trx->active_trans = 2;
|
||||
}
|
||||
|
||||
if (!THDVAR(thd, support_xa)) {
|
||||
|
||||
@@ -7793,33 +7811,6 @@ innobase_xa_prepare(
|
||||
|
||||
srv_active_wake_master_thread();
|
||||
|
||||
if (thd_sql_command(thd) != SQLCOM_XA_PREPARE &&
|
||||
(all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
|
||||
{
|
||||
|
||||
/* For ibbackup to work the order of transactions in binlog
|
||||
and InnoDB must be the same. Consider the situation
|
||||
|
||||
thread1> prepare; write to binlog; ...
|
||||
<context switch>
|
||||
thread2> prepare; write to binlog; commit
|
||||
thread1> ... commit
|
||||
|
||||
To ensure this will not happen we're taking the mutex on
|
||||
prepare, and releasing it on commit.
|
||||
|
||||
Note: only do it for normal commits, done via ha_commit_trans.
|
||||
If 2pc protocol is executed by external transaction
|
||||
coordinator, it will be just a regular MySQL client
|
||||
executing XA PREPARE and XA COMMIT commands.
|
||||
In this case we cannot know how many minutes or hours
|
||||
will be between XA PREPARE and XA COMMIT, and we don't want
|
||||
to block for undefined period of time.
|
||||
*/
|
||||
pthread_mutex_lock(&prepare_commit_mutex);
|
||||
trx->active_trans = 2;
|
||||
}
|
||||
|
||||
return(error);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user