Skip to content
Permalink
Browse files
5.6.36-82.0
  • Loading branch information
cvicentiu committed May 16, 2017
1 parent 8d69ce7 commit 360a4a0
Show file tree
Hide file tree
Showing 42 changed files with 1,419 additions and 459 deletions.
@@ -199,7 +199,7 @@ btr_search_sys_create(
&btr_search_latch_arr[i], SYNC_SEARCH_SYS);

btr_search_sys->hash_tables[i]
= ha_create(hash_size, 0, MEM_HEAP_FOR_BTR_SEARCH, 0);
= ib_create(hash_size, 0, MEM_HEAP_FOR_BTR_SEARCH, 0);

#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
btr_search_sys->hash_tables[i]->adaptive = TRUE;
@@ -1413,7 +1413,7 @@ buf_pool_init_instance(
ut_a(srv_n_page_hash_locks != 0);
ut_a(srv_n_page_hash_locks <= MAX_PAGE_HASH_LOCKS);

buf_pool->page_hash = ha_create(2 * buf_pool->curr_size,
buf_pool->page_hash = ib_create(2 * buf_pool->curr_size,
srv_n_page_hash_locks,
MEM_HEAP_FOR_PAGE_HASH,
SYNC_BUF_PAGE_HASH);
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -355,7 +355,7 @@ recovery, this function loads the pages from double write buffer into memory. */
void
buf_dblwr_init_or_load_pages(
/*=========================*/
os_file_t file,
pfs_os_file_t file,
char* path,
bool load_corrupt_pages)
{
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -597,6 +597,7 @@ DECLARE_THREAD(buf_dump_thread)(
void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
required by os_thread_create */
{
my_thread_init();
ut_ad(!srv_read_only_mode);

srv_buf_dump_thread_active = TRUE;
@@ -632,6 +633,7 @@ DECLARE_THREAD(buf_dump_thread)(

srv_buf_dump_thread_active = FALSE;

my_thread_end();
/* We count the number of threads in os_thread_exit(). A created
thread should always use that to exit and not use return() to exit. */
os_thread_exit(NULL);
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -356,6 +356,7 @@ buf_flush_insert_into_flush_list(
buf_block_t* block, /*!< in/out: block which is modified */
lsn_t lsn) /*!< in: oldest modification */
{
ut_ad(srv_shutdown_state != SRV_SHUTDOWN_FLUSH_PHASE);
ut_ad(log_flush_order_mutex_own());
ut_ad(mutex_own(&block->mutex));

@@ -414,6 +415,7 @@ buf_flush_insert_sorted_into_flush_list(
buf_page_t* prev_b;
buf_page_t* b;

ut_ad(srv_shutdown_state != SRV_SHUTDOWN_FLUSH_PHASE);
ut_ad(log_flush_order_mutex_own());
ut_ad(mutex_own(&block->mutex));
ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
@@ -724,6 +726,7 @@ buf_flush_write_complete(
buf_page_set_io_fix(bpage, BUF_IO_NONE);

buf_pool->n_flush[flush_type]--;
ut_ad(buf_pool->n_flush[flush_type] != ULINT_MAX);

/* fprintf(stderr, "n pending flush %lu\n",
buf_pool->n_flush[flush_type]); */
@@ -1061,6 +1064,7 @@ buf_flush_page(
}

++buf_pool->n_flush[flush_type];
ut_ad(buf_pool->n_flush[flush_type] != 0);

mutex_exit(&buf_pool->flush_state_mutex);

@@ -2206,13 +2210,14 @@ Clears up tail of the LRU lists:
* Flush dirty pages at the tail of LRU to the disk
The depth to which we scan each buffer pool is controlled by dynamic
config parameter innodb_LRU_scan_depth.
@return number of pages flushed */
@return number of flushed and evicted pages */
UNIV_INTERN
ulint
buf_flush_LRU_tail(void)
/*====================*/
{
ulint total_flushed = 0;
ulint total_evicted = 0;
ulint start_time = ut_time_ms();
ulint scan_depth[MAX_BUFFER_POOLS];
ulint requested_pages[MAX_BUFFER_POOLS];
@@ -2278,6 +2283,7 @@ buf_flush_LRU_tail(void)
limited_scan[i]
= (previous_evicted[i] > n.evicted);
previous_evicted[i] = n.evicted;
total_evicted += n.evicted;

requested_pages[i] += lru_chunk_size;

@@ -2310,7 +2316,7 @@ buf_flush_LRU_tail(void)
MONITOR_LRU_BATCH_PAGES,
total_flushed);
}
return(total_flushed);
return(total_flushed + total_evicted);
}

/*********************************************************************//**
@@ -2604,6 +2610,23 @@ buf_get_total_free_list_length(void)
return result;
}

/** Returns the aggregate LRU list length over all buffer pool instances.
@return total LRU list length. */
MY_ATTRIBUTE((warn_unused_result))
static
ulint
buf_get_total_LRU_list_length(void)
{
ulint result = 0;

for (ulint i = 0; i < srv_buf_pool_instances; i++) {

result += UT_LIST_GET_LEN(buf_pool_from_array(i)->LRU);
}

return result;
}

/*********************************************************************//**
Adjust the desired page cleaner thread sleep time for LRU flushes. */
MY_ATTRIBUTE((nonnull))
@@ -2616,8 +2639,9 @@ page_cleaner_adapt_lru_sleep_time(
ulint lru_n_flushed) /*!< in: number of flushed in previous batch */

{
ulint free_len = buf_get_total_free_list_length();
ulint max_free_len = srv_LRU_scan_depth * srv_buf_pool_instances;
ulint free_len = buf_get_total_free_list_length();
ulint max_free_len = ut_min(buf_get_total_LRU_list_length(),
srv_LRU_scan_depth * srv_buf_pool_instances);

if (free_len < max_free_len / 100 && lru_n_flushed) {

@@ -2629,7 +2653,7 @@ page_cleaner_adapt_lru_sleep_time(

/* Free lists filled more than 20%
or no pages flushed in previous batch, sleep a bit more */
*lru_sleep_time += 50;
*lru_sleep_time += 1;
if (*lru_sleep_time > srv_cleaner_max_lru_time)
*lru_sleep_time = srv_cleaner_max_lru_time;
} else if (free_len < max_free_len / 20 && *lru_sleep_time >= 50) {
@@ -2676,6 +2700,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)(
/*!< in: a dummy parameter required by
os_thread_create */
{
my_thread_init();
ulint next_loop_time = ut_time_ms() + 1000;
ulint n_flushed = 0;
ulint last_activity = srv_get_activity_count();
@@ -2812,6 +2837,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)(
thread_exit:
buf_page_cleaner_is_active = FALSE;

my_thread_end();
/* We count the number of threads in os_thread_exit(). A created
thread should always use that to exit and not use return() to exit. */
os_thread_exit(NULL);
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -464,7 +464,10 @@ dict_boot(void)

dberr_t err = DB_SUCCESS;

if (srv_read_only_mode && !ibuf_is_empty()) {
/** If innodb_force_recovery is set to 6 then allow
the server to start even though ibuf is not empty. */
if (srv_force_recovery != SRV_FORCE_NO_LOG_REDO
&& srv_read_only_mode && !ibuf_is_empty()) {

ib_logf(IB_LOG_LEVEL_ERROR,
"Change buffer must be empty when --innodb-read-only "
@@ -835,16 +835,24 @@ dict_index_get_nth_col_or_prefix_pos(
/*=================================*/
const dict_index_t* index, /*!< in: index */
ulint n, /*!< in: column number */
ibool inc_prefix) /*!< in: TRUE=consider
ibool inc_prefix, /*!< in: TRUE=consider
column prefixes too */
ulint* prefix_col_pos) /*!< out: col num if prefix */
{
const dict_field_t* field;
const dict_col_t* col;
ulint pos;
ulint n_fields;
ulint prefixed_pos_dummy;

ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad((inc_prefix && !prefix_col_pos) || (!inc_prefix));

if (!prefix_col_pos) {
prefix_col_pos = &prefixed_pos_dummy;
}
*prefix_col_pos = ULINT_UNDEFINED;

col = dict_table_get_nth_col(index->table, n);

@@ -858,10 +866,11 @@ dict_index_get_nth_col_or_prefix_pos(
for (pos = 0; pos < n_fields; pos++) {
field = dict_index_get_nth_field(index, pos);

if (col == field->col
&& (inc_prefix || field->prefix_len == 0)) {

return(pos);
if (col == field->col) {
*prefix_col_pos = pos;
if (inc_prefix || field->prefix_len == 0) {
return(pos);
}
}
}

@@ -1005,7 +1014,7 @@ dict_table_get_nth_col_pos(
ulint n) /*!< in: column number */
{
return(dict_index_get_nth_col_pos(dict_table_get_first_index(table),
n));
n, NULL));
}

/********************************************************************//**
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 2009, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, 2017, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -690,6 +690,9 @@ dict_stats_copy(
&& (src_idx = dict_table_get_next_index(src_idx)))) {

if (dict_stats_should_ignore_index(dst_idx)) {
if (!(dst_idx->type & DICT_FTS)) {
dict_stats_empty_index(dst_idx);
}
continue;
}

@@ -1096,10 +1099,10 @@ dict_stats_analyze_index_level(
leaf-level delete marks because delete marks on
non-leaf level do not make sense. */

if (level == 0 && srv_stats_include_delete_marked? 0:
if (level == 0 && (srv_stats_include_delete_marked ? 0:
rec_get_deleted_flag(
rec,
page_is_comp(btr_pcur_get_page(&pcur)))) {
page_is_comp(btr_pcur_get_page(&pcur))))) {

if (rec_is_last_on_page
&& !prev_rec_is_copied
@@ -3229,12 +3232,6 @@ dict_stats_update(

dict_table_stats_lock(table, RW_X_LATCH);

/* Initialize all stats to dummy values before
copying because dict_stats_table_clone_create() does
skip corrupted indexes so our dummy object 't' may
have less indexes than the real object 'table'. */
dict_stats_empty_table(table);

dict_stats_copy(table, t);

dict_stats_assert_initialized(table);
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, 2017, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -334,6 +334,7 @@ DECLARE_THREAD(dict_stats_thread)(
void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
required by os_thread_create */
{
my_thread_init();
ut_a(!srv_read_only_mode);

srv_dict_stats_thread_active = TRUE;
@@ -359,6 +360,7 @@ DECLARE_THREAD(dict_stats_thread)(

srv_dict_stats_thread_active = FALSE;

my_thread_end();
/* We count the number of threads in os_thread_exit(). A created
thread should always use that to exit instead of return(). */
os_thread_exit(NULL);

0 comments on commit 360a4a0

Please sign in to comment.