List:Commits« Previous MessageNext Message »
From:Satya B Date:April 24 2009 11:48am
Subject:bzr commit into mysql-5.0-bugteam branch (satya.bn:2731) Bug#42279
View as plain text  
#At file:///home/satya/WORK/mysql/mysql-5.0-bugteam-innodb/ based on revid:satya.bn@stripped

 2731 Satya B	2009-04-24
      Applying InnoDB snashot 5.0-ss4900 part 1, Fixes BUG#42279
      
      1) BUG#42279 - Race condition in btr_search_drop_page_hash_when_freed()
      
      Detailed revision comments:
      
      r4031 | marko | 2009-01-23 15:33:46 +0200 (Fri, 23 Jan 2009) | 8 lines
      branches/5.0: btr_search_drop_page_hash_when_freed(): Check if
      buf_page_get_gen() returns NULL.  The page may have been evicted
      from the buffer pool between buf_page_peek_if_search_hashed() and
      buf_page_get_gen(), because the buffer pool mutex will be released
      between these two calls. (Bug #42279)
      
      rb://82 approved by Heikki Tuuri
      modified:
        innobase/btr/btr0sea.c

=== modified file 'innobase/btr/btr0sea.c'
--- a/innobase/btr/btr0sea.c	2008-12-13 00:40:31 +0000
+++ b/innobase/btr/btr0sea.c	2009-04-24 11:48:20 +0000
@@ -1101,12 +1101,20 @@ btr_search_drop_page_hash_when_freed(
 	page = buf_page_get_gen(space, page_no, RW_S_LATCH, NULL,
 				BUF_GET_IF_IN_POOL, __FILE__, __LINE__,
 				&mtr);
+	/* Because the buffer pool mutex was released by
+	buf_page_peek_if_search_hashed(), it is possible that the
+	block was removed from the buffer pool by another thread
+	before buf_page_get_gen() got a chance to acquire the buffer
+	pool mutex again.  Thus, we must check for a NULL return. */
+
+	if (UNIV_LIKELY(page != NULL)) {
 
 #ifdef UNIV_SYNC_DEBUG
-	buf_page_dbg_add_level(page, SYNC_TREE_NODE_FROM_HASH);
+		buf_page_dbg_add_level(page, SYNC_TREE_NODE_FROM_HASH);
 #endif /* UNIV_SYNC_DEBUG */
 
-	btr_search_drop_page_hash_index(page);
+		btr_search_drop_page_hash_index(page);
+	}
 
 	mtr_commit(&mtr);
 }

Thread
bzr commit into mysql-5.0-bugteam branch (satya.bn:2731) Bug#42279Satya B24 Apr