Merge lp:~laurynas-biveinis/percona-server/bug1407941-5.5 into lp:percona-server/5.5

Proposed by Laurynas Biveinis on 2015-01-07
Status: Merged
Approved by: Laurynas Biveinis on 2015-01-07
Approved revision: 723
Merged at revision: 726
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1407941-5.5
Merge into: lp:percona-server/5.5
Diff against target: 31 lines (+11/-4)
1 file modified
storage/innobase/srv/srv0start.c (+11/-4)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1407941-5.5
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve on 2015-01-07
Review via email: mp+245715@code.launchpad.net

Description of the change

Fix bug 1407941 (Thread id lost on srv/srv0start.cc).

The issue is a thread_ids array element index being reused on the call
to os_thread_create for the redo log tracker thread. Fix by allocating
a separate array item correctly. An alternative fix would be simply
passing NULL, but apparently accounting those thread ids is a good
idea on some of the platforms. Add a comment describing the thread_ids
array item allocation. Fix thread_ids and n array sizing.

    http://jenkins.percona.com/job/percona-server-5.5-param/1079/

To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'storage/innobase/srv/srv0start.c'
--- storage/innobase/srv/srv0start.c 2014-03-27 15:42:21 +0000
+++ storage/innobase/srv/srv0start.c 2015-01-07 07:55:37 +0000
@@ -122,9 +122,16 @@
122static os_file_t files[1000];122static os_file_t files[1000];
123123
124/** io_handler_thread parameters for thread identification */124/** io_handler_thread parameters for thread identification */
125static ulint n[SRV_MAX_N_IO_THREADS + 8];125static ulint n[SRV_MAX_N_IO_THREADS];
126/** io_handler_thread identifiers */126/** io_handler_thread identifiers. The extra elements at the end are allocated
127static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 8];127as follows:
128SRV_MAX_N_IO_THREADS + 1: srv_master_thread
129SRV_MAX_N_IO_THREADS + 2: srv_lock_timeout_thread
130SRV_MAX_N_IO_THREADS + 3: srv_error_monitor_thread
131SRV_MAX_N_IO_THREADS + 4: srv_monitor_thread
132SRV_MAX_N_IO_THREADS + 5: srv_LRU_dump_restore_thread
133SRV_MAX_N_IO_THREADS + 6: srv_redo_log_follow_thread */
134static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 7];
128135
129/** We use this mutex to test the return value of pthread_mutex_trylock136/** We use this mutex to test the return value of pthread_mutex_trylock
130 on successful locking. HP-UX does NOT return 0, though Linux et al do. */137 on successful locking. HP-UX does NOT return 0, though Linux et al do. */
@@ -1184,7 +1191,7 @@
1184 /* Create the thread that follows the redo log to output the1191 /* Create the thread that follows the redo log to output the
1185 changed page bitmap */1192 changed page bitmap */
1186 os_thread_create(&srv_redo_log_follow_thread, NULL,1193 os_thread_create(&srv_redo_log_follow_thread, NULL,
1187 thread_ids + 5 + SRV_MAX_N_IO_THREADS);1194 thread_ids + 6 + SRV_MAX_N_IO_THREADS);
1188 }1195 }
1189}1196}
11901197

Subscribers

People subscribed via source and target branches