[MDEV-15903] innodb-flush-method documentation needs to be amended for 10.2/10.3 Created: 2018-04-17  Updated: 2018-05-10  Resolved: 2018-05-10

Status: Closed
Project: MariaDB Server
Component/s: Documentation
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Vladislav Vaintroub Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-15900 fdatasync value is not recognized by... Closed

 Description   

https://mariadb.com/kb/en/library/xtradbinnodb-server-system-variables/ lists fdatasync as valid method, as well as ALL_O_DIRECT.

Both are gone in 10.2



 Comments   
Comment by Ian Gilfillan [ 2018-04-17 ]

Updated docs. ALL_O_DIRECT was listed as XtraDB only, but made the versioning clearer. fdatasync became fsync sometime in 5.3

wlad can you clarify the Windows settings (before and after 10.2.5) so that I can document those properly? I don't have a Windows environment to test.

Comment by Vladislav Vaintroub [ 2018-04-17 ]

In MariaDB (unlike in MySQL), Windows recognizes and handles correctly all of the Unix methods, but if none specified it uses own default - unbuffered write (analog of O_DIRECT) + syncs (e.g FileFlushBuffers()) for all files. Since 5.3

Comment by Ian Gilfillan [ 2018-05-08 ]

The MySQL docs mention 3 Windows settings - async_unbuffered, normal, unbuffered, with the default being async_unbuffered. Are these supported in MariaDB?

Comment by Vladislav Vaintroub [ 2018-05-08 ]

This is a question to marko. He added parsing of these quite recently. the "async_unbuffered" is what I referred to as "own default". I think marko made "normal" to be fsync synonym, and unbuffered to async_unbuffered

Comment by Marko Mäkelä [ 2018-05-09 ]

greenman, wlad, I recently touched this code in 10.3.7:
MDEV-12218 Clean up InnoDB parameter validation

This changed innodb_change_buffering and innodb_flush_method to enums instead of strings. For Windows, there are 3 additional enum values, 2 of which are aliases to the common values:

#ifdef _WIN32
	"unbuffered",
	"async_unbuffered" /* alias for "unbuffered" */,
	"normal" /* alias for "fsync" */,
#endif

The aliases are mapped on startup (after all, this parameter is not settable at runtime):

	switch (innodb_flush_method) {
	case SRV_ALL_O_DIRECT_FSYNC + 1 /* "async_unbuffered"="unbuffered" */:
		innodb_flush_method = SRV_ALL_O_DIRECT_FSYNC;
		break;
	case SRV_ALL_O_DIRECT_FSYNC + 2 /* "normal"="fsync" */:
		innodb_flush_method = SRV_FSYNC;
		break;
	default:
		ut_ad(innodb_flush_method <= SRV_ALL_O_DIRECT_FSYNC);
	}

The default value on Windows is "unbuffered", also known as "async_unbuffered". The value "normal" is an alias for "fsync". There should be no functional change (other than allowing numeric values corresponding to the enum names) between 10.2 and 10.3.

Generated at Thu Feb 08 08:24:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.