diff options
author | Eugene Kosov <eugene.kosov@mariadb.com> | 2020-05-29 01:24:50 +0300 |
---|---|---|
committer | Eugene Kosov <eugene.kosov@mariadb.com> | 2020-06-10 16:59:07 +0300 |
commit | 264a98eaa0a783e1ce76d18b9105ae00dc11098b (patch) | |
tree | 389b0b4777fcd049eb9b578ea30fd04d5132a8f2 /mysql-test/lsan.supp | |
parent | af194ab5bd538567ef735cfc374ac328052105ed (diff) | |
download | mariadb-git-264a98eaa0a783e1ce76d18b9105ae00dc11098b.tar.gz |
MDEV-8069 DROP or rebuild of a large table may lock up InnoDB
Problematic mutex is dict_sys.mutex.
Idea of the patch: unlink() fd under that mutex while
it's still open. This way unlink() will be fast and
actual file removal will happen on close().
And close() will be called outside of dict_sys.mutex.
This should be safe against crash which may happen between
unlink() and close(): file will be removed by OS anyway.
The same applies to both *nix and Windows.
I created and removed a 4G file on some NVMe SSD on ext4:
write(3, "\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"..., 1048576) = 1048576 <0.000519>
fdatasync(3) = 0 <3.533763>
close(3) = 0 <0.000011>
unlink("file") = 0 <0.411563>
write(3, "\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"..., 1048576) = 1048576 <0.000520>
fdatasync(3) = 0 <3.544938>
unlink("file") = 0 <0.000029>
close(3) = 0 <0.407057>
Such systems can benefit of this patch.
fil_node_t::detach(): closes fil_node_t but not file handle,
returns that file handle
fil_node_t::prepare_to_close_or_deatch(): 'closes' fil_node_t
fil_node_t:close_to_free(): new argument detach_handle
fil_system_t::detach(): now can detach file handles
fil_delete_tablespace(): now can detach file handles
row_drop_table_for_mysql(): performs actual file removal
Diffstat (limited to 'mysql-test/lsan.supp')
0 files changed, 0 insertions, 0 deletions