Commit 20e609d0 authored by unknown's avatar unknown
Browse files

Merge aivanov@bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/home/alexi/innodb/mysql-5.0-merge

parents 16fa54bf fd6db50c
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -1915,13 +1915,13 @@ btr_cur_pessimistic_update(
	ut_a(rec || optim_err != DB_UNDERFLOW);

	if (rec) {
		offsets = rec_get_offsets(rec, index, offsets,
					ULINT_UNDEFINED, &heap);

		lock_rec_restore_from_page_infimum(rec, page);
		rec_set_field_extern_bits(rec, index,
						ext_vect, n_ext_vect, mtr);

		offsets = rec_get_offsets(rec, index, offsets,
					ULINT_UNDEFINED, &heap);

		if (!rec_get_deleted_flag(rec, rec_offs_comp(offsets))) {
			/* The new inserted record owns its possible externally
			stored fields */
@@ -3329,7 +3329,10 @@ btr_store_big_rec_extern_fields(
	dict_index_t*	index,		/* in: index of rec; the index tree
					MUST be X-latched */
	rec_t*		rec,		/* in: record */
	const ulint*	offsets,	/* in: rec_get_offsets(rec, index) */
	const ulint*	offsets,	/* in: rec_get_offsets(rec, index);
					the "external storage" flags in offsets
					will not correspond to rec when
					this function returns */
	big_rec_t*	big_rec_vec,	/* in: vector containing fields
					to be stored externally */
	mtr_t*		local_mtr __attribute__((unused))) /* in: mtr
+30 −4
Original line number Diff line number Diff line
@@ -1600,14 +1600,29 @@ btr_search_validate(void)
	ulint		n_page_dumps	= 0;
	ibool		ok		= TRUE;
	ulint		i;
	ulint		cell_count;
	mem_heap_t*	heap		= NULL;
	ulint		offsets_[REC_OFFS_NORMAL_SIZE];
	ulint*		offsets		= offsets_;
	*offsets_ = (sizeof offsets_) / sizeof *offsets_;

	/* How many cells to check before temporarily releasing
	btr_search_latch. */
	ulint		chunk_size = 10000;
	
	rw_lock_x_lock(&btr_search_latch);

	cell_count = hash_get_n_cells(btr_search_sys->hash_index);
	
	for (i = 0; i < cell_count; i++) {
		/* We release btr_search_latch every once in a while to
		give other queries a chance to run. */
		if ((i != 0) && ((i % chunk_size) == 0)) {
			rw_lock_x_unlock(&btr_search_latch);
			os_thread_yield();
			rw_lock_x_lock(&btr_search_latch);
		}
		
	for (i = 0; i < hash_get_n_cells(btr_search_sys->hash_index); i++) {
		node = hash_get_nth_cell(btr_search_sys->hash_index, i)->node;

		while (node != NULL) {
@@ -1661,10 +1676,21 @@ btr_search_validate(void)
		}
	}

	if (!ha_validate(btr_search_sys->hash_index)) {
	for (i = 0; i < cell_count; i += chunk_size) {
		ulint end_index = ut_min(i + chunk_size - 1, cell_count - 1);
		
		/* We release btr_search_latch every once in a while to
		give other queries a chance to run. */
		if (i != 0) {
			rw_lock_x_unlock(&btr_search_latch);
			os_thread_yield();
			rw_lock_x_lock(&btr_search_latch);
		}

		if (!ha_validate(btr_search_sys->hash_index, i, end_index)) {
			ok = FALSE;
		}
	}

	rw_lock_x_unlock(&btr_search_latch);
	if (UNIV_LIKELY_NULL(heap)) {
+5 −0
Original line number Diff line number Diff line
@@ -464,12 +464,17 @@ buf_block_init(
	byte*		frame)	/* in: pointer to buffer frame, or NULL if in
				the case of AWE there is no frame */
{
	block->magic_n = 0;

	block->state = BUF_BLOCK_NOT_USED;
	
	block->frame = frame;

	block->awe_info = NULL;

	block->buf_fix_count = 0;
	block->io_fix = 0;

	block->modify_clock = ut_dulint_zero;
	
	block->file_page_was_freed = FALSE;
+8 −8
Original line number Diff line number Diff line
@@ -294,14 +294,14 @@ buf_LRU_try_free_flushed_blocks(void)
}	

/**********************************************************************
Returns TRUE if less than 15 % of the buffer pool is available. This can be
Returns TRUE if less than 25 % of the buffer pool is available. This can be
used in heuristics to prevent huge transactions eating up the whole buffer
pool for their locks. */

ibool
buf_LRU_buf_pool_running_out(void)
/*==============================*/
				/* out: TRUE if less than 15 % of buffer pool
				/* out: TRUE if less than 25 % of buffer pool
				left */
{
	ibool	ret	= FALSE;
@@ -309,7 +309,7 @@ buf_LRU_buf_pool_running_out(void)
	mutex_enter(&(buf_pool->mutex));

	if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
	   + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 7) {
	   + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 4) {
		
		ret = TRUE;
	}
@@ -340,11 +340,11 @@ buf_LRU_get_free_block(void)
	mutex_enter(&(buf_pool->mutex));

	if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
	   + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 10) {
	   + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 20) {
	   	ut_print_timestamp(stderr);

	   	fprintf(stderr,
"  InnoDB: ERROR: over 9 / 10 of the buffer pool is occupied by\n"
"  InnoDB: ERROR: over 95 percent of the buffer pool is occupied by\n"
"InnoDB: lock heaps or the adaptive hash index! Check that your\n"
"InnoDB: transactions do not set too many row locks.\n"
"InnoDB: Your buffer pool size is %lu MB. Maybe you should make\n"
@@ -356,17 +356,17 @@ buf_LRU_get_free_block(void)
		ut_error;
	   
	} else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
	   + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 5) {
	   + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 3) {

		if (!buf_lru_switched_on_innodb_mon) {

	   		/* Over 80 % of the buffer pool is occupied by lock
	   		/* Over 67 % of the buffer pool is occupied by lock
			heaps or the adaptive hash index. This may be a memory
			leak! */

	   		ut_print_timestamp(stderr);
	   		fprintf(stderr,
"  InnoDB: WARNING: over 4 / 5 of the buffer pool is occupied by\n"
"  InnoDB: WARNING: over 67 percent of the buffer pool is occupied by\n"
"InnoDB: lock heaps or the adaptive hash index! Check that your\n"
"InnoDB: transactions do not set too many row locks.\n"
"InnoDB: Your buffer pool size is %lu MB. Maybe you should make\n"
+1 −1
Original line number Diff line number Diff line
@@ -252,7 +252,7 @@ dtype_print(
		} else if (prtype == DATA_ENGLISH) {
			fputs("DATA_ENGLISH", stderr);
		} else {
			fprintf(stderr, "prtype %lu", (ulong) mtype);
			fprintf(stderr, "prtype %lu", (ulong) prtype);
		}
	}

Loading