-
Marko Mäkelä authored
Temporary tablespaces in InnoDB are supposed to be discarded and recreated on startup. Therefore, it does not make sense to write redo log for operations on temporary tablespaces. InnoDB was writing some redo log for some operations on temporary undo logs and B-trees, and associated page allocation and freeing. dict_create_index_tree_in_mem(): Assert that the table is temporary, and remove some bogus code and comments that was copied from dict_create_index_tree_step(). dict_truncate_index_tree_in_mem(): Assert that the table is temporary. fsp_init_file_page(), fsp_header_inc_size(), fsp_try_extend_data_file_with_pages(), fsp_try_extend_data_file(), fsp_fill_free_list(), fsp_alloc_free_page(), fsp_free_page(), fsp_free_seg_inode(), fseg_create_general(), fseg_fill_free_list(), fseg_alloc_free_extent(), fseg_alloc_free_page_low(), fseg_free_page_low(), fseg_free_extent(): Assert that redo logging is disabled when a temporary tablespace is being modified. fsp_header_init(): Remove some duplicated code. mtr_t::commit_lsn(): Remove the assertion that m_commit_lsn must be nonzero. After these fixes, it can be zero if the transaction only modified temporary tables. mtr_t::set_log_mode(): Add debug assertions for enforcing rules on the state changes. Most notably, MTR_LOG_NO_REDO is sticky and can only be set before writing any redo log. page_parse_create(): Remove the parameter mtr. page_copy_rec_list_end_to_created_page(): Do not set log mode to MTR_LOG_SHORT_INSERTS when compressing the tree during IMPORT TABLESPACE. IMPORT TABLESPACE should not be writing any redo log until the tablespace has been fully imported. trx_undo_insert_cleanup(), trx_purge_free_segment(), trx_undo_seg_free(): Add the parameter noredo, for disabling redo logging when removing temporary undo logs. trx_purge_truncate_rseg_history(), trx_rseg_create(), trx_undo_truncate_end_func(), trx_undo_assign_undo(): Do not write redo log for modifying temporary undo logs. trx_write_serialisation_history(): Use a separate mini-transaction for modifying the temporary undo logs. trx_commit_in_memory(): Treat mtr->commit_lsn()==0 specially. Adjust to other code changes. trx_prepare_low(): Assert that mtr->commit_lsn() if and only if we are preparing a transaction in the temporary undo logs. srv_open_tmp_tablespace(), innobase_start_or_create_for_mysql(): Remove some duplicated code. rb#4611 approved by Vasil Dimov
Marko Mäkelä authoredTemporary tablespaces in InnoDB are supposed to be discarded and recreated on startup. Therefore, it does not make sense to write redo log for operations on temporary tablespaces. InnoDB was writing some redo log for some operations on temporary undo logs and B-trees, and associated page allocation and freeing. dict_create_index_tree_in_mem(): Assert that the table is temporary, and remove some bogus code and comments that was copied from dict_create_index_tree_step(). dict_truncate_index_tree_in_mem(): Assert that the table is temporary. fsp_init_file_page(), fsp_header_inc_size(), fsp_try_extend_data_file_with_pages(), fsp_try_extend_data_file(), fsp_fill_free_list(), fsp_alloc_free_page(), fsp_free_page(), fsp_free_seg_inode(), fseg_create_general(), fseg_fill_free_list(), fseg_alloc_free_extent(), fseg_alloc_free_page_low(), fseg_free_page_low(), fseg_free_extent(): Assert that redo logging is disabled when a temporary tablespace is being modified. fsp_header_init(): Remove some duplicated code. mtr_t::commit_lsn(): Remove the assertion that m_commit_lsn must be nonzero. After these fixes, it can be zero if the transaction only modified temporary tables. mtr_t::set_log_mode(): Add debug assertions for enforcing rules on the state changes. Most notably, MTR_LOG_NO_REDO is sticky and can only be set before writing any redo log. page_parse_create(): Remove the parameter mtr. page_copy_rec_list_end_to_created_page(): Do not set log mode to MTR_LOG_SHORT_INSERTS when compressing the tree during IMPORT TABLESPACE. IMPORT TABLESPACE should not be writing any redo log until the tablespace has been fully imported. trx_undo_insert_cleanup(), trx_purge_free_segment(), trx_undo_seg_free(): Add the parameter noredo, for disabling redo logging when removing temporary undo logs. trx_purge_truncate_rseg_history(), trx_rseg_create(), trx_undo_truncate_end_func(), trx_undo_assign_undo(): Do not write redo log for modifying temporary undo logs. trx_write_serialisation_history(): Use a separate mini-transaction for modifying the temporary undo logs. trx_commit_in_memory(): Treat mtr->commit_lsn()==0 specially. Adjust to other code changes. trx_prepare_low(): Assert that mtr->commit_lsn() if and only if we are preparing a transaction in the temporary undo logs. srv_open_tmp_tablespace(), innobase_start_or_create_for_mysql(): Remove some duplicated code. rb#4611 approved by Vasil Dimov
Loading