Commit cbbca7ed authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-25483: Shutdown crash during innodb.innodb_buffer_pool_resize_temporary

buf_resize_callback(): Correct an invalid assertion, and enable
the assertion in debug builds only.

Between buf_resize_start() and buf_resize_shutdown(),
srv_shutdown_state must be less than SRV_SHUTDOWN_CLEANUP.

The incorrect assertion had been introduced in
commit 5e62b6a5 (MDEV-16264).
As a result, the server could crash if shutdown was initiated
concurrently with initiating a change of innodb_buffer_pool_size.
parent 9abc6fd7
...@@ -2322,7 +2322,7 @@ inline void buf_pool_t::resize() ...@@ -2322,7 +2322,7 @@ inline void buf_pool_t::resize()
static void buf_resize_callback(void *) static void buf_resize_callback(void *)
{ {
DBUG_ENTER("buf_resize_callback"); DBUG_ENTER("buf_resize_callback");
ut_a(srv_shutdown_state == SRV_SHUTDOWN_NONE); ut_ad(srv_shutdown_state < SRV_SHUTDOWN_CLEANUP);
mysql_mutex_lock(&buf_pool.mutex); mysql_mutex_lock(&buf_pool.mutex);
const auto size= srv_buf_pool_size; const auto size= srv_buf_pool_size;
const bool work= srv_buf_pool_old_size != size; const bool work= srv_buf_pool_old_size != size;
......
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