diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index 1f76974b03d..f457d52dec7 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -53,7 +53,7 @@ extern ulint srv_n_log_files; extern ulint srv_log_file_size; extern ibool srv_log_archive_on; extern ulint srv_log_buffer_size; -extern ibool srv_flush_log_at_trx_commit; +extern ulint srv_flush_log_at_trx_commit; extern byte srv_latin1_ordering[256];/* The sort order table of the latin1 character set */ diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 2a17c554dc1..b2881581fc7 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -15,8 +15,6 @@ Created 10/21/1995 Heikki Tuuri #undef HAVE_FDATASYNC -#undef UNIV_NON_BUFFERED_IO - #ifdef POSIX_ASYNC_IO /* We assume in this case that the OS has standard Posix aio (at least SunOS 2.6, HP-UX 11i and AIX 4.3 have) */ @@ -500,14 +498,25 @@ try_again: } #endif #ifdef UNIV_NON_BUFFERED_IO - attributes = attributes | FILE_FLAG_NO_BUFFERING; + if (type == OS_LOG_FILE && srv_flush_log_at_trx_commit == 2) { + /* Do not use unbuffered i/o to log files because + value 2 denotes that we do not flush the log at every + commit, but only once per second */ + } else { + attributes = attributes | FILE_FLAG_NO_BUFFERING; + } #endif } else if (purpose == OS_FILE_NORMAL) { - attributes = 0 + attributes = 0; #ifdef UNIV_NON_BUFFERED_IO - | FILE_FLAG_NO_BUFFERING + if (type == OS_LOG_FILE && srv_flush_log_at_trx_commit == 2) { + /* Do not use unbuffered i/o to log files because + value 2 denotes that we do not flush the log at every + commit, but only once per second */ + } else { + attributes = attributes | FILE_FLAG_NO_BUFFERING; + } #endif - ; } else { attributes = 0; ut_error; diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 7b5aa79b3c7..84d48bebf97 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -96,7 +96,7 @@ ulint srv_n_log_files = ULINT_MAX; ulint srv_log_file_size = ULINT_MAX; /* size in database pages */ ibool srv_log_archive_on = TRUE; ulint srv_log_buffer_size = ULINT_MAX; /* size in database pages */ -ibool srv_flush_log_at_trx_commit = TRUE; +ulint srv_flush_log_at_trx_commit = 1; byte srv_latin1_ordering[256] /* The sort order table of the latin1 character set. The following table is