mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
MDEV-25292 Better debug trace
Improves readability of DDL log debug traces.
This commit is contained in:
parent
045757af4c
commit
2dc3c32070
1 changed files with 16 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue