Bug #79166 When the buffer pool is being loaded from disk, do not dump it on shutdown
Submitted: 7 Nov 2015 15:12
Reporter: Jaime Crespo (OCA) Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:5.7,8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: buffer pool

[7 Nov 2015 15:12] Jaime Crespo
Description:
Wishlist:

When the buffer pool is being loaded from disk (Innodb_buffer_pool_load_status being in progress), do not dump the buffer pool list to disk unless forced manually.
I am a happy user of buffer pool automatic dumping and loading:

innodb_buffer_pool_dump_at_shutdown = ON
innodb_buffer_pool_load_at_startup  = ON

However, I suffer a common issue on my workflow: I restart a server twice in a short period of time (maybe I have to revert a bad non-dynamic configuration change, maybe I have to tune the performance_schem static allocation- maybe the start failed).

If the previous variables are on, after the first restart, mysql starts populating the buffer pool correctly, but if I shutdown it shortly after, it gets rewriten with a non-complete list.

How to repeat:
* Have the buffer pool full with:
innodb_buffer_pool_dump_at_shutdown = ON
innodb_buffer_pool_load_at_startup  = ON
* Restart mysql
* Restart mysql again shortly after
* Buffer pool is almost empty- Expected: the buffer pool will be loading up to full again

Suggested fix:
Of course I can fix this myself in several ways- I can dump manually the BP, I can use a different name every time, I can backup it up. 

I think by default most people will want the older, but full list of pages rather than a partial, newer dump. So I am proposing to disable dump at shutdown when it is being loaded or, alternatively, have 3 modes: 0 = never dump, 1= always dump, 2=dump when not being loaded and default to this last value. It could sent a warning to the error log "not dumping the buffer pool because a load was still in progress".

There are other options, like have 2 copies automatically rotating, or not dump if the list on file is larger, but those are more complex.
[18 Jun 2016 21:34] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0