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

Test migration from MySQL 5.7 with named tablespaces to MariaDB 10.2

    XMLWordPrintable

Details

    • Task
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2
    • Tests
    • None

    Description

      We don't expect live upgrade to work when MySQL 5.7 has tables using named tablespaces, but the goal is to find out how exactly it does not work, in order to avoid data corruption and improve the diagnostics.

      General test flow:

      • start the "old" server;
      • execute some SQL related to tablespaces;
      • shutdown the server (with innodb_fast_shutdown=0);
      • start the "new" server on the same datadir;
      • run mysql_upgrade;
      • shutdown the server;
      • start the server again;
      • execute some SQL related to tablespaces.

      RESULTS

      Test 1: Migration of an empty tablespace

      Result: OK
      The tablespace is simply ignored

      Test 2: Migration of one tablespace with a simple table

      Variant A: debug server

      Result: FAIL (assertion failure)
      Server fails to start

      10.2 a06da5c848e6

      mysqld: /data/src/10.2/storage/innobase/dict/dict0load.cc:1304: ulint dict_check_sys_tables(bool): Assertion `!((flags & ((~(~0U << 1)) << 0)) >> 0) || flags2 & 16U' failed.
      170320 15:46:27 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f8e86733312 in __GI___assert_fail (assertion=0x7f8e89cc0370 "!((flags & ((~(~0U << 1)) << 0)) >> 0) || flags2 & 16U", file=0x7f8e89cbfb48 "/data/src/10.2/storage/innobase/dict/dict0load.cc", line=1304, function=0x7f8e89cc2e80 <dict_check_sys_tables(bool)::__PRETTY_FUNCTION__> "ulint dict_check_sys_tables(bool)") at assert.c:101
      #8  0x00007f8e898645fd in dict_check_sys_tables (validate=true) at /data/src/10.2/storage/innobase/dict/dict0load.cc:1303
      #9  0x00007f8e89864a3e in dict_check_tablespaces_and_store_max_id (validate=false) at /data/src/10.2/storage/innobase/dict/dict0load.cc:1398
      #10 0x00007f8e89745790 in innobase_start_or_create_for_mysql () at /data/src/10.2/storage/innobase/srv/srv0start.cc:2459
      #11 0x00007f8e89583625 in innobase_init (p=0x7f8e85c4d0f0) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:4453
      #12 0x00007f8e8927b73e in ha_initialize_handlerton (plugin=0x7f8e85ef3880) at /data/src/10.2/sql/handler.cc:512
      #13 0x00007f8e89029378 in plugin_initialize (tmp_root=0x7ffeb991f370, plugin=0x7f8e85ef3880, argc=0x7f8e8a54d7f0 <remaining_argc>, argv=0x7f8e85c481a8, options_only=false) at /data/src/10.2/sql/sql_plugin.cc:1415
      #14 0x00007f8e89029f2f in plugin_init (argc=0x7f8e8a54d7f0 <remaining_argc>, argv=0x7f8e85c481a8, flags=0) at /data/src/10.2/sql/sql_plugin.cc:1690
      #15 0x00007f8e88f375e9 in init_server_components () at /data/src/10.2/sql/mysqld.cc:5249
      #16 0x00007f8e88f38668 in mysqld_main (argc=11, argv=0x7f8e85c481a8) at /data/src/10.2/sql/mysqld.cc:5841
      #17 0x00007f8e88f2d620 in main (argc=11, argv=0x7ffeb99200b8) at /data/src/10.2/sql/main.cc:25
      

      Variant B: release server

      Result: FAIL (Table doesn't exist in engine)
      Server starts and allows mysql_upgrade, but an attempt to use or even see the table causes failure:

      bin/mysql -uroot --protocol=tcp test -e 'SHOW CREATE TABLE t1'
      ERROR 1932 (42S02) at line 1: Table 'test.t1' doesn't exist in engine
      

      10.2.4

      2017-03-20 15:51:05 140532080670592 [ERROR] InnoDB: In file './space1f1.ibd', tablespace id and flags are 37 and 0, but in the InnoDB data dictionary they are 37 and 0x21. Have you moved InnoDB .ibd files around without using the commands DISCARD TABLESPACE and IMPORT TABLESPACE? Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
      2017-03-20 15:51:05 140532080670592 [ERROR] InnoDB: Operating system error number 2 in a file operation.
      2017-03-20 15:51:05 140532080670592 [ERROR] InnoDB: The error means the system cannot find the path specified.
      2017-03-20 15:51:05 140532080670592 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
      2017-03-20 15:51:05 140532080670592 [ERROR] InnoDB: Could not find a valid tablespace file for `test/t1`. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
      2017-03-20 15:51:05 140532080670592 [Warning] InnoDB: Ignoring tablespace for `test`.`t1` because it could not be opened.
      2017-03-20 15:51:06 140532079878912 [ERROR] InnoDB: Failed to find tablespace for table `test`.`t1` in the cache. Attempting to load the tablespace with space id 37
      2017-03-20 15:51:06 140532079878912 [ERROR] InnoDB: Operating system error number 2 in a file operation.
      2017-03-20 15:51:06 140532079878912 [ERROR] InnoDB: The error means the system cannot find the path specified.
      2017-03-20 15:51:06 140532079878912 [ERROR] InnoDB: Cannot open datafile for read-only: './test/t1.ibd' OS error: 71
      2017-03-20 15:51:06 140532079878912 [ERROR] InnoDB: Operating system error number 2 in a file operation.
      2017-03-20 15:51:06 140532079878912 [ERROR] InnoDB: The error means the system cannot find the path specified.
      2017-03-20 15:51:06 140532079878912 [ERROR] InnoDB: Could not find a valid tablespace file for `test/t1`. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
      2017-03-20 15:51:06 140532079878912 [Warning] InnoDB: Cannot calculate statistics for table `test`.`t1` because the .ibd file is missing. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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