Merge 10.5 into 10.6

This commit is contained in:
Marko Mäkelä 2021-09-07 10:37:36 +03:00
commit 40ae9c5d10
3 changed files with 21 additions and 7 deletions

View file

@ -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");

View file

@ -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) {

View file

@ -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.