sachin
5797cbaf4a
MDEV-10259 mysqld crash with certain statement length and...
...
order with Galera and encrypt-tmp-files=1
Problem:- If trans_cache (IO_CACHE) uses encrypted tmp file
then on next DML server will crash.
Case:-
Lets take a case , we have a table t1 , We try to do 2 inserts in t1
1. A really long insert so that trans_cache has to use temp_file
2. Just a small insert
Analysis:- Actually server crashes from inside of galera
library.
/lib64/libc.so.6(abort+0x175)[0x7fb5ba779dc5]
/usr/lib64/galera/libgalera_smm.so(_ZN6galera3FSMINS_9TrxHandle5State...
mysys/stacktrace.c:247(my_print_stacktrace)[0x7fb5a714940e]
sql/signal_handler.cc:160(handle_fatal_signal)[0x7fb5a715c1bd]
sql/wsrep_hton.cc:257(wsrep_rollback)[0x7fb5bcce923a]
sql/wsrep_hton.cc:268(wsrep_rollback)[0x7fb5bcce9368]
sql/handler.cc:1658(ha_rollback_trans(THD*, bool))[0x7fb5bcd4f41a]
sql/handler.cc:1483(ha_commit_trans(THD*, bool))[0x7fb5bcd4f804]
but actual issue is not in galera but in mariadb, because for 2nd
insert we should never call rollback. We are calling rollback because
log_and_order fails it fails because write_cache fails , It fails
because after reinit_io_cache(trans_cache) , my_b_bytes_in_cache says 0
so we look into tmp_file for data , which is obviously wrong since temp
was used for previous insert and it no longer exist.
wsrep_write_cache_inc() reads the IO_CACHE in a loop, filling it with
my_b_fill() until it returns "0 bytes read". Later
MYSQL_BIN_LOG::write_cache() does the same. wsrep_write_cache_inc()
assumes that reading a zero bytes past EOF leaves the old data in the
cache
Solution:- There is two issue in my_b_encr_read
1st we should never equal read_end to info->buffer. I mean this
does not make sense read_end should always point to end of buffer.
2nd For most of the case(apart from async IO_CACHE) info->pos_in_file
should be equal to info->buffer position wrt to temp file , since
in this case we are not changing info->buffer it should remain
unchanged.
2018-05-22 13:47:42 +05:30
..
2014-10-01 23:38:27 +02:00
2015-07-14 16:05:29 -04:00
2016-06-27 18:21:00 -04:00
2016-09-28 13:26:13 -04:00
2015-10-01 20:36:25 -04:00
2017-04-06 15:41:54 +05:30
2014-09-03 18:51:02 +03:00
2016-08-21 16:17:09 -04:00
2017-08-16 07:49:19 +03:00
2017-04-06 15:41:54 +05:30
2017-04-06 15:41:54 +05:30
2017-04-06 15:41:54 +05:30
2017-04-06 15:41:54 +05:30
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2017-08-14 11:42:13 +03:00
2017-08-14 11:42:13 +03:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-12-18 14:35:56 -05:00
2018-03-27 14:23:45 +02:00
2017-08-14 12:42:00 +03:00
2015-07-14 16:05:29 -04:00
2016-08-21 16:17:03 -04:00
2015-09-09 22:42:42 -04:00
2015-09-09 22:42:42 -04:00
2015-09-09 22:53:38 -04:00
2015-09-09 21:36:03 -04:00
2017-08-14 11:42:13 +03:00
2018-03-14 10:26:02 +01:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-09-09 21:38:58 -04:00
2015-07-14 16:05:29 -04:00
2017-04-06 15:41:54 +05:30
2017-12-09 11:21:23 +02:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2016-02-24 01:21:40 -05:00
2015-09-08 17:46:03 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2017-08-14 11:44:27 +03:00
2018-03-20 12:10:41 +02:00
2015-07-14 16:05:29 -04:00
2017-04-06 15:41:54 +05:30
2015-09-09 21:36:03 -04:00
2018-05-22 13:47:42 +05:30
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2014-09-30 18:06:15 -04:00
2014-09-30 18:06:15 -04:00
2014-09-30 18:06:15 -04:00
2014-09-30 18:06:15 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2014-09-30 18:06:15 -04:00
2014-09-30 18:06:15 -04:00
2014-09-30 18:06:15 -04:00
2016-02-23 20:33:21 -05:00
2016-02-24 01:21:40 -05:00
2016-03-22 01:35:56 -04:00
2016-02-22 12:58:02 -05:00
2015-07-14 16:05:29 -04:00
2015-09-09 20:56:41 -04:00
2017-04-06 15:41:54 +05:30
2017-04-06 15:41:54 +05:30
2017-04-06 15:41:54 +05:30
2016-08-21 16:17:03 -04:00
2016-02-22 17:48:13 -05:00
2015-07-14 16:05:29 -04:00
2018-04-11 09:14:35 +02:00
2017-12-25 13:57:42 +05:30
2018-03-28 11:46:23 +02:00
2015-07-14 16:05:29 -04:00
2017-08-14 11:42:13 +03:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2018-04-26 13:58:31 +02:00
2017-08-11 14:15:23 +03:00
2016-08-21 16:17:06 -04:00
2017-08-14 13:00:57 +03:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-09-09 21:36:03 -04:00
2016-08-21 16:20:07 -04:00
2015-07-14 16:05:29 -04:00
2018-04-24 16:32:44 +02:00
2015-07-14 16:05:29 -04:00
2018-04-09 07:28:13 +03:00
2016-02-24 01:21:40 -05:00
2016-08-21 16:17:11 -04:00
2015-07-14 16:05:29 -04:00
2014-09-30 18:06:15 -04:00
2017-08-14 11:42:13 +03:00
2015-12-10 12:39:54 +02:00
2017-04-06 15:41:54 +05:30
2017-01-31 13:34:49 +05:30
2017-09-27 10:15:08 +05:30
2016-02-23 20:33:21 -05:00
2015-09-09 22:39:28 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2014-09-30 18:06:15 -04:00
2014-09-30 18:06:15 -04:00
2014-09-30 18:06:15 -04:00
2015-07-14 16:05:29 -04:00
2017-08-14 11:42:13 +03:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2018-04-08 09:03:55 +03:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-09-14 15:26:50 -04:00
2017-08-14 11:42:13 +03:00
2015-07-14 16:05:29 -04:00
2015-09-21 20:49:31 -04:00
2015-07-14 16:05:29 -04:00
2016-08-25 15:39:39 -04:00
2015-07-14 16:05:29 -04:00
2017-04-06 15:41:54 +05:30
2016-08-25 21:28:26 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2016-08-21 16:17:08 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2018-03-20 12:10:41 +02:00
2015-09-09 21:40:07 -04:00
2016-03-22 00:38:21 -04:00
2016-12-20 15:31:18 -05:00
2015-08-08 15:04:15 -04:00
2015-09-09 21:36:03 -04:00
2016-08-21 16:17:12 -04:00
2015-07-14 16:05:29 -04:00
2018-03-23 00:55:20 +01:00
2018-03-23 00:55:20 +01:00
2016-04-28 16:30:34 +03:00
2018-03-23 00:55:20 +01:00
2018-03-23 00:55:20 +01:00
2018-03-23 00:55:20 +01:00
2018-03-23 00:55:20 +01:00
2015-09-09 22:39:26 -04:00
2015-09-09 21:36:03 -04:00
2018-03-23 00:55:20 +01:00
2018-03-23 00:55:20 +01:00
2015-07-14 16:05:29 -04:00
2015-09-09 22:31:06 -04:00
2015-07-14 16:05:29 -04:00
2018-03-27 12:05:33 +02:00
2017-08-21 13:35:00 +03:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2018-04-05 10:31:42 +03:00
2017-04-06 15:41:54 +05:30
2015-09-08 17:43:48 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2017-04-06 15:41:54 +05:30
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2017-04-06 15:41:54 +05:30
2015-07-14 16:05:29 -04:00
2016-08-21 16:17:05 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2017-08-14 11:42:13 +03:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2018-04-27 11:05:04 +02:00
2017-01-31 12:28:09 -05:00
2018-03-20 12:10:41 +02:00
2016-08-21 16:17:03 -04:00
2018-03-23 00:55:19 +01:00
2014-09-30 18:06:15 -04:00
2015-02-27 22:33:41 -05:00
2015-07-14 16:05:29 -04:00
2015-08-20 09:55:54 -04:00
2015-09-09 22:42:31 -04:00
2017-01-31 12:28:09 -05:00
2016-08-25 15:39:39 -04:00
2014-09-30 18:06:15 -04:00
2018-02-22 14:22:44 +02:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2018-03-20 12:10:41 +02:00
2014-09-30 18:06:15 -04:00
2016-11-02 09:45:43 -04:00
2018-04-26 13:03:51 +02:00
2018-04-10 13:25:19 +03:00
2017-08-21 13:35:00 +03:00
2015-07-14 16:05:29 -04:00
2015-09-09 21:36:03 -04:00
2015-09-09 22:53:38 -04:00
2015-07-14 16:05:29 -04:00
2018-04-06 15:15:44 +02:00
2017-04-06 15:41:54 +05:30
2015-07-14 16:05:29 -04:00
2017-04-06 15:41:54 +05:30
2017-08-18 11:31:03 +03:00
2015-07-14 16:05:29 -04:00
2017-08-18 11:31:03 +03:00
2014-10-01 23:38:27 +02:00
2018-03-19 10:01:40 +02:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2015-07-14 16:05:29 -04:00
2018-04-09 07:49:00 +03:00
2017-04-06 15:41:54 +05:30
2017-04-06 15:41:54 +05:30
2018-04-09 07:49:00 +03:00
2015-09-09 22:31:06 -04:00
2015-12-16 20:07:12 -05:00
2016-08-22 21:27:20 -04:00
2018-04-26 12:23:19 +03:00
2017-08-15 13:57:15 +03:00
2017-08-15 13:57:15 +03:00
2016-08-21 16:17:03 -04:00
2016-08-21 16:17:09 -04:00
2016-08-21 16:17:08 -04:00
2018-04-05 14:43:11 +02:00
2016-08-21 16:17:16 -04:00
2016-08-21 16:17:15 -04:00
2016-07-25 21:38:09 -04:00
2017-03-14 07:12:50 +05:30
2017-04-06 15:41:54 +05:30
2017-04-06 15:41:54 +05:30
2017-04-06 15:41:54 +05:30
2017-04-06 15:41:54 +05:30
2017-04-06 15:41:54 +05:30
2017-04-06 15:41:54 +05:30
2018-03-20 12:10:41 +02:00
2018-03-13 14:27:44 +01:00
2017-08-11 12:17:22 +03:00
2017-08-14 13:45:45 +03:00
2017-12-09 11:21:56 +02:00
2017-11-08 14:20:38 +02:00
2016-02-22 16:21:04 -05:00
2018-04-05 17:15:24 +03:00
2018-03-29 15:50:06 +02:00
2015-09-09 21:04:35 -04:00
2017-08-14 12:42:00 +03:00
2017-08-14 11:42:13 +03:00
2016-06-26 21:15:36 -04:00
2016-02-17 16:03:40 -05:00
2015-08-25 11:15:45 -04:00
2018-04-11 14:24:39 +02:00
2014-09-17 14:59:39 -04:00
2015-09-08 17:46:03 -04:00
2015-07-14 16:05:29 -04:00
2017-11-15 22:26:32 +02:00
2014-10-01 23:38:27 +02:00
2015-08-14 01:17:57 -04:00