Skip to content

Commit 839325f

Browse files
yoshinorimfacebook-github-bot
authored andcommitted
Fixing Redo Log file open mode from InnoDB Clone
Summary: This diff fixes https://bugs.mysql.com/bug.php?id=97755 Prior to this diff, at clone plugin file sync phase, it opened InnoDB redo log file with the same file option as data files, not redo log file specific options. This particularly caused problems with innodb_flush_method=O_DIRECT. InnoDB redo log files are always opened without O_DIRECT. However prior to this diff, clone plugin opened InnoDB redo log files with O_DIRECT (since it referred data file option) and hit offset errors. This diff fixes it -- using redo log specific option, which means O_DIRECT is not passed, so no offset error happens anymore. Reviewed By: hermanlee Differential Revision: D37231218 fbshipit-source-id: 1caa4f3f8d762055b3df6768f5fad575e3d184c2
1 parent e7b957c commit 839325f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

storage/innobase/clone/clone0apply.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,15 +1194,16 @@ int Clone_Snapshot::init_apply_state(Clone_Desc_State *state_desc) {
11941194

11951195
int Clone_Snapshot::extend_and_flush_files(bool flush_redo) {
11961196
auto &file_vector = (flush_redo) ? m_redo_file_vector : m_data_file_vector;
1197+
auto file_type = flush_redo ? OS_CLONE_LOG_FILE : OS_CLONE_DATA_FILE;
11971198

11981199
for (auto file_meta : file_vector) {
11991200
char errbuf[MYSYS_STRERROR_SIZE];
12001201
bool success = true;
12011202

12021203
auto file =
12031204
os_file_create(innodb_clone_file_key, file_meta->m_file_name,
1204-
OS_FILE_OPEN | OS_FILE_ON_ERROR_NO_EXIT, OS_FILE_NORMAL,
1205-
OS_CLONE_DATA_FILE, false, &success);
1205+
OS_FILE_OPEN | OS_FILE_ON_ERROR_NO_EXIT,
1206+
OS_FILE_NORMAL, file_type, false, &success);
12061207

12071208
if (!success) {
12081209
my_error(ER_CANT_OPEN_FILE, MYF(0), file_meta->m_file_name, errno,

0 commit comments

Comments
 (0)