Commit 021d7d72 authored by Timothy Smith's avatar Timothy Smith
Browse files

Cherry-pick InnoDB fixes for Bug#34286, Bug#35352, and Bug#36600 from snapshot

innodb-5.0-ss2475.

Bug #34286  Assertion failure in thread 2816 in file .\row\row0sel.c line 3500
Since autoinc init performs a MySQL SELECT query to determine the auto-inc
value, set prebuilt->sql_stat_start = TRUE so that it is performed like any
normal SELECT, regardless of the context in which it was invoked.


Bug #35352  If InnoDB crashes with UNDO slots full error the error persists on restart
We've added a heuristic that checks the size of the UNDO slots cache lists
(insert and upate). If either of cached lists has more than 500 entries then we
add any UNDO slots that are freed, to the common free list instead of the cache
list, this is to avoid the case where all the free slots end up in only one of
the lists on startup after a crash.

Tested with test case for 26590 and passes all mysql-test(s).

Bug #36600  SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number
Fixed by removing the Innodb_buffer_pool_pages_latched variable from SHOW
STATUS output in non-UNIV_DEBUG compilation.
parent a0768d32
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2260,6 +2260,7 @@ buf_print(void)
	ut_a(buf_validate());
}	

#ifdef UNIV_DEBUG
/*************************************************************************
Returns the number of latched pages in the buffer pool. */

@@ -2290,6 +2291,7 @@ buf_get_latched_pages_number(void)
        mutex_exit(&(buf_pool->mutex));
        return fixed_pages_number;
}
#endif /* UNIV_DEBUG */

/*************************************************************************
Returns the number of pending buf pool ios. */
+8 −5
Original line number Diff line number Diff line
@@ -495,7 +495,15 @@ Prints info of the buffer pool data structure. */
void
buf_print(void);
/*============*/

/*************************************************************************
Returns the number of latched pages in the buffer pool. */

ulint
buf_get_latched_pages_number(void);
/*==============================*/
#endif /* UNIV_DEBUG */

/************************************************************************
Prints a page to stderr. */

@@ -503,12 +511,7 @@ void
buf_page_print(
/*===========*/
	byte*	read_buf);	/* in: a database page */
/*************************************************************************
Returns the number of latched pages in the buffer pool. */

ulint
buf_get_latched_pages_number(void);
/*==============================*/
/*************************************************************************
Returns the number of pending buf pool ios. */

+2 −0
Original line number Diff line number Diff line
@@ -531,7 +531,9 @@ struct export_var_struct{
        ulint innodb_buffer_pool_pages_dirty;
        ulint innodb_buffer_pool_pages_misc;
        ulint innodb_buffer_pool_pages_free;
#ifdef UNIV_DEBUG
        ulint innodb_buffer_pool_pages_latched;
#endif /* UNIV_DEBUG */
        ulint innodb_buffer_pool_read_requests;
        ulint innodb_buffer_pool_reads;
        ulint innodb_buffer_pool_wait_free;
+1 −0
Original line number Diff line number Diff line
@@ -237,6 +237,7 @@ trx_undo_set_state_at_finish(
/*=========================*/
				/* out: undo log segment header page,
				x-latched */
	trx_rseg_t*	rseg,	/* in: rollback segment memory object */
	trx_t*		trx,	/* in: transaction */
	trx_undo_t*	undo,	/* in: undo log memory copy */
	mtr_t*		mtr);	/* in: mtr */
+2 −0
Original line number Diff line number Diff line
@@ -1803,7 +1803,9 @@ srv_export_innodb_status(void)
        export_vars.innodb_buffer_pool_pages_data= UT_LIST_GET_LEN(buf_pool->LRU);
        export_vars.innodb_buffer_pool_pages_dirty= UT_LIST_GET_LEN(buf_pool->flush_list);
        export_vars.innodb_buffer_pool_pages_free= UT_LIST_GET_LEN(buf_pool->free);
#ifdef UNIV_DEBUG
        export_vars.innodb_buffer_pool_pages_latched= buf_get_latched_pages_number();
#endif /* UNIV_DEBUG */
        export_vars.innodb_buffer_pool_pages_total= buf_pool->curr_size;
        export_vars.innodb_buffer_pool_pages_misc= buf_pool->max_size -
          UT_LIST_GET_LEN(buf_pool->LRU) - UT_LIST_GET_LEN(buf_pool->free);
Loading