Skip to content

Commit

Permalink
Merge pull request percona#3381 from altmannmarcelo/PS-5.7-5642
Browse files Browse the repository at this point in the history
5.7 PS-5642 - page tracker thread won't exist if startup fails
  • Loading branch information
altmannmarcelo authored Nov 5, 2019
2 parents f4940de + 73f08c6 commit b3180d8
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SELECT 1;
1
1
# Asserting that the error was not thrown.
[log_grep.inc] file: pattern: threads created by InnoDB had not exited at shutdown
[log_grep.inc] lines: 0
# restart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--innodb_track_changed_pages=TRUE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# PS-5642 - page tracker thread won't exist if startup fails
#

--source include/have_debug.inc
--source include/not_embedded.inc

SELECT 1;
--source include/shutdown_mysqld.inc
--error 1
--exec $MYSQLD_CMD --innodb_track_changed_pages=TRUE --debug=d,ib_dic_boot_error --log-error=$MYSQLTEST_VARDIR/tmp/percona_changed_page_bmp_shutdown_thread.err

--echo # Asserting that the error was not thrown.
--let log_file_full_path=$MYSQLTEST_VARDIR/tmp/percona_changed_page_bmp_shutdown_thread.err
--let grep_pattern=threads created by InnoDB had not exited at shutdown
--let log_expected_matches=0
--source include/log_grep.inc

--source include/start_mysqld.inc
--remove_file $MYSQLTEST_VARDIR/tmp/percona_changed_page_bmp_shutdown_thread.err
8 changes: 8 additions & 0 deletions storage/innobase/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,12 @@ srv_shutdown_all_bg_threads()
if (srv_n_fil_crypt_threads_started) {
os_event_set(fil_crypt_threads_event);
}

/* Stop srv_redo_log_follow_thread thread */
if (srv_redo_log_thread_started) {
os_event_reset(srv_redo_log_tracked_event);
os_event_set(srv_checkpoint_completed_event);
}
}

if (srv_start_state_is_set(SRV_START_STATE_IO)) {
Expand Down Expand Up @@ -2552,6 +2558,8 @@ innobase_start_or_create_for_mysql(void)
if (err == DB_SUCCESS) {
/* Initialize the change buffer. */
err = dict_boot();
DBUG_EXECUTE_IF("ib_dic_boot_error",
err = DB_ERROR;);
}

if (err != DB_SUCCESS) {
Expand Down

0 comments on commit b3180d8

Please sign in to comment.