List:Commits« Previous MessageNext Message »
From:marko.makela Date:June 30 2010 9:58am
Subject:bzr push into mysql-trunk-innodb branch (marko.makela:3129 to 3131) Bug#54358
View as plain text  
 3131 Marko Mäkelä	2010-06-30
      Merge a Bug #54358 error handling correction from mysql-5.1-innodb:
      ------------------------------------------------------------
      revno: 3534
      revision-id: marko.makela@oracle.com-20100630093847-7gkr1lh3bh2xksy0
      parent: marko.makela@stripped
      committer: Marko Mäkelä <marko.makela@stripped>
      branch nick: 5.1-innodb
      timestamp: Wed 2010-06-30 12:38:47 +0300
      message:
        Bug#54358 follow-up: Correct some error handling.

    modified:
      storage/innobase/row/row0sel.c
 3130 Marko Mäkelä	2010-06-30
      Merge Bug #54358 comment corrections from mysql-5.1-innodb:
      ------------------------------------------------------------
      revno: 3533
      revision-id: marko.makela@stripped
      parent: marko.makela@strippedk5rsqztmw27
      committer: Marko Mäkelä <marko.makela@oracle.com>
      branch nick: 5.1-innodb
      timestamp: Wed 2010-06-30 12:31:49 +0300
      message:
        Correct some comments that were added in the fix of Bug #54358
        (READ UNCOMMITTED access failure of off-page DYNAMIC or COMPRESSED columns).
      
        Records that lack incompletely written externally stored columns may
        be accessed by READ UNCOMMITTED transaction even without involving a
        crash during an INSERT or UPDATE operation. I verified this as follows.
      
        (1) added a delay after the mini-transaction for writing the clustered
        index 'stub' record was committed (patch attached)
        (2) started mysqld in gdb, setting breakpoints to the where the
        assertions about READ UNCOMMITTED were added in the bug fix
        (3) invoked ibtest3 --create-options=key_block_size=2
        to create BLOBs in a COMPRESSED table
        (4) invoked the following:
        yes 'set transaction isolation level read uncommitted;
        checksum table blobt3;select sleep(1);'|mysql -uroot test
        (5) noted that one of the breakpoints was triggered
        (return(NULL) in btr_rec_copy_externally_stored_field())
      
        === modified file 'storage/innodb_plugin/row/row0ins.c'
        --- storage/innodb_plugin/row/row0ins.c	2010-06-30 08:17:25 +0000
        +++ storage/innodb_plugin/row/row0ins.c	2010-06-30 08:17:25 +0000
        @@ -2120,6 +2120,7 @@ function_exit:
         		rec_t*	rec;
         		ulint*	offsets;
         		mtr_start(&mtr);
        +		os_thread_sleep(5000000);
         
         		btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
         					    BTR_MODIFY_TREE, &cursor, 0,
        
        === modified file 'storage/innodb_plugin/row/row0upd.c'
        --- storage/innodb_plugin/row/row0upd.c	2010-06-30 08:11:55 +0000
        +++ storage/innodb_plugin/row/row0upd.c	2010-06-30 08:11:55 +0000
        @@ -1763,6 +1763,7 @@ row_upd_clust_rec(
         		rec_offs_init(offsets_);
         
         		mtr_start(mtr);
        +		os_thread_sleep(5000000);
         
         		ut_a(btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr));
         		rec = btr_cur_get_rec(btr_cur);

    modified:
      storage/innobase/btr/btr0cur.c
      storage/innobase/row/row0sel.c
 3129 Mark Leith	2010-06-30
      Bug#54726 - Inconsistent reporting between mutex and RW lock spin rounds
       - Add round counts to the output for RW s/x locks

    modified:
      storage/innobase/sync/sync0sync.c
=== modified file 'storage/innobase/btr/btr0cur.c'
--- a/storage/innobase/btr/btr0cur.c	revid:mark.leith@stripped0630091104-yxpjqu3ruebif2jb
+++ b/storage/innobase/btr/btr0cur.c	revid:marko.makela@stripped2z0s1mo8gav5
@@ -4969,20 +4969,10 @@ btr_rec_copy_externally_stored_field(
 	if (UNIV_UNLIKELY
 	    (!memcmp(data + local_len - BTR_EXTERN_FIELD_REF_SIZE,
 		     field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE))) {
-		/* The externally stored field was not written
-		yet. This is only a valid condition when the server
-		crashed after the time a record stub was freshly
-		inserted but before all its columns were written. This
-		record should only be seen by
+		/* The externally stored field was not written yet.
+		This record should only be seen by
 		recv_recovery_rollback_active() or any
 		TRX_ISO_READ_UNCOMMITTED transactions. */
-
-		/* TODO: assert that there is an owner_trx with
-		owner_trx->id == DB_TRX_ID and owner_trx->is_recovered */
-
-		/* TODO: assert that for the current transaction trx,
-		either (trx == owner_trx && trx_is_recv(trx)) or
-		trx->isolation_level == TRX_ISO_READ_UNCOMMITTED. */
 		return(NULL);
 	}
 

=== modified file 'storage/innobase/row/row0sel.c'
--- a/storage/innobase/row/row0sel.c	revid:mark.leith@strippeduebif2jb
+++ b/storage/innobase/row/row0sel.c	revid:marko.makela@stripped
@@ -425,11 +425,7 @@ row_sel_fetch_columns(
 
 				/* data == NULL means that the
 				externally stored field was not
-				written yet. This is only a valid
-				condition when the server crashed
-				after the time a record stub was
-				freshly inserted but before all its
-				columns were written. This record
+				written yet. This record
 				should only be seen by
 				recv_recovery_rollback_active() or any
 				TRX_ISO_READ_UNCOMMITTED
@@ -2736,12 +2732,7 @@ row_sel_store_mysql_rec(
 
 			if (UNIV_UNLIKELY(!data)) {
 				/* The externally stored field
-				was not written yet. This is
-				only a valid condition when
-				the server crashed after the
-				time a record stub was freshly
-				inserted but before all its
-				columns were written. This
+				was not written yet. This
 				record should only be seen by
 				recv_recovery_rollback_active()
 				or any TRX_ISO_READ_UNCOMMITTED
@@ -3615,8 +3606,7 @@ row_search_for_mysql(
 
 				if (!row_sel_store_mysql_rec(buf, prebuilt,
 							     rec, offsets)) {
-					/* Only fresh inserts at
-					server crash time may contain
+					/* Only fresh inserts may contain
 					incomplete externally stored
 					columns. Pretend that such
 					records do not exist. Such
@@ -3628,16 +3618,9 @@ row_search_for_mysql(
 					at a lower level, not here. */
 					ut_a(trx->isolation_level
 					     == TRX_ISO_READ_UNCOMMITTED);
-					/* TODO: assert that there is
-					an owner_trx with
-					owner_trx->id == DB_TRX_ID and
-					owner_trx->is_recovered */
-
-					err = DB_TOO_BIG_RECORD;
-
-					/* We let the main loop to do the
-					error handling */
-					goto shortcut_fails_too_big_rec;
+
+					/* Proceed as in case SEL_RETRY. */
+					break;
 				}
 
 				mtr_commit(&mtr);
@@ -3677,7 +3660,7 @@ release_search_latch_if_needed:
 			default:
 				ut_ad(0);
 			}
-shortcut_fails_too_big_rec:
+
 			mtr_commit(&mtr);
 			mtr_start(&mtr);
 		}
@@ -4414,16 +4397,14 @@ requires_clust_rec:
 
 		if (!row_sel_push_cache_row_for_mysql(prebuilt, result_rec,
 						      offsets)) {
-			/* Only fresh inserts at server crash time may contain
-			incomplete externally stored columns. Pretend that
-			such records do not exist. Such records may only be
-			accessed at the READ UNCOMMITTED isolation level or
-			when rolling back a recovered transaction. Rollback
-			happens at a lower level, not here. */
+			/* Only fresh inserts may contain incomplete
+			externally stored columns. Pretend that such
+			records do not exist. Such records may only be
+			accessed at the READ UNCOMMITTED isolation
+			level or when rolling back a recovered
+			transaction. Rollback happens at a lower
+			level, not here. */
 			ut_a(trx->isolation_level == TRX_ISO_READ_UNCOMMITTED);
-			/* TODO: assert that there is an owner_trx
-			with owner_trx->id == DB_TRX_ID and
-			owner_trx->is_recovered */
 		} else if (prebuilt->n_fetch_cached
 			   == MYSQL_FETCH_CACHE_SIZE) {
 
@@ -4441,19 +4422,16 @@ requires_clust_rec:
 		} else {
 			if (!row_sel_store_mysql_rec(buf, prebuilt,
 						     result_rec, offsets)) {
-				/* Only fresh inserts at server crash
-				time may contain incomplete externally
-				stored columns. Pretend that such
-				records do not exist. Such records may
-				only be accessed at the READ UNCOMMITTED
+				/* Only fresh inserts may contain
+				incomplete externally stored
+				columns. Pretend that such records do
+				not exist. Such records may only be
+				accessed at the READ UNCOMMITTED
 				isolation level or when rolling back a
-				recovered transaction. Rollback happens
-				at a lower level, not here. */
+				recovered transaction. Rollback
+				happens at a lower level, not here. */
 				ut_a(trx->isolation_level
 				     == TRX_ISO_READ_UNCOMMITTED);
-				/* TODO: assert that there is an owner_trx
-				with owner_trx->id == DB_TRX_ID and
-				owner_trx->is_recovered */
 				goto next_rec;
 			}
 		}

Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20100630095510-g6fw2z0s1mo8gav5.bundle
Thread
bzr push into mysql-trunk-innodb branch (marko.makela:3129 to 3131) Bug#54358marko.makela30 Jun