1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.2 into 10.3

This commit is contained in:
Marko Mäkelä
2021-04-22 07:32:51 +03:00
9 changed files with 325 additions and 19 deletions

View File

@@ -6908,6 +6908,9 @@ int MYSQL_BIN_LOG::rotate_and_purge(bool force_rotate,
bool check_purge= false;
mysql_mutex_lock(&LOCK_log);
DEBUG_SYNC(current_thd, "rotate_after_acquire_LOCK_log");
prev_binlog_id= current_binlog_id;
if ((err_gtid= do_delete_gtid_domain(domain_drop_lex)))
@@ -6918,11 +6921,22 @@ int MYSQL_BIN_LOG::rotate_and_purge(bool force_rotate,
}
else if (unlikely((error= rotate(force_rotate, &check_purge))))
check_purge= false;
DEBUG_SYNC(current_thd, "rotate_after_rotate");
/*
NOTE: Run purge_logs wo/ holding LOCK_log because it does not need
the mutex. Otherwise causes various deadlocks.
Explicit binlog rotation must be synchronized with a concurrent
binlog ordered commit, in particular not let binlog
checkpoint notification request until early binlogged
concurrent commits have has been completed.
*/
mysql_mutex_lock(&LOCK_after_binlog_sync);
mysql_mutex_unlock(&LOCK_log);
mysql_mutex_lock(&LOCK_commit_ordered);
mysql_mutex_unlock(&LOCK_after_binlog_sync);
mysql_mutex_unlock(&LOCK_commit_ordered);
if (check_purge)
checkpoint_and_purge(prev_binlog_id);
@@ -8079,7 +8093,12 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
}
DEBUG_SYNC(leader->thd, "commit_before_get_LOCK_commit_ordered");
mysql_mutex_lock(&LOCK_commit_ordered);
DBUG_EXECUTE_IF("crash_before_engine_commit",
{
DBUG_SUICIDE();
});
last_commit_pos_offset= commit_offset;
/*