Skip to content

Commit

Permalink
MDEV-16469 SET GLOBAL innodb_change_buffering has no effect
Browse files Browse the repository at this point in the history
When type of the settable global variable innodb_change_buffering was
changed from string to ENUM in MDEV-12218, the "shadow" variable ibuf_use
stopped being updated as a result of SET GLOBAL innodb_change_buffering.
Only on InnoDB startup, the parameter innodb_change_buffering would
take effect.

ibuf_use: Remove, and use the global variable innodb_change_buffering.
  • Loading branch information
dr-m committed Jun 12, 2018
1 parent 4461b0f commit b52bb6e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ static char* innobase_disable_monitor_counter;
static char* innobase_reset_monitor_counter;
static char* innobase_reset_all_monitor_counter;

static ulong innodb_change_buffering;
static ulong innodb_flush_method;

/* This variable can be set in the server configure file, specifying
Expand Down Expand Up @@ -3859,7 +3858,6 @@ static int innodb_init_params()
}

DBUG_ASSERT(innodb_change_buffering <= IBUF_USE_ALL);
ibuf_use = ibuf_use_t(innodb_change_buffering);

/* Check that interdependent parameters have sane values. */
if (srv_max_buf_pool_modified_pct < srv_max_dirty_pages_pct_lwm) {
Expand Down
6 changes: 3 additions & 3 deletions storage/innobase/ibuf/ibuf0ibuf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ it uses synchronous aio, it can access any pages, as long as it obeys the
access order rules. */

/** Operations that can currently be buffered. */
ibuf_use_t ibuf_use = IBUF_USE_ALL;
ulong innodb_change_buffering;

#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
/** Flag to control insert buffer debugging. */
Expand Down Expand Up @@ -3695,9 +3695,9 @@ ibuf_insert(
dberr_t err;
ulint entry_size;
ibool no_counter;
/* Read the settable global variable ibuf_use only once in
/* Read the settable global variable only once in
this function, so that we will have a consistent view of it. */
ibuf_use_t use = ibuf_use;
ibuf_use_t use = ibuf_use_t(innodb_change_buffering);
DBUG_ENTER("ibuf_insert");

DBUG_PRINT("ibuf", ("op: %d, space: " UINT32PF ", page_no: " UINT32PF,
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/include/ibuf0ibuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ enum ibuf_use_t {
};

/** Operations that can currently be buffered. */
extern ibuf_use_t ibuf_use;
extern ulong innodb_change_buffering;

/** The insert buffer control structure */
extern ibuf_t* ibuf;
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/include/ibuf0ibuf.ic
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ ibuf_should_try(
a secondary index when we
decide */
{
return(ibuf_use != IBUF_USE_NONE
return(innodb_change_buffering
&& ibuf->max_size != 0
&& !dict_index_is_clust(index)
&& !dict_index_is_spatial(index)
Expand Down

0 comments on commit b52bb6e

Please sign in to comment.