• Marko Mäkelä's avatar
    Shut down InnoDB after aborted startup. · 81b7fe9d
    Marko Mäkelä authored
    This fixes memory leaks in tests that cause InnoDB startup to fail.
    
    buf_pool_free_instance(): Also free buf_pool->flush_rbt, which would
    normally be freed when crash recovery finishes.
    
    fil_node_close_file(), fil_space_free_low(), fil_close_all_files():
    Relax some debug assertions to tolerate !srv_was_started.
    
    innodb_shutdown(): Renamed from innobase_shutdown_for_mysql().
    Changed the return type to void. Do not assume that all subsystems
    were started.
    
    que_init(), que_close(): Remove (empty functions).
    
    srv_init(), srv_general_init(): Remove as global functions.
    
    srv_free(): Allow srv_sys=NULL.
    
    srv_get_active_thread_type(): Only return SRV_PURGE if purge really
    is running.
    
    srv_shutdown_all_bg_threads(): Do not reset srv_start_state. It will
    be needed by innodb_shutdown().
    
    innobase_start_or_create_for_mysql(): Always call srv_boot() so that
    innodb_shutdown() can assume that it was called. Make more subsystems
    dependent on SRV_START_STATE_STAT.
    
    srv_shutdown_bg_undo_sources(): Require SRV_START_STATE_STAT.
    
    trx_sys_close(): Do not assume purge_sys!=NULL. Do not call
    buf_dblwr_free(), because the doublewrite buffer can exist while
    the transaction system does not.
    
    logs_empty_and_mark_files_at_shutdown(): Do a faster shutdown if
    !srv_was_started.
    
    recv_sys_close(): Invoke dblwr.pages.clear() which would normally
    be invoked by buf_dblwr_process().
    
    recv_recovery_from_checkpoint_start(): Always release log_sys->mutex.
    
    row_mysql_close(): Allow the subsystem not to exist.
    81b7fe9d
trx0sys.cc 32.7 KB