mariadb/mysys
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
..
crc32 MDEV-34825 FreeBSD fails to build under clang natively 2024-09-05 12:14:06 +10:00
array.c Merge branch '10.5' into '10.6' 2024-12-13 01:45:35 +01:00
base64.c Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
ChangeLog
charset-def.c MDEV-26669 Add MY_COLLATION_HANDLER functions min_str() and max_str() 2021-09-27 17:10:22 +04:00
charset.c Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
CMakeLists.txt Merge branch '10.5' into 10.6 2024-10-29 14:20:03 +01:00
crc32ieee.cc MDEV-33817 preparation: Restructuring and unit tests 2024-05-03 13:06:13 +03:00
errors.c MDEV-33813 ERROR 1021 (HY000): Disk full (./org/test1.MAI); waiting for someone to free some space 2024-04-10 17:01:24 +03:00
file_logger.c Merge 10.4 into 10.5 2021-03-05 12:54:43 +02:00
get_password.c Merge branch '10.5' into 10.6 2023-08-01 15:08:52 +02:00
guess_malloc_library.c Fixed compiler warnings in guess_malloc_library 2018-01-15 16:44:44 +02:00
hash.c MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
lf_alloc-pin.c Fix a stack overflow in pinbox allocator 2024-07-05 13:26:37 +10:00
lf_dynarray.c perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
lf_hash.cc MDEV-27088: Server crash on ARM (WMM architecture) due to missing barriers in lf-hash (10.5) 2021-11-30 15:16:16 +11:00
list.c Merge 10.4 into 10.5 2020-05-13 14:25:06 +03:00
ma_dyncol.c Merge 10.5 into 10.6 2024-05-30 14:27:07 +03:00
mf_arr_appstr.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_cache.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
mf_dirname.c MDEV-21581 Helper functions and methods for CHARSET_INFO 2020-01-28 12:29:23 +04:00
mf_fn_ext.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mf_format.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mf_getdate.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_iocache.c MDEV-35806: Error in read_log_event() corrupts relay log writer, crashes server 2025-01-24 09:15:20 +00:00
mf_iocache2.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
mf_keycache.c Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
mf_keycaches.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_loadpath.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_pack.c MDEV-21581 Helper functions and methods for CHARSET_INFO 2020-01-28 12:29:23 +04:00
mf_path.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
mf_qsort.c MDEV-34348: Consolidate cmp function declarations 2024-11-23 08:14:22 -07:00
mf_qsort2.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_radix.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mf_same.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_sort.c perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
mf_soundex.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_tempdir.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
mf_tempfile.c MDEV-26601: mysys - O_TMPFILE ^ O_CREAT 2021-09-14 21:06:34 +10:00
mf_unixpath.c Update FSF Address 2019-05-11 21:29:06 +03:00
mf_wcomp.c Update FSF Address 2019-05-11 21:29:06 +03:00
mulalloc.c Added detection of memory overwrite with multi_malloc 2023-02-27 19:25:44 +02:00
my_access.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_addr_resolve.c Backport my_addr_resolve from 10.6 to get latest bug fixes in. 2023-11-27 19:08:14 +02:00
my_alarm.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_alloc.c MDEV-35750 Change MEM_ROOT allocation sizes to reduse calls to malloc() and avoid memory fragmentation 2025-01-05 16:40:11 +02:00
my_atomic_writes.c Merge 10.5 into 10.6 2023-04-11 16:15:19 +03:00
my_basename.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_bit.c Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
my_bitmap.c MDEV-33623 Partitioning is broken on big endian architectures 2024-03-08 15:25:12 +02:00
my_chmod.c Merge branch '5.5' into 10.1 2019-05-11 19:15:57 +03:00
my_chsize.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_compare.c Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
my_compress.c Cleanup: Remove IF_VALGRIND 2022-04-25 09:40:40 +03:00
my_conio.c Merge 10.5 into 10.6 2023-04-11 16:15:19 +03:00
my_copy.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_cpu.c MDEV-19845: Make my_cpu.h self-contained 2020-02-01 14:56:05 +02:00
my_create.c Change my_umask{,_dir} to mode_t and remove os_innodb_umask 2024-12-11 17:21:01 +11:00
my_default.c MDEV-35750 Change MEM_ROOT allocation sizes to reduse calls to malloc() and avoid memory fragmentation 2025-01-05 16:40:11 +02:00
my_delete.c Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
my_div.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_dlerror.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_error.c Merge branch '10.4' into 10.5 2020-11-01 14:26:15 +01:00
my_file.c perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
my_fopen.c Merge 10.4 into 10.5 2020-04-25 21:57:52 +03:00
my_fstream.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_getexe.c MDEV-34340 mariadb-backup immediately dumps core on NetBSD 2024-10-16 11:46:19 +11:00
my_gethwaddr.c OS detection logic in my_gethwaddr.c is backwards 2022-11-13 13:12:37 +11:00
my_getncpus.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_getopt.c MDEV-34491 Setting log_slow_admin="" at startup should be converted to log_slow_admin=ALL 2024-07-02 11:26:13 +03:00
my_getpagesize.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_getsystime.c Windows : fix warning about potential division by 0 2021-05-09 13:26:03 +02:00
my_getwd.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_init.c Change my_umask{,_dir} to mode_t and remove os_innodb_umask 2024-12-11 17:21:01 +11:00
my_largepage.c Added Myisam, Aria and InnoDB buffer pool to @@memory_used status variable 2023-10-03 08:25:30 +03:00
my_lib.c MDEV-34348: Consolidate cmp function declarations 2024-11-23 08:14:22 -07:00
my_libwrap.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_likely.c MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
my_lock.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_lockmem.c Added Myisam, Aria and InnoDB buffer pool to @@memory_used status variable 2023-10-03 08:25:30 +03:00
my_malloc.c Added Myisam, Aria and InnoDB buffer pool to @@memory_used status variable 2023-10-03 08:25:30 +03:00
my_memmem.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_mess.c MDEV-23846: O_TMPFILE error in mysqlbinlog stream output breaks restore 2020-11-23 12:16:45 +05:30
my_minidump.cc MDEV-11499 mysqltest, Windows : improve diagnostics if server fails to shutdown 2021-09-24 11:49:28 +02:00
my_mkdir.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_mmap.c libpmem cmake macros 2020-02-04 23:23:50 +04:00
my_new.cc Fixes that enables my_new.cc (new wrapper using my_malloc) 2021-05-19 22:27:27 +02:00
my_once.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_open.c Merge 10.5 into 10.6 2024-12-11 14:46:43 +02:00
my_port.c Follow-up to changing FSF address 2019-05-11 18:30:45 +03:00
my_pread.c Merge 10.3 into 10.4 2019-06-19 10:49:00 +03:00
my_pthread.c Merge 10.5 into 10.6 2022-10-25 14:25:42 +03:00
my_quick.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_rdtsc.c Refactor GitLab cppcheck and update SAST ignorelists 2024-07-08 10:51:48 +01:00
my_read.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_redel.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_rename.c Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
my_rnd.c MDEV-18531 : Use WolfSSL instead of YaSSL as "bundled" SSL/encryption library 2019-05-22 13:48:25 +02:00
my_safehash.c MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
my_safehash.h Update FSF address 2019-05-10 20:52:00 +03:00
my_seek.c myseek: AIX has no "tell" 2021-03-19 11:14:53 +11:00
my_setuser.c mysys: rename ME_xxx flags to match plugin api 2018-06-04 12:32:23 +02:00
my_sleep.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_stack.c Fixup bddbef3573 2024-10-31 10:01:01 +01:00
my_static.c Merge 10.5 into 10.6 2024-12-11 14:46:43 +02:00
my_static.h Update FSF Address 2019-05-11 21:29:06 +03:00
my_symlink.c Remove HAVE_BROKEN_REALPATH 2024-10-16 11:46:19 +11:00
my_symlink2.c Change my_umask{,_dir} to mode_t and remove os_innodb_umask 2024-12-11 17:21:01 +11:00
my_sync.c MDEV-381: fdatasync() does not correctly flush growing binlog file 2023-08-10 19:52:04 +02:00
my_thr_init.c MDEV-34077 scripts/mariadb-install-db: Error in my_thread_global_end(): 1 threads didn't exit 2024-05-05 21:37:08 +02:00
my_uuid.c MDEV-24285 support oracle build-in function: sys_guid 2021-05-19 22:54:11 +02:00
my_win_popen.cc Ensure that source files contain only valid UTF8 encodings (#2188) 2023-05-19 13:21:34 +01:00
my_wincond.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_winerr.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_winfile.c Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
my_winthread.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_wintoken.c Merge pull request #1221 from grooverdan/10.4-MDEV-18851-multiple-sized-large-page-support 2020-04-02 23:54:08 +04:00
my_write.c Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
mysys_priv.h Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
psi_noop.c Merge branch 'merge-perfschema-5.7' into 10.5 2022-08-02 09:34:15 +02:00
ptr_cmp.c MDEV-34348: Consolidate cmp function declarations 2024-11-23 08:14:22 -07:00
queues.c MDEV-34348: Consolidate cmp function declarations 2024-11-23 08:14:22 -07:00
safemalloc.c Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
stacktrace.c MDEV-30573 Server doesn't build with GCOV by GCC 11+ 2023-02-06 21:25:02 +11:00
string.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
test_charset.c MDEV-8334: Rename utf8 to utf8mb3 2021-05-19 06:48:36 +02:00
test_dir.c Update FSF Address 2019-05-11 21:29:06 +03:00
test_thr_mutex.c Update FSF address 2019-05-10 20:52:00 +03:00
test_xml.c Update FSF Address 2019-05-11 21:29:06 +03:00
testhash.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
thr_alarm.c Merge 10.5 into 10.6 2024-12-11 14:46:43 +02:00
thr_lock.c Merge branch '10.5' into 10.6 2024-01-11 12:59:22 +11:00
thr_mutex.c Merge 10.5 into 10.6 2024-06-10 15:22:15 +03:00
thr_rwlock.c MDEV-34530 dead code in the thr_rwlock.c 2024-07-17 21:25:40 +02:00
thr_timer.c MDEV-35574 remove obsolete pthread_exit calls 2024-12-10 12:12:20 +11:00
tree.c MDEV-28130 MariaDB SEGV issue at tree_search_next 2025-01-14 18:56:14 +03:00
typelib.c Added 'const' to arguments in get_one_option and find_typeset() 2021-02-08 12:16:29 +02:00
waiting_threads.c MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
wqueue.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00