[MDEV-20794] Mariabackup does not support O_DIRECT Created: 2019-10-10  Updated: 2019-10-13  Resolved: 2019-10-12

Status: Closed
Project: MariaDB Server
Component/s: Backup
Affects Version/s: 10.3.18, 10.4.8
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: MG Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

# mariabackup --print-defaults
mariabackup would have been started with the following arguments:
--innodb_flush_method=O_DIRECT
# mariabackup --version
mariabackup based on MariaDB server 10.3.18-MariaDB Linux (x86_64)

# strace -ffff -s2048 -e trace=open mariabackup --innodb_flush_method=O_DIRECT --backup 2>&1 | grep t1
open("./test/t1.ibd", O_RDONLY|O_CLOEXEC) = 8
open("./test/t1.ibd", O_RDONLY|O_CLOEXEC) = 13
[pid  2909] open("/root/mgtmp/xtrabackup_backupfiles/test/t1.ibd", O_WRONLY|O_CREAT|O_EXCL|O_NOFOLLOW|O_CLOEXEC, 0660) = 6
[01] 2019-10-10 03:16:46 Copying ./test/t1.ibd to /root/mgtmp/xtrabackup_backupfiles/test/t1.ibd
[pid  2907] open("./test/t1.frm", O_RDONLY|O_CLOEXEC) = 8
[pid  2907] open("/root/mgtmp/xtrabackup_backupfiles/test/t1.frm", O_WRONLY|O_CREAT|O_EXCL|O_NOFOLLOW|O_CLOEXEC, 0660) = 9
[01] 2019-10-10 03:16:47 Copying ./test/t1.frm to /root/mgtmp/xtrabackup_backupfiles/test/t1.frm

# strace -ffff -s2048 -e trace=open mariabackup --innodb_flush_method=O_DIRECT --backup 2>&1 | grep O_DIRECT[^O]
#

Upgrading does not help:

# mariabackup --print-defaults
mariabackup would have been started with the following arguments:
--innodb_flush_method=O_DIRECT
 
# mariabackup --version
mariabackup based on MariaDB server 10.4.8-MariaDB Linux (x86_64)

# strace -ffff -s2048 -e trace=open mariabackup --innodb_flush_method=O_DIRECT --backup 2>&1 | grep t1
open("./test/t1.ibd", O_RDONLY|O_CLOEXEC) = 8
open("./test/t1.ibd", O_RDONLY|O_CLOEXEC) = 13
[pid  2479] open("/root/mgtmp/xtrabackup_backupfiles/test/t1.ibd", O_WRONLY|O_CREAT|O_EXCL|O_NOFOLLOW|O_CLOEXEC, 0660) = 6
[01] 2019-10-10 03:11:26 Copying ./test/t1.ibd to /root/mgtmp/xtrabackup_backupfiles/test/t1.ibd

# strace -ffff -s2048 -e trace=open mariabackup --innodb_flush_method=O_DIRECT --backup 2>&1 | grep O_DIRECT[^O]
#



 Comments   
Comment by MG [ 2019-10-11 ]

This bug report seems incorrect:

open("./test/t1.ibd", O_RDONLY|O_CLOEXEC) = 13
[pid  1963] fstat(13, {st_mode=S_IFREG|0660, st_size=98304, ...}) = 0
[pid  1963] fcntl(13, F_SETFL, O_RDONLY|O_DIRECT) = 0
[pid  1963] fadvise64(13, 0, 0, POSIX_FADV_SEQUENTIAL) = 0
[pid  1963] pread(13, "E\325I\244\

I was trying to diagnose why filesystem cache used memory massively spikes during backup and some mild swapping occurs, and I suppose that might be the output (which in my case was piped via mbstream and can't be controlled by mariabackup)

Closing as not a bug.

Generated at Thu Feb 08 09:02:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.