Bug #96799 Contribution by Facebook: Periodic fsync in select into outfile controlled ...
Submitted: 10 Sep 2019 0:32 Modified: 5 Aug 23:58
Reporter: FBContrib Admin Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any

[10 Sep 2019 0:32] FBContrib Admin
Background innformation provided by Facebook:

Two variables are added, GLOBAL variables with SESSION override.
    select_into_file_fsync_size, which controls the size of the buffer
    after which a fsync will be done. Needs to be a multiple of 1024

    After each fsync you can optionally sleep for
    select_into_file_fsync_timeout milliseconds.

Use case:

We use select into outfile to dump data into files for data migration purposes. These writes can often be buffered and then trigger a large burst of write I/O to the storage device and stall other queries that are more latency sensitive. The feature provides a way to periodically write data to the storage device to prevent these large write stalls from occurring.

Repo: https://github.com/mysql/mysql-server
Patch on top of 8.0.13: https://github.com/mysql/mysql-server/commit/e4924f36486f971f8a04252e01c803457a2c72f7

How to repeat:
See description

Suggested fix:
See contribution code attached
[10 Sep 2019 0:32] FBContrib Admin
Periodic fsync in select into outfile controlled by sysvar 
(*) This code is contributed under the Facebook agreement

Contribution: fb_patch_121.txt (text/plain), 45.36 KiB.

[5 Aug 23:58] Jon Stephens
Fixed in MySQL 8.0.22 as WL#13926.

See same for docs info.

[31 Aug 16:16] Omer Barnir
Thanks to Facebook for the contribution
[20 Oct 6:52] Frederic Descamps
Thank you for your contribution that has been added to 8.0.22: https://lefred.be/content/mysql-8-0-22-thank-you-for-the-contributions/