Bug #107952 there is no need to core dump the memory that temptable engine mmap from disk
Submitted: 23 Jul 2022 8:31 Modified: 26 Jul 2022 11:49
Reporter: zhang yingqiang (OCA) Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: Memory storage engine Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[23 Jul 2022 8:31] zhang yingqiang
Description:
When we use TempTable as the internal_tmp_mem_storage_engine, the temptable engine may allocate a very large amount of memory (1TB for example) from the disk by using the mmap way. If the core dump happened at that time, there will be a very large core file. This will cause the core dump process to become very slow, and make the disk full.

How to repeat:
coredump when using temptable engine

Suggested fix:
add a variable to let user ignore the temptable memory in coredump, just like the variable innodb_buffer_pool_in_core_file
[26 Jul 2022 11:49] MySQL Verification Team
Hi Mr. yingglang,

Thank you for your feature request.

However, we do not find it feasible to implement a feature like that one. Simply, InnoDB's buffer pool is allocated at once, so there is only one item of that type. Next, it is fully under control of our server.

On the other hand, you can have thousands of temporary tables in memory, plus if they are using mmap, then a part of that memory is not our under control, but under the control of the operating system.

In a way, your report is a duplicate of several of our internal bug reports, that are not accessible to the public. When fixed, those changes will reduce significantly the usage of memory by in-memory temporary tables. This, in itself, would reduce the size of the core files.

We hope that we have been clear enough.