List:Commits« Previous MessageNext Message »
From:Satya B Date:April 20 2009 7:27am
Subject:bzr commit into mysql-5.1-bugteam branch (satya.bn:2860) Bug#27276
View as plain text  
#At file:///home/satya/WORK/mysql/mysql-5.1-bugteam-innodb/ based on revid:chad@stripped

 2860 Satya B	2009-04-20
      Applying InnoDB snashot 5.1-ss3603. Fixes BUG#27276
      
      1) BUG#27276 - InnoDB Error: ibuf cursor restoration fails
      
      2) Follow up fix for BUG#27276 which fixes the bug introduced in
         the previous revision r2924
      
      Detailed revision comments:
      
      r2924 | marko | 2008-10-29 10:07:48 +0200 (Wed, 29 Oct 2008) | 7 lines
      branches/5.1: Merge revision 2866 from branches/zip:
      
      ibuf_delete_rec(): When the cursor to the insert buffer record cannot be
      restored, do not complain if the tablespace does not exist. (Bug #27276)
      
      Approved by Sunny Bains (rb://34)
      
      r3598 | marko | 2008-12-22 15:28:03 +0200 (Mon, 22 Dec 2008) | 6 lines
      branches/5.1: ibuf_delete_rec(): When the record cannot be found and
      the tablespace has been dropped, commit the mini-transaction, so that
      InnoDB will not hold the insert buffer tree latch in exclusive mode,
      causing a potential deadlock.  This bug was introduced in the fix of
      Bug #27276 in r2924.
      modified:
        storage/innobase/ibuf/ibuf0ibuf.c

=== modified file 'storage/innobase/ibuf/ibuf0ibuf.c'
--- a/storage/innobase/ibuf/ibuf0ibuf.c	2007-11-06 22:42:58 +0000
+++ b/storage/innobase/ibuf/ibuf0ibuf.c	2009-04-20 07:27:41 +0000
@@ -2992,6 +2992,13 @@ ibuf_delete_rec(
 	success = btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr);
 
 	if (!success) {
+		if (fil_space_get_version(space) == -1) {
+			/* The tablespace has been dropped.  It is possible
+			that another thread has deleted the insert buffer
+			entry.  Do not complain. */
+			goto commit_and_exit;
+		}
+
 		fprintf(stderr,
 			"InnoDB: ERROR: Submit the output to"
 			" http://bugs.mysql.com\n"
@@ -3018,11 +3025,7 @@ ibuf_delete_rec(
 		fprintf(stderr, "InnoDB: ibuf tree ok\n");
 		fflush(stderr);
 
-		btr_pcur_close(pcur);
-
-		mutex_exit(&ibuf_mutex);
-
-		return(TRUE);
+		goto func_exit;
 	}
 
 	root = ibuf_tree_root_get(ibuf_data, 0, mtr);
@@ -3033,15 +3036,15 @@ ibuf_delete_rec(
 
 #ifdef UNIV_IBUF_DEBUG
 	ibuf_count_set(space, page_no, ibuf_count_get(space, page_no) - 1);
-#else
-	UT_NOT_USED(space);
 #endif
 	ibuf_data_sizes_update(ibuf_data, root, mtr);
 
 	ut_ad(ibuf_validate_low());
 
+commit_and_exit:
 	btr_pcur_commit_specify_mtr(pcur, mtr);
 
+func_exit:
 	btr_pcur_close(pcur);
 
 	mutex_exit(&ibuf_mutex);

Thread
bzr commit into mysql-5.1-bugteam branch (satya.bn:2860) Bug#27276Satya B20 Apr