Skip to content

Commit 793e5be

Browse files
committed
Give a readable error if aria_log page numbers doesn't match
MDEV-18461 Aria crash recovery failures This does not fix the bug reported in the MDEV, but now we get an error message of the problem instead of an assert.
1 parent 204434f commit 793e5be

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

storage/maria/ma_loghandler.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3856,7 +3856,14 @@ my_bool translog_init_with_table(const char *directory,
38563856
my_bool pageok;
38573857

38583858
DBUG_PRINT("info", ("The log is really present"));
3859-
DBUG_ASSERT(sure_page <= last_page);
3859+
if (sure_page > last_page)
3860+
{
3861+
my_printf_error(HA_ERR_GENERIC, "Aria engine: log data error\n"
3862+
"last_log_page: " LSN_FMT " is less than\n"
3863+
"checkpoint page: " LSN_FMT, MYF(0),
3864+
LSN_IN_PARTS(last_page), LSN_IN_PARTS(sure_page));
3865+
goto err;
3866+
}
38603867

38613868
/* TODO: check page size */
38623869

@@ -4004,7 +4011,7 @@ my_bool translog_init_with_table(const char *directory,
40044011
if (!logs_found)
40054012
{
40064013
TRANSLOG_FILE *file= (TRANSLOG_FILE*)my_malloc(sizeof(TRANSLOG_FILE),
4007-
MYF(0));
4014+
MYF(MY_WME));
40084015
DBUG_PRINT("info", ("The log is not found => we will create new log"));
40094016
if (file == NULL)
40104017
goto err;

0 commit comments

Comments
 (0)