mariadb/storage/xtradb/row
Marko Mäkelä 582545a384 MDEV-13637 InnoDB change buffer housekeeping can cause redo log overrun and possibly deadlocks
The function ibuf_remove_free_page() may be called while the caller
is holding several mutexes or rw-locks. Because of this, this
housekeeping loop may cause performance glitches for operations that
involve tables that are stored in the InnoDB system tablespace.
Also deadlocks might be possible.

The worst impact of all is that due to the mutexes being held, calls to
log_free_check() had to be skipped during this housekeeping.
This means that the cyclic InnoDB redo log may be overwritten.
If the system crashes during this, it would be unable to recover.

The entry point to the problematic code is ibuf_free_excess_pages().
It would make sense to call it before acquiring any mutexes or rw-locks,
in any 'pessimistic' operation that involves the system tablespace.

fseg_create_general(), fseg_alloc_free_page_general(): Do not call
ibuf_free_excess_pages() while potentially holding some latches.

ibuf_remove_free_page(): Do call log_free_check(), like every operation
that is about to generate redo log should do.

ibuf_free_excess_pages(): Remove some assertions that are replaced
by stricter assertions in the log_free_check() that is now called by
ibuf_remove_free_page().

row_ins_sec_index_entry(), row_undo_ins_remove_sec_low(),
row_undo_mod_del_mark_or_remove_sec_low(),
row_undo_mod_del_unmark_sec_and_undo_update(): Call
ibuf_free_excess_pages() if the operation may involve allocating pages
and change buffering in the system tablespace.
2017-08-25 14:01:51 +03:00
..
row0ext.cc move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0ftsort.cc Remove redundant UT_LIST_INIT() calls 2017-05-17 10:33:49 +03:00
row0import.cc Silence bogus GCC 7 warnings -Wimplicit-fallthrough 2017-05-17 08:07:02 +03:00
row0ins.cc MDEV-13637 InnoDB change buffer housekeeping can cause redo log overrun and possibly deadlocks 2017-08-25 14:01:51 +03:00
row0log.cc Merge remote-tracking branch 'origin/10.0' into 10.0 2017-05-18 15:45:55 +03:00
row0merge.cc Merge branch 'merge-xtradb-5.6' into 10.0 2017-05-17 12:11:12 +03:00
row0mysql.cc Silence bogus GCC 7 warnings -Wimplicit-fallthrough 2017-05-17 08:07:02 +03:00
row0purge.cc Silence bogus GCC 7 warnings -Wimplicit-fallthrough 2017-05-17 08:07:02 +03:00
row0quiesce.cc 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0row.cc 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0sel.cc Remove dead code added in merge commit d8b45b0c00 2017-05-19 09:51:44 +03:00
row0uins.cc MDEV-13637 InnoDB change buffer housekeeping can cause redo log overrun and possibly deadlocks 2017-08-25 14:01:51 +03:00
row0umod.cc MDEV-13637 InnoDB change buffer housekeeping can cause redo log overrun and possibly deadlocks 2017-08-25 14:01:51 +03:00
row0undo.cc 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0upd.cc Merge branch '5.5' into 10.0 2017-03-03 01:37:54 +02:00
row0vers.cc move to storage/xtradb 2015-05-04 19:15:28 +02:00