Repository navigation
MDEV-41843 Forcing rotation of Aria log files - #6135
sanja-byelkin wants to merge 1 commit into
Conversation
Backup needs to switch Aria to a new log file so that the finished files can be copied without blocking commits. Added translog_rotate() and handlerton::rotate_logs (ha_rotate_logs()), implemented for Aria. Nothing in the server calls it yet (BACKUP SERVER will), so it is tested by the unit test ma_test_loghandler_rotate-t. Rotation of a log without records makes files with no records, which were not handled: - the header of such a file got max LSN 0, which purge takes for a file still in writing and never passes; now it gets the last address of the file - the scan for the first record (recovery without a checkpoint, aria_read_log) stopped at the filler of the empty file and found no records; now it goes on to the next page - the log start left a page of the empty log pinned Assisted-by: Claude:claude-opus-5-5
|
|
dr-m
left a comment
There was a problem hiding this comment.
I wonder what this is needed for. The function maria_backup_log_tail() in #4817 is copying the last ENGINE=Aria log file. Disabling the critical part in it by applying the following patch:
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index c0eb72c8727..c6b526d272c 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -4118,7 +4118,7 @@ static bool maria_backup_log_tail(const backup_target &target,
my_close(s, MYF(0));
return true;
}
- if (translog_cut_page(buf, end))
+ if (0 && translog_cut_page(buf, end))
{
my_error(ER_ERROR_ON_READ, MYF(0), name, HA_ERR_CRASHED);
goto fail;would make one test crash on recovery:
CURRENT_TEST: backup.backup_aria_log_end
…
2026-11-12 15:45:09 0 [Note] Plugin 'InnoDB' is disabled.
mariadbd: /mariadb/main/storage/maria/ma_loghandler.c:7195: translog_read_record_header_from_buffer: Assertion `translog_is_LSN_chunk(page[page_offset])' failed.
I believe that this should demonstrate that the log in its present format is being recovered just fine.
| bool ha_rotate_logs() | ||
| { | ||
| return plugin_foreach(NULL, rotate_logs_handlerton, | ||
| MYSQL_STORAGE_ENGINE_PLUGIN, 0); | ||
| } |
There was a problem hiding this comment.
This seems to be dead code. I don’t see any caller of it. Was an SQL interface to this forgotten? I do not see any SQL test case being added either.
Backup needs to switch Aria to a new log file so that the finished files can be copied without blocking commits.
Added translog_rotate() and handlerton::rotate_logs (ha_rotate_logs()), implemented for Aria. Nothing in the server calls it yet (BACKUP SERVER will), so it is tested by the unit test ma_test_loghandler_rotate-t.
Rotation of a log without records makes files with no records, which were not handled:
Assisted-by: Claude:claude-opus-5-5