mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Applying InnoDB plugin snashot
Detailed revision comments: r6064 | calvin | 2009-10-13 18:23:35 +0300 (Tue, 13 Oct 2009) | 4 lines branches/zip: non-functional changes Changes from MySQL to fix build issue. r6065 | inaam | 2009-10-13 20:43:13 +0300 (Tue, 13 Oct 2009) | 7 lines branches/zip rb://182 Call fsync() on datafiles after a batch of pages is written to disk even when skip_innodb_doublewrite is set. Approved by: Heikki
This commit is contained in:
@@ -303,6 +303,28 @@ buf_flush_write_complete(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/********************************************************************//**
|
||||||
|
Flush a batch of writes to the datafiles that have already been
|
||||||
|
written by the OS. */
|
||||||
|
static
|
||||||
|
void
|
||||||
|
buf_flush_sync_datafiles(void)
|
||||||
|
/*==========================*/
|
||||||
|
{
|
||||||
|
/* Wake possible simulated aio thread to actually post the
|
||||||
|
writes to the operating system */
|
||||||
|
os_aio_simulated_wake_handler_threads();
|
||||||
|
|
||||||
|
/* Wait that all async writes to tablespaces have been posted to
|
||||||
|
the OS */
|
||||||
|
os_aio_wait_until_no_pending_writes();
|
||||||
|
|
||||||
|
/* Now we flush the data to disk (for example, with fsync) */
|
||||||
|
fil_flush_file_spaces(FIL_TABLESPACE);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/********************************************************************//**
|
/********************************************************************//**
|
||||||
Flushes possible buffered writes from the doublewrite memory buffer to disk,
|
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
|
and also wakes up the aio thread if simulated aio is used. It is very
|
||||||
@@ -320,8 +342,8 @@ buf_flush_buffered_writes(void)
|
|||||||
ulint i;
|
ulint i;
|
||||||
|
|
||||||
if (!srv_use_doublewrite_buf || trx_doublewrite == NULL) {
|
if (!srv_use_doublewrite_buf || trx_doublewrite == NULL) {
|
||||||
os_aio_simulated_wake_handler_threads();
|
/* Sync the writes to the disk. */
|
||||||
|
buf_flush_sync_datafiles();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -529,22 +551,10 @@ flush:
|
|||||||
buf_LRU_stat_inc_io();
|
buf_LRU_stat_inc_io();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wake possible simulated aio thread to actually post the
|
/* Sync the writes to the disk. */
|
||||||
writes to the operating system */
|
buf_flush_sync_datafiles();
|
||||||
|
|
||||||
os_aio_simulated_wake_handler_threads();
|
|
||||||
|
|
||||||
/* Wait that all async writes to tablespaces have been posted to
|
|
||||||
the OS */
|
|
||||||
|
|
||||||
os_aio_wait_until_no_pending_writes();
|
|
||||||
|
|
||||||
/* Now we flush the data to disk (for example, with fsync) */
|
|
||||||
|
|
||||||
fil_flush_file_spaces(FIL_TABLESPACE);
|
|
||||||
|
|
||||||
/* We can now reuse the doublewrite memory buffer: */
|
/* We can now reuse the doublewrite memory buffer: */
|
||||||
|
|
||||||
trx_doublewrite->first_free = 0;
|
trx_doublewrite->first_free = 0;
|
||||||
|
|
||||||
mutex_exit(&(trx_doublewrite->mutex));
|
mutex_exit(&(trx_doublewrite->mutex));
|
||||||
|
Reference in New Issue
Block a user