Proper locking for mysql.gtid_slave_pos truncation
Aim of this patch is to remove tdc_remove_table(TDC_RT_REMOVE_UNUSED), which was mistakenly introduced by 055a3334. InnoDB allows only one open TABLE instance while performing table truncation. To fulfill this requirement: 1. MDL_EXCLUSIVE has to be acquired to block concurrent threads from accessing given table 2. cached TABLE instances have to be flushed 3. another InnoDB requirement is such that TABLE_SHARE and remaining TABLE instance have to be invalidated and re-opened after truncation This goes more or less inline with what regular TRUNCATE TABLE does. Alternative solution would be handler::ha_delete_all_rows(), but InnoDB doesn't implement it unfortunately. Part of MDEV-17882 - Cleanup refresh version
Showing
Please register or sign in to comment