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

Proposed by Laurynas Biveinis
Status: Merged
Approved by: George Ormond Lorch III
Approved revision: no longer in the source branch.
Merged at revision: 525
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1263087-5.6
Merge into: lp:percona-server/5.6
Diff against target: 52 lines (+36/-0)
1 file modified
Percona-Server/storage/innobase/os/os0file.cc (+36/-0)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1263087-5.6
Reviewer Review Type Date Requested Status
George Ormond Lorch III (community) g2 Approve
Alexey Kopytov Pending
Review via email: mp+199954@code.launchpad.net

Description of the change

Trivially merge bug 1263087 fix from 5.5 with a fprintf/ib_logf change.

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

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) wrote :

Same comment/question as 5.5...

review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/storage/innobase/os/os0file.cc'
2--- Percona-Server/storage/innobase/os/os0file.cc 2013-12-19 15:22:20 +0000
3+++ Percona-Server/storage/innobase/os/os0file.cc 2013-12-23 14:22:39 +0000
4@@ -5204,6 +5204,7 @@
5 segment = os_aio_get_array_and_local_segment(&array, global_seg);
6 n = array->n_slots / array->n_segments;
7
8+ wait_for_event:
9 /* Loop until we have found a completed request. */
10 for (;;) {
11 ibool any_reserved = FALSE;
12@@ -5266,6 +5267,41 @@
13 if (slot->ret == 0 && slot->n_bytes == (long) slot->len) {
14
15 ret = TRUE;
16+ } else if ((slot->ret == 0) && (slot->n_bytes > 0)
17+ && (slot->n_bytes < (long) slot->len)) {
18+ /* Partial read or write scenario */
19+ int submit_ret;
20+ struct iocb* iocb;
21+ slot->buf = (byte*)slot->buf + slot->n_bytes;
22+ slot->offset = slot->offset + slot->n_bytes;
23+ slot->len = slot->len - slot->n_bytes;
24+ /* Resetting the bytes read/written */
25+ slot->n_bytes = 0;
26+ slot->io_already_done = FALSE;
27+ iocb = &(slot->control);
28+
29+ if (slot->type == OS_FILE_READ) {
30+ io_prep_pread(&slot->control, slot->file, slot->buf,
31+ slot->len, (off_t) slot->offset);
32+ } else {
33+ ut_a(slot->type == OS_FILE_WRITE);
34+ io_prep_pwrite(&slot->control, slot->file, slot->buf,
35+ slot->len, (off_t) slot->offset);
36+ }
37+ /* Resubmit an I/O request */
38+ submit_ret = io_submit(array->aio_ctx[segment], 1, &iocb);
39+ if (submit_ret < 0 ) {
40+ /* Aborting in case of submit failure */
41+ ib_logf(IB_LOG_LEVEL_FATAL,
42+ "Native Linux AIO interface. io_submit()"
43+ " call failed when resubmitting a partial"
44+ " I/O request on the file %s.",
45+ slot->name);
46+ } else {
47+ ret = FALSE;
48+ os_mutex_exit(array->mutex);
49+ goto wait_for_event;
50+ }
51 } else {
52 errno = -slot->ret;
53

Subscribers

People subscribed via source and target branches