[MDEV-14263] FLUSH TABLES FOR EXPORT may write the same pages multiple times Created: 2017-11-02  Updated: 2023-04-27

Status: Confirmed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 10.0, 10.1, 10.2, 10.3
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: backup, performance

Issue Links:
Relates
relates to MDEV-13328 ALTER TABLE ... DISCARD TABLESPACE ta... Closed

 Description   

In FLUSH TABLES, the function buf_flush_or_remove_pages() scans the buf_pool->flush_list and initiates a page write for any pages that it encounters there. But, because pages will not be immediately removed from the flush_list, it is possible (maybe even likely) that due to "goto rescan" the same page will be flushed multiple times.

The flush list membership is removed at I/O completion:

#0  buf_flush_remove (bpage=0x7ffff00cab68)
    at /mariadb/10.1/storage/xtradb/buf/buf0flu.cc:575
#1  0x0000555556210745 in buf_flush_write_complete (bpage=0x7ffff00cab68)
    at /mariadb/10.1/storage/xtradb/buf/buf0flu.cc:715
#2  0x0000555556200fb5 in buf_page_io_complete (bpage=0x7ffff00cab68)
    at /mariadb/10.1/storage/xtradb/buf/buf0buf.cc:4978
#3  0x000055555628206e in fil_aio_wait (segment=4)
    at /mariadb/10.1/storage/xtradb/fil/fil0fil.cc:6412
#4  0x000055555615f0eb in io_handler_thread (arg=0x5555576554a0 <n+32>)
    at /mariadb/10.1/storage/xtradb/srv/srv0start.cc:585


Generated at Thu Feb 08 08:12:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.