Bug #97356 Assertion failure: srv0srv.cc:2466:(&(undo::ddl_mutex))->is_owned()
Submitted: 24 Oct 2019 10:42 Modified: 11 Dec 2019 19:36
Reporter: Satya Bodapati (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.17 OS:Any
Assigned to: CPU Architecture:Any

[24 Oct 2019 10:42] Satya Bodapati
Description:
On debug build,

create truncate_recover_03-master.opt at mysql-test/suite/innodb_undo/t and run

./mtr --mem innodb_undo.truncate_recover_03

----
cat truncate_recover_03-master.opt 
$KEYRING_PLUGIN_OPT
--early-plugin-load="keyring_file=$KEYRING_PLUGIN"
--keyring_file_data=$MYSQL_TMP_DIR/mysecret_keyring
--innodb_undo_log_encrypt=1
-----

How to repeat:
See above

Suggested fix:
acquire mutex
[24 Oct 2019 10:43] Satya Bodapati
opt file

Attachment: truncate_recover_03-master.opt (application/octet-stream, text), 151 bytes.

[24 Oct 2019 10:47] Satya Bodapati
Thread 1 (Thread 0x7fa61fffb700 (LWP 3646)):
#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x000055ca0a8d7b00 in my_write_core (sig=6) at /home/satya/WORK/mysql-8.0.17/mysys/stacktrace.cc:305
#2  0x000055ca0956e948 in handle_fatal_signal (sig=6) at /home/satya/WORK/mysql-8.0.17/sql/signal_handler.cc:168
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x00007fa62a828535 in __GI_abort () at abort.c:79
#6  0x000055ca0ad0a902 in ut_dbg_assertion_failed (expr=0x55ca0c729c50 "(&(undo::ddl_mutex))->is_owned()", file=0x55ca0c729328 "/home/satya/WORK/mysql-8.0.17/storage/innobase/srv/srv0srv.cc", line=2466) at /home/satya/WORK/mysql-8.0.17/storage/innobase/ut/ut0dbg.cc:102
#7  0x000055ca0ac6f224 in srv_enable_undo_encryption (is_boot=false) at /home/satya/WORK/mysql-8.0.17/storage/innobase/srv/srv0srv.cc:2466
#8  0x000055ca0ac7a273 in srv_undo_tablespaces_construct (create_new_db=false) at /home/satya/WORK/mysql-8.0.17/storage/innobase/srv/srv0start.cc:1308
#9  0x000055ca0ac7a9db in srv_undo_tablespace_create (space_name=0x7fa618b151b0 "innodb_undo_002", file_name=0x7fa61fff9740 "./undo_002", space_id=4294967151) at /home/satya/WORK/mysql-8.0.17/storage/innobase/srv/srv0start.cc:1445
#10 0x000055ca0ac788ff in srv_undo_tablespace_fixup (space_name=0x7fa618b151b0 "innodb_undo_002", file_name=0x7fa61fff9740 "./undo_002", space_id=4294967278) at /home/satya/WORK/mysql-8.0.17/storage/innobase/srv/srv0start.cc:839
#11 0x000055ca0a9d1fea in Validate_files::check (this=0x7fa61fffa0f0, begin=0x7fa618b15358, end=0x400000002, thread_id=0, moved_count=0x7fa61fffa7b8) at /home/satya/WORK/mysql-8.0.17/storage/innobase/handler/ha_innodb.cc:3237
..
args#0=@0x7fa61fff9f98: 0x7fa61fffa7b8) at /home/satya/WORK/mysql-8.0.17/storage/innobase/include/os0thread-create.h:280
#19 0x000055ca0a9d2cc7 in Validate_files::validate (this=0x7fa61fffa0f0, tablespaces=std::vector of length 9, capacity 16 = {...}, moved_count=0x7fa61fffa7b8) at /home/satya/WORK/mysql-8.0.17/storage/innobase/handler/ha_innodb.cc:3380
#20 0x000055ca0a9d2efd in boot_tablespaces (thd=0x55ca0e4318b0, moved_count=0x7fa61fffa7b8) at /home/satya/WORK/mysql-8.0.17/storage/innobase/handler/ha_innodb.cc:3432
#21 0x000055ca0a9d378a in innobase_dict_recover (dict_recovery_mode=DICT_RECOVERY_RESTART_SERVER, version=80017) at /home/satya/WORK/mysql-8.0.17/storage/innobase/handler/ha_innodb.cc:3592
#22 0x000055ca0a686e1c in (anonymous namespace)::DDSE_dict_recover (thd=0x55ca0e4318b0, dict_recovery_mode=DICT_RECOVERY_RESTART_SERVER, version=80017) at /home/satya/WORK/mysql-8.0.17/sql/dd/impl/bootstrap/bootstrapper.cc:87
#23 0x000055ca0a68ac7f in dd::bootstrap::restart (thd=0x55ca0e4318b0) at /home/satya/WORK/mysql-8.0.17/sql/dd/impl/bootstrap/bootstrapper.cc:925
#24 0x000055ca0a890b2b in dd::upgrade_57::restart_dictionary (thd=0x55ca0e4318b0) at /home/satya/WORK/mysql-8.0.17/sql/dd/upgrade_57/upgrade.cc:790
#25 0x000055ca0a89146f in dd::upgrade_57::do_pre_checks_and_initialize_dd (thd=0x55ca0e4318b0) at /home/satya/WORK/mysql-8.0.17/sql/dd/upgrade_57/upgrade.cc:947
#26 0x000055ca0969e9d4 in bootstrap::handle_bootstrap (arg=0x55ca0e4318b0) at /home/satya/WORK/mysql-8.0.17/sql/bootstrap.cc:347
#27 0x000055ca0b0c622d in pfs_spawn_thread (arg=0x55ca0e3c4510) at /home/satya/WORK/mysql-8.0.17/storage/perfschema/pfs.cc:2854
#28 0x00007fa62b0bf182 in start_thread (arg=<optimized out>) at pthread_create.c:486
#29 0x00007fa62a920b1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
[24 Oct 2019 11:30] Umesh Shastry
Hello Satya,

Thank you for the report and test case.

regards,
Umesh
[24 Oct 2019 11:31] Umesh Shastry
Test results - 8.0.17

Attachment: 97356_8.0.17.results (application/octet-stream, text), 139.04 KiB.

[30 Oct 2019 6:14] Satya Bodapati
This bug is fixed in 8.0.18

https://github.com/mysql/mysql-server/commit/1893011077a9d2b836d88f1b0e2a29198e96487b

Bug#30029433: ASSERTION FAILURE: SRV0SRV.CC:2469:(&(UNDO::DDL_MUTEX))…

…->IS_OWNED()
[30 Oct 2019 6:15] Satya Bodapati
But testcase is missing. This bug can be used to add testcase
[11 Dec 2019 19:36] Daniel Price
Posted by developer:
 
This bug was fixed by the Bug#30029433 patch. The changelog entry for Bug#30029433 was updated to also reference this bug report.
[11 Dec 2019 19:38] Daniel Price
Posted by developer:
 
This bug was fixed by the Bug#30029433 patch. The changelog entry for Bug#30029433 was updated to also reference this bug report.
[11 Dec 2019 19:40] Daniel Price
Posted by developer:
 
Bug #30029433 was fixed in MySQL 8.0.18 and is documented in the 8.0.18 changelog.