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

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
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
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.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'storage/innobase/srv/srv0start.c'
2--- storage/innobase/srv/srv0start.c 2014-03-27 15:42:21 +0000
3+++ storage/innobase/srv/srv0start.c 2015-01-07 07:55:37 +0000
4@@ -122,9 +122,16 @@
5 static os_file_t files[1000];
6
7 /** io_handler_thread parameters for thread identification */
8-static ulint n[SRV_MAX_N_IO_THREADS + 8];
9-/** io_handler_thread identifiers */
10-static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 8];
11+static ulint n[SRV_MAX_N_IO_THREADS];
12+/** io_handler_thread identifiers. The extra elements at the end are allocated
13+as follows:
14+SRV_MAX_N_IO_THREADS + 1: srv_master_thread
15+SRV_MAX_N_IO_THREADS + 2: srv_lock_timeout_thread
16+SRV_MAX_N_IO_THREADS + 3: srv_error_monitor_thread
17+SRV_MAX_N_IO_THREADS + 4: srv_monitor_thread
18+SRV_MAX_N_IO_THREADS + 5: srv_LRU_dump_restore_thread
19+SRV_MAX_N_IO_THREADS + 6: srv_redo_log_follow_thread */
20+static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 7];
21
22 /** We use this mutex to test the return value of pthread_mutex_trylock
23 on successful locking. HP-UX does NOT return 0, though Linux et al do. */
24@@ -1184,7 +1191,7 @@
25 /* Create the thread that follows the redo log to output the
26 changed page bitmap */
27 os_thread_create(&srv_redo_log_follow_thread, NULL,
28- thread_ids + 5 + SRV_MAX_N_IO_THREADS);
29+ thread_ids + 6 + SRV_MAX_N_IO_THREADS);
30 }
31 }
32

Subscribers

People subscribed via source and target branches