summaryrefslogtreecommitdiff
path: root/sql/backup.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2021-06-17 20:15:24 +0300
committerMonty <monty@mariadb.org>2021-06-19 03:46:00 +0300
commit93f5d40656e3faa6cac9fe66934f6d8f3aa15d98 (patch)
tree3cdd0c52e0ec3598931d9a158ec7b861f985be88 /sql/backup.cc
parent15e1fbc37d5a60967295dc0855c2ef5741856a6d (diff)
downloadmariadb-git-93f5d40656e3faa6cac9fe66934f6d8f3aa15d98.tar.gz
Fixed debug_sync timeout in deadlock_drop_table
The issue was that we sent two different signals to different threads after each other. The DEBUG_SYNC functionality cannot handle this (as the signal is stored in a global variable) and the first one can get lost. Fixed by using the same signal for both threads.
Diffstat (limited to 'sql/backup.cc')
-rw-r--r--sql/backup.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/backup.cc b/sql/backup.cc
index 1b3007c5a00..5367a75b094 100644
--- a/sql/backup.cc
+++ b/sql/backup.cc
@@ -258,16 +258,19 @@ static bool backup_flush(THD *thd)
static bool backup_block_ddl(THD *thd)
{
+ PSI_stage_info org_stage;
DBUG_ENTER("backup_block_ddl");
kill_delayed_threads();
mysql_ha_cleanup_no_free(thd);
+ thd->backup_stage(&org_stage);
+ THD_STAGE_INFO(thd, stage_waiting_for_flush);
/* Wait until all non trans statements has ended */
if (thd->mdl_context.upgrade_shared_lock(backup_flush_ticket,
MDL_BACKUP_WAIT_FLUSH,
thd->variables.lock_wait_timeout))
- DBUG_RETURN(1);
+ goto err;
/*
Remove not used tables from the table share. Flush all changes to
@@ -284,6 +287,7 @@ static bool backup_block_ddl(THD *thd)
We didn't do this lock above, as we wanted DDL's to be executed while
we wait for non transactional tables (which may take a while).
*/
+ THD_STAGE_INFO(thd, stage_waiting_for_ddl);
if (thd->mdl_context.upgrade_shared_lock(backup_flush_ticket,
MDL_BACKUP_WAIT_DDL,
thd->variables.lock_wait_timeout))
@@ -293,12 +297,16 @@ static bool backup_block_ddl(THD *thd)
was called so that this function can be called again
*/
backup_flush_ticket->downgrade_lock(MDL_BACKUP_FLUSH);
- DBUG_RETURN(1);
+ goto err;
}
/* There can't be anything more that needs to be logged to ddl log */
+ THD_STAGE_INFO(thd, org_stage);
stop_ddl_logging();
DBUG_RETURN(0);
+err:
+ THD_STAGE_INFO(thd, org_stage);
+ DBUG_RETURN(1);
}