Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-19128

file_name_parse() handes path MLOG_FILE_XXX in OS-dependend way

    XMLWordPrintable

Details

    Description

      file_name_parse() handes path MLOG_FILE_XXX in OS-dependend way, making it impossible e.g to prepare backup from Linux on Windows.

      As an example, I have this output trying to prepare backup from MDEV-18309 on Windows

       2019-04-01 14:57:16 0 [ERROR] InnoDB: MLOG_FILE_NAME incorrect:./test/t1.ibd
      2019-04-01 14:57:16 0 [ERROR] InnoDB: ############### CORRUPT LOG RECORD FOUND ##################
      2019-04-01 14:57:16 0 [Note] InnoDB: Log record type 55, page 211:0. Log parsing proceeded successfully up to 37116468. Previous log record type 128, is multi 0 Recv offset 0, prev 0
      2019-04-01 14:57:16 0 [Note] InnoDB: Hex dump starting 0 bytes before and ending 100 bytes after the corrupted record:
      len 100; hex 3780d300000e2e2f746573742f74312e696264003780dd00000e2e2f746573742f74362e69626400370100001f2e2f6d7973716c2f696e6e6f64625f7461626c655f73746174732e69626400370200001f2e2f6d7973716c2f696e6e6f64625f696e6465; as
      ibd 7    ./mysql/innodb_table_stats.ibd 7    ./mysql/innodb_inde;
      2019-04-01 14:57:16 0 [Note] InnoDB: Set innodb_force_recovery to ignore this error.
      2019-04-01 14:57:16 0 [Warning] InnoDB: Log scan aborted at LSN 37148160
      2019-04-01 14:57:16 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1848] with error Generic error
      [00] 2019-04-01 14:57:17 mariabackup: innodb_init() returned 11 (Generic error).
      

      quick and dirty fix makes it possible again

      diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
      index 70a705cd026..c0b31e7f8c4 100644
      --- a/storage/innobase/log/log0recv.cc
      +++ b/storage/innobase/log/log0recv.cc
      @@ -445,8 +445,8 @@ fil_name_parse(
              and end in .ibd. */
              bool corrupt = is_predefined_tablespace(space_id)
                      || len < sizeof "/a.ibd\0"
      -               || (!first_page_no != !memcmp(ptr + len - 5, DOT_IBD, 5))
      -               || memchr(ptr, OS_PATH_SEPARATOR, len) == NULL;
      +               || (!first_page_no != !memcmp(ptr + len - 5, DOT_IBD, 5));
      +               //|| memchr(ptr, OS_PATH_SEPARATOR, len) == NULL;
       
              byte*   end_ptr = ptr + len;
       
      @@ -513,8 +513,8 @@ fil_name_parse(
       
                      corrupt = corrupt
                              || new_len < sizeof "/a.ibd\0"
      -                       || memcmp(new_name + new_len - 5, DOT_IBD, 5) != 0
      -                       || !memchr(new_name, OS_PATH_SEPARATOR, new_len);
      +                       || memcmp(new_name + new_len - 5, DOT_IBD, 5) != 0;
      +                       //|| !memchr(new_name, OS_PATH_SEPARATOR, new_len);
       
                      if (corrupt) {
                              ib::error() << "MLOG_FILE_RENAME2 new_name incorrect:" << ptr
      

      Attachments

        Activity

          People

            marko Marko Mäkelä
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.