From 793e5be7707fac95cb71f9c1e74d97424eeef09d Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Thu, 13 Jun 2019 17:54:28 +0300 Subject: 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. --- storage/maria/ma_loghandler.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index 03faadbb42a..beda5f46ff4 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -3856,7 +3856,14 @@ my_bool translog_init_with_table(const char *directory, my_bool pageok; DBUG_PRINT("info", ("The log is really present")); - DBUG_ASSERT(sure_page <= last_page); + if (sure_page > last_page) + { + my_printf_error(HA_ERR_GENERIC, "Aria engine: log data error\n" + "last_log_page: " LSN_FMT " is less than\n" + "checkpoint page: " LSN_FMT, MYF(0), + LSN_IN_PARTS(last_page), LSN_IN_PARTS(sure_page)); + goto err; + } /* TODO: check page size */ @@ -4004,7 +4011,7 @@ my_bool translog_init_with_table(const char *directory, if (!logs_found) { TRANSLOG_FILE *file= (TRANSLOG_FILE*)my_malloc(sizeof(TRANSLOG_FILE), - MYF(0)); + MYF(MY_WME)); DBUG_PRINT("info", ("The log is not found => we will create new log")); if (file == NULL) goto err; -- cgit v1.2.1