/** Doublewrite control struct */
struct buf_dblwr_t{
ib_mutex_t mutex; /*!< mutex protecting the first_free field and write_buf */
ulint block1; /*!< the page number of the first doublewrite block (64 pages) */
ulint block2; /*!< page number of the second block */
ulint first_free;/*!<在write_buf中的第一个空闲的位置*/
ulint b_reserved;/*!< 为批量刷写预留的slot个数 */
os_event_t b_event;/*!< event where threads wait for a batch flush to end. */
ulint s_reserved;/*!<为单个页刷新预留的slot个数,当flush类型为BUF_FLUSH_SINGLE_PAGE时,会进入函数buf_dblwr_write_single_page来写一个页 */
os_event_t s_event;/*!< event where threads wait for a single page flush slot. */
bool* in_use; /*!<用于标记一个slot是否被使用。只用于single page flush */
bool batch_running;/*!<TRUE&#
innodb double write buffer--struct
最新推荐文章于 2021-11-30 17:00:45 发布
本文详细介绍了InnoDB存储引擎的双写缓冲区(double write buffer)结构,及其三种刷新策略:BUF_FLUSH_LRU用于批量从LRU列表中刷新,BUF_FLUSH_LIST针对FLUSH LIST进行刷新,而BUF_FLUSH_SINGLE_PAGE则针对单独页面进行刷新。这些策略确保了数据的安全性和持久性。
摘要由CSDN通过智能技术生成