encrypted system tablespace has empty uuid

Description

To reproduce the bug in 5.7 add `ut_ad` from 8.0 for fsp_header_decode_encryption_info():

/* Get server uuid. */ if (version == Encryption::ENCRYPTION_VERSION_2) { memset(srv_uuid, 0, ENCRYPTION_SERVER_UUID_LEN + 1); memcpy(srv_uuid, ptr, ENCRYPTION_SERVER_UUID_LEN); ptr += ENCRYPTION_SERVER_UUID_LEN; ut_ad(strlen(srv_uuid) != 0); }

then run:

./mysql-test/mtr --debug-server innodb.percona_sys_tablespace_encrypt

and check `tmp/sys_encrypt_err.log`

Environment

None

Smart Checklist

Activity

Show:

Ramesh Sivaraman November 18, 2018 at 3:17 PM

Yes it is fixed.

roel.vandepaar November 15, 2018 at 11:56 PM

in summary, this ticket is fully fixed, correct?

Ramesh Sivaraman November 8, 2018 at 8:41 AM

Yes you are right, initialization did not work properly due to the wrong command.

--no-defaults --initialize-insecure these options added multiple times in initialization command.  

 

 

Satya Bodapati November 8, 2018 at 8:33 AM

This looks like a failed bootstrap. Can you list contents of datadir after bootstrap?

 

I am not able to reproduce

Ramesh Sivaraman November 2, 2018 at 5:11 PM

Able to reproduce this issue with .7.23.24

Testcase

rm -Rf /dev/shm/test/1104 mkdir -p /dev/shm/test/1104/data /dev/shm/test/1104/tmp /dev/shm/test/1104/log/qa/ps/work/PS011118-percona-server-5.7.23-24-linux-x86_64-debug/bin/mysqld --no-defaults --initialize-insecure --basedir=/qa/ps/work/PS011118-percona-server-5.7.23-24-linux-x86_64-debug --datadir=/dev/shm/test/1104/data --tmpdir=/dev/shm/test/1104/tmp --core-file --port=55974 --pid_file=/dev/shm/test/1104/pid.pid --socket=/dev/shm/test/1104/socket.sock --log-output=none --log-error=/dev/shm/test/1104/log/master.err --no-defaults --initialize-insecure --innodb_undo_tablespaces=2 --early-plugin-load=keyring_file.so --keyring_file_data=keyring --innodb_sys_tablespace_encrypt=ON /qa/ps/work/PS011118-percona-server-5.7.23-24-linux-x86_64-debug/bin/mysqld --no-defaults --log-output=none --sql_mode=ONLY_FULL_GROUP_BY --early-plugin-load=keyring_file.so --keyring_file_data=keyring --plugin-load=TokuDB=ha_tokudb.so --innodb_sys_tablespace_encrypt=ON --innodb_parallel_dblwr_encrypt=ON --innodb_undo_tablespaces=2 --basedir=/qa/ps/work/PS011118-percona-server-5.7.23-24-linux-x86_64-debug --datadir=/dev/shm/test/1104/data --tmpdir=/dev/shm/test/1104/tmp --core-file --port=55974 --pid_file=/dev/shm/test/1104/pid.pid --socket=/dev/shm/test/1104/socket.sock --log-output=none --log-error=/dev/shm/test/1104/log/master.err > /dev/shm/test/1104/log/master.err 2>&1 &

GDB info

#0 __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62 #1 0x00000000019d8a14 in my_write_core (sig=6) at /qa/ps/work/release-5.7.23-24_dbg/mysys/stacktrace.c:249 #2 0x00000000017290f6 in handle_fatal_signal (sig=6) at /qa/ps/work/release-5.7.23-24_dbg/sql/signal_handler.cc:223 #3 <signal handler called> #4 0x00007fb378045428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 #5 0x00007fb37804702a in __GI_abort () at abort.c:89 #6 0x0000000001d8464f in ut_dbg_assertion_failed (expr=0x24c862a "strlen(srv_uuid) != 0", file=0x24c7bc0 "/qa/ps/work/release-5.7.23-24_dbg/storage/innobase/fsp/fsp0fsp.cc", line=1381) at /qa/ps/work/release-5.7.23-24_dbg/storage/innobase/ut/ut0dbg.cc:67 #7 0x0000000001ea7c9f in fsp_header_decode_encryption_info (key=0x48bb998 "", iv=0x48bb9d8 "", encryption_info=0x7fb36c3e2896 "lCB") at /qa/ps/work/release-5.7.23-24_dbg/storage/innobase/fsp/fsp0fsp.cc:1381 #8 0x0000000001ea7f71 in fsp_header_get_encryption_key (fsp_flags=8192, key=0x48bb998 "", iv=0x48bb9d8 "", page=0x7fb36c3e0000 "\365\324,,") at /qa/ps/work/release-5.7.23-24_dbg/storage/innobase/fsp/fsp0fsp.cc:1478 #9 0x0000000001eb4a52 in Datafile::validate_first_page (this=0x4412f28, flush_lsn=0x7ffda72ac188, for_import=false) at /qa/ps/work/release-5.7.23-24_dbg/storage/innobase/fsp/fsp0file.cc:687 #10 0x0000000001ebc8f5 in SysTablespace::read_lsn_and_check_flags (this=0x2fb9640 <srv_sys_space>, flushed_lsn=0x7ffda72ac188) at /qa/ps/work/release-5.7.23-24_dbg/storage/innobase/fsp/fsp0sysspace.cc:586 #11 0x0000000001ebe050 in SysTablespace::open_or_create (this=0x2fb9640 <srv_sys_space>, is_temp=false, create_new_db=false, sum_new_sizes=0x7ffda72ac1a8, flush_lsn=0x7ffda72ac188) at /qa/ps/work/release-5.7.23-24_dbg/storage/innobase/fsp/fsp0sysspace.cc:942 #12 0x0000000001d1c4a5 in innobase_start_or_create_for_mysql () at /qa/ps/work/release-5.7.23-24_dbg/storage/innobase/srv/srv0start.cc:2187 #13 0x0000000001b02984 in innobase_init (p=0x4528200) at /qa/ps/work/release-5.7.23-24_dbg/storage/innobase/handler/ha_innodb.cc:4682 #14 0x0000000000f3c7cb in ha_initialize_handlerton (plugin=0x45471b8) at /qa/ps/work/release-5.7.23-24_dbg/sql/handler.cc:873 #15 0x00000000015f339a in plugin_initialize (plugin=0x45471b8) at /qa/ps/work/release-5.7.23-24_dbg/sql/sql_plugin.cc:1252 #16 0x00000000015f40b7 in plugin_register_builtin_and_init_core_se (argc=0x2f15b10 <remaining_argc>, argv=0x4410710) at /qa/ps/work/release-5.7.23-24_dbg/sql/sql_plugin.cc:1615 #17 0x00000000017190c5 in init_server_components () at /qa/ps/work/release-5.7.23-24_dbg/sql/mysqld.cc:4350 #18 0x000000000171aa58 in mysqld_main (argc=19, argv=0x4410710) at /qa/ps/work/release-5.7.23-24_dbg/sql/mysqld.cc:5131 #19 0x0000000000f1bcd6 in main (argc=19, argv=0x7ffda72b4778) at /qa/ps/work/release-5.7.23-24_dbg/sql/main.cc:25
Done

Details

Assignee

Reporter

Time tracking

11m logged

Priority

Smart Checklist

Created September 12, 2018 at 10:07 AM
Updated March 6, 2024 at 12:51 PM
Resolved September 25, 2018 at 9:52 AM