InnoDB Plugin
1.0
|
Go to the source code of this file.
Data Structures | |
struct | buf_dblwr_t |
Functions | |
UNIV_INTERN void | buf_dblwr_create (void) |
void | buf_dblwr_init_or_load_pages (os_file_t file, char *path, bool load_corrupt_pages) |
void | buf_dblwr_process (void) |
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 ibool | buf_dblwr_page_inside (ulint page_no) |
UNIV_INTERN void | buf_dblwr_add_to_batch (buf_page_t *bpage) |
UNIV_INTERN void | buf_dblwr_flush_buffered_writes (void) |
UNIV_INTERN void | buf_dblwr_write_single_page (buf_page_t *bpage, bool sync) |
Variables | |
buf_dblwr_t * | buf_dblwr |
ibool | buf_dblwr_being_created |
Doublewrite buffer module
Created 2011/12/19 Inaam Rana
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. in: buffer block to write
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.
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.
UNIV_INTERN void buf_dblwr_free | ( | void | ) |
frees doublewrite buffer.
void buf_dblwr_init_or_load_pages | ( | os_file_t | file, |
char * | path, | ||
bool | load_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 loads the pages from double write buffer into memory.
UNIV_INTERN ibool buf_dblwr_page_inside | ( | ulint | page_no | ) |
Determines if a page number is located inside the doublewrite buffer.
void buf_dblwr_process | ( | void | ) |
Process the double write buffer pages.
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. in: flush type
bpage | in: buffer block descriptor |
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. in: true if sync IO requested
bpage | in: buffer block to write |
buf_dblwr_t* buf_dblwr |
Doublewrite system
ibool buf_dblwr_being_created |
Set to TRUE when the doublewrite buffer is being created