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

Proposed by Laurynas Biveinis on 2012-12-07
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 on 2012-12-27
Sergei Glushchenko (community) g2 2012-12-07 Approve on 2012-12-11
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 on 2012-12-10

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

Approve

review: Approve (g2)
497. By <email address hidden> on 2012-12-11

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

498. By <email address hidden> on 2012-12-12

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

499. By <email address hidden> on 2012-12-12

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

500. By <email address hidden> on 2012-12-12

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

501. By <email address hidden> on 2012-12-13

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

502. By <email address hidden> on 2012-12-13

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

503. By <email address hidden> on 2012-12-13

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

504. By <email address hidden> on 2012-12-14

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

505. By <email address hidden> on 2012-12-14

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

Stewart Smith (stewart) :
review: Approve
506. By <email address hidden> on 2012-12-18

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

507. By <email address hidden> on 2012-12-19

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

508. By <email address hidden> on 2012-12-19

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

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> on 2012-12-27

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

510. By <email address hidden> on 2013-01-03

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

511. By Laurynas Biveinis on 2013-01-04

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
=== modified file 'Percona-Server/storage/innodb_plugin/handler/i_s.cc'
--- Percona-Server/storage/innodb_plugin/handler/i_s.cc 2012-11-25 09:29:43 +0000
+++ Percona-Server/storage/innodb_plugin/handler/i_s.cc 2013-01-04 07:33:24 +0000
@@ -3932,10 +3932,10 @@
3932 LOG_BITMAP_ITERATOR_PAGE_NUM(i));3932 LOG_BITMAP_ITERATOR_PAGE_NUM(i));
3933 /* START_LSN */3933 /* START_LSN */
3934 table->field[2]->store(3934 table->field[2]->store(
3935 LOG_BITMAP_ITERATOR_START_LSN(i));3935 LOG_BITMAP_ITERATOR_START_LSN(i), true);
3936 /* END_LSN */3936 /* END_LSN */
3937 table->field[3]->store(3937 table->field[3]->store(
3938 LOG_BITMAP_ITERATOR_END_LSN(i));3938 LOG_BITMAP_ITERATOR_END_LSN(i), true);
39393939
3940 /*3940 /*
3941 I_S tables are in-memory tables. If bitmap file is big enough3941 I_S tables are in-memory tables. If bitmap file is big enough
39423942
=== modified file 'Percona-Server/storage/innodb_plugin/include/ut0ut.h'
--- Percona-Server/storage/innodb_plugin/include/ut0ut.h 2009-09-15 10:26:01 +0000
+++ Percona-Server/storage/innodb_plugin/include/ut0ut.h 2013-01-04 07:33:24 +0000
@@ -120,6 +120,15 @@
120/*===*/120/*===*/
121 ulint n1, /*!< in: first number */121 ulint n1, /*!< in: first number */
122 ulint n2); /*!< in: second number */122 ulint n2); /*!< in: second number */
123/******************************************************//**
124Calculates the maximum of two ib_uint64_t values.
125@return the maximum */
126UNIV_INLINE
127ib_uint64_t
128ut_max_uint64(
129/*==========*/
130 ib_uint64_t n1, /*!< in: first number */
131 ib_uint64_t n2); /*!< in: second number */
123/****************************************************************//**132/****************************************************************//**
124Calculates minimum of two ulint-pairs. */133Calculates minimum of two ulint-pairs. */
125UNIV_INLINE134UNIV_INLINE
126135
=== modified file 'Percona-Server/storage/innodb_plugin/include/ut0ut.ic'
--- Percona-Server/storage/innodb_plugin/include/ut0ut.ic 2009-05-25 09:52:29 +0000
+++ Percona-Server/storage/innodb_plugin/include/ut0ut.ic 2013-01-04 07:33:24 +0000
@@ -49,6 +49,19 @@
49 return((n1 <= n2) ? n2 : n1);49 return((n1 <= n2) ? n2 : n1);
50}50}
5151
52/******************************************************//**
53Calculates the maximum of two ib_uint64_t values.
54@return the maximum */
55UNIV_INLINE
56ib_uint64_t
57ut_max_uint64(
58/*==========*/
59 ib_uint64_t n1, /*!< in: first number */
60 ib_uint64_t n2) /*!< in: second number */
61{
62 return((n1 <= n2) ? n2 : n1);
63}
64
52/****************************************************************//**65/****************************************************************//**
53Calculates minimum of two ulint-pairs. */66Calculates minimum of two ulint-pairs. */
54UNIV_INLINE67UNIV_INLINE
5568
=== modified file 'Percona-Server/storage/innodb_plugin/log/log0log.c'
--- Percona-Server/storage/innodb_plugin/log/log0log.c 2012-06-14 09:16:03 +0000
+++ Percona-Server/storage/innodb_plugin/log/log0log.c 2013-01-04 07:33:24 +0000
@@ -233,7 +233,7 @@
233 checked for the already-written log. */233 checked for the already-written log. */
234{234{
235 ib_uint64_t tracked_lsn;235 ib_uint64_t tracked_lsn;
236 ulint tracked_lsn_age;236 ib_uint64_t tracked_lsn_age;
237237
238 if (!srv_track_changed_pages) {238 if (!srv_track_changed_pages) {
239 return FALSE;239 return FALSE;
@@ -445,7 +445,7 @@
445 ib_uint64_t oldest_lsn;445 ib_uint64_t oldest_lsn;
446 ib_uint64_t lsn;446 ib_uint64_t lsn;
447 ib_uint64_t tracked_lsn;447 ib_uint64_t tracked_lsn;
448 ulint tracked_lsn_age;448 ib_uint64_t tracked_lsn_age;
449 log_t* log = log_sys;449 log_t* log = log_sys;
450 ib_uint64_t checkpoint_age;450 ib_uint64_t checkpoint_age;
451451
452452
=== modified file 'Percona-Server/storage/innodb_plugin/log/log0online.c'
--- Percona-Server/storage/innodb_plugin/log/log0online.c 2012-11-25 09:29:43 +0000
+++ Percona-Server/storage/innodb_plugin/log/log0online.c 2013-01-04 07:33:24 +0000
@@ -401,7 +401,7 @@
401{401{
402 /* last_tracked_lsn might be < MIN_TRACKED_LSN in the case of empty402 /* last_tracked_lsn might be < MIN_TRACKED_LSN in the case of empty
403 bitmap file, handle this too. */403 bitmap file, handle this too. */
404 last_tracked_lsn = ut_max(last_tracked_lsn, MIN_TRACKED_LSN);404 last_tracked_lsn = ut_max_uint64(last_tracked_lsn, MIN_TRACKED_LSN);
405405
406 if (last_tracked_lsn > tracking_start_lsn) {406 if (last_tracked_lsn > tracking_start_lsn) {
407 fprintf(stderr,407 fprintf(stderr,
@@ -431,10 +431,10 @@
431{431{
432 ut_ad(last_tracked_lsn != tracking_start_lsn);432 ut_ad(last_tracked_lsn != tracking_start_lsn);
433433
434 fprintf(stderr, "InnoDB: last tracked LSN is %llu, but the last "434 fprintf(stderr, "InnoDB: last tracked LSN in \'%s\' is %llu, but the "
435 "checkpoint LSN is %llu. This might be due to a server "435 "last checkpoint LSN is %llu. This might be due to a server "
436 "crash or a very fast shutdown. ", last_tracked_lsn,436 "crash or a very fast shutdown. ", log_bmp_sys->out.name,
437 tracking_start_lsn);437 last_tracked_lsn, tracking_start_lsn);
438438
439 /* See if we can fully recover the missing interval */439 /* See if we can fully recover the missing interval */
440 if (log_online_can_track_missing(last_tracked_lsn,440 if (log_online_can_track_missing(last_tracked_lsn,
@@ -443,8 +443,8 @@
443 fprintf(stderr,443 fprintf(stderr,
444 "Reading the log to advance the last tracked LSN.\n");444 "Reading the log to advance the last tracked LSN.\n");
445445
446 log_bmp_sys->start_lsn = ut_max(last_tracked_lsn,446 log_bmp_sys->start_lsn = ut_max_uint64(last_tracked_lsn,
447 MIN_TRACKED_LSN);447 MIN_TRACKED_LSN);
448 log_set_tracked_lsn(log_bmp_sys->start_lsn);448 log_set_tracked_lsn(log_bmp_sys->start_lsn);
449 log_online_follow_redo_log();449 log_online_follow_redo_log();
450 ut_ad(log_bmp_sys->end_lsn >= tracking_start_lsn);450 ut_ad(log_bmp_sys->end_lsn >= tracking_start_lsn);
@@ -560,7 +560,7 @@
560{560{
561 ibool success;561 ibool success;
562 ib_uint64_t tracking_start_lsn562 ib_uint64_t tracking_start_lsn
563 = ut_max(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN);563 = ut_max_uint64(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN);
564 os_file_dir_t bitmap_dir;564 os_file_dir_t bitmap_dir;
565 os_file_stat_t bitmap_dir_file_info;565 os_file_stat_t bitmap_dir_file_info;
566 ib_uint64_t last_file_start_lsn = MIN_TRACKED_LSN;566 ib_uint64_t last_file_start_lsn = MIN_TRACKED_LSN;
@@ -931,8 +931,8 @@
931 /* The next parse LSN is inside the current block, skip931 /* The next parse LSN is inside the current block, skip
932 data preceding it. */932 data preceding it. */
933 skip_already_parsed_len933 skip_already_parsed_len
934 = log_bmp_sys->next_parse_lsn934 = (ulint)(log_bmp_sys->next_parse_lsn
935 - block_start_lsn;935 - block_start_lsn);
936 }936 }
937 else {937 else {
938938
939939
=== modified file 'Percona-Server/storage/innodb_plugin/os/os0file.c'
--- Percona-Server/storage/innodb_plugin/os/os0file.c 2012-06-14 09:16:03 +0000
+++ Percona-Server/storage/innodb_plugin/os/os0file.c 2013-01-04 07:33:24 +0000
@@ -1949,8 +1949,10 @@
1949 ib_uint64_t new_len)/*!< in: new file length */1949 ib_uint64_t new_len)/*!< in: new file length */
1950{1950{
1951#ifdef __WIN__1951#ifdef __WIN__
1952 /* TODO: untested! */1952 LARGE_INTEGER li, li2;
1953 return(!_chsize_s(file, new_len));1953 li.QuadPart = new_len;
1954 return(SetFilePointerEx(file, li, &li2,FILE_BEGIN)
1955 && SetEndOfFile(file));
1954#else1956#else
1955 /* TODO: works only with -D_FILE_OFFSET_BITS=64 ? */1957 /* TODO: works only with -D_FILE_OFFSET_BITS=64 ? */
1956 return(!ftruncate(file, new_len));1958 return(!ftruncate(file, new_len));

Subscribers

People subscribed via source and target branches