[MDEV-16845] Failure upon upgrade from 5.7.23 to 10.2 and 10.3, pagesize 4K Created: 2018-07-29  Updated: 2018-08-05  Resolved: 2018-08-03

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2, 10.3
Fix Version/s: 10.2.17, 10.3.9

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None

Attachments: File data.tar.gz    
Issue Links:
Relates
relates to MDEV-14637 Latching order violation during btr_c... Closed

 Description   

https://travis-ci.org/elenst/travis-tests/jobs/409014461

# 2018-07-28T04:59:50 [24239] Running mysql_upgrade:
# 2018-07-28T04:59:50 [24239]   "/home/travis/server/bin/mysql_upgrade" --host=127.0.0.1 --port=19300 -uroot
ERROR 1071 (42000) at line 596: Specified key was too long; max key length is 768 bytes
ERROR 1071 (42000) at line 600: Specified key was too long; max key length is 768 bytes
ERROR 1071 (42000) at line 603: Specified key was too long; max key length is 768 bytes
FATAL ERROR: Upgrade failed
# 2018-07-28T04:59:51 [24239][ERROR] mysql_upgrade failed

Nothing special is needed on MySQL side, apart from bootstrap with page_size 4K. The pre-created datadir is attached. The exact steps to create it were these:

  • start MySQL 5.7.23 in initialize mode:

    /data/bld/mysql-5.7/bin/mysqld --no-defaults --basedir=/data/bld/mysql-5.7 --datadir=/data/bld/mysql-5.7/data --log-error=/data/bld/mysql-5.7/data/log.err --loose-lc-messages-dir= --loose-language= --port=3306 --socket=/tmp/mysql.sock --tmpdir=/tmp --loose-core-file --initialize --innodb-page-size=4K
    

  • start the same server in normal mode, with skip-grant-tables:

    /data/bld/mysql-5.7/bin/mysqld --no-defaults --basedir=/data/bld/mysql-5.7 --datadir=/data/bld/mysql-5.7/data --log-error=/data/bld/mysql-5.7/data/log.err --loose-lc-messages-dir= --loose-language= --port=3306 --socket=/tmp/mysql.sock --tmpdir=/tmp --loose-core-file --innodb-page-size=4K --skip-grant-tables
    

  • execute

    MySQL [(none)]> flush privileges;
    Query OK, 0 rows affected (0.01 sec)
     
    MySQL [(none)]> set password for root@localhost = '';
    Query OK, 0 rows affected (0.00 sec)
    

  • shut down the server normally.

Note: Upon initialization, MySQL sets one-time password which it writes to the error log. MySQL one-time passwords don't work for me reliably on some reason, that's why I reset it using skip-grant-tables. It's not important for the upgrade issue.

To reproduce the upgrade problem, start recent MariaDB 10.2 on the created datadir (which you either created as above, or unpacked from the attachment). Don't forget innodb_page_size=4K.

The server should complain in the error log but start all right. Then run mysql_upgrade with root user without parameters, like

bin/mysql_upgrade -uroot --protocol=tcp

It complains a lot while running, but the real (fatal) problem happens on phase 4/7:

Phase 4/7: Running 'mysql_fix_privilege_tables'
ERROR 1071 (42000) at line 596: Specified key was too long; max key length is 768 bytes
ERROR 1071 (42000) at line 600: Specified key was too long; max key length is 768 bytes
ERROR 1071 (42000) at line 603: Specified key was too long; max key length is 768 bytes
FATAL ERROR: Upgrade failed



 Comments   
Comment by Marko Mäkelä [ 2018-07-31 ]

I think that we must fix this as part of MDEV-14637. What are the failing SQL statements?

Comment by Elena Stepanova [ 2018-07-31 ]

alter table mysql.innodb_index_stats modify last_update timestamp not null default current_timestamp on update current_timestamp;
alter table mysql.innodb_table_stats modify last_update timestamp not null default current_timestamp on update current_timestamp;

mysql_upgrade runs the statement for innodb_table_stats twice, hence 3 errors.

The SQL error can be reproduced by manually executing the same statements, mysql_upgrade doesn't do anything special to achieve it.

Comment by Marko Mäkelä [ 2018-08-02 ]

The dataset works with bb-10.2-marko, with the second commit of MDEV-14637 which (among other things) makes ha_innobase::max_supported_key_length() return a longer limit for innodb_page_size=4k.

Comment by Marko Mäkelä [ 2018-08-03 ]

Fixed as part of MDEV-14637.

Generated at Thu Feb 08 08:31:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.