mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-23268 SIGSEGV on srv_monitor_event if InnoDB is read-only
The srv_monitor_event and the srv_monitor_thread would not be created when InnoDB is in read-only mode. Yet, some code would unconditionally invoke os_event_set(srv_monitor_event).
This commit is contained in:
@@ -26,6 +26,7 @@ a
|
|||||||
1
|
1
|
||||||
UPDATE t SET a=3 WHERE a=1;
|
UPDATE t SET a=3 WHERE a=1;
|
||||||
ERROR HY000: Table 't' is read only
|
ERROR HY000: Table 't' is read only
|
||||||
|
SET GLOBAL innodb_status_output= @@GLOBAL.innodb_status_output;
|
||||||
# Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED.
|
# Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED.
|
||||||
# In earlier versions, this would return the last committed version
|
# In earlier versions, this would return the last committed version
|
||||||
# (empty table)!
|
# (empty table)!
|
||||||
|
@@ -53,6 +53,7 @@ SELECT * FROM t;
|
|||||||
UPDATE t SET a=3 WHERE a=1;
|
UPDATE t SET a=3 WHERE a=1;
|
||||||
--let $restart_parameters= --innodb-read-only
|
--let $restart_parameters= --innodb-read-only
|
||||||
--source include/restart_mysqld.inc
|
--source include/restart_mysqld.inc
|
||||||
|
SET GLOBAL innodb_status_output= @@GLOBAL.innodb_status_output;
|
||||||
--echo # Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED.
|
--echo # Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED.
|
||||||
--echo # In earlier versions, this would return the last committed version
|
--echo # In earlier versions, this would return the last committed version
|
||||||
--echo # (empty table)!
|
--echo # (empty table)!
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2017, 2019, MariaDB Corporation.
|
Copyright (c) 2017, 2020, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
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
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -981,7 +981,7 @@ buf_LRU_check_size_of_non_data_objects(
|
|||||||
+ UT_LIST_GET_LEN(buf_pool->LRU))
|
+ UT_LIST_GET_LEN(buf_pool->LRU))
|
||||||
< buf_pool->curr_size / 3) {
|
< buf_pool->curr_size / 3) {
|
||||||
|
|
||||||
if (!buf_lru_switched_on_innodb_mon) {
|
if (!buf_lru_switched_on_innodb_mon && srv_monitor_event) {
|
||||||
|
|
||||||
/* Over 67 % of the buffer pool is occupied by lock
|
/* Over 67 % of the buffer pool is occupied by lock
|
||||||
heaps or the adaptive hash index. This may be a memory
|
heaps or the adaptive hash index. This may be a memory
|
||||||
|
@@ -18481,11 +18481,14 @@ void
|
|||||||
innodb_status_output_update(THD*,st_mysql_sys_var*,void*var,const void*save)
|
innodb_status_output_update(THD*,st_mysql_sys_var*,void*var,const void*save)
|
||||||
{
|
{
|
||||||
*static_cast<my_bool*>(var)= *static_cast<const my_bool*>(save);
|
*static_cast<my_bool*>(var)= *static_cast<const my_bool*>(save);
|
||||||
|
if (srv_monitor_event)
|
||||||
|
{
|
||||||
mysql_mutex_unlock(&LOCK_global_system_variables);
|
mysql_mutex_unlock(&LOCK_global_system_variables);
|
||||||
/* Wakeup server monitor thread. */
|
/* Wakeup server monitor thread. */
|
||||||
os_event_set(srv_monitor_event);
|
os_event_set(srv_monitor_event);
|
||||||
mysql_mutex_lock(&LOCK_global_system_variables);
|
mysql_mutex_lock(&LOCK_global_system_variables);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Update the system variable innodb_encryption_threads.
|
/** Update the system variable innodb_encryption_threads.
|
||||||
@param[in] save to-be-assigned value */
|
@param[in] save to-be-assigned value */
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2008, Google Inc.
|
Copyright (c) 2008, Google Inc.
|
||||||
Copyright (c) 2013, 2019, MariaDB Corporation.
|
Copyright (c) 2013, 2020, MariaDB Corporation.
|
||||||
|
|
||||||
Portions of this file contain modifications contributed and copyrighted by
|
Portions of this file contain modifications contributed and copyrighted by
|
||||||
Google, Inc. Those modifications are gratefully acknowledged and are described
|
Google, Inc. Those modifications are gratefully acknowledged and are described
|
||||||
@@ -1077,7 +1077,7 @@ sync_array_print_long_waits(
|
|||||||
sync_array_exit(arr);
|
sync_array_exit(arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noticed) {
|
if (noticed && srv_monitor_event) {
|
||||||
ibool old_val;
|
ibool old_val;
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2017, 2019, MariaDB Corporation.
|
Copyright (c) 2017, 2020, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
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
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -1049,7 +1049,7 @@ buf_LRU_check_size_of_non_data_objects(
|
|||||||
+ UT_LIST_GET_LEN(buf_pool->LRU))
|
+ UT_LIST_GET_LEN(buf_pool->LRU))
|
||||||
< buf_pool->curr_size / 3) {
|
< buf_pool->curr_size / 3) {
|
||||||
|
|
||||||
if (!buf_lru_switched_on_innodb_mon) {
|
if (!buf_lru_switched_on_innodb_mon && srv_monitor_event) {
|
||||||
|
|
||||||
/* Over 67 % of the buffer pool is occupied by lock
|
/* Over 67 % of the buffer pool is occupied by lock
|
||||||
heaps or the adaptive hash index. This may be a memory
|
heaps or the adaptive hash index. This may be a memory
|
||||||
|
@@ -19458,11 +19458,14 @@ void
|
|||||||
innodb_status_output_update(THD*,st_mysql_sys_var*,void*var,const void*save)
|
innodb_status_output_update(THD*,st_mysql_sys_var*,void*var,const void*save)
|
||||||
{
|
{
|
||||||
*static_cast<my_bool*>(var)= *static_cast<const my_bool*>(save);
|
*static_cast<my_bool*>(var)= *static_cast<const my_bool*>(save);
|
||||||
|
if (srv_monitor_event)
|
||||||
|
{
|
||||||
mysql_mutex_unlock(&LOCK_global_system_variables);
|
mysql_mutex_unlock(&LOCK_global_system_variables);
|
||||||
/* Wakeup server monitor thread. */
|
/* Wakeup server monitor thread. */
|
||||||
os_event_set(srv_monitor_event);
|
os_event_set(srv_monitor_event);
|
||||||
mysql_mutex_lock(&LOCK_global_system_variables);
|
mysql_mutex_lock(&LOCK_global_system_variables);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Update the system variable innodb_encryption_threads.
|
/** Update the system variable innodb_encryption_threads.
|
||||||
@param[in] save to-be-assigned value */
|
@param[in] save to-be-assigned value */
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2008, Google Inc.
|
Copyright (c) 2008, Google Inc.
|
||||||
Copyright (c) 2013, 2019, MariaDB Corporation.
|
Copyright (c) 2013, 2020, MariaDB Corporation.
|
||||||
|
|
||||||
Portions of this file contain modifications contributed and copyrighted by
|
Portions of this file contain modifications contributed and copyrighted by
|
||||||
Google, Inc. Those modifications are gratefully acknowledged and are described
|
Google, Inc. Those modifications are gratefully acknowledged and are described
|
||||||
@@ -1164,7 +1164,7 @@ sync_array_print_long_waits(
|
|||||||
sync_array_exit(arr);
|
sync_array_exit(arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noticed) {
|
if (noticed && srv_monitor_event) {
|
||||||
ibool old_val;
|
ibool old_val;
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
Reference in New Issue
Block a user