summaryrefslogtreecommitdiff
path: root/sql/ddl_log.cc
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2021-04-22 10:47:05 +0300
committerSergei Golubchik <serg@mariadb.org>2021-10-26 17:07:46 +0200
commit2dc3c3207056edbbaa37e4342c5d98c79a0132a0 (patch)
treea689fe6b0b33ae9bdb06cd029a6eed437eb6852f /sql/ddl_log.cc
parent045757af4c301757ba449269351cc27b1691a7d6 (diff)
downloadmariadb-git-2dc3c3207056edbbaa37e4342c5d98c79a0132a0.tar.gz
MDEV-25292 Better debug trace
Improves readability of DDL log debug traces.
Diffstat (limited to 'sql/ddl_log.cc')
-rw-r--r--sql/ddl_log.cc23
1 files changed, 16 insertions, 7 deletions
diff --git a/sql/ddl_log.cc b/sql/ddl_log.cc
index 951a7abd95f..e5ed0caaeaf 100644
--- a/sql/ddl_log.cc
+++ b/sql/ddl_log.cc
@@ -335,7 +335,7 @@ static bool write_ddl_log_file_entry(uint entry_pos)
static bool update_phase(uint entry_pos, uchar phase)
{
DBUG_ENTER("update_phase");
- DBUG_PRINT("enter", ("phase: %d", (int) phase));
+ DBUG_PRINT("ddl_log", ("pos: %u phase: %u", entry_pos, (uint) phase));
DBUG_RETURN(mysql_file_pwrite(global_ddl_log.file_id, &phase, 1,
global_ddl_log.io_size * entry_pos +
@@ -369,6 +369,8 @@ static bool update_next_entry_pos(uint entry_pos, uint next_entry)
uchar buff[4];
DBUG_ENTER("update_next_entry_pos");
+ DBUG_PRINT("ddl_log", ("pos: %u->%u", entry_pos, next_entry));
+
int4store(buff, next_entry);
DBUG_RETURN(mysql_file_pwrite(global_ddl_log.file_id, buff, sizeof(buff),
global_ddl_log.io_size * entry_pos +
@@ -420,6 +422,7 @@ static bool disable_execute_entry(uint entry_pos)
{
uchar buff[1];
DBUG_ENTER("disable_execute_entry");
+ DBUG_PRINT("ddl_log", ("pos: {%u}", entry_pos));
buff[0]= DDL_LOG_IGNORE_ENTRY_CODE;
DBUG_RETURN(mysql_file_pwrite(global_ddl_log.file_id, buff, sizeof(buff),
@@ -1296,13 +1299,15 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
mysql_mutex_assert_owner(&LOCK_gdl);
DBUG_PRINT("ddl_log",
- ("entry type: %u action type: %u (%s) phase: %u next: %u "
+ ("pos: %u=>%u->%u type: %u action: %u (%s) phase: %u "
"handler: '%s' name: '%s' from_name: '%s' tmp_name: '%s'",
+ recovery_state.execute_entry_pos,
+ ddl_log_entry->entry_pos,
+ ddl_log_entry->next_entry,
(uint) ddl_log_entry->entry_type,
(uint) ddl_log_entry->action_type,
ddl_log_action_name[ddl_log_entry->action_type],
(uint) ddl_log_entry->phase,
- ddl_log_entry->next_entry,
ddl_log_entry->handler_name.str,
ddl_log_entry->name.str,
ddl_log_entry->from_name.str,
@@ -2470,13 +2475,13 @@ bool ddl_log_write_entry(DDL_LOG_ENTRY *ddl_log_entry,
error= FALSE;
DBUG_PRINT("ddl_log",
- ("entry type: %u action type: %u (%s) phase: %u next: %u "
+ ("pos: %u->%u action: %u (%s) phase: %u "
"handler: '%s' name: '%s' from_name: '%s' tmp_name: '%s'",
- (uint) ddl_log_entry->entry_type,
+ (*active_entry)->entry_pos,
+ (uint) ddl_log_entry->next_entry,
(uint) ddl_log_entry->action_type,
ddl_log_action_name[ddl_log_entry->action_type],
(uint) ddl_log_entry->phase,
- ddl_log_entry->next_entry,
ddl_log_entry->handler_name.str,
ddl_log_entry->name.str,
ddl_log_entry->from_name.str,
@@ -2542,7 +2547,10 @@ bool ddl_log_write_execute_entry(uint first_entry,
if (ddl_log_get_free_entry(active_entry))
DBUG_RETURN(TRUE);
got_free_entry= TRUE;
- }
+ }
+ DBUG_PRINT("ddl_log",
+ ("pos: %u=>%u",
+ (*active_entry)->entry_pos, first_entry));
if (write_ddl_log_file_entry((*active_entry)->entry_pos))
{
if (got_free_entry)
@@ -2575,6 +2583,7 @@ bool ddl_log_increment_phase(uint entry_pos)
{
bool error;
DBUG_ENTER("ddl_log_increment_phase");
+ DBUG_PRINT("ddl_log", ("pos: %u", entry_pos));
mysql_mutex_lock(&LOCK_gdl);
error= ddl_log_increment_phase_no_lock(entry_pos);