Commit 5e93fe1
committed
MDEV-37677: Inconsistent flush_list after InnoDB recovery
In commit bea4adc (MDEV-35225)
we inadvertently introduced a race condition. Another thread
may invoke buf_page_t::write_complete() between the time
log_sort_flush_list() inserted the block to the list for sorting,
and the time it would apply the sorted list back to buf_pool.flush_list.
In this case, log_sort_flush_list() would neither add the block to
buf_pool.flush_list nor clear the buf_page_t::oldest_modification_
so that it would correctly indicate whether the block is in the list.
log_sort_flush_list(): Simplify the logic, and always add the entire
sorted list to the buf_pool.flush_list, even if they had been written
back during the time we were copying or sorting.
This fixes an anomaly where a subsequent
buf_pool_t::insert_into_flush_list() would end up incrementing
buf_pool.flush_list.count by one too much.
Thanks to Daniel Black for providing an "rr replay" trace of a
failure.1 parent 9f92d64 commit 5e93fe1
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3667 | 3667 | | |
3668 | 3668 | | |
3669 | 3669 | | |
3670 | | - | |
3671 | | - | |
3672 | | - | |
3673 | | - | |
| 3670 | + | |
| 3671 | + | |
3674 | 3672 | | |
3675 | 3673 | | |
3676 | 3674 | | |
| |||
0 commit comments