Skip to content

Commit

Permalink
MDEV-8268: InnoDB: Assertion failure in file buf0buf.cc line 5842 fai…
Browse files Browse the repository at this point in the history
…ling assertion ut_a(free_slot != NULL);

Analysis: Problem is that there is not enough temporary buffer slots
for pending IO requests.

Fixed by allocating same amount of temporary buffer slots as there
are max pending IO requests.
  • Loading branch information
Jan Lindström committed Jun 9, 2015
1 parent d7f3d88 commit 4a6a61c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions storage/innobase/buf/buf0buf.cc
Expand Up @@ -63,10 +63,6 @@ Created 11/5/1995 Heikki Tuuri
#include "lzo/lzo1x.h"
#endif

/* Number of temporary slots used for encryption/compression
memory allocation before/after I/O operations */
#define BUF_MAX_TMP_SLOTS 200

/*
IMPLEMENTATION OF THE BUFFER POOL
=================================
Expand Down Expand Up @@ -1368,8 +1364,9 @@ buf_pool_init_instance(

/* Initialize the temporal memory array and slots */
buf_pool->tmp_arr = (buf_tmp_array_t *)mem_zalloc(sizeof(buf_tmp_array_t));
buf_pool->tmp_arr->n_slots = BUF_MAX_TMP_SLOTS;
buf_pool->tmp_arr->slots = (buf_tmp_buffer_t*)mem_zalloc(sizeof(buf_tmp_buffer_t) * BUF_MAX_TMP_SLOTS);
ulint n_slots = srv_n_read_io_threads * srv_n_write_io_threads * (8 * OS_AIO_N_PENDING_IOS_PER_THREAD);
buf_pool->tmp_arr->n_slots = n_slots;
buf_pool->tmp_arr->slots = (buf_tmp_buffer_t*)mem_zalloc(sizeof(buf_tmp_buffer_t) * n_slots);

buf_pool_mutex_exit(buf_pool);

Expand Down
9 changes: 3 additions & 6 deletions storage/xtradb/buf/buf0buf.cc
Expand Up @@ -99,10 +99,6 @@ _increment_page_get_statistics(buf_block_t* block, trx_t* trx)
#include "lzo/lzo1x.h"
#endif

/* Number of temporary slots used for encryption/compression
memory allocation before/after I/O operations */
#define BUF_MAX_TMP_SLOTS 200

/*
IMPLEMENTATION OF THE BUFFER POOL
=================================
Expand Down Expand Up @@ -1444,8 +1440,9 @@ buf_pool_init_instance(

/* Initialize the temporal memory array and slots */
buf_pool->tmp_arr = (buf_tmp_array_t *)mem_zalloc(sizeof(buf_tmp_array_t));
buf_pool->tmp_arr->n_slots = BUF_MAX_TMP_SLOTS;
buf_pool->tmp_arr->slots = (buf_tmp_buffer_t*)mem_zalloc(sizeof(buf_tmp_buffer_t) * BUF_MAX_TMP_SLOTS);
ulint n_slots = srv_n_read_io_threads * srv_n_write_io_threads * (8 * OS_AIO_N_PENDING_IOS_PER_THREAD);
buf_pool->tmp_arr->n_slots = n_slots;
buf_pool->tmp_arr->slots = (buf_tmp_buffer_t*)mem_zalloc(sizeof(buf_tmp_buffer_t) * n_slots);

buf_pool->try_LRU_scan = TRUE;

Expand Down

0 comments on commit 4a6a61c

Please sign in to comment.