MySQL 8.0.40
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 "my_dbug.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 "fsp0fsp.h"
#include "fsp0sysspace.h"
#include "ha_prototypes.h"
#include "ibuf0ibuf.h"
#include "log0buf.h"
#include "log0chkp.h"
#include "log0recv.h"
#include "log0write.h"
#include "mem0mem.h"
#include "mtr0mtr.h"
#include "my_psi_config.h"
#include "mysql/psi/mysql_stage.h"
#include "mysqld.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 "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::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 (pfs_os_file_t fh, const char *file_name, fil_space_t *space)
 Try to read encryption metadata from an undo tablespace. More...
 
static dberr_t srv_undo_tablespace_fixup_57 (space_id_t space_id)
 Fix up a v5.7 type undo tablespace that was being truncated. More...
 
static dberr_t srv_undo_tablespace_fixup_num (space_id_t space_num)
 Start the fix-up process on an undo tablespace if it was in the process of being truncated when the server crashed. 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::Tablespace &undo_space)
 Open an undo tablespace. More...
 
static dberr_t srv_undo_tablespace_open_by_id (space_id_t space_id)
 Open an undo tablespace with a specified space_id. More...
 
static dberr_t srv_undo_tablespace_open_by_num (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_tablespaces_create ()
 Create the implicit undo tablespaces if we are creating a new instance or if there was not enough implicit undo tablespaces previously existing. More...
 
static dberr_t srv_undo_tablespaces_construct ()
 Finish building an undo tablespace. More...
 
static void srv_undo_tablespaces_mark_construction_done ()
 Mark the point in which the undo tablespaces in the construction list are fully constructed and ready to use. More...
 
dberr_t srv_undo_tablespaces_upgrade ()
 Upgrade undo tablespaces by deleting the old undo tablespaces referenced by the TRX_SYS page. More...
 
static void srv_undo_tablespaces_downgrade ()
 Downgrade undo tablespaces by deleting the new undo tablespaces which are not referenced by the TRX_SYS page. More...
 
dberr_t srv_undo_tablespace_create (const char *space_name, const char *file_name, space_id_t space_id)
 Create an undo tablespace with an explicit file name This is called during CREATE UNDO TABLESPACE. More...
 
void undo_spaces_init ()
 Initialize undo::spaces and trx_sys_undo_spaces, called once during srv_start(). More...
 
void undo_spaces_deinit ()
 Free the resources occupied by undo::spaces and trx_sys_undo_spaces, called once during thread de-initialization. More...
 
static dberr_t srv_undo_tablespaces_init (bool create_new_db)
 Open the configured number of implicit undo tablespaces. More...
 
static void srv_start_wait_for_purge_to_start ()
 
static dberr_t srv_open_tmp_tablespace (bool create_new_db, 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 dberr_t recreate_redo_files (lsn_t &flushed_lsn)
 Recreate REDO log files. 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...
 
void srv_fatal_error ()
 Call std::_Exit(3) More...
 

Variables

uint32_t predefined_flags
 fil_space_t::flags for hard-coded tablespaces More...
 
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.

◆ recreate_redo_files()

static dberr_t recreate_redo_files ( lsn_t flushed_lsn)
static

Recreate REDO log files.

Parameters
[in,out]flushed_lsnflushed_lsn
Returns
DB_SUCCESS or error code

◆ srv_create_sdi_indexes()

static void srv_create_sdi_indexes ( )
static

Create SDI Indexes in system 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_fatal_error()

void srv_fatal_error ( )

Call std::_Exit(3)

Call std::quick_exit(3)

◆ 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 ( bool  create_new_db,
SysTablespace tmp_space 
)
static

Create the temporary file tablespace.

Parameters
[in]create_new_dbwhether we are creating a new database
[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

◆ 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

◆ 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_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 with an explicit file name This is called during CREATE 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::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
error code

◆ srv_undo_tablespace_fixup_57()

static dberr_t srv_undo_tablespace_fixup_57 ( space_id_t  space_id)
static

Fix up a v5.7 type undo tablespace that was being truncated.

The space_id is not a reserved undo space_id. We will just delete the file since it will be replaced.

Parameters
[in]space_idTablespace ID
Returns
error code

◆ srv_undo_tablespace_fixup_num()

static dberr_t srv_undo_tablespace_fixup_num ( space_id_t  space_num)
static

Start the fix-up process on an undo tablespace if it was in the process of being truncated when the server crashed.

At this point, just delete the old file if it exists. We could do the whole reconstruction here for implicit undo spaces since we know the space_id, space_name, and file_name implicitly. But for explicit undo spaces, we must wait for the DD to be scanned in boot_tablespaces() in order to know the space_id, space_name, and file_name.

Parameters
[in]space_numundo tablespace number
Returns
error code

◆ srv_undo_tablespace_open()

dberr_t srv_undo_tablespace_open ( undo::Tablespace undo_space)

Open an undo tablespace.

Parameters
[in]undo_spaceUndo tablespace
Returns
DB_SUCCESS or error code

◆ srv_undo_tablespace_open_by_id()

static dberr_t srv_undo_tablespace_open_by_id ( space_id_t  space_id)
static

Open an undo tablespace with a specified space_id.

Parameters
[in]space_idtablespace ID
Returns
DB_SUCCESS or error code

◆ srv_undo_tablespace_open_by_num()

static dberr_t srv_undo_tablespace_open_by_num ( space_id_t  space_num)
static

Open an undo tablespace with a specified undo number.

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 ( pfs_os_file_t  fh,
const char *  file_name,
fil_space_t space 
)
static

Try to read encryption metadata from an undo tablespace.

Parameters
[in]fhfile handle of undo log file
[in]file_namefile name
[in]spaceundo tablespace
Returns
DB_SUCCESS if success

◆ srv_undo_tablespaces_construct()

static dberr_t srv_undo_tablespaces_construct ( )
static

Finish building an undo tablespace.

So far these tablespace files in the construction list should be created and filled with zeros.

Returns
DB_SUCCESS or error code

◆ srv_undo_tablespaces_create()

static dberr_t srv_undo_tablespaces_create ( )
static

Create the implicit undo tablespaces if we are creating a new instance or if there was not enough implicit undo tablespaces previously existing.

Returns
DB_SUCCESS or error code

◆ srv_undo_tablespaces_downgrade()

static void srv_undo_tablespaces_downgrade ( )
static

Downgrade undo tablespaces by deleting the new undo tablespaces which are not referenced by the TRX_SYS page.

◆ srv_undo_tablespaces_init()

static dberr_t srv_undo_tablespaces_init ( bool  create_new_db)
static

Open the configured number of implicit undo tablespaces.

Parameters
[in]create_new_dbtrue if new db being created
Returns
DB_SUCCESS or error code

◆ srv_undo_tablespaces_mark_construction_done()

static void srv_undo_tablespaces_mark_construction_done ( )
static

Mark the point in which the undo tablespaces in the construction list are fully constructed and ready to use.

◆ srv_undo_tablespaces_open()

static dberr_t srv_undo_tablespaces_open ( )
static

◆ srv_undo_tablespaces_upgrade()

dberr_t srv_undo_tablespaces_upgrade ( )

Upgrade undo tablespaces by deleting the old undo tablespaces referenced by the TRX_SYS page.

Returns
error code

◆ undo_spaces_deinit()

void undo_spaces_deinit ( )

Free the resources occupied by undo::spaces and trx_sys_undo_spaces, called once during thread de-initialization.

◆ undo_spaces_init()

void undo_spaces_init ( )

Initialize undo::spaces and trx_sys_undo_spaces, called once during srv_start().

Variable Documentation

◆ predefined_flags

uint32_t predefined_flags
extern

fil_space_t::flags for hard-coded tablespaces

◆ 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:214

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:841
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:826
PSI_stage_info srv_stage_alter_table_flush
Performance schema stage event for monitoring ALTER TABLE progress log_make_latest_checkpoint().
Definition: srv0srv.cc:811
PSI_stage_info srv_stage_alter_table_end
Performance schema stage event for monitoring ALTER TABLE progress everything after flush log_make_la...
Definition: srv0srv.cc:806
PSI_stage_info srv_stage_clone_file_copy
Performance schema stage event for monitoring clone file copy progress.
Definition: srv0srv.cc:851
PSI_stage_info srv_stage_buffer_pool_load
Performance schema stage event for monitoring buffer pool load progress.
Definition: srv0srv.cc:846
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:835
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:815
PSI_stage_info srv_stage_alter_table_merge_sort
Performance schema stage event for monitoring ALTER TABLE progress row_merge_sort().
Definition: srv0srv.cc:831
PSI_stage_info srv_stage_clone_page_copy
Performance schema stage event for monitoring clone page copy progress.
Definition: srv0srv.cc:859
PSI_stage_info srv_stage_clone_redo_copy
Performance schema stage event for monitoring clone redo copy progress.
Definition: srv0srv.cc:855
PSI_stage_info srv_stage_alter_table_log_index
Performance schema stage event for monitoring ALTER TABLE progress row_log_apply().
Definition: srv0srv.cc:820

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:6074
void os_event_set(os_event_t event)
Sets an event semaphore to the signaled state: lets waiting threads proceed.
Definition: os0event.cc:553
@ 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:1968
os_event_t srv_monitor_event
Event to signal the monitor thread.
Definition: srv0srv.cc:778
os_event_t srv_error_event
Event to signal the error thread.
Definition: srv0srv.cc:781
os_event_t srv_buf_dump_event
The buffer pool dump/load thread waits on this event.
Definition: srv0srv.cc:784
Srv_threads srv_threads
Structure with state of srv background threads.
Definition: srv0srv.cc:103
os_event_t srv_buf_resize_event
The buffer pool resize thread waits on this event.
Definition: srv0srv.cc:787
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