Merge lp:~sergei.glushchenko/percona-xtrabackup/2.2-xb-bug1093385 into lp:percona-xtrabackup/2.2

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 4946
Proposed branch: lp:~sergei.glushchenko/percona-xtrabackup/2.2-xb-bug1093385
Merge into: lp:percona-xtrabackup/2.2
Diff against target: 118 lines (+19/-12)
4 files modified
storage/innobase/xtrabackup/src/ds_tmpfile.c (+4/-1)
storage/innobase/xtrabackup/src/fil_cur.cc (+1/-1)
storage/innobase/xtrabackup/src/xbstream.c (+5/-1)
storage/innobase/xtrabackup/src/xtrabackup.cc (+9/-9)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-xtrabackup/2.2-xb-bug1093385
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+208192@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'storage/innobase/xtrabackup/src/ds_tmpfile.c'
2--- storage/innobase/xtrabackup/src/ds_tmpfile.c 2013-11-26 10:44:44 +0000
3+++ storage/innobase/xtrabackup/src/ds_tmpfile.c 2014-02-25 17:10:41 +0000
4@@ -179,6 +179,7 @@
5 void *buf = NULL;
6 const size_t buf_size = 1024 * 1024;
7 size_t bytes;
8+ size_t offset;
9
10 pipe_ctxt = ctxt->pipe_ctxt;
11 xb_a(pipe_ctxt != NULL);
12@@ -217,9 +218,11 @@
13 tmp_file->file->path, my_errno);
14 exit(EXIT_FAILURE);
15 }
16+ offset = 0;
17 while ((bytes = my_read(tmp_file->fd, buf, buf_size,
18 MYF(MY_WME))) > 0) {
19- posix_fadvise(tmp_file->fd, 0, 0, POSIX_FADV_DONTNEED);
20+ posix_fadvise(tmp_file->fd, offset, buf_size, POSIX_FADV_DONTNEED);
21+ offset += buf_size;
22 if (ds_write(dst_file, buf, bytes)) {
23 msg("error: cannot write to stream for '%s'.\n",
24 tmp_file->orig_path);
25
26=== modified file 'storage/innobase/xtrabackup/src/fil_cur.cc'
27--- storage/innobase/xtrabackup/src/fil_cur.cc 2013-11-26 10:44:44 +0000
28+++ storage/innobase/xtrabackup/src/fil_cur.cc 2014-02-25 17:10:41 +0000
29@@ -357,7 +357,7 @@
30 cursor->buf_npages++;
31 }
32
33- posix_fadvise(cursor->file, 0, 0, POSIX_FADV_DONTNEED);
34+ posix_fadvise(cursor->file, offset, to_read, POSIX_FADV_DONTNEED);
35
36 return(ret);
37 }
38
39=== modified file 'storage/innobase/xtrabackup/src/xbstream.c'
40--- storage/innobase/xtrabackup/src/xbstream.c 2013-11-26 10:44:44 +0000
41+++ storage/innobase/xtrabackup/src/xbstream.c 2014-02-25 17:10:41 +0000
42@@ -209,8 +209,10 @@
43 {
44 uchar buf[XBSTREAM_BUFFER_SIZE];
45 size_t bytes;
46+ size_t offset;
47
48 posix_fadvise(file, 0, 0, POSIX_FADV_SEQUENTIAL);
49+ offset = my_tell(file, MYF(MY_WME));
50
51 while ((bytes = my_read(file, buf, XBSTREAM_BUFFER_SIZE,
52 MYF(MY_WME))) > 0) {
53@@ -219,7 +221,9 @@
54 my_progname);
55 return 1;
56 }
57- posix_fadvise(file, 0, 0, POSIX_FADV_DONTNEED);
58+ posix_fadvise(file, offset, XBSTREAM_BUFFER_SIZE,
59+ POSIX_FADV_DONTNEED);
60+ offset += XBSTREAM_BUFFER_SIZE;
61
62 }
63
64
65=== modified file 'storage/innobase/xtrabackup/src/xtrabackup.cc'
66--- storage/innobase/xtrabackup/src/xtrabackup.cc 2014-01-17 12:20:16 +0000
67+++ storage/innobase/xtrabackup/src/xtrabackup.cc 2014-02-25 17:10:41 +0000
68@@ -4347,6 +4347,8 @@
69 byte* incremental_buffer_base = NULL;
70 byte* incremental_buffer;
71
72+ size_t offset;
73+
74 ut_a(xtrabackup_incremental);
75
76 if (dbname) {
77@@ -4399,7 +4401,6 @@
78 }
79
80 posix_fadvise(src_file, 0, 0, POSIX_FADV_SEQUENTIAL);
81- posix_fadvise(src_file, 0, 0, POSIX_FADV_DONTNEED);
82
83 os_file_set_nocache(src_file, src_path, "OPEN");
84
85@@ -4430,11 +4431,10 @@
86
87 /* read to buffer */
88 /* first block of block cluster */
89+ offset = ((incremental_buffers * (page_size / 4))
90+ << page_size_shift);
91 success = os_file_read(src_file, incremental_buffer,
92- ((incremental_buffers
93- * (page_size / 4))
94- << page_size_shift),
95- page_size);
96+ offset, page_size);
97 if (!success) {
98 goto error;
99 }
100@@ -4463,14 +4463,14 @@
101
102 /* read whole of the cluster */
103 success = os_file_read(src_file, incremental_buffer,
104- ((incremental_buffers
105- * (page_size / 4))
106- << page_size_shift),
107- page_in_buffer * page_size);
108+ offset, page_in_buffer * page_size);
109 if (!success) {
110 goto error;
111 }
112
113+ posix_fadvise(src_file, offset, page_in_buffer * page_size,
114+ POSIX_FADV_DONTNEED);
115+
116 for (page_in_buffer = 1; page_in_buffer < page_size / 4;
117 page_in_buffer++) {
118 ulint offset_on_page;

Subscribers

People subscribed via source and target branches