[MDEV-5746] Slow file extend when innodb_use_fallocate=1 and SSD file storage Created: 2014-02-26 Updated: 2017-11-06 Due: 2014-02-28 Resolved: 2014-02-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.36, 10.0.8 |
| Fix Version/s: | 5.5.37, 10.0.9 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Jan Lindström (Inactive) | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Fusion-IO SSD |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Currently size is set like: current_size = 0; #ifdef HAVE_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) |
| Comments |
| Comment by Jan Lindström (Inactive) [ 2014-02-26 ] |
|
revno: 4098 Analysis: posix_fallocate was called using 0 as offset and len as Fix: Call posix_fallocate with correct offset i.e. current file size |
| Comment by Jan Lindström (Inactive) [ 2014-02-26 ] |
|
revno: 4008 Analysis: posix_fallocate was called using 0 as offset and len as Fix: Call posix_fallocate with correct offset i.e. current file size |
| Comment by Marko Mäkelä [ 2017-02-22 ] |
|
In the 5.5 version of this change we are incorrectly extending the file to current_size+desired_size bytes (if we ignore the fact that the start_offset calculation does not work for file_start_page_no>0). The third argument of posix_fallocate() is supposed to be the length by which the file is to be extended, not the total size. In my third 5.5 commit of |