Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1087202-1087218-5.1 into lp:percona-server/5.1

Proposed by Laurynas Biveinis
Status: Superseded
Proposed branch: lp:~laurynas-biveinis/percona-server/BT-16274-bug1087202-1087218-5.1
Merge into: lp:percona-server/5.1
Diff against target: 158 lines (+40/-16)
6 files modified
Percona-Server/storage/innodb_plugin/handler/i_s.cc (+2/-2)
Percona-Server/storage/innodb_plugin/include/ut0ut.h (+9/-0)
Percona-Server/storage/innodb_plugin/include/ut0ut.ic (+13/-0)
Percona-Server/storage/innodb_plugin/log/log0log.c (+2/-2)
Percona-Server/storage/innodb_plugin/log/log0online.c (+10/-10)
Percona-Server/storage/innodb_plugin/os/os0file.c (+4/-2)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1087202-1087218-5.1
Reviewer Review Type Date Requested Status
Stewart Smith (community) Needs Fixing
Sergei Glushchenko (community) g2 Approve
Review via email: mp+138728@code.launchpad.net

This proposal has been superseded by a proposal from 2013-01-04.

To post a comment you must log in.
496. By Hrvoje Matijakovic

* bug fix for Bug #1056603
* added missing tables with the description
* fixed already existing I_S tables

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Approve

review: Approve (g2)
497. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/bug1076215-5.1

498. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/26611-bug917942-5.1

499. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/26611-bug1064333-5.1

500. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/26611-bug1059738-5.1

501. By <email address hidden>

Merge lp:~akopytov/percona-server/bugs-1039536-1081003-5.1

502. By <email address hidden>

Merge lp:~akopytov/percona-server/bug1070856-5.1

503. By <email address hidden>

Merge lp:~akopytov/percona-server/bug830286-5.1

504. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/bug901060-5.1

505. By <email address hidden>

Merge lp:~laurynas-biveinis/percona-server/xtradb-multiple-bmp-files-51

Revision history for this message
Stewart Smith (stewart) :
review: Approve
506. By <email address hidden>

Merge lp:~vlad-lesin/percona-server/5.1-bug1083377-gca

507. By <email address hidden>

Merge lp:~stewart/percona-server/5.1-bug1090596

508. By <email address hidden>

Merge lp:~hrvojem/percona-server/bug1057031-5.1

Revision history for this message
Stewart Smith (stewart) wrote :

http://jenkins.percona.com/view/Merge/job/merge-PS-5.1-kickoff/21/console

22:36:24 Text conflict in Percona-Server/storage/innodb_plugin/log/log0online.c

<<<<<<< TREE
        fprintf(stderr, "InnoDB: last tracked LSN is %llu, but the last "
                "checkpoint LSN is %llu. This might be due to a server "
                "crash or a very fast shutdown. ", last_tracked_lsn,
                tracking_start_lsn);
=======
        fprintf(stderr, "InnoDB: last tracked LSN in \'%s\' is %llu, but "
                "last checkpoint LSN is %llu. This might be due to a server "
                "crash or a very fast shutdown. ", log_bmp_sys->out_name,
                last_tracked_lsn, tracking_start_lsn);

        /* last_tracked_lsn might be < MIN_TRACKED_LSN in the case of empty
           bitmap file, handle this too. */
        last_tracked_lsn = ut_max_uint64(last_tracked_lsn, MIN_TRACKED_LSN);
>>>>>>> MERGE-SOURCE

review: Needs Fixing
509. By <email address hidden>

Merge lp:~hrvojem/percona-server/rn-5.1.66-14.2

510. By <email address hidden>

Merge lp:~vlad-lesin/percona-server/5.1-bug1049871-injections-gca

511. By Laurynas Biveinis

Fix bug 1087202 (smaller type conversion bugs on 32 bit) and bug
1087218
(Incorrect implementation of os_file_set_eof_at on Windows).

1) i_s_innodb_changed_pages_fill used Field::store(double) to store
   ulonglong.
2) ut_max, which is defined for ulints, was incorrectly used to
   compare ib_uint64_t values in log_online_track_missing_on_startup
   and log_online_read_init. Fixed by introducing new inline
   function ut_max_uint64 and using it instead.
3) Typecast to ulint the difference of two ib_uint64_ts in
   log_online_follow_log_seg. The values are guaranteed to fit into
   ulint.
4) In log_check_tracking_margin and log_close adjust the type of
   tracked_lsn_age to ib_uint64_t. In theory ulint could have been
   used too, but ib_uint64_t future-proofs it against large log
   files.
5) Provide correct Windows implementation for os_file_set_eof_at.

Bugs found and patches provided by Vladislav Vaintroub.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/storage/innodb_plugin/handler/i_s.cc'
2--- Percona-Server/storage/innodb_plugin/handler/i_s.cc 2012-11-25 09:29:43 +0000
3+++ Percona-Server/storage/innodb_plugin/handler/i_s.cc 2013-01-04 07:33:24 +0000
4@@ -3932,10 +3932,10 @@
5 LOG_BITMAP_ITERATOR_PAGE_NUM(i));
6 /* START_LSN */
7 table->field[2]->store(
8- LOG_BITMAP_ITERATOR_START_LSN(i));
9+ LOG_BITMAP_ITERATOR_START_LSN(i), true);
10 /* END_LSN */
11 table->field[3]->store(
12- LOG_BITMAP_ITERATOR_END_LSN(i));
13+ LOG_BITMAP_ITERATOR_END_LSN(i), true);
14
15 /*
16 I_S tables are in-memory tables. If bitmap file is big enough
17
18=== modified file 'Percona-Server/storage/innodb_plugin/include/ut0ut.h'
19--- Percona-Server/storage/innodb_plugin/include/ut0ut.h 2009-09-15 10:26:01 +0000
20+++ Percona-Server/storage/innodb_plugin/include/ut0ut.h 2013-01-04 07:33:24 +0000
21@@ -120,6 +120,15 @@
22 /*===*/
23 ulint n1, /*!< in: first number */
24 ulint n2); /*!< in: second number */
25+/******************************************************//**
26+Calculates the maximum of two ib_uint64_t values.
27+@return the maximum */
28+UNIV_INLINE
29+ib_uint64_t
30+ut_max_uint64(
31+/*==========*/
32+ ib_uint64_t n1, /*!< in: first number */
33+ ib_uint64_t n2); /*!< in: second number */
34 /****************************************************************//**
35 Calculates minimum of two ulint-pairs. */
36 UNIV_INLINE
37
38=== modified file 'Percona-Server/storage/innodb_plugin/include/ut0ut.ic'
39--- Percona-Server/storage/innodb_plugin/include/ut0ut.ic 2009-05-25 09:52:29 +0000
40+++ Percona-Server/storage/innodb_plugin/include/ut0ut.ic 2013-01-04 07:33:24 +0000
41@@ -49,6 +49,19 @@
42 return((n1 <= n2) ? n2 : n1);
43 }
44
45+/******************************************************//**
46+Calculates the maximum of two ib_uint64_t values.
47+@return the maximum */
48+UNIV_INLINE
49+ib_uint64_t
50+ut_max_uint64(
51+/*==========*/
52+ ib_uint64_t n1, /*!< in: first number */
53+ ib_uint64_t n2) /*!< in: second number */
54+{
55+ return((n1 <= n2) ? n2 : n1);
56+}
57+
58 /****************************************************************//**
59 Calculates minimum of two ulint-pairs. */
60 UNIV_INLINE
61
62=== modified file 'Percona-Server/storage/innodb_plugin/log/log0log.c'
63--- Percona-Server/storage/innodb_plugin/log/log0log.c 2012-06-14 09:16:03 +0000
64+++ Percona-Server/storage/innodb_plugin/log/log0log.c 2013-01-04 07:33:24 +0000
65@@ -233,7 +233,7 @@
66 checked for the already-written log. */
67 {
68 ib_uint64_t tracked_lsn;
69- ulint tracked_lsn_age;
70+ ib_uint64_t tracked_lsn_age;
71
72 if (!srv_track_changed_pages) {
73 return FALSE;
74@@ -445,7 +445,7 @@
75 ib_uint64_t oldest_lsn;
76 ib_uint64_t lsn;
77 ib_uint64_t tracked_lsn;
78- ulint tracked_lsn_age;
79+ ib_uint64_t tracked_lsn_age;
80 log_t* log = log_sys;
81 ib_uint64_t checkpoint_age;
82
83
84=== modified file 'Percona-Server/storage/innodb_plugin/log/log0online.c'
85--- Percona-Server/storage/innodb_plugin/log/log0online.c 2012-11-25 09:29:43 +0000
86+++ Percona-Server/storage/innodb_plugin/log/log0online.c 2013-01-04 07:33:24 +0000
87@@ -401,7 +401,7 @@
88 {
89 /* last_tracked_lsn might be < MIN_TRACKED_LSN in the case of empty
90 bitmap file, handle this too. */
91- last_tracked_lsn = ut_max(last_tracked_lsn, MIN_TRACKED_LSN);
92+ last_tracked_lsn = ut_max_uint64(last_tracked_lsn, MIN_TRACKED_LSN);
93
94 if (last_tracked_lsn > tracking_start_lsn) {
95 fprintf(stderr,
96@@ -431,10 +431,10 @@
97 {
98 ut_ad(last_tracked_lsn != tracking_start_lsn);
99
100- fprintf(stderr, "InnoDB: last tracked LSN is %llu, but the last "
101- "checkpoint LSN is %llu. This might be due to a server "
102- "crash or a very fast shutdown. ", last_tracked_lsn,
103- tracking_start_lsn);
104+ fprintf(stderr, "InnoDB: last tracked LSN in \'%s\' is %llu, but the "
105+ "last checkpoint LSN is %llu. This might be due to a server "
106+ "crash or a very fast shutdown. ", log_bmp_sys->out.name,
107+ last_tracked_lsn, tracking_start_lsn);
108
109 /* See if we can fully recover the missing interval */
110 if (log_online_can_track_missing(last_tracked_lsn,
111@@ -443,8 +443,8 @@
112 fprintf(stderr,
113 "Reading the log to advance the last tracked LSN.\n");
114
115- log_bmp_sys->start_lsn = ut_max(last_tracked_lsn,
116- MIN_TRACKED_LSN);
117+ log_bmp_sys->start_lsn = ut_max_uint64(last_tracked_lsn,
118+ MIN_TRACKED_LSN);
119 log_set_tracked_lsn(log_bmp_sys->start_lsn);
120 log_online_follow_redo_log();
121 ut_ad(log_bmp_sys->end_lsn >= tracking_start_lsn);
122@@ -560,7 +560,7 @@
123 {
124 ibool success;
125 ib_uint64_t tracking_start_lsn
126- = ut_max(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN);
127+ = ut_max_uint64(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN);
128 os_file_dir_t bitmap_dir;
129 os_file_stat_t bitmap_dir_file_info;
130 ib_uint64_t last_file_start_lsn = MIN_TRACKED_LSN;
131@@ -931,8 +931,8 @@
132 /* The next parse LSN is inside the current block, skip
133 data preceding it. */
134 skip_already_parsed_len
135- = log_bmp_sys->next_parse_lsn
136- - block_start_lsn;
137+ = (ulint)(log_bmp_sys->next_parse_lsn
138+ - block_start_lsn);
139 }
140 else {
141
142
143=== modified file 'Percona-Server/storage/innodb_plugin/os/os0file.c'
144--- Percona-Server/storage/innodb_plugin/os/os0file.c 2012-06-14 09:16:03 +0000
145+++ Percona-Server/storage/innodb_plugin/os/os0file.c 2013-01-04 07:33:24 +0000
146@@ -1949,8 +1949,10 @@
147 ib_uint64_t new_len)/*!< in: new file length */
148 {
149 #ifdef __WIN__
150- /* TODO: untested! */
151- return(!_chsize_s(file, new_len));
152+ LARGE_INTEGER li, li2;
153+ li.QuadPart = new_len;
154+ return(SetFilePointerEx(file, li, &li2,FILE_BEGIN)
155+ && SetEndOfFile(file));
156 #else
157 /* TODO: works only with -D_FILE_OFFSET_BITS=64 ? */
158 return(!ftruncate(file, new_len));

Subscribers

People subscribed via source and target branches