Details
Description
Currently size is set like:
current_size = 0;
desired_size = (ib_int64_t)size + (((ib_int64_t)size_high) << 32);
#ifdef HAVE_POSIX_FALLOCATE
if (srv_use_posix_fallocate) {
if (posix_fallocate(file, current_size, desired_size) == -1) {
Thus file size is always extended from offset 0 to desired offset. This is clearly slower than doing
posix_fallocate(real_current_size, desired_size)
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
revno: 4098
message:
MDEV-5746: Slow file extend when innodb_use_fallocate=1 and SSDfile storage.
Analysis: posix_fallocate was called using 0 as offset and len as
desired size. This is not optimal for SSDs.
Fix: Call posix_fallocate with correct offset i.e. current file size
and extend the file from there len bytes.