InnoDB: Failing assertion: fsp_flags_is_valid(flags) with encrypted general tablespace

Bug #1737525 reported by Shahriyar Rzayev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Status tracked in 2.4
2.4
In Progress
High
Sergei Glushchenko

Bug Description

Started PS as:

/home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/bin/mysqld --no-defaults --core-file --basedir=/home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug --tmpdir=/home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/data --datadir=/home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/data --plugin-load-add=tokudb=ha_tokudb.so --tokudb-check-jemalloc=0 --plugin-load-add=rocksdb=ha_rocksdb.so --socket=/home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/socket.sock --port=13986 --log-error=/home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/log/master.err --server-id=100 --innodb_buffer_pool_size=1G --innodb_log_file_size=1G --innodb_page_size=4K --early-plugin-load=keyring_file.so --keyring_file_data=/home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/mysql-keyring/keyring --log-bin=mysql-bin --log-slave-updates --server-id=1 --gtid-mode=ON --enforce-gtid-consistency --binlog-format=row

Creating encrypted tablespace:

CREATE TABLESPACE ts3 ADD DATAFILE 'ts3.ibd' ENCRYPTION="Y";
Query OK, 0 rows affected (0.19 sec)

Took backup as:

/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup --defaults-file= --user=root --password='' --target-dir=/home/shahriyar.rzaev/XB_TEST/backup_dir/ps_5_7_x_2_4/cycle1/full/2017-12-11_09-11-02 --backup --socket=/home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/socket.sock --compress=quicklz --compress-chunk-size=65536 --compress-threads=4 --encrypt=AES256 --encrypt-key=VVTBwgM4UhwkTTV98fhuj+D1zyWoA89K --encrypt-threads=4 --encrypt-chunk-size=65536 --slave-info --no-version-check --core-file --parallel=10 --throttle=40 --check-privileges --ftwrl-wait-timeout=0 --ftwrl-wait-query-type=all --ftwrl-wait-threshold=1 --kill-long-queries-timeout=1 --kill-wait-query-type=all --kill-long-query-type=all --no-backup-locks --keyring-file-data=/home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/mysql-keyring/keyring --stream="xbstream" > /home/shahriyar.rzaev/XB_TEST/backup_dir/ps_5_7_x_2_4/cycle1/full/2017-12-11_09-11-02/full_backup.stream
171211 10:26:50 Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: /home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/socket.sock
Using server version 5.7.20-18-debug-log
/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup version 2.4.9 based on MySQL server 5.7.13 Linux (x86_64) (revision id: abdb970)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/data/
xtrabackup: open files limit requested 0, set to 1048576
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = .
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 1073741824
InnoDB: Number of pools: 1
171211 10:26:50 >> log scanned up to (45463907)
xtrabackup: Generating a list of tablespaces
2017-12-11 10:26:50 0x7f4c86a25880 InnoDB: Assertion failure in thread 139966653028480 in file fil0fil.cc line 1232
InnoDB: Failing assertion: fsp_flags_is_valid(flags)
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
10:26:50 UTC - xtrabackup got signal 6 ;
This could be because you hit a bug or data is corrupted.
This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x10000
/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup(my_print_stacktrace+0x35)[0x1518e43]
/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup(handle_fatal_signal+0x2ab)[0x12bbdea]
/usr/lib64/libpthread.so.0(+0xf130)[0x7f4c86613130]
/usr/lib64/libc.so.6(gsignal+0x37)[0x7f4c843125d7]
/usr/lib64/libc.so.6(abort+0x148)[0x7f4c84313cc8]
/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup[0x10f979e]
/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup(_Z16fil_space_createPKcmm10fil_type_t+0x89)[0x103a912]
/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup(_Z31xb_load_single_table_tablespacePKcS0_b+0x28c)[0xdbc9d0]
/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup(_Z32xb_load_single_table_tablespacesPFbPKcS0_E+0x114)[0xdbcd94]
/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup[0xdbd200]
/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup(_Z22xtrabackup_backup_funcv+0xb75)[0xdbf126]
/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup(main+0x920)[0xdc7e8b]
/usr/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f4c842feaf5]
/home/shahriyar.rzaev/XB_TEST/server_dir/target/percona-xtrabackup-2.4.x-debug/bin/xtrabackup[0xdb29a9]

Tags: qa
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Examined a bit assertion.
It is failed on:
(gdb) bt
+bt
#0 0x00007ffff58cd5d7 in raise () from /usr/lib64/libc.so.6
#1 0x00007ffff58cecc8 in abort () from /usr/lib64/libc.so.6
#2 0x00000000010f979e in ut_dbg_assertion_failed (expr=0x1c14f72 "fsp_flags_is_valid(flags)", file=0x1c15148 "/home/shahriyar.rzaev/XB_TEST/server_dir/PXB-2.4-xb-bug1737179/storage/innobase/fil/fil0fil.cc", line=1232) at /home/shahriyar.rzaev/XB_TEST/server_dir/PXB-2.4-xb-bug1737179/storage/innobase/ut/ut0dbg.cc:67
#3 0x000000000103a912 in fil_space_create (name=0x29ef2b0 "ts3", id=112, flags=10432, purpose=FIL_TYPE_TABLESPACE) at /home/shahriyar.rzaev/XB_TEST/server_dir/PXB-2.4-xb-bug1737179/storage/innobase/fil/fil0fil.cc:1232
#4 0x0000000000dbc9d0 in xb_load_single_table_tablespace (dirname=0x0, filname=0x7fffffffb3c0 "ts3.ibd", is_remote=false) at /home/shahriyar.rzaev/XB_TEST/server_dir/PXB-2.4-xb-bug1737179/storage/innobase/xtrabackup/src/xtrabackup.cc:3530
#5 0x0000000000dbcd94 in xb_load_single_table_tablespaces (pred=0xdbc5d7 <xb_check_if_open_tablespace(char const*, char const*)>) at /home/shahriyar.rzaev/XB_TEST/server_dir/PXB-2.4-xb-bug1737179/storage/innobase/xtrabackup/src/xtrabackup.cc:3647
#6 0x0000000000dbd200 in xb_load_tablespaces () at /home/shahriyar.rzaev/XB_TEST/server_dir/PXB-2.4-xb-bug1737179/storage/innobase/xtrabackup/src/xtrabackup.cc:3816
#7 0x0000000000dbf126 in xtrabackup_backup_func () at /home/shahriyar.rzaev/XB_TEST/server_dir/PXB-2.4-xb-bug1737179/storage/innobase/xtrabackup/src/xtrabackup.cc:4781
#8 0x0000000000dc7e8b in main (argc=29, argv=0x7fffffffdd88) at /home/shahriyar.rzaev/XB_TEST/server_dir/PXB-2.4-xb-bug1737179/storage/innobase/xtrabackup/src/xtrabackup.cc:8704

According to source code:
https://github.com/percona/percona-xtrabackup/blob/2.4/storage/innobase/fsp/fsp0fsp.cc#L280

/* Only single-table and not temp tablespaces use the encryption
 clause. */
 if (is_encryption && (is_shared || is_temp)) {
  return(false);
}

With recent changes, i.e creating encrypted general tablespace the clause is_shared is invalidated?
And it can be changed to something like:

/* The encryption is invalid clause for temp tablespaces */
 if (is_encryption && is_temp) {
  return(false);
}

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-520

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.