MySQL 8.3.0
Source Code Documentation
srv0start.h File Reference

Starts the Innobase database server. More...

#include "os0thread-create.h"
#include "sync0rw.h"
#include "trx0purge.h"
#include "univ.i"
#include "ut0byte.h"

Go to the source code of this file.

Macros

#define RECOVERY_CRASH(x)
 

Functions

void srv_free_paths_and_sizes (void)
 Frees the memory allocated by srv_parse_data_file_paths_and_sizes() and srv_parse_log_group_home_dirs(). More...
 
char * srv_add_path_separator_if_needed (char *str)
 Adds a slash or a backslash to the end of a string if it is missing and the string is not empty. More...
 
dberr_t srv_undo_tablespace_open (undo::Tablespace &undo_space)
 Open an undo tablespace. More...
 
dberr_t srv_undo_tablespaces_upgrade ()
 Upgrade undo tablespaces by deleting the old undo tablespaces referenced by the TRX_SYS page. More...
 
dberr_t srv_start (bool create_new_db)
 Start InnoDB. 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...
 
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_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...
 
void srv_start_purge_threads ()
 Start purge threads. 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

constexpr uint32_t BUF_POOL_SIZE_THRESHOLD = 1024 * 1024 * 1024
 If buffer pool is less than the size, only one buffer pool instance is used. More...
 
bool srv_is_being_started
 true if the server is being started More...
 
bool srv_sys_tablespaces_open
 true if SYS_TABLESPACES is available for lookups More...
 
bool srv_startup_is_before_trx_rollback_phase
 true if the server is being started, before rolling back any incomplete transactions More...
 
bool srv_start_raw_disk_in_use
 true if a raw partition is in use More...
 

Detailed Description

Starts the Innobase database server.

Created 10/10/1995 Heikki Tuuri

Macro Definition Documentation

◆ RECOVERY_CRASH

#define RECOVERY_CRASH (   x)
Value:
do { \
flush_error_log_messages(); \
fprintf(stderr, "innodb_force_recovery_crash=%lu\n", \
fflush(stderr); \
_exit(3); \
} \
} while (0)
ulong srv_force_recovery_crash
Inject a crash at different steps of the recovery process.
Definition: srv0srv.cc:538

Function Documentation

◆ srv_add_path_separator_if_needed()

char * srv_add_path_separator_if_needed ( char *  str)

Adds a slash or a backslash to the end of a string if it is missing and the string is not empty.

Returns
string which has the separator if the string is not empty in: null-terminated character string

◆ 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_free_paths_and_sizes()

void srv_free_paths_and_sizes ( void  )

Frees the memory allocated by srv_parse_data_file_paths_and_sizes() and srv_parse_log_group_home_dirs().

◆ 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_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_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_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_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_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

Variable Documentation

◆ BUF_POOL_SIZE_THRESHOLD

constexpr uint32_t BUF_POOL_SIZE_THRESHOLD = 1024 * 1024 * 1024
constexpr

If buffer pool is less than the size, only one buffer pool instance is used.

◆ srv_is_being_started

bool srv_is_being_started
extern

true if the server is being started

◆ srv_start_raw_disk_in_use

bool srv_start_raw_disk_in_use
extern

true if a raw partition is in use

◆ srv_startup_is_before_trx_rollback_phase

bool srv_startup_is_before_trx_rollback_phase
extern

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

◆ srv_sys_tablespaces_open

bool srv_sys_tablespaces_open
extern

true if SYS_TABLESPACES is available for lookups