Skip to content

Commit

Permalink
Merge 10.5 into 10.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Sep 7, 2021
2 parents cacd8f5 + eb2f2c1 commit 40ae9c5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
16 changes: 9 additions & 7 deletions sql/signal_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,18 @@ extern "C" sig_handler handle_fatal_signal(int sig)

if (dflt_key_cache && thread_scheduler)
{
size_t used_mem=
(dflt_key_cache->key_cache_mem_size +
(global_system_variables.read_buff_size +
(size_t) global_system_variables.sortbuff_size) *
(thread_scheduler->max_threads + extra_max_connections) +
(max_connections + extra_max_connections) * sizeof(THD)) / 1024;

my_safe_printf_stderr("It is possible that mysqld could use up to \n"
"key_buffer_size + "
"(read_buffer_size + sort_buffer_size)*max_threads = "
"%zu K bytes of memory\n",
(dflt_key_cache->key_cache_mem_size +
(global_system_variables.read_buff_size +
(size_t)global_system_variables.sortbuff_size) *
(thread_scheduler->max_threads + extra_max_connections) +
(max_connections + extra_max_connections) *
sizeof(THD)) / 1024);
"%zu K bytes of memory\n", used_mem);

my_safe_printf_stderr("%s",
"Hope that's ok; if not, decrease some variables in "
"the equation.\n\n");
Expand Down
4 changes: 4 additions & 0 deletions storage/innobase/buf/buf0dump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,10 @@ buf_load()

ut_free(dump);

if (i == dump_n) {
os_aio_wait_until_no_pending_reads();
}

ut_sprintf_timestamp(now);

if (i == dump_n) {
Expand Down
8 changes: 8 additions & 0 deletions storage/innobase/os/os0file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3817,7 +3817,15 @@ void os_aio_wait_until_no_pending_writes()
/** Wait until all pending asynchronous reads have completed. */
void os_aio_wait_until_no_pending_reads()
{
const auto notify_wait= read_slots->pending_io_count();

if (notify_wait)
tpool::tpool_wait_begin();

read_slots->wait();

if (notify_wait)
tpool::tpool_wait_end();
}

/** Request a read or write.
Expand Down

0 comments on commit 40ae9c5

Please sign in to comment.