Bug #82263 Failing assertion: req_type.is_dblwr_recover() || err == DB_SUCCESS
Submitted: 18 Jul 2016 8:59 Modified: 3 Aug 2016 16:15
Reporter: Shahriyar Rzayev Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version:5.7.13 OS:CentOS (7)
Assigned to: CPU Architecture:Any

[18 Jul 2016 8:59] Shahriyar Rzayev
Description:
Here are the simple steps:
Running "ALTER INSTANCE ROTATE INNODB MASTER KEY" inside loop:

import mysql.connector

cnx = mysql.connector.connect(user='root', password='Baku12345#',
                              host='127.0.0.1',
                              database='dbtest')
cursor = cnx.cursor()

alter_stmt = "ALTER INSTANCE ROTATE INNODB MASTER KEY"

while(True):
        print "Master key rotated"
        cursor.execute(alter_stmt)

cursor.close()
cnx.close()

Trying to alter table to use encryption:

mysql> alter table sbtest1 encryption='Y';
ERROR 2013 (HY000): Lost connection to MySQL server during query

Result:

2016-07-18 12:33:02 0x7f43bcff9700  InnoDB: Assertion failure in thread 139928910403328 in file fil0fil.cc line 5779
InnoDB: Failing assertion: req_type.is_dblwr_recover() || err == DB_SUCCESS

/usr/sbin/mysqld(my_print_stacktrace+0x3b)[0xef0cfb]
/usr/sbin/mysqld(handle_fatal_signal+0x461)[0x7af361]
/lib64/libpthread.so.0(+0xf100)[0x7f43e0833100]
/lib64/libc.so.6(gsignal+0x37)[0x7f43df2265f7]
/lib64/libc.so.6(abort+0x148)[0x7f43df227ce8]
/usr/sbin/mysqld[0x77f71c]
/usr/sbin/mysqld(_Z6fil_ioRK9IORequestbRK9page_id_tRK11page_size_tmmPvS8_+0x79a)[0x118abba]
/usr/sbin/mysqld(_Z13buf_read_pageRK9page_id_tRK11page_size_t+0xe4)[0x1139074]
/usr/sbin/mysqld(_Z16buf_page_get_genRK9page_id_tRK11page_size_tmP11buf_block_tmPKcmP5mtr_tb+0x443)[0x11075b3]
/usr/sbin/mysqld[0x11713ef]
/usr/sbin/mysqld[0x1174bae]
/usr/sbin/mysqld(_Z17dict_stats_updateP12dict_table_t23dict_stats_upd_option_t+0x11df)[0x1177d1f]
/usr/sbin/mysqld(dict_stats_thread+0x9e5)[0x117a345]
/lib64/libpthread.so.0(+0x7dc5)[0x7f43e082bdc5]
/lib64/libc.so.6(clone+0x6d)[0x7f43df2e7ced]

How to repeat:
See description

Suggested fix:
No idea
[2 Aug 2016 8:39] MySQL Verification Team
Hello Shahriyar,

Thank you for the report.
While working on Bug #82355, observed that this is no longer crashing with 5.7.14 build. Could you please confirm at your end?

-- 5.7.14 (just follow the order of steps as in bug report)

[umshastr@hod03]/export/umesh/server/source/bugs/mysql-5.7.14: client/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.14 Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database test;
Query OK, 1 row affected (0.00 sec)

mysql> use test
Database changed
mysql> alter table sbtest1 encryption='Y';
Query OK, 1000000 rows affected (15.68 sec)

mysql> \q

Thanks,
Umesh
[3 Aug 2016 15:32] Shahriyar Rzayev
Confirming with -> mysql-5.7.14-linux-glibc2.5-x86_64.tar.gz
Created a sandbox and tested, no issues:

mysql [localhost] {msandbox} (dbtest) > alter table sbtest1 encryption='Y';
Query OK, 1000000 rows affected (25.91 sec)
Records: 1000000  Duplicates: 0  Warnings: 0
[3 Aug 2016 16:15] MySQL Verification Team
Thank you for confirming! 
Closing the bug for now.

Thanks,
Umesh