commit b550f3b496467b9bdb81cb00d015c9a30d0df93b Author: zhongbei.yk Date: Wed May 29 13:32:08 2024 +0800 Bug #115124 sort file cache is not fully controlled Description =========== Sort file cache in DDL is not fully controlled by innodb_disable_sort_file_cache. Analysis ======== There is a temporary file named tmpfd which is used in DDL file-sorting is not controlled by innodb_disable_sort_file_cache. Fix === The tmpfd should be controlled by innodb_disable_sort_file_cache. I also checked the tmpfd's read and write processes, and the IO processes are IO-aligned. diff --git a/storage/innobase/ddl/ddl0merge.cc b/storage/innobase/ddl/ddl0merge.cc index b0a0785f970..627bac4259a 100644 --- a/storage/innobase/ddl/ddl0merge.cc +++ b/storage/innobase/ddl/ddl0merge.cc @@ -503,6 +503,10 @@ dberr_t Merge_file_sort::sort(Builder *builder, auto tmpfd = ddl::file_create_low(builder->tmpdir()); if (tmpfd.is_open()) { + if (srv_disable_sort_file_cache) { + os_file_set_nocache(tmpfd.get(), "ddl0merge.cc", "sort"); + } + MONITOR_ATOMIC_INC(MONITOR_ALTER_TABLE_SORT_FILES); } else { return DB_OUT_OF_RESOURCES;