Bug #105398 Updating performance_schema succeeded but did not take effect
Submitted: 1 Nov 2021 13:44 Modified: 1 Nov 2021 14:16
Reporter: yi qian Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:8.0.25 OS:Any
Assigned to: CPU Architecture:Any
Tags: performance_schema

[1 Nov 2021 13:44] yi qian
Description:
I want to turn off some monitoring items of performance_schema, so I want to update table performance_schema.setup_instruments. The execution result shows success, but when I look at the data of table, I found that it has not been modified.

How to repeat:
Take table memory_summary_by_thread_by_event_name as an example:

1.View original status:
mysql> select * from performance_schema.setup_instruments where name like "%memory_summary_by_thread_by_event_name%"\G
*************************** 1. row ***************************
         NAME: memory/performance_schema/memory_summary_by_thread_by_event_name
      ENABLED: YES
        TIMED: NULL
   PROPERTIES: global_statistics
   VOLATILITY: 1
DOCUMENTATION: Memory used for table performance_schema.memory_summary_by_thread_by_event_name
1 row in set (0.01 sec)

2.Update the data:
mysql> update performance_schema.setup_instruments set ENABLED = 'NO' where NAME = 'memory/performance_schema/memory_summary_by_thread_by_event_name';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

3.View results:
mysql> select * from performance_schema.setup_instruments where name like "%memory_summary_by_thread_by_event_name%"\G
*************************** 1. row ***************************
         NAME: memory/performance_schema/memory_summary_by_thread_by_event_name
      ENABLED: YES
        TIMED: NULL
   PROPERTIES: global_statistics
   VOLATILITY: 1
DOCUMENTATION: Memory used for table performance_schema.memory_summary_by_thread_by_event_name
1 row in set (0.02 sec)

As we can see, although the results show that the implementation is successful, the data has not changed in fact.
[1 Nov 2021 14:16] MySQL Verification Team
Hi Mr. qian,

Thank you for your bug report.

However, this is not a bug.

You have to use special commands to enable or disable special conditions, events, alarms etc .... This is all described in our Reference Manual, chapter 27. Take a look especially in sub-chapters 27.4 and 27.12. Do note, that some instruments have to be enabled on the startup, which is also described in the mentioned chapter.

Hence, we do recommend you to read the entire chapter.

Not a bug.