Merge lp:~laurynas-biveinis/percona-server/bug1286114-5.6 into lp:percona-server/5.6

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Sergei Glushchenko
Approved revision: no longer in the source branch.
Merged at revision: 564
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1286114-5.6
Merge into: lp:percona-server/5.6
Diff against target: 28 lines (+15/-3)
1 file modified
storage/innobase/fil/fil0fil.cc (+15/-3)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1286114-5.6
Reviewer Review Type Date Requested Status
Sergei Glushchenko (community) g2 Approve
Review via email: mp+209622@code.launchpad.net

Description of the change

Merge bug 1286114 fix from 5.5.

http://jenkins.percona.com/job/percona-server-5.6-param/538/

Also run MTR locally with enabled srv_use_fallocate.

To post a comment you must log in.
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Approve

review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'storage/innobase/fil/fil0fil.cc'
2--- storage/innobase/fil/fil0fil.cc 2014-03-04 12:59:39 +0000
3+++ storage/innobase/fil/fil0fil.cc 2014-03-06 09:29:22 +0000
4@@ -5119,9 +5119,21 @@
5 #ifdef HAVE_POSIX_FALLOCATE
6 if (srv_use_posix_fallocate) {
7
8- success = os_file_set_size(node->name, node->handle,
9- (size_after_extend
10- - file_start_page_no) * page_size);
11+ os_offset_t start_offset = file_start_page_no * page_size;
12+ os_offset_t end_offset
13+ = (size_after_extend - file_start_page_no) * page_size;
14+
15+ success = (posix_fallocate(node->handle, start_offset,
16+ end_offset) == 0);
17+ if (!success)
18+ {
19+ ib_logf(IB_LOG_LEVEL_ERROR,
20+ "preallocating file space for file \'%s\' "
21+ "failed. Current size " INT64PF
22+ ", len " INT64PF ", desired size " INT64PF
23+ "\n", node->name, start_offset, end_offset,
24+ start_offset + end_offset);
25+ }
26 mutex_enter(&fil_system->mutex);
27 if (success) {
28 node->size += (size_after_extend - start_page_no);

Subscribers

People subscribed via source and target branches