MySQL 9.1.0
Source Code Documentation
row0quiesce.cc File Reference

Quiesce a tablespace. More...

#include <errno.h>
#include <my_aes.h>
#include "dd/cache/dictionary_client.h"
#include "sql/dd/dictionary.h"
#include "sql/dd/types/column_type_element.h"
#include "dict0dd.h"
#include "fsp0sysspace.h"
#include "ha_prototypes.h"
#include "ibuf0ibuf.h"
#include "row0mysql.h"
#include "row0quiesce.h"
#include "srv0start.h"
#include "trx0purge.h"
#include "my_dbug.h"

Functions

static dberr_t row_quiesce_write_index_fields (const dict_index_t *index, FILE *file, THD *thd)
 Write the meta data (index user fields) config file. More...
 
static dberr_t row_quiesce_write_one_index (const dict_index_t *index, FILE *file, THD *thd)
 Write the meta data config file index information. More...
 
static dberr_t row_quiesce_write_indexes (const dict_table_t *table, FILE *file, THD *thd)
 Write the meta data config file index information. More...
 
static dberr_t row_quiesce_write_dropped_col_metadata (const dict_col_t *col, const char *col_name, FILE *file, const dict_table_t *dict_table, THD *thd)
 Write the metadata (table columns) config file. More...
 
static dberr_t row_quiesce_write_default_value (const dict_col_t *col, FILE *file)
 Write the metadata (table columns) config file. More...
 
static dberr_t row_quiesce_write_table (const dict_table_t *table, FILE *file, THD *thd)
 Write the meta data (table columns) config file. More...
 
static dberr_t row_quiesce_write_header (const dict_table_t *table, FILE *file, THD *thd)
 Write the meta data config file header. More...
 
static dberr_t row_quiesce_write_cfg (dict_table_t *table, THD *thd)
 Write the table meta data after quiesce. More...
 
static dberr_t row_quiesce_write_transfer_key (const Encryption_metadata &encryption_metadata, FILE *file, THD *thd)
 Write the transfer key to CFP file. More...
 
static dberr_t row_quiesce_write_cfp (dict_table_t *table, THD *thd)
 Write the encryption data after quiesce. More...
 
static bool row_quiesce_table_has_fts_index (const dict_table_t *table)
 Check whether a table has an FTS index defined on it. More...
 
void row_quiesce_table_start (dict_table_t *table, trx_t *trx)
 Quiesce the tablespace that the table resides in. More...
 
void row_quiesce_table_complete (dict_table_t *table, trx_t *trx)
 Cleanup after table quiesce. More...
 
dberr_t row_quiesce_set_state (dict_table_t *table, ib_quiesce_t state, trx_t *trx)
 Set a table's quiesce state. More...
 

Detailed Description

Quiesce a tablespace.

Created 2012-02-08 by Sunny Bains.

Function Documentation

◆ row_quiesce_set_state()

dberr_t row_quiesce_set_state ( dict_table_t table,
ib_quiesce_t  state,
trx_t trx 
)

Set a table's quiesce state.

Returns
DB_SUCCESS or error code.
Parameters
tablein: quiesce this table
statein: quiesce state to set
trxin/out: transaction

◆ row_quiesce_table_complete()

void row_quiesce_table_complete ( dict_table_t table,
trx_t trx 
)

Cleanup after table quiesce.

Parameters
[in]tableQuiesce this table
[in,out]trxTransaction/session

◆ row_quiesce_table_has_fts_index()

static bool row_quiesce_table_has_fts_index ( const dict_table_t table)
static

Check whether a table has an FTS index defined on it.

Returns
true if an FTS index exists on the table
Parameters
tablein: quiesce this table

◆ row_quiesce_table_start()

void row_quiesce_table_start ( dict_table_t table,
trx_t trx 
)

Quiesce the tablespace that the table resides in.

Parameters
[in]tableQuiesce this table
[in,out]trxTransaction/session

◆ row_quiesce_write_cfg()

static dberr_t row_quiesce_write_cfg ( dict_table_t table,
THD thd 
)
static

Write the table meta data after quiesce.

Returns
DB_SUCCESS or error code
Parameters
tablein: write the meta data for this table
thdin/out: session

◆ row_quiesce_write_cfp()

static dberr_t row_quiesce_write_cfp ( dict_table_t table,
THD thd 
)
static

Write the encryption data after quiesce.

Parameters
[in]tablewrite the data for this table
[in]thdsession
Returns
DB_SUCCESS or error code

◆ row_quiesce_write_default_value()

static dberr_t row_quiesce_write_default_value ( const dict_col_t col,
FILE *  file 
)
static

Write the metadata (table columns) config file.

Serialise the contents of dict_col_t default value part if exists.

Parameters
[in]colcolumn to which the default value belongs
[in]filefile to write to
Returns
DB_SUCCESS or DB_IO_ERROR.

◆ row_quiesce_write_dropped_col_metadata()

static dberr_t row_quiesce_write_dropped_col_metadata ( const dict_col_t col,
const char *  col_name,
FILE *  file,
const dict_table_t dict_table,
THD thd 
)
static

Write the metadata (table columns) config file.

Serialise the contents of dict_col_t default value part if exists.

Parameters
[in]colcolumn to which the default value belongs
[in]col_namecolumn name
[in,out]filefile to write to
[in]dict_tableInnoDB table cache
[in]thdTHD
Returns
DB_SUCCESS or DB_IO_ERROR.

◆ row_quiesce_write_header()

static dberr_t row_quiesce_write_header ( const dict_table_t table,
FILE *  file,
THD thd 
)
static

Write the meta data config file header.

Parameters
[in]tablewrite the meta data for this table
[in]filefile to write to
[in,out]thdsession
Returns
DB_SUCCESS or error code.

◆ row_quiesce_write_index_fields()

static dberr_t row_quiesce_write_index_fields ( const dict_index_t index,
FILE *  file,
THD thd 
)
static

Write the meta data (index user fields) config file.

Returns
DB_SUCCESS or error code.
Parameters
indexin: write the meta data for this index
filein: file to write to
thdin/out: session

◆ row_quiesce_write_indexes()

static dberr_t row_quiesce_write_indexes ( const dict_table_t table,
FILE *  file,
THD thd 
)
static

Write the meta data config file index information.

Returns
DB_SUCCESS or error code.
Parameters
tablein: write the meta data for this table
filein: file to write to
thdin/out: session

◆ row_quiesce_write_one_index()

static dberr_t row_quiesce_write_one_index ( const dict_index_t index,
FILE *  file,
THD thd 
)
static

Write the meta data config file index information.

Parameters
[in]indexwrite metadata for this index
[in,out]filefile to write to
[in,out]thdsession
Returns
DB_SUCCESS or error code.

◆ row_quiesce_write_table()

static dberr_t row_quiesce_write_table ( const dict_table_t table,
FILE *  file,
THD thd 
)
static

Write the meta data (table columns) config file.

Serialise the contents of dict_col_t structure, along with the column name. All fields are serialized as uint32_t.

Returns
DB_SUCCESS or error code.
Parameters
tablein: write the meta data for this table
filein: file to write to
thdin/out: session

◆ row_quiesce_write_transfer_key()

static dberr_t row_quiesce_write_transfer_key ( const Encryption_metadata encryption_metadata,
FILE *  file,
THD thd 
)
static

Write the transfer key to CFP file.

Parameters
[in]encryption_metadatathe encryption key and iv to store in file
[in]filefile to write to
[in]thdsession
Returns
DB_SUCCESS or error code.