mariadb/client
Kristian Nielsen 72e1cc8f52 MDEV-35806: Error in read_log_event() corrupts relay log writer, crashes server
In Log_event::read_log_event(), don't use IO_CACHE::error of the relay log's
IO_CACHE to signal an error back to the caller. When reading the active
relay log, this flag is also being used by the IO thread, and setting it can
randomly cause the IO thread to wrongly detect IO error on writing and
permanently disable the relay log.

This was seen sporadically in test case rpl.rpl_from_mysql80. The read
error set by the SQL thread in the IO_CACHE would be interpreted as a
write error by the IO thread, which would cause it to throw a fatal
error and close the relay log. And this would later cause CHANGE
MASTER to try to purge a closed relay log, resulting in nullptr crash.

SQL thread is not able to parse an event read from the relay log. This
can happen like here when replicating unknown events from a MySQL master,
potentially also for other reasons.

Also fix a mistake in my_b_flush_io_cache() introduced back in 2001
(fa09f2cd7e) where my_b_flush_io_cache() could wrongly return an error set
in IO_CACHE::error, even if the flush operation itself succeeded.

Also fix another sporadic failure in rpl.rpl_from_mysql80 where the outout
of MASTER_POS_WAIT() depended on timing of SQL and IO thread.

Reviewed-by: Monty <monty@mariadb.org>
Reviewed-by: Andrei Elkin <andrei.elkin@mariadb.com>
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2025-01-24 09:15:20 +00:00
..
async_example.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
client_metadata.h MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRY 2020-03-10 20:43:32 +04:00
client_priv.h Merge branch '10.5' into 10.6 2024-05-08 20:06:00 +02:00
CMakeLists.txt MDEV-33091 pcre2 headers aren't found on Solaris 2024-09-05 12:14:06 +10:00
completion_hash.cc Merge 10.4 into 10.5 2020-11-03 16:24:47 +02:00
completion_hash.h Update FSF Address 2019-05-11 21:29:06 +03:00
echo.c Fix typos in the codebase. 2022-08-09 18:41:09 +03:00
mariadb-conv.cc mariadb-conv --character-sets-dir 2021-05-20 18:33:07 +02:00
my_readline.h Update FSF Address 2019-05-11 21:29:06 +03:00
mysql.cc Merge 10.5 into 10.6 2025-01-08 08:48:21 +02:00
mysql_plugin.c Fixed compiler warning from strncpy in mysql_plugin.c 2024-09-11 16:15:37 +03:00
mysql_upgrade.c Merge 10.5 into 10.6 2024-06-17 08:40:07 +03:00
mysqladmin.cc Merge 10.5 into 10.6 2024-05-30 14:27:07 +03:00
mysqlbinlog.cc MDEV-35806: Error in read_log_event() corrupts relay log writer, crashes server 2025-01-24 09:15:20 +00:00
mysqlcheck.c Merge branch '10.5' into 10.6 2024-05-08 20:06:00 +02:00
mysqldump.c Merge 10.5 into 10.6 2025-01-20 09:57:37 +02:00
mysqlimport.c Merge 10.5 into 10.6 2024-12-11 14:46:43 +02:00
mysqlshow.c Merge branch '10.5' into 10.6 2024-05-08 20:06:00 +02:00
mysqlslap.c Merge branch '10.5' into 10.6 2024-05-08 20:06:00 +02:00
mysqltest.cc mysqltest: fix --sorted_results 2025-01-09 10:00:36 +01:00
readline.cc MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00