• Daniel Black's avatar
    MDEV-27467: innodb to enforce the minimum innodb_buffer_pool_size in SET GLOBAL · 410c4ede
    Daniel Black authored
    .. to be the same as startup.
    
    In resolving MDEV-27461, BUF_LRU_MIN_LEN (256) is the minimum number of
    pages for the innodb buffer pool size. Obviously we need more than just
    flushing pages. Taking the 16k page size and its default minimum, an
    extra 25% is needed on top of the flushing pages to make a workable buffer
    pool.
    
    The minimum innodb_buffer_pool_chunk_size (1M) restricts the minimum
    otherwise we'd have a pool made up of different chunk sizes.
    
    The resulting minimum innodb buffer pool sizes are:
    
    Page Size, Previously minimum (startup), with change.
            4k                            5M           2M
            8k                            5M           3M
           16k                            5M           5M
           32k                           24M          10M
           64k                           24M          20M
    
    With this patch, SET GLOBAL innodb_buffer_pool_size minimums are
    enforced.
    
    The evident minimum system variable size for innodb_buffer_pool_size
    is 2M, however this is only setable if using 4k page size. As
    the order of the page_size and buffer_pool_size aren't fixed, we can't
    hide this change.
    
    Subsequent changes:
    * innodb_buffer_pool_resize_with_chunks.test - raised of pool resize due to new
      minimums. Chunk size also needed increase as the test was for
      pool_size < chunk_size to generate a warning.
    * Removed srv_buf_pool_min_size and replaced use with MYSQL_SYSVAR_NAME(buffer_pool_size).min_val
    * Removed srv_buf_pool_def_size and replaced constant defination in
      MYSQL_SYSVAR_LONGLONG(buffer_pool_size)
    * Reordered ha_innodb to allow for direct use of MYSQL_SYSVAR_NAME(buffer_pool_size).min_val
    * Moved buf_pool_size_align into ha_innodb to access to MYSQL_SYSVAR_NAME(buffer_pool_size).min_val
    * loose-innodb_disable_resize_buffer_pool_debug is needed in the
      innodb.restart.opt test so that under debug mode, resizing of the
      innodb buffer pool can occur.
    410c4ede
restart.result 2.04 KB