Skip to content

Commit 360a4a0

Browse files
committed
5.6.36-82.0
1 parent 8d69ce7 commit 360a4a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1419
-459
lines changed

storage/xtradb/btr/btr0sea.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ btr_search_sys_create(
199199
&btr_search_latch_arr[i], SYNC_SEARCH_SYS);
200200

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

204204
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
205205
btr_search_sys->hash_tables[i]->adaptive = TRUE;

storage/xtradb/buf/buf0buf.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ buf_pool_init_instance(
14131413
ut_a(srv_n_page_hash_locks != 0);
14141414
ut_a(srv_n_page_hash_locks <= MAX_PAGE_HASH_LOCKS);
14151415

1416-
buf_pool->page_hash = ha_create(2 * buf_pool->curr_size,
1416+
buf_pool->page_hash = ib_create(2 * buf_pool->curr_size,
14171417
srv_n_page_hash_locks,
14181418
MEM_HEAP_FOR_PAGE_HASH,
14191419
SYNC_BUF_PAGE_HASH);

storage/xtradb/buf/buf0dblwr.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
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. */
355355
void
356356
buf_dblwr_init_or_load_pages(
357357
/*=========================*/
358-
os_file_tfile,
358+
pfs_os_file_tfile,
359359
char* path,
360360
boolload_corrupt_pages)
361361
{

storage/xtradb/buf/buf0dump.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -597,6 +597,7 @@ DECLARE_THREAD(buf_dump_thread)(
597597
void* arg MY_ATTRIBUTE((unused)))/*!< in: a dummy parameter
598598
required by os_thread_create */
599599
{
600+
my_thread_init();
600601
ut_ad(!srv_read_only_mode);
601602

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

633634
srv_buf_dump_thread_active = FALSE;
634635

636+
my_thread_end();
635637
/* We count the number of threads in os_thread_exit(). A created
636638
thread should always use that to exit and not use return() to exit. */
637639
os_thread_exit(NULL);

storage/xtradb/buf/buf0flu.cc

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -356,6 +356,7 @@ buf_flush_insert_into_flush_list(
356356
buf_block_t* block,/*!< in/out: block which is modified */
357357
lsn_tlsn)/*!< in: oldest modification */
358358
{
359+
ut_ad(srv_shutdown_state != SRV_SHUTDOWN_FLUSH_PHASE);
359360
ut_ad(log_flush_order_mutex_own());
360361
ut_ad(mutex_own(&block->mutex));
361362

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

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

726728
buf_pool->n_flush[flush_type]--;
729+
ut_ad(buf_pool->n_flush[flush_type] != ULINT_MAX);
727730

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

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

10651069
mutex_exit(&buf_pool->flush_state_mutex);
10661070

@@ -2206,13 +2210,14 @@ Clears up tail of the LRU lists:
22062210
* Flush dirty pages at the tail of LRU to the disk
22072211
The depth to which we scan each buffer pool is controlled by dynamic
22082212
config parameter innodb_LRU_scan_depth.
2209-
@return number of pages flushed */
2213+
@return number of flushed and evicted pages */
22102214
UNIV_INTERN
22112215
ulint
22122216
buf_flush_LRU_tail(void)
22132217
/*====================*/
22142218
{
22152219
ulint total_flushed = 0;
2220+
ulint total_evicted = 0;
22162221
ulint start_time = ut_time_ms();
22172222
ulint scan_depth[MAX_BUFFER_POOLS];
22182223
ulint requested_pages[MAX_BUFFER_POOLS];
@@ -2278,6 +2283,7 @@ buf_flush_LRU_tail(void)
22782283
limited_scan[i]
22792284
= (previous_evicted[i] > n.evicted);
22802285
previous_evicted[i] = n.evicted;
2286+
total_evicted += n.evicted;
22812287

22822288
requested_pages[i] += lru_chunk_size;
22832289

@@ -2310,7 +2316,7 @@ buf_flush_LRU_tail(void)
23102316
MONITOR_LRU_BATCH_PAGES,
23112317
total_flushed);
23122318
}
2313-
return(total_flushed);
2319+
return(total_flushed + total_evicted);
23142320
}
23152321

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

2613+
/** Returns the aggregate LRU list length over all buffer pool instances.
2614+
@return total LRU list length. */
2615+
MY_ATTRIBUTE((warn_unused_result))
2616+
static
2617+
ulint
2618+
buf_get_total_LRU_list_length(void)
2619+
{
2620+
ulint result = 0;
2621+
2622+
for (ulint i = 0; i < srv_buf_pool_instances; i++) {
2623+
2624+
result += UT_LIST_GET_LEN(buf_pool_from_array(i)->LRU);
2625+
}
2626+
2627+
return result;
2628+
}
2629+
26072630
/*********************************************************************//**
26082631
Adjust the desired page cleaner thread sleep time for LRU flushes. */
26092632
MY_ATTRIBUTE((nonnull))
@@ -2616,8 +2639,9 @@ page_cleaner_adapt_lru_sleep_time(
26162639
ulint lru_n_flushed) /*!< in: number of flushed in previous batch */
26172640

26182641
{
2619-
ulint free_len = buf_get_total_free_list_length();
2620-
ulint max_free_len = srv_LRU_scan_depth * srv_buf_pool_instances;
2642+
ulint free_len = buf_get_total_free_list_length();
2643+
ulint max_free_len = ut_min(buf_get_total_LRU_list_length(),
2644+
srv_LRU_scan_depth * srv_buf_pool_instances);
26212645

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

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

26302654
/* Free lists filled more than 20%
26312655
or no pages flushed in previous batch, sleep a bit more */
2632-
*lru_sleep_time += 50;
2656+
*lru_sleep_time += 1;
26332657
if (*lru_sleep_time > srv_cleaner_max_lru_time)
26342658
*lru_sleep_time = srv_cleaner_max_lru_time;
26352659
} else if (free_len < max_free_len / 20 && *lru_sleep_time >= 50) {
@@ -2676,6 +2700,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)(
26762700
/*!< in: a dummy parameter required by
26772701
os_thread_create */
26782702
{
2703+
my_thread_init();
26792704
ulint next_loop_time = ut_time_ms() + 1000;
26802705
ulint n_flushed = 0;
26812706
ulint last_activity = srv_get_activity_count();
@@ -2812,6 +2837,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)(
28122837
thread_exit:
28132838
buf_page_cleaner_is_active = FALSE;
28142839

2840+
my_thread_end();
28152841
/* We count the number of threads in os_thread_exit(). A created
28162842
thread should always use that to exit and not use return() to exit. */
28172843
os_thread_exit(NULL);

storage/xtradb/dict/dict0boot.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -464,7 +464,10 @@ dict_boot(void)
464464

465465
dberr_terr = DB_SUCCESS;
466466

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

469472
ib_logf(IB_LOG_LEVEL_ERROR,
470473
"Change buffer must be empty when --innodb-read-only "

storage/xtradb/dict/dict0dict.cc

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -835,16 +835,24 @@ dict_index_get_nth_col_or_prefix_pos(
835835
/*=================================*/
836836
const dict_index_t* index,/*!< in: index */
837837
ulint n,/*!< in: column number */
838-
ibool inc_prefix)/*!< in: TRUE=consider
838+
ibool inc_prefix,/*!< in: TRUE=consider
839839
column prefixes too */
840+
ulint* prefix_col_pos)/*!< out: col num if prefix */
840841
{
841842
const dict_field_t* field;
842843
const dict_col_t* col;
843844
ulint pos;
844845
ulint n_fields;
846+
ulint prefixed_pos_dummy;
845847

846848
ut_ad(index);
847849
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
850+
ut_ad((inc_prefix && !prefix_col_pos) || (!inc_prefix));
851+
852+
if (!prefix_col_pos) {
853+
prefix_col_pos = &prefixed_pos_dummy;
854+
}
855+
*prefix_col_pos = ULINT_UNDEFINED;
848856

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

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

861-
if (col == field->col
862-
&& (inc_prefix || field->prefix_len == 0)) {
863-
864-
return(pos);
869+
if (col == field->col) {
870+
*prefix_col_pos = pos;
871+
if (inc_prefix || field->prefix_len == 0) {
872+
return(pos);
873+
}
865874
}
866875
}
867876

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

10111020
/********************************************************************//**

storage/xtradb/dict/dict0stats.cc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 2009, 2016, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 2009, 2017, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -690,6 +690,9 @@ dict_stats_copy(
690690
&& (src_idx = dict_table_get_next_index(src_idx)))) {
691691

692692
if (dict_stats_should_ignore_index(dst_idx)) {
693+
if (!(dst_idx->type & DICT_FTS)) {
694+
dict_stats_empty_index(dst_idx);
695+
}
693696
continue;
694697
}
695698

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

1099-
if (level == 0 && srv_stats_include_delete_marked? 0:
1102+
if (level == 0 && (srv_stats_include_delete_marked ? 0:
11001103
rec_get_deleted_flag(
11011104
rec,
1102-
page_is_comp(btr_pcur_get_page(&pcur)))) {
1105+
page_is_comp(btr_pcur_get_page(&pcur))))) {
11031106

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

32303233
dict_table_stats_lock(table, RW_X_LATCH);
32313234

3232-
/* Initialize all stats to dummy values before
3233-
copying because dict_stats_table_clone_create() does
3234-
skip corrupted indexes so our dummy object 't' may
3235-
have less indexes than the real object 'table'. */
3236-
dict_stats_empty_table(table);
3237-
32383235
dict_stats_copy(table, t);
32393236

32403237
dict_stats_assert_initialized(table);

storage/xtradb/dict/dict0stats_bg.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 2012, 2017, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -334,6 +334,7 @@ DECLARE_THREAD(dict_stats_thread)(
334334
void* arg MY_ATTRIBUTE((unused)))/*!< in: a dummy parameter
335335
required by os_thread_create */
336336
{
337+
my_thread_init();
337338
ut_a(!srv_read_only_mode);
338339

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

360361
srv_dict_stats_thread_active = FALSE;
361362

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

0 commit comments

Comments
 (0)