Skip to content

Commit

Permalink
Fix CMAKE_BUILD_TYPE=Debug
Browse files Browse the repository at this point in the history
Remove unused variables and type mismatch that was introduced
in commit b393e2c

Also, fix a typo in the documentation of the parameter, and
update the test.
  • Loading branch information
dr-m committed Oct 11, 2019
1 parent 350e46a commit 1fd1ef2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 25 deletions.
12 changes: 12 additions & 0 deletions mysql-test/suite/sys_vars/r/sysvars_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,18 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_DEBUG_SYNC
SESSION_VALUE NULL
DEFAULT_VALUE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT debug_sync for innodb purge threads. Use it to set up sync points for all purge threads at once. The commands will be applied sequentially at the beginning of purging the next undo record.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_DEFAULT_ENCRYPTION_KEY_ID
SESSION_VALUE 1
DEFAULT_VALUE 1
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21015,9 +21015,9 @@ char *innobase_debug_sync;
static MYSQL_SYSVAR_STR(debug_sync, innobase_debug_sync,
PLUGIN_VAR_NOCMDARG,
"debug_sync for innodb purge threads. "
"Use it t oset up sync points for all purge threads "
"Use it to set up sync points for all purge threads "
"at once. The commands will be applied sequentially at "
"the beginning of purging the next node ",
"the beginning of purging the next undo record.",
NULL,
innobase_debug_sync_set, NULL);
#endif /* UNIV_DEBUG */
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/include/que0que.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ struct que_thr_t{
row_prebuilt_t* prebuilt; /*!< prebuilt structure processed by
the query thread */

ut_d(srv_slot_t *thread_slot;) /*!< a slot from srv_sys.sys_threads
* if any */
/** a slot of srv_sys.sys_threads, for DEBUG_SYNC in purge thread */
ut_d(srv_slot_t* thread_slot;)
};

#define QUE_THR_MAGIC_N 8476583
Expand Down
3 changes: 0 additions & 3 deletions storage/innobase/que/que0que.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1082,9 +1082,6 @@ que_run_threads_low(
ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS);
ut_ad(!trx_mutex_own(thr_get_trx(thr)));

/* slot can be received from purge thread for debug_sync setup */
ut_d(srv_slot_t *slot = thr->thread_slot);

/* cumul_resource counts how much resources the OS thread (NOT the
query thread) has spent in this function */

Expand Down
34 changes: 16 additions & 18 deletions storage/innobase/srv/srv0srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3047,33 +3047,31 @@ srv_was_tablespace_truncated(const fil_space_t* space)
}

#ifdef UNIV_DEBUG
static uint get_first_slot(srv_thread_type type)
static ulint get_first_slot(srv_thread_type type)
{
switch (type) {
case SRV_MASTER:
return SRV_MASTER_SLOT;
case SRV_PURGE:
return SRV_PURGE_SLOT;
case SRV_WORKER:
/* Find an empty slot, skip the master and purge slots. */
return SRV_WORKER_SLOTS_START;
default:
ut_error;
case SRV_MASTER:
return SRV_MASTER_SLOT;
case SRV_PURGE:
return SRV_PURGE_SLOT;
case SRV_WORKER:
/* Find an empty slot, skip the master and purge slots. */
return SRV_WORKER_SLOTS_START;
default:
ut_error;
}
}

void srv_for_each_thread(srv_thread_type type,
srv_slot_callback_t callback,
const void *arg)
{
int slot_idx= get_first_slot(type);
while(slot_idx < srv_sys.n_sys_threads
&& srv_sys.sys_threads[slot_idx].in_use
&& srv_sys.sys_threads[slot_idx].type == type)
{
srv_slot_t *slot= &srv_sys.sys_threads[slot_idx];
callback(slot, arg);
slot_idx++;
for (ulint slot_idx= get_first_slot(type);
slot_idx < srv_sys.n_sys_threads
&& srv_sys.sys_threads[slot_idx].in_use
&& srv_sys.sys_threads[slot_idx].type == type;
slot_idx++) {
callback(&srv_sys.sys_threads[slot_idx], arg);
}
}
#endif

0 comments on commit 1fd1ef2

Please sign in to comment.