Commit 9f9eb682 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-10098 main.create_delayed fails with ps-protocol: assertion...

MDEV-10098 main.create_delayed fails with ps-protocol: assertion `global_status_var.global_memory_used >= 0' failed

Remove the assert. We cannot verify that
global_memory_used value is valid (>=0)
because some of updates are cached in individual THD's
(e.g. THD1 can have +300 cached, while the other THD2
can have -300 cached. If the second THD exists before
the first one, global_memory_used will be -300
temporarily).

Instead add the assert just before the exit, when all
THDs been already destroyed.
parent e65703c6
......@@ -2141,6 +2141,7 @@ static void mysqld_exit(int exit_code)
shutdown_performance_schema(); // we do it as late as possible
#endif
set_malloc_size_cb(NULL);
DBUG_ASSERT(global_status_var.global_memory_used == 0);
cleanup_tls();
DBUG_LEAVE;
if (opt_endinfo && global_status_var.global_memory_used)
......@@ -4109,14 +4110,6 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific)
else
{
update_global_memory_status(size);
#ifndef EMBEDDED_LIBRARY
/*
Check if we have missed some mallocs. THis can't be done for embedded
server as the main code may have done calls to malloc before starting
the embedded library.
*/
DBUG_ASSERT(global_status_var.global_memory_used >= 0);
#endif
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment