MySQL 5.6.14 Source Code Document
|
#include "buf0dblwr.h"
#include "buf0buf.h"
#include "buf0checksum.h"
#include "srv0start.h"
#include "srv0srv.h"
#include "page0zip.h"
#include "trx0sys.h"
Go to the source code of this file.
Functions | |
UNIV_INTERN ibool | buf_dblwr_page_inside (ulint page_no) |
UNIV_INLINE byte * | buf_dblwr_get (mtr_t *mtr) |
UNIV_INLINE void | buf_dblwr_sync_datafiles () |
UNIV_INTERN void | buf_dblwr_create (void) |
UNIV_INTERN void | buf_dblwr_init_or_restore_pages (ibool restore_corrupt_pages) |
UNIV_INTERN void | buf_dblwr_free (void) |
UNIV_INTERN void | buf_dblwr_update (const buf_page_t *bpage, buf_flush_t flush_type) |
UNIV_INTERN void | buf_dblwr_flush_buffered_writes (void) |
UNIV_INTERN void | buf_dblwr_add_to_batch (buf_page_t *bpage) |
UNIV_INTERN void | buf_dblwr_write_single_page (buf_page_t *bpage, bool sync) |
Variables | |
UNIV_INTERN buf_dblwr_t * | buf_dblwr = NULL |
UNIV_INTERN ibool | buf_dblwr_being_created = FALSE |
UNIV_INTERN void buf_dblwr_add_to_batch | ( | buf_page_t * | bpage | ) |
Posts a buffer page for writing. If the doublewrite memory buffer is full, calls buf_dblwr_flush_buffered_writes and waits for for free space to appear.
bpage | in: buffer block to write |
Definition at line 932 of file buf0dblwr.cc.
UNIV_INTERN void buf_dblwr_create | ( | void | ) |
Creates the doublewrite buffer to a new InnoDB installation. The header of the doublewrite buffer is placed on the trx system header page.
Definition at line 178 of file buf0dblwr.cc.
UNIV_INTERN void buf_dblwr_flush_buffered_writes | ( | void | ) |
Flushes possible buffered writes from the doublewrite memory buffer to disk, and also wakes up the aio thread if simulated aio is used. It is very important to call this function after a batch of writes has been posted, and also when we may have to wait for a page latch! Otherwise a deadlock of threads can occur.
Definition at line 789 of file buf0dblwr.cc.
UNIV_INTERN void buf_dblwr_free | ( | void | ) |
Frees doublewrite buffer.
Definition at line 568 of file buf0dblwr.cc.
UNIV_INLINE byte* buf_dblwr_get | ( | mtr_t * | mtr | ) |
Calls buf_page_get() on the TRX_SYS_PAGE and returns a pointer to the doublewrite buffer within it.
mtr | in/out: MTR to hold the page latch |
Definition at line 89 of file buf0dblwr.cc.
UNIV_INTERN void buf_dblwr_init_or_restore_pages | ( | ibool | restore_corrupt_pages | ) |
At a database startup initializes the doublewrite buffer memory structure if we already have a doublewrite buffer created in the data files. If we are upgrading to an InnoDB version which supports multiple tablespaces, then this function performs the necessary update operations. If we are in a crash recovery, this function uses a possible doublewrite buffer to restore half-written pages in the data files.
restore_corrupt_pages | in: TRUE=restore pages |
Definition at line 358 of file buf0dblwr.cc.
UNIV_INTERN ibool buf_dblwr_page_inside | ( | ulint | page_no | ) |
Determines if a page number is located inside the doublewrite buffer.
page_no | in: page number |
Definition at line 58 of file buf0dblwr.cc.
UNIV_INLINE void buf_dblwr_sync_datafiles | ( | ) |
Flush a batch of writes to the datafiles that have already been written to the dblwr buffer on disk.
Definition at line 107 of file buf0dblwr.cc.
UNIV_INTERN void buf_dblwr_update | ( | const buf_page_t * | bpage, |
buf_flush_t | flush_type | ||
) |
Updates the doublewrite buffer when an IO request is completed.
bpage | in: buffer block descriptor |
flush_type | in: flush type |
Definition at line 596 of file buf0dblwr.cc.
UNIV_INTERN void buf_dblwr_write_single_page | ( | buf_page_t * | bpage, |
bool | sync | ||
) |
Writes a page to the doublewrite buffer on disk, sync it, then write the page to the datafile and sync the datafile. This function is used for single page flushes. If all the buffers allocated for single page flushes in the doublewrite buffer are in use we wait here for one to become free. We are guaranteed that a slot will become free because any thread that is using a slot must also release the slot before leaving this function.
bpage | in: buffer block to write |
sync | in: true if sync IO requested |
Definition at line 1019 of file buf0dblwr.cc.
UNIV_INTERN buf_dblwr_t* buf_dblwr = NULL |
The doublewrite buffer
Definition at line 47 of file buf0dblwr.cc.
UNIV_INTERN ibool buf_dblwr_being_created = FALSE |
Set to TRUE when the doublewrite buffer is being created
Definition at line 50 of file buf0dblwr.cc.