MySQL  8.0.21
Source Code Documentation
dblwr Namespace Reference

Namespaces

 recv
 
 v1
 

Classes

struct  Buffer
 IO buffer in UNIV_PAGE_SIZE units and aligned on UNIV_PAGE_SIZE. More...
 
struct  File
 

Functions

dberr_t open (bool create_new_db) noexcept
 Startup the background thread(s) and create the instance. More...
 
void close () noexcept
 Shutdown the background thread and destroy the instance. More...
 
void force_flush (buf_flush_t flush_type, uint32_t buf_pool_index) noexcept
 Force a write of all pages in the queue. More...
 
dberr_t write (buf_flush_t flush_type, buf_page_t *bpage, bool sync) noexcept
 Writes a page to the doublewrite buffer on disk, syncs it, then writes the page to the datafile. More...
 
void write_complete (buf_page_t *bpage, buf_flush_t flush_type) noexcept
 Updates the double write buffer when a write request is completed. More...
 
void reset_files () noexcept
 Delete or adjust the dblwr file size if required. More...
 
void set ()
 Toggle the doublewrite buffer. More...
 

Variables

std::string dir {"."}
 Double write files location. More...
 
ulong n_files {1}
 Number of files to use for the double write buffer. More...
 
ulong batch_size {}
 Maximum number of pages to write in one batch. More...
 
ulong n_pages {64}
 Number of pages per doublewrite thread/segment. More...
 
bool enabled {true}
 true if enabled. More...
 
static page_no_t LEGACY_PAGE1
 Legacy dblwr buffer first segment page number. More...
 
static page_no_t LEGACY_PAGE2
 Legacy dblwr buffer second segment page number. More...
 
page_id_t Force_crash {UINT32_UNDEFINED, UINT32_UNDEFINED}
 Crash the server after writing this page to the data file. More...
 

Function Documentation

◆ close()

void dblwr::close ( )
noexcept

Shutdown the background thread and destroy the instance.

◆ force_flush()

void dblwr::force_flush ( buf_flush_t  flush_type,
uint32_t  buf_pool_index 
)
noexcept

Force a write of all pages in the queue.

Parameters
[in]flush_typeFLUSH LIST or LRU_LIST flush request.
[in]buf_pool_indexBuffer pool instance for which called.

◆ open()

dberr_t dblwr::open ( bool  create_new_db)
noexcept

Startup the background thread(s) and create the instance.

Parameters
[in]create_new_dbCreate new database.
Returns
DB_SUCCESS or error code

◆ reset_files()

void dblwr::reset_files ( )
noexcept

Delete or adjust the dblwr file size if required.

◆ set()

void dblwr::set ( )

Toggle the doublewrite buffer.

◆ write()

dberr_t dblwr::write ( buf_flush_t  flush_type,
buf_page_t bpage,
bool  sync 
)
noexcept

Writes a page to the doublewrite buffer on disk, syncs it, then writes the page to the datafile.

Parameters
[in]flush_typeFlush type
[in]bpageBuffer block to write
[in]syncTrue if sync IO requested
Returns
DB_SUCCESS or error code

◆ write_complete()

void dblwr::write_complete ( buf_page_t bpage,
buf_flush_t  flush_type 
)
noexcept

Updates the double write buffer when a write request is completed.

Parameters
[in]bpageBlock that has just been writtent to disk.
[in]flush_typeFlush type that triggered the write.

Variable Documentation

◆ batch_size

ulong dblwr::batch_size {}

Maximum number of pages to write in one batch.

◆ dir

std::string dblwr::dir {"."}

Double write files location.

◆ enabled

bool dblwr::enabled {true}

true if enabled.

◆ Force_crash

page_id_t dblwr::Force_crash {UINT32_UNDEFINED, UINT32_UNDEFINED}

Crash the server after writing this page to the data file.

◆ LEGACY_PAGE1

page_no_t dblwr::LEGACY_PAGE1
static

Legacy dblwr buffer first segment page number.

◆ LEGACY_PAGE2

page_no_t dblwr::LEGACY_PAGE2
static

Legacy dblwr buffer second segment page number.

◆ n_files

ulong dblwr::n_files {1}

Number of files to use for the double write buffer.

It must be <= than the number of buffer pool instances.

◆ n_pages

ulong dblwr::n_pages {64}

Number of pages per doublewrite thread/segment.