Description:
When I used MySQL shell 8.4.1 LTS and MySQL 8.4.1 LTS to build an innodb cluster, I found that the memory of the machines in the cluster was growing slowly. When I used the following command to check, I found an exception.
select USER,HOST,EVENT_NAME,COUNT_ALLOC,COUNT_FREE,CURRENT_COUNT_USED,SUM_NUMBER_OF_BYTES_ALLOC,SUM_NUMBER_OF_BYTES_FREE,CURRENT_NUMBER_OF_BYTES_USED from performance_schema.memory_summary_by_account_by_event_name order by CURRENT_NUMBER_OF_BYTES_USED desc limit 10;
I found that memory/group_rpl/Gcs_message_data:: m_buffer allocated memory keeps growing and never releases it. I tried to change the memory manager, but it didn't work.
How to repeat:
If you need to reproduce this situation, I hope you can do it under the following conditions.
1. Use Docker to pull the Ubuntu: 22.04 image and download MySQL Community Server 8.4.1 LTS Linux - Generic (glibc 2.28) (x86, 64 bit) and the corresponding version of MySQL shell for replication
2. Use apt serach to search for and install the missing lib file.
3. The configuration required to enable the innodb cluster in the configuration file, such as: enabling GTID, bin log, etc
4. Give the root user the permission to log in to other IPs, and the permission required to set up the Innodb cluster
5. Enter the MySQL shell and connect to the main database to build innodb. The communication stack mode is both MySQL and XCOM, without redundant configuration
6. Connect to other databases and configure to join the cluster
Note: The problem occurs in three nodes, single master mode, and clone mode. Please deploy no less than three nodes when replicating
Suggested fix:
The only way I can find is to build a new database and cluster and import data, and switch the memory manager to inhibit the growth of the rest of the memory, but this is difficult to achieve in practical applications.
In order to prevent the server from crashing, it is recommended to limit the memory of the Docker used to build MySQL.