Bug #93937 Contribution: Linux use O_TMPFILE for create_temp_file
Submitted: 15 Jan 13:33 Modified: 12 Feb 20:15
Reporter: OCA Admin (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Locking Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[15 Jan 13:33] OCA Admin
Description:
This bug tracks a contribution by Daniel Black (Github user: grooverdan) as described in http://github.com/mysql/mysql-server/pull/244

How to repeat:
See description

Suggested fix:
See contribution code attached
[15 Jan 13:33] OCA Admin
Contribution submitted via Github - Linux use O_TMPFILE for create_temp_file 
(*) Contribution by Daniel Black (Github grooverdan, mysql-server/pull/244#issuecomment-454273623): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_244680466.txt (text/plain), 1.96 KiB.

[15 Jan 13:51] Miguel Solorzano
Thank you for the contribution.
[15 Jan 23:19] Daniel Black
For clarity, the main purpose of this is to change create_file and then unlink to just a create_file.

In addition to saving a system call for the unlink, and the small race condition of an empty file, there's shorter path within the kernel filesystem code.
[8 Feb 9:22] Tor Didriksen
Posted by developer:
 
Supported only on select platforms, e.g. not until RedHat 7.6

https://bugzilla.redhat.com/show_bug.cgi?id=1471405
[12 Feb 20:15] Paul Dubois
Posted by developer:
 
Fixed in 8.0.17.

MySQL now uses open(O_TMPFILE) whenever applicable when creating a
temporary file that is immediately unlinked. This is more efficient
than previously and avoids the small possibility of a race condition.
Thanks to Daniel Black for the contribution.
[12 Feb 22:52] Daniel Black
Thanks Tor and Paul for the merge.
[15 Feb 8:44] Frederic Descamps
Thank you for your contribution, it has been processed by our development and documentation team.

Your contribution will be part of a future release.

Regards,