Enhancement: Change atomic_writes table option to enum type. Now every file can either use atomic writes, not use it or use default.

SYNTAX: ATOMIC_WRITES=['DEFAULT','ON','OFF']

Idea here is to be able to define innodb_doublewrite = 1 but with following rules:

ATOMIC_WRITES='DEFAULT' - if innodb_use_atomic_writes = 1, we do not write to doublewrite buffer the changes
                          if innodb_use_atomic_writes = 0, we write to doublewrite buffer
ATOMIC_WRITES='ON'      - do not write to doublewrite buffer
ATOMIC_WRITES='OFF'     - write to doublewrite buffer

Note that doublewrite buffer can't be used if innodb_doublewrite = 0.
This commit is contained in:
Jan Lindström 2014-01-10 12:11:36 +02:00
commit ec8257216e
20 changed files with 137 additions and 94 deletions

View file

@ -45,7 +45,6 @@ pfs_os_file_create_simple_func(
ulint access_type,/*!< in: OS_FILE_READ_ONLY or
OS_FILE_READ_WRITE */
ibool* success,/*!< out: TRUE if succeed, FALSE if error */
ibool atomic_writes, /*!<in TRUE if atomic writes are used */
const char* src_file,/*!< in: file name where func invoked */
ulint src_line)/*!< in: line where the func invoked */
{
@ -61,7 +60,7 @@ pfs_os_file_create_simple_func(
name, src_file, src_line);
file = os_file_create_simple_func(name, create_mode,
access_type, success, atomic_writes);
access_type, success);
/* Regsiter the returning "file" value with the system */
register_pfs_file_open_end(locker, file);
@ -90,7 +89,8 @@ pfs_os_file_create_simple_no_error_handling_func(
OS_FILE_READ_ALLOW_DELETE; the last option is
used by a backup program reading the file */
ibool* success,/*!< out: TRUE if succeed, FALSE if error */
ibool atomic_writes, /*!<in TRUE if atomic writes are used */
ulint atomic_writes,/*!< in: atomic writes table option
value */
const char* src_file,/*!< in: file name where func invoked */
ulint src_line)/*!< in: line where the func invoked */
{
@ -137,7 +137,8 @@ pfs_os_file_create_func(
function source code for the exact rules */
ulint type, /*!< in: OS_DATA_FILE or OS_LOG_FILE */
ibool* success,/*!< out: TRUE if succeed, FALSE if error */
ibool atomic_writes, /*!<in TRUE if atomic writes are used */
ulint atomic_writes, /*!< in: atomic writes table option
value */
const char* src_file,/*!< in: file name where func invoked */
ulint src_line)/*!< in: line where the func invoked */
{