MySQL 8.3.0
Source Code Documentation
mtr_t::Logging Class Reference

mtr global logging More...

#include <mtr0mtr.h>

Public Types

enum  State : uint32_t { ENABLED , ENABLED_DBLWR , ENABLED_RESTRICT , DISABLED }
 mtr global redo logging state. More...
 

Public Member Functions

void init ()
 Initialize logging state at server start up. More...
 
int disable (THD *thd)
 Disable mtr redo logging. More...
 
int enable (THD *thd)
 Enable mtr redo logging. More...
 
bool mark_mtr (size_t index)
 Mark a no-logging mtr to indicate that it would not generate redo log and system is crash unsafe. More...
 
void unmark_mtr (size_t index)
 unmark a no logging mtr. More...
 
uint32_t get_nolog_flush_loop () const
 
bool is_enabled () const
 
bool is_disabled () const
 
bool dblwr_disabled () const
 

Static Public Attributes

static constexpr uint32_t NOLOG_MAX_FLUSH_LOOP = 5
 

Private Types

using Shards = Counter::Shards< 128 >
 

Private Member Functions

int wait_no_log_mtr (THD *thd)
 Wait till all no-logging mtrs are finished. More...
 

Private Attributes

std::atomic< Statem_state
 Global redo logging state. More...
 
Shards m_count_nologging_mtr
 Number of no logging mtrs currently running. More...
 

Detailed Description

mtr global logging

Member Typedef Documentation

◆ Shards

Member Enumeration Documentation

◆ State

enum mtr_t::Logging::State : uint32_t

mtr global redo logging state.

Enable Logging : [ENABLED] -> [ENABLED_RESTRICT] -> [DISABLED]

Disable Logging : [DISABLED] -> [ENABLED_RESTRICT] -> [ENABLED_DBLWR] -> [ENABLED]

Enumerator
ENABLED 
ENABLED_DBLWR 
ENABLED_RESTRICT 
DISABLED 

Member Function Documentation

◆ dblwr_disabled()

bool mtr_t::Logging::dblwr_disabled ( ) const
inline
Returns
true iff we can skip data page double write.

◆ disable()

int mtr_t::Logging::disable ( THD thd)

Disable mtr redo logging.

Server is crash unsafe without logging.

Parameters
[in]thdserver connection THD
Returns
mysql error code.

◆ enable()

int mtr_t::Logging::enable ( THD thd)

Enable mtr redo logging.

Ensure that the server is crash safe before returning.

Parameters
[in]thdserver connection THD
Returns
mysql error code.

◆ get_nolog_flush_loop()

uint32_t mtr_t::Logging::get_nolog_flush_loop ( ) const
inline

◆ init()

void mtr_t::Logging::init ( void  )
inline

Initialize logging state at server start up.

◆ is_disabled()

bool mtr_t::Logging::is_disabled ( ) const
inline
Returns
true iff redo logging is disabled and new mtrs are not going to generate redo log.

◆ is_enabled()

bool mtr_t::Logging::is_enabled ( ) const
inline
Returns
true iff redo logging is enabled and server is crash safe.

◆ mark_mtr()

bool mtr_t::Logging::mark_mtr ( size_t  index)
inline

Mark a no-logging mtr to indicate that it would not generate redo log and system is crash unsafe.

Returns
true iff logging is disabled and mtr is marked.

◆ unmark_mtr()

void mtr_t::Logging::unmark_mtr ( size_t  index)
inline

unmark a no logging mtr.

◆ wait_no_log_mtr()

int mtr_t::Logging::wait_no_log_mtr ( THD thd)
private

Wait till all no-logging mtrs are finished.

Returns
mysql error code.

Member Data Documentation

◆ m_count_nologging_mtr

Shards mtr_t::Logging::m_count_nologging_mtr
private

Number of no logging mtrs currently running.

◆ m_state

std::atomic<State> mtr_t::Logging::m_state
private

Global redo logging state.

◆ NOLOG_MAX_FLUSH_LOOP

constexpr uint32_t mtr_t::Logging::NOLOG_MAX_FLUSH_LOOP = 5
staticconstexpr

The documentation for this class was generated from the following files: