Merge lp:~laurynas-biveinis/percona-server/bug1100178-1100643-5.1 into lp:percona-server/5.1

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Stewart Smith
Approved revision: 514
Merged at revision: 524
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1100178-1100643-5.1
Merge into: lp:percona-server/5.1
Diff against target: 62 lines (+17/-7)
3 files modified
Percona-Server/storage/innodb_plugin/buf/buf0buf.c (+3/-1)
Percona-Server/storage/innodb_plugin/include/buf0buf.h (+4/-0)
Percona-Server/storage/innodb_plugin/lock/lock0lock.c (+10/-6)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1100178-1100643-5.1
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
George Ormond Lorch III g2 Approve
Review via email: mp+144014@code.launchpad.net
To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) wrote :

laurynas,

Do you need to also change the call to buf_page_get at btr0cur.c:3383 to buf_page_get_gen passing BUF_GET_POSSIBLY_FREED similar to the 5.5 code?

5.1:
                /* fetch the page */
                block = buf_page_get(space, zip_size, page_no, RW_S_LATCH,
                                     &mtr);

5.5:
             /* Fetch the page. Because we are not holding the
                index->lock, the tree may have changed and we may be
                attempting to read a page that is no longer part of
                the B-tree. We pass BUF_GET_POSSIBLY_FREED in order to
                silence a debug assertion about this. */
                block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH,
                                         NULL, BUF_GET_POSSIBLY_FREED,
                                         __FILE__, __LINE__, &mtr);

review: Needs Information
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

George -

That change is to fix http://bugs.mysql.com/bug.php?id=58815, which is a similar issue, but not the one we are seeing here. Let's hold off backporting this bit until we see that 58815 applies to 5.1.

Revision history for this message
George Ormond Lorch III (gl-az) wrote :

OK, that sounds fair. I only questioned it in case it was a missed piece of back porting BUF_GET_POSSIBLY_FREED.

review: Approve (g2)
Revision history for this message
Stewart Smith (stewart) :
review: Approve

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/buf/buf0buf.c'
2--- Percona-Server/storage/innodb_plugin/buf/buf0buf.c 2013-01-18 03:33:06 +0000
3+++ Percona-Server/storage/innodb_plugin/buf/buf0buf.c 2013-01-20 11:56:20 +0000
4@@ -1795,6 +1795,7 @@
5 case BUF_GET:
6 case BUF_GET_IF_IN_POOL:
7 case BUF_PEEK_IF_IN_POOL:
8+ case BUF_GET_POSSIBLY_FREED:
9 break;
10 default:
11 ut_error;
12@@ -2172,7 +2173,8 @@
13 }
14
15 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
16- ut_a(!block->page.file_page_was_freed);
17+ ut_a(mode == BUF_GET_POSSIBLY_FREED
18+ || !block->page.file_page_was_freed);
19 #endif
20
21 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
22
23=== modified file 'Percona-Server/storage/innodb_plugin/include/buf0buf.h'
24--- Percona-Server/storage/innodb_plugin/include/buf0buf.h 2012-10-16 04:49:59 +0000
25+++ Percona-Server/storage/innodb_plugin/include/buf0buf.h 2013-01-20 11:56:20 +0000
26@@ -49,6 +49,10 @@
27 it is error-prone programming
28 not to set a latch, and it
29 should be used with care */
30+#define BUF_GET_POSSIBLY_FREED 16
31+ /*!< Like BUF_GET, but do not mind
32+ if the file page has been freed. */
33+
34 /* @} */
35 /** @name Modes for buf_page_get_known_nowait */
36 /* @{ */
37
38=== modified file 'Percona-Server/storage/innodb_plugin/lock/lock0lock.c'
39--- Percona-Server/storage/innodb_plugin/lock/lock0lock.c 2012-10-11 13:58:54 +0000
40+++ Percona-Server/storage/innodb_plugin/lock/lock0lock.c 2013-01-20 11:56:20 +0000
41@@ -4655,12 +4655,16 @@
42
43 lock_mutex_exit_kernel();
44
45- mtr_start(&mtr);
46-
47- buf_page_get_with_no_latch(space, zip_size,
48- page_no, &mtr);
49-
50- mtr_commit(&mtr);
51+ if (srv_show_verbose_locks) {
52+ mtr_start(&mtr);
53+
54+ buf_page_get_gen(space, zip_size, page_no,
55+ RW_NO_LATCH, NULL,
56+ BUF_GET_POSSIBLY_FREED,
57+ __FILE__, __LINE__, &mtr);
58+
59+ mtr_commit(&mtr);
60+ }
61
62 load_page_first = FALSE;
63

Subscribers

People subscribed via source and target branches