Comment 13 for bug 1055547

Revision history for this message
Alexey Kopytov (akopytov) wrote :

xtrabackup must use the same innodb_flush_method value on --backup, because direct and buffered I/O on the same file is a very bad idea according to kernel developers.

There's are no strict requirements to use O_DIRECT on --prepare. However, the problem here appears to be the following code in xtrabackup_close_temp_log():

 log_buf_ = static_cast<byte *>(ut_malloc(LOG_FILE_HDR_SIZE * 2));
 log_buf = static_cast<byte *>(ut_align(log_buf_, LOG_FILE_HDR_SIZE));

 success = os_file_read(src_file, log_buf, 0, 0, LOG_FILE_HDR_SIZE);

It aligns the buffer to LOG_FILE_HDR_SIZE (2048 bytes) which is wrong. Using UNIV_PAGE_SIZE_MAX as done in other code parts should fix this.