MySQL 26.7.0
Source Code Documentation
srv0start.cc File Reference

Starts the InnoDB database server. More...

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <zlib.h>
#include "btr0btr.h"
#include "btr0cur.h"
#include "buf0buf.h"
#include "buf0dump.h"
#include "current_thd.h"
#include "data0data.h"
#include "data0type.h"
#include "dict0dd.h"
#include "dict0dict.h"
#include "fil0fil.h"
#include "fil0pages_persistence_interface.h"
#include "fil0tablespace_scan.h"
#include "fil0tablespaces_nodes_interface.h"
#include "fsp0fsp.h"
#include "fsp0sysspace.h"
#include "ha_prototypes.h"
#include "ibuf0ibuf.h"
#include "log0chkp.h"
#include "log0handler.h"
#include "log0helpers.h"
#include "log0recv.h"
#include "log0write.h"
#include "mem0mem.h"
#include "mtr0mtr.h"
#include "my_dbug.h"
#include "my_psi_config.h"
#include "mysql/psi/mysql_stage.h"
#include "mysqld.h"
#include "scope_guard.h"
#include "ddl0fts.h"
#include "os0file.h"
#include "os0thread-create.h"
#include "os0thread.h"
#include "page0cur.h"
#include "page0page.h"
#include "rem0rec.h"
#include "srv0srv.h"
#include "srv0start.h"
#include "trx0sys.h"
#include "trx0trx.h"
#include "ut0mem.h"
#include "arch0arch.h"
#include "arch0recv.h"
#include "btr0pcur.h"
#include "btr0sea.h"
#include "buf0flu.h"
#include "buf0rea.h"
#include "clone0api.h"
#include "clone0clone.h"
#include "dict0boot.h"
#include "dict0crea.h"
#include "dict0load.h"
#include "dict0stats_bg.h"
#include "lock0lock.h"
#include "os0event.h"
#include "os0proc.h"
#include "pars0pars.h"
#include "que0que.h"
#include "rem0cmp.h"
#include "row0ins.h"
#include "row0mysql.h"
#include "row0row.h"
#include "row0sel.h"
#include "row0upd.h"
#include "srv0tmp.h"
#include "trx0purge.h"
#include "trx0roll.h"
#include "trx0rseg.h"
#include "usr0sess.h"
#include "ut0crc32.h"
#include "ut0dbg.h"
#include "ut0new.h"

Classes

struct  Thread_to_stop
 
struct  metadata_applier
 Applier of dynamic metadata. More...
 

Macros

#define SRV_MAX_N_PENDING_SYNC_IOS   100
 
#define srv_init_abort(_db_err)    srv_init_abort_low(create_new_db, __FILE__, __LINE__, _db_err)
 

Enumerations

enum  srv_start_state_t { SRV_START_STATE_NONE = 0 , SRV_START_STATE_IO = 1 , SRV_START_STATE_PURGE = 2 , SRV_START_STATE_STAT = 4 }
 Bit flags for tracking background thread creation. More...
 

Functions

static dberr_t srv_undo_tablespace_create (undo_truncate::Tablespace &undo_space)
 Create undo tablespace. More...
 
static dberr_t srv_undo_tablespace_enable_encryption (space_id_t space_id)
 Try to enable encryption of an undo log tablespace. More...
 
static dberr_t srv_undo_tablespace_read_encryption (ib::fil::Tablespace_node_handle_interface *file_handle, fil_space_t *space)
 Try to read encryption metadata from an undo tablespace. More...
 
static dberr_t srv_undo_tablespace_fixup_num (space_id_t space_num)
 Handles the undo_$num_trunc.log marker generated by 9.x, by removing the space with corresponding space_id, if it was found during tablespace scanning. More...
 
dberr_t srv_undo_tablespace_fixup (const char *space_name, const char *file_name, space_id_t space_id)
 Fix up an undo tablespace if it was in the process of being truncated when the server crashed. More...
 
dberr_t srv_undo_tablespace_open (undo_truncate::Tablespace &undo_space, bool expected_to_be_unusable)
 Open an undo tablespace. More...
 
static dberr_t srv_undo_tablespace_open_by_num (const space_id_t space_num)
 Open an undo tablespace with a specified undo number. More...
 
static dberr_t srv_undo_tablespaces_open ()
 
static dberr_t srv_undo_create_implicit_tablespaces ()
 Create the implicit undo tablespaces for the new instance. More...
 
static dberr_t srv_undo_prepare_empty_structure (space_id_t space_id, bool enable_undo_encryption)
 Initialize FSP structures (such as fragment and inode lists) and the (empty) rseg array of an undo tablespace. More...
 
static void srv_undo_mark_tablespace_usable (space_id_t space_id)
 Mark the point in which an undo tablespace is fully constructed and ready to use. More...
 
static void srv_undo_mark_all_tablespaces_usable ()
 Mark any fully constructed undo tablespaces ready to use. More...
 
dberr_t srv_undo_tablespace_create (const char *space_name, const char *file_name, space_id_t space_id)
 Create an undo tablespace. More...
 
void undo_truncate_spaces_init ()
 Initialize undo_truncate::spaces, called once during srv_start(). More...
 
void undo_truncate_spaces_deinit ()
 Free the resources occupied by undo_truncate::spaces, called once during srv_shutdown(). More...
 
static dberr_t srv_undo_create_implicit_tablespaces_with_empty_structure ()
 Create the implicit undo tablespaces for the new instance, and create their rseg arrrays, but not their rollback segments. More...
 
static void srv_start_wait_for_purge_to_start ()
 Wait for the purge thread(s) to start up. More...
 
static void srv_delete_temporary_space_files (ib::fsp::SysTablespace &tmp_space)
 Deletes all files used by the System Temporary Tablespace. More...
 
static dberr_t srv_open_tmp_tablespace (ib::fsp::SysTablespace &tmp_space)
 Create the temporary file tablespace. More...
 
static void srv_create_sdi_indexes ()
 Create SDI Indexes in system tablespace. More...
 
static void srv_start_state_set (srv_start_state_t state)
 Set state to indicate start of particular group of threads in InnoDB. More...
 
static bool srv_start_state_is_set (srv_start_state_t state)
 Check if following group of threads is started. More...
 
void srv_shutdown_exit_threads ()
 Attempt to shutdown all background threads created by InnoDB. More...
 
static dberr_t srv_init_abort_low (bool create_new_db, const char *file, ulint line, dberr_t err)
 Innobase start-up aborted. More...
 
static void verify_page_type (page_id_t page_id, page_type_t type)
 Check the page type, if there is a mismatch then throw fatal error. More...
 
dberr_t srv_start (bool create_new_db)
 Start InnoDB. More...
 
static void apply_dynamic_metadata ()
 Apply the dynamic metadata to all tables. More...
 
void srv_dict_recover_on_restart ()
 On a restart, initialize the remaining InnoDB subsystems so that any tables (including data dictionary tables) can be accessed. More...
 
void srv_start_purge_threads ()
 Start purge threads. More...
 
void srv_start_threads ()
 Start up the InnoDB service threads which are independent of DDL recovery. More...
 
void srv_start_threads_after_ddl_recovery ()
 Start the remaining InnoDB service threads which must wait for complete DD recovery(post the DDL recovery) More...
 
static void srv_shutdown_set_state (srv_shutdown_t new_state)
 Set srv_shutdown_state to a given state and validate change is proper. More...
 
static void srv_shutdown_cleanup_and_master_stop ()
 Shutdown background threads of InnoDB at the start of the shutdown phase. More...
 
bool srv_shutdown_waits_for_rollback_of_recovered_transactions ()
 Checks if all recovered transactions are supposed to be rolled back before shutdown is ended. More...
 
void srv_pre_dd_shutdown ()
 Shut down all InnoDB background tasks that may look up objects in the data dictionary. More...
 
static void srv_shutdown_page_cleaners ()
 Waits for page cleaners exit. More...
 
static lsn_t srv_shutdown_log ()
 Closes redo log. More...
 
static void srv_shutdown_arch ()
 Copy all remaining data and shutdown archiver threads. More...
 
void srv_thread_delay_cleanup_if_needed (bool wait_for_signal)
 Delay the thread after it discovered that the shutdown_state is greater or equal to SRV_SHUTDOWN_CLEANUP, before it proceeds with further clean up. More...
 
void srv_shutdown ()
 Shut down the InnoDB database. More...
 
void srv_get_encryption_data_filename (dict_table_t *table, char *filename, ulint max_len)
 Get the encryption-data filename from the table name for a single-table tablespace. More...
 

Variables

bool srv_start_raw_disk_in_use = false
 true if a raw partition is in use More...
 
bool srv_is_being_started = false
 true if the server is being started More...
 
bool srv_sys_tablespaces_open = false
 true if SYS_TABLESPACES is available for lookups More...
 
bool srv_startup_is_before_trx_rollback_phase = false
 true if the server is being started, before rolling back any incomplete transactions More...
 
static bool srv_start_has_been_called = false
 true if srv_start() has been called More...
 
static uint64_t srv_start_state = SRV_START_STATE_NONE
 Track server thrd starting phases. More...
 
std::atomic< enum srv_shutdown_tsrv_shutdown_state {SRV_SHUTDOWN_NONE}
 At a shutdown this value climbs from SRV_SHUTDOWN_NONE to SRV_SHUTDOWN_EXIT_THREADS. More...
 
static char * srv_monitor_file_name
 Name of srv_monitor_file. More...
 
static PSI_stage_infosrv_stages []
 Array of all InnoDB stage events for monitoring activities via performance schema. More...
 
static constexpr uint32_t SHUTDOWN_SLEEP_TIME_US = 100
 Sleep time in loops which wait for pending tasks during shutdown. More...
 
static constexpr uint32_t SHUTDOWN_SLEEP_ROUNDS
 Number of wait rounds during shutdown, after which error is produced, or other policy for timed out wait is applied. More...
 
static const Thread_to_stop threads_to_stop []
 

Detailed Description

Starts the InnoDB database server.

Created 2/16/1996 Heikki Tuuri

Macro Definition Documentation

◆ srv_init_abort

#define srv_init_abort (   _db_err)     srv_init_abort_low(create_new_db, __FILE__, __LINE__, _db_err)

◆ SRV_MAX_N_PENDING_SYNC_IOS

#define SRV_MAX_N_PENDING_SYNC_IOS   100

Enumeration Type Documentation

◆ srv_start_state_t

Bit flags for tracking background thread creation.

They are used to determine which threads need to be stopped if we need to abort during the initialisation step.

Enumerator
SRV_START_STATE_NONE 

No thread started.

SRV_START_STATE_IO 

Started IO threads.

SRV_START_STATE_PURGE 

Started purge thread(s)

SRV_START_STATE_STAT 

Started bufdump + dict stat and FTS optimize thread.

Function Documentation

◆ apply_dynamic_metadata()

static void apply_dynamic_metadata ( )
static

Apply the dynamic metadata to all tables.

◆ srv_create_sdi_indexes()

static void srv_create_sdi_indexes ( )
static

Create SDI Indexes in system tablespace.

◆ srv_delete_temporary_space_files()

static void srv_delete_temporary_space_files ( ib::fsp::SysTablespace tmp_space)
static

Deletes all files used by the System Temporary Tablespace.

◆ srv_dict_recover_on_restart()

void srv_dict_recover_on_restart ( )

On a restart, initialize the remaining InnoDB subsystems so that any tables (including data dictionary tables) can be accessed.

◆ srv_get_encryption_data_filename()

void srv_get_encryption_data_filename ( dict_table_t table,
char *  filename,
ulint  max_len 
)

Get the encryption-data filename from the table name for a single-table tablespace.

Parameters
[in]tabletable object
[out]filenamefilename
[in]max_lenfilename max length

◆ srv_init_abort_low()

static dberr_t srv_init_abort_low ( bool  create_new_db,
const char *  file,
ulint  line,
dberr_t  err 
)
static

Innobase start-up aborted.

Perform cleanup actions.

Parameters
[in]create_new_dbtrue if new db is being created
[in]fileFile name
[in]lineLine number
[in]errReason for aborting InnoDB startup
Returns
DB_SUCCESS or error code.

◆ srv_open_tmp_tablespace()

static dberr_t srv_open_tmp_tablespace ( ib::fsp::SysTablespace tmp_space)
static

Create the temporary file tablespace.

Parameters
[in,out]tmp_spaceShared Temporary SysTablespace
Returns
DB_SUCCESS or error code.

◆ srv_pre_dd_shutdown()

void srv_pre_dd_shutdown ( )

Shut down all InnoDB background tasks that may look up objects in the data dictionary.

◆ srv_shutdown()

void srv_shutdown ( )

Shut down the InnoDB database.

◆ srv_shutdown_arch()

static void srv_shutdown_arch ( )
static

Copy all remaining data and shutdown archiver threads.

◆ srv_shutdown_cleanup_and_master_stop()

static void srv_shutdown_cleanup_and_master_stop ( )
static

Shutdown background threads of InnoDB at the start of the shutdown phase.

Handles shutdown phases: SRV_SHUTDOWN_CLEANUP and SRV_SHUTDOWN_MASTER_STOP.

◆ srv_shutdown_exit_threads()

void srv_shutdown_exit_threads ( )

Attempt to shutdown all background threads created by InnoDB.

NOTE: Does not guarantee they are actually shut down, only does the best effort. Changes state of shutdown to SHUTDOWN_EXIT_THREADS, wakes up the background threads and waits a little bit. It might be used within startup phase or when fatal error is discovered during some IO operation. Therefore you must not assume anything related to the state in which it might be used.

◆ srv_shutdown_log()

static lsn_t srv_shutdown_log ( )
static

Closes redo log.

If this is not fast shutdown, it forces to write a checkpoint which should be written for logically empty redo log. Note that we forced to flush all dirty pages in the last stages of page cleaners activity (unless it was fast shutdown). After checkpoint is written, the flushed_lsn is updated within header of the system tablespace. This is lsn of the last clean shutdown.

◆ srv_shutdown_page_cleaners()

static void srv_shutdown_page_cleaners ( )
static

Waits for page cleaners exit.

◆ srv_shutdown_set_state()

static void srv_shutdown_set_state ( srv_shutdown_t  new_state)
static

Set srv_shutdown_state to a given state and validate change is proper.

Remarks
This function is used only from the main thread, and only during startup or shutdown.
Parameters
[in]new_statenew state to set

◆ srv_shutdown_waits_for_rollback_of_recovered_transactions()

bool srv_shutdown_waits_for_rollback_of_recovered_transactions ( )

Checks if all recovered transactions are supposed to be rolled back before shutdown is ended.

Returns
value of the check

◆ srv_start()

dberr_t srv_start ( bool  create_new_db)

Start InnoDB.

Parameters
[in]create_new_dbWhether to create a new database
Returns
DB_SUCCESS or error code

Minimum expected tablespace size. TBD Why is it 5MB exactly?

◆ srv_start_purge_threads()

void srv_start_purge_threads ( )

Start purge threads.

During upgrade we start purge threads early to apply purge.

◆ srv_start_state_is_set()

static bool srv_start_state_is_set ( srv_start_state_t  state)
inlinestatic

Check if following group of threads is started.

Returns
true if started
Parameters
statein: state to check for

◆ srv_start_state_set()

static void srv_start_state_set ( srv_start_state_t  state)
inlinestatic

Set state to indicate start of particular group of threads in InnoDB.

Parameters
statein: indicate current state of thread startup

◆ srv_start_threads()

void srv_start_threads ( )

Start up the InnoDB service threads which are independent of DDL recovery.

◆ srv_start_threads_after_ddl_recovery()

void srv_start_threads_after_ddl_recovery ( )

Start the remaining InnoDB service threads which must wait for complete DD recovery(post the DDL recovery)

◆ srv_start_wait_for_purge_to_start()

static void srv_start_wait_for_purge_to_start ( )
static

Wait for the purge thread(s) to start up.

◆ srv_thread_delay_cleanup_if_needed()

void srv_thread_delay_cleanup_if_needed ( bool  wait_for_signal)

Delay the thread after it discovered that the shutdown_state is greater or equal to SRV_SHUTDOWN_CLEANUP, before it proceeds with further clean up.

This is used in the tests to see if such a possible delay does not have impact on the clean shutdown.

Parameters
[in]wait_for_signalwait until shutdown phase starts

◆ srv_undo_create_implicit_tablespaces()

static dberr_t srv_undo_create_implicit_tablespaces ( )
static

Create the implicit undo tablespaces for the new instance.

It only ensures the Undo Tablespace exists, has a minimal valid header and is open. It doesn't create rseg arrays, nor rollback segments.

Returns
DB_SUCCESS or error code

◆ srv_undo_create_implicit_tablespaces_with_empty_structure()

static dberr_t srv_undo_create_implicit_tablespaces_with_empty_structure ( )
static

Create the implicit undo tablespaces for the new instance, and create their rseg arrrays, but not their rollback segments.

Returns
DB_SUCCESS or error code

◆ srv_undo_mark_all_tablespaces_usable()

static void srv_undo_mark_all_tablespaces_usable ( )
static

Mark any fully constructed undo tablespaces ready to use.

◆ srv_undo_mark_tablespace_usable()

static void srv_undo_mark_tablespace_usable ( space_id_t  space_id)
static

Mark the point in which an undo tablespace is fully constructed and ready to use.

Parameters
[in]space_idundo tablespace id

◆ srv_undo_prepare_empty_structure()

static dberr_t srv_undo_prepare_empty_structure ( space_id_t  space_id,
bool  enable_undo_encryption 
)
static

Initialize FSP structures (such as fragment and inode lists) and the (empty) rseg array of an undo tablespace.

Before the call this tablespace file should be created and filled with zeros with a minimal tablespace header. This function does not create any rollback segments.

Parameters
[in]space_idundo tablespace id
[in]enable_undo_encryptionwhether to update global undo encryption metadata after construction
Returns
DB_SUCCESS or error code

◆ srv_undo_tablespace_create() [1/2]

dberr_t srv_undo_tablespace_create ( const char *  space_name,
const char *  file_name,
space_id_t  space_id 
)

Create an undo tablespace.

Parameters
[in]space_nametablespace name
[in]file_namefile name
[in]space_idTablespace ID
Returns
DB_SUCCESS or error code

◆ srv_undo_tablespace_create() [2/2]

static dberr_t srv_undo_tablespace_create ( undo_truncate::Tablespace undo_space)
static

Create undo tablespace.

Parameters
[in]undo_spaceUndo Tablespace
Returns
DB_SUCCESS or error code

◆ srv_undo_tablespace_enable_encryption()

static dberr_t srv_undo_tablespace_enable_encryption ( space_id_t  space_id)
static

Try to enable encryption of an undo log tablespace.

Parameters
[in]space_idundo tablespace id
Returns
DB_SUCCESS if success

◆ srv_undo_tablespace_fixup()

dberr_t srv_undo_tablespace_fixup ( const char *  space_name,
const char *  file_name,
space_id_t  space_id 
)

Fix up an undo tablespace if it was in the process of being truncated when the server crashed.

This is the second call and is done after the DD is available so now we know the space_name, file_name and previous space_id.

Parameters
[in]space_nameundo tablespace name
[in]file_nameundo tablespace file name
[in]space_idundo tablespace ID
Returns
DB_SUCCESS or error code

◆ srv_undo_tablespace_fixup_num()

static dberr_t srv_undo_tablespace_fixup_num ( space_id_t  space_num)
static

Handles the undo_$num_trunc.log marker generated by 9.x, by removing the space with corresponding space_id, if it was found during tablespace scanning.

This ensures:

  1. It will not be opened by subsequent srv_undo_tablespace_open_by_num(num)
  2. It will clean up file created by CREATE UNDO TABLESPACE if it wasn't yet registered in DD (and thus wouldn't be found in DD and processed by srv_undo_tablespace_fixup)
    Parameters
    [in]space_numundo tablespace number
    Returns
    error code

◆ srv_undo_tablespace_open()

dberr_t srv_undo_tablespace_open ( undo_truncate::Tablespace undo_space,
bool  expected_to_be_unusable 
)

Open an undo tablespace.

Parameters
[in]undo_spaceUndo tablespace
[in]expected_to_be_unusabletrue if tablespace is expected to be unusable
Returns
DB_SUCCESS or error code

◆ srv_undo_tablespace_open_by_num()

static dberr_t srv_undo_tablespace_open_by_num ( const space_id_t  space_num)
static

Open an undo tablespace with a specified undo number.

If the undo space is undergoing truncation, we will delete the undo file.

Parameters
[in]space_numundo tablespace number
Returns
DB_SUCCESS or error code

◆ srv_undo_tablespace_read_encryption()

static dberr_t srv_undo_tablespace_read_encryption ( ib::fil::Tablespace_node_handle_interface file_handle,
fil_space_t space 
)
static

Try to read encryption metadata from an undo tablespace.

Parameters
[in]file_handlefile handle of undo log file
[in]spaceundo tablespace
Returns
DB_SUCCESS if success

◆ srv_undo_tablespaces_open()

static dberr_t srv_undo_tablespaces_open ( )
static

◆ undo_truncate_spaces_deinit()

void undo_truncate_spaces_deinit ( )

Free the resources occupied by undo_truncate::spaces, called once during srv_shutdown().

◆ undo_truncate_spaces_init()

void undo_truncate_spaces_init ( )

Initialize undo_truncate::spaces, called once during srv_start().

◆ verify_page_type()

static void verify_page_type ( page_id_t  page_id,
page_type_t  type 
)
static

Check the page type, if there is a mismatch then throw fatal error.

It may so happen that data file before 5.7 GA version may contain uninitialized bytes in the FIL_PAGE_TYPE field.

Parameters
[in]page_idPage id to verify
[in]typeExpected page type

Variable Documentation

◆ SHUTDOWN_SLEEP_ROUNDS

constexpr uint32_t SHUTDOWN_SLEEP_ROUNDS
staticconstexpr
Initial value:
=
60 * 1000 * 1000 / SHUTDOWN_SLEEP_TIME_US
static constexpr uint32_t SHUTDOWN_SLEEP_TIME_US
Sleep time in loops which wait for pending tasks during shutdown.
Definition: srv0start.cc:213

Number of wait rounds during shutdown, after which error is produced, or other policy for timed out wait is applied.

◆ SHUTDOWN_SLEEP_TIME_US

constexpr uint32_t SHUTDOWN_SLEEP_TIME_US = 100
staticconstexpr

Sleep time in loops which wait for pending tasks during shutdown.

◆ srv_is_being_started

bool srv_is_being_started = false

true if the server is being started

◆ srv_monitor_file_name

char* srv_monitor_file_name
static

Name of srv_monitor_file.

◆ srv_shutdown_state

std::atomic<enum srv_shutdown_t> srv_shutdown_state {SRV_SHUTDOWN_NONE}

At a shutdown this value climbs from SRV_SHUTDOWN_NONE to SRV_SHUTDOWN_EXIT_THREADS.

◆ srv_stages

PSI_stage_info* srv_stages[]
static
Initial value:
= {
}
PSI_stage_info srv_stage_alter_tablespace_encryption
Performance schema stage event for monitoring ALTER TABLESPACE ENCRYPTION progress.
Definition: srv0srv.cc:833
PSI_stage_info srv_stage_alter_table_log_table
Performance schema stage event for monitoring ALTER TABLE progress row_log_table_apply().
Definition: srv0srv.cc:818
PSI_stage_info srv_stage_alter_table_flush
Performance schema stage event for monitoring ALTER TABLE progress pages_persistence->request_sharp_c...
Definition: srv0srv.cc:803
PSI_stage_info srv_stage_alter_table_end
Performance schema stage event for monitoring ALTER TABLE progress everything after flush pages_persi...
Definition: srv0srv.cc:798
PSI_stage_info srv_stage_clone_file_copy
Performance schema stage event for monitoring clone file copy progress.
Definition: srv0srv.cc:843
PSI_stage_info srv_stage_buffer_pool_load
Performance schema stage event for monitoring buffer pool load progress.
Definition: srv0srv.cc:838
PSI_stage_info srv_stage_alter_table_read_pk_internal_sort
Performance schema stage event for monitoring ALTER TABLE progress row_merge_read_clustered_index().
Definition: srv0srv.cc:827
PSI_stage_info srv_stage_alter_table_insert
Performance schema stage event for monitoring ALTER TABLE progress row_merge_insert_index_tuples().
Definition: srv0srv.cc:807
PSI_stage_info srv_stage_alter_table_merge_sort
Performance schema stage event for monitoring ALTER TABLE progress row_merge_sort().
Definition: srv0srv.cc:823
PSI_stage_info srv_stage_clone_page_copy
Performance schema stage event for monitoring clone page copy progress.
Definition: srv0srv.cc:851
PSI_stage_info srv_stage_clone_redo_copy
Performance schema stage event for monitoring clone redo copy progress.
Definition: srv0srv.cc:847
PSI_stage_info srv_stage_alter_table_log_index
Performance schema stage event for monitoring ALTER TABLE progress row_log_apply().
Definition: srv0srv.cc:812

Array of all InnoDB stage events for monitoring activities via performance schema.

◆ srv_start_has_been_called

bool srv_start_has_been_called = false
static

true if srv_start() has been called

◆ srv_start_raw_disk_in_use

bool srv_start_raw_disk_in_use = false

true if a raw partition is in use

◆ srv_start_state

uint64_t srv_start_state = SRV_START_STATE_NONE
static

Track server thrd starting phases.

◆ srv_startup_is_before_trx_rollback_phase

bool srv_startup_is_before_trx_rollback_phase = false

true if the server is being started, before rolling back any incomplete transactions

◆ srv_sys_tablespaces_open

bool srv_sys_tablespaces_open = false

true if SYS_TABLESPACES is available for lookups

◆ threads_to_stop

const Thread_to_stop threads_to_stop[]
static
Initial value:
{
{"lock_wait_timeout", srv_threads.m_lock_wait_timeout,
{"error_monitor", srv_threads.m_error_monitor,
{"monitor", srv_threads.m_monitor,
{"buf_dump", srv_threads.m_buf_dump,
{"buf_resize", srv_threads.m_buf_resize,
void lock_set_timeout_event()
Set the lock system timeout event.
Definition: lock0lock.cc:5946
void os_event_set(os_event_t event)
Sets an event semaphore to the signaled state: lets waiting threads proceed.
Definition: os0event.cc:539
@ SRV_SHUTDOWN_CLEANUP
Stopping remaining InnoDB background threads except:
Definition: srv0shutdown.h:92
@ SRV_SHUTDOWN_MASTER_STOP
Stopping the master thread.
Definition: srv0shutdown.h:95
void srv_wake_master_thread(void)
Wakes up the master thread if it is suspended or being suspended.
Definition: srv0srv.cc:1964
os_event_t srv_monitor_event
Event to signal the monitor thread.
Definition: srv0srv.cc:770
os_event_t srv_error_event
Event to signal the error thread.
Definition: srv0srv.cc:773
os_event_t srv_buf_dump_event
The buffer pool dump/load thread waits on this event.
Definition: srv0srv.cc:776
Srv_threads srv_threads
Structure with state of srv background threads.
Definition: srv0srv.cc:112
os_event_t srv_buf_resize_event
The buffer pool resize thread waits on this event.
Definition: srv0srv.cc:779
IB_thread m_error_monitor
Error monitor thread.
Definition: srv0srv.h:170
IB_thread m_buf_resize
Buffer pool resize thread.
Definition: srv0srv.h:197
IB_thread m_lock_wait_timeout
Thread detecting lock wait timeouts.
Definition: srv0srv.h:203
IB_thread m_buf_dump
Buffer pool dump thread.
Definition: srv0srv.h:194
IB_thread m_monitor
Monitor thread (prints info).
Definition: srv0srv.h:167
IB_thread m_master
The master thread.
Definition: srv0srv.h:206