From bde7e0ba6e94d576c4563022f38e8d81b1f6d54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 16 Jan 2020 11:40:21 +0200 Subject: MDEV-21500 Server hang when using simulated AIO The write-heavy test innodb_zip.wl6501_scale_1 timed out on 10.2 60d7011c5f6ebda057d3e730c6f67519a1fb7f0c for me. Out of os_aio_n_segments=6, 5 are waiting for an event in os_aio_simulated_handler(). One thread is waiting for a write to complete in buf_dblwr_add_to_batch(), but that would never happen, because nothing is waking up the simulated AIO handler threads. This hang appears to have been introduced in MySQL 5.6.12 in mysql/mysql-server@26cfde776cdf5ce61bd5cc494dfc1df28c76977f. --- storage/innobase/buf/buf0dblwr.cc | 4 +++- storage/xtradb/buf/buf0dblwr.cc | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'storage') diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index 36054dbf9fe..32b4399b41d 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2019, MariaDB Corporation. +Copyright (c) 2013, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -963,6 +963,7 @@ try_again: ib_int64_t sig_count = os_event_reset(buf_dblwr->b_event); mutex_exit(&buf_dblwr->mutex); + os_aio_simulated_wake_handler_threads(); os_event_wait_low(buf_dblwr->b_event, sig_count); goto try_again; } @@ -1096,6 +1097,7 @@ try_again: checkpoint. */ ib_int64_t sig_count = os_event_reset(buf_dblwr->b_event); mutex_exit(&buf_dblwr->mutex); + os_aio_simulated_wake_handler_threads(); os_event_wait_low(buf_dblwr->b_event, sig_count); goto try_again; diff --git a/storage/xtradb/buf/buf0dblwr.cc b/storage/xtradb/buf/buf0dblwr.cc index c3a169d45ef..5df40b5f4e8 100644 --- a/storage/xtradb/buf/buf0dblwr.cc +++ b/storage/xtradb/buf/buf0dblwr.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2019, MariaDB Corporation. +Copyright (c) 2013, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -963,6 +963,7 @@ try_again: ib_int64_t sig_count = os_event_reset(buf_dblwr->b_event); mutex_exit(&buf_dblwr->mutex); + os_aio_simulated_wake_handler_threads(); os_event_wait_low(buf_dblwr->b_event, sig_count); goto try_again; } @@ -1112,6 +1113,7 @@ try_again: checkpoint. */ ib_int64_t sig_count = os_event_reset(buf_dblwr->b_event); mutex_exit(&buf_dblwr->mutex); + os_aio_simulated_wake_handler_threads(); os_event_wait_low(buf_dblwr->b_event, sig_count); goto try_again; -- cgit v1.2.1