diff options
Diffstat (limited to 'storage/innobase/fil/fil0fil.cc')
-rw-r--r-- | storage/innobase/fil/fil0fil.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index a0542825891..8075defac4c 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -980,11 +980,16 @@ fil_space_extend_must_retry( const page_size_t pageSize(space->flags); const ulint page_size = pageSize.physical(); - /* fil_read_first_page() expects UNIV_PAGE_SIZE bytes. - fil_node_open_file() expects at least 4 * UNIV_PAGE_SIZE bytes.*/ + /* fil_read_first_page() expects innodb_page_size bytes. + fil_node_open_file() expects at least 4 * innodb_page_size bytes. + os_file_set_size() expects multiples of 4096 bytes. + For ROW_FORMAT=COMPRESSED tables using 1024-byte or 2048-byte + pages, we will preallocate up to an integer multiple of 4096 bytes, + and let normal writes append 1024, 2048, or 3072 bytes to the file. */ os_offset_t new_size = std::max( - os_offset_t(size - file_start_page_no) * page_size, - os_offset_t(FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE)); + (os_offset_t(size - file_start_page_no) * page_size) + & ~os_offset_t(4095), + os_offset_t(FIL_IBD_FILE_INITIAL_SIZE << srv_page_size_shift)); *success = os_file_set_size(node->name, node->handle, new_size, FSP_FLAGS_HAS_PAGE_COMPRESSION(space->flags)); |