MySQL  8.0.22
Source Code Documentation
FlushObserver Class Reference

We use FlushObserver to track flushing of non-redo logged pages in bulk create index(BtrBulk.cc).Since we disable redo logging during a index build, we need to make sure that all dirty pages modifed by the index build are flushed to disk before any redo logged operations go to the index. More...

#include <buf0flu.h>

Public Member Functions

 FlushObserver (space_id_t space_id, trx_t *trx, ut_stage_alter_t *stage)
 Constructor. More...
 
 ~FlushObserver ()
 Deconstructor. More...
 
bool is_complete (ulint instance_no)
 Check pages have been flushed and removed from the flush list in a buffer pool instance. More...
 
void interrupted ()
 Interrupt observer not to wait. More...
 
bool check_interrupted ()
 Check whether trx is interrupted. More...
 
void flush ()
 Flush dirty pages. More...
 
void notify_flush (buf_pool_t *buf_pool, buf_page_t *bpage)
 Notify observer of flushing a page. More...
 
void notify_remove (buf_pool_t *buf_pool, buf_page_t *bpage)
 Notify observer of removing a page from flush list. More...
 

Private Attributes

space_id_t m_space_id
 Table space id. More...
 
trx_tm_trx
 Trx instance. More...
 
ut_stage_alter_tm_stage
 Performance schema accounting object, used by ALTER TABLE. More...
 
std::vector< ulint > * m_flushed
 
std::vector< ulint > * m_removed
 
bool m_interrupted
 

Detailed Description

We use FlushObserver to track flushing of non-redo logged pages in bulk create index(BtrBulk.cc).Since we disable redo logging during a index build, we need to make sure that all dirty pages modifed by the index build are flushed to disk before any redo logged operations go to the index.

Constructor & Destructor Documentation

◆ FlushObserver()

FlushObserver::FlushObserver ( space_id_t  space_id,
trx_t trx,
ut_stage_alter_t stage 
)

Constructor.

FlushObserver constructor.

Parameters
[in]space_idtable space id
[in]trxtrx instance
[in]stageperformance schema accounting object, used by ALTER TABLE. It is passed to log_preflush_pool_modified_pages() for accounting.

◆ ~FlushObserver()

FlushObserver::~FlushObserver ( )

Deconstructor.

FlushObserver deconstructor.

Member Function Documentation

◆ check_interrupted()

bool FlushObserver::check_interrupted ( )

Check whether trx is interrupted.

Returns
true if trx is interrupted

◆ flush()

void FlushObserver::flush ( )

Flush dirty pages.

Flush dirty pages and wait.

◆ interrupted()

void FlushObserver::interrupted ( )
inline

Interrupt observer not to wait.

◆ is_complete()

bool FlushObserver::is_complete ( ulint  instance_no)
inline

Check pages have been flushed and removed from the flush list in a buffer pool instance.

Parameters
[in]instance_nobuffer pool instance no
Returns
true if the pages were removed from the flush list

◆ notify_flush()

void FlushObserver::notify_flush ( buf_pool_t buf_pool,
buf_page_t bpage 
)

Notify observer of flushing a page.

Notify observer of a flush.

Parameters
[in]buf_poolbuffer pool instance
[in]bpagebuffer page to flush

◆ notify_remove()

void FlushObserver::notify_remove ( buf_pool_t buf_pool,
buf_page_t bpage 
)

Notify observer of removing a page from flush list.

Notify observer of a remove.

Parameters
[in]buf_poolbuffer pool instance
[in]bpagebuffer page flushed

Member Data Documentation

◆ m_flushed

std::vector<ulint>* FlushObserver::m_flushed
private

◆ m_interrupted

bool FlushObserver::m_interrupted
private

◆ m_removed

std::vector<ulint>* FlushObserver::m_removed
private

◆ m_space_id

space_id_t FlushObserver::m_space_id
private

Table space id.

◆ m_stage

ut_stage_alter_t* FlushObserver::m_stage
private

Performance schema accounting object, used by ALTER TABLE.

If not NULL, then stage->begin_phase_flush() will be called initially, specifying the number of pages to be attempted to be flushed and subsequently, stage->inc() will be called for each page we attempt to flush.

◆ m_trx

trx_t* FlushObserver::m_trx
private

Trx instance.


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