Merge lp:~percona-core/percona-xtradb-cluster/bug1315588 into lp:percona-xtradb-cluster

Proposed by Raghavendra D Prabhu
Status: Merged
Approved by: Raghavendra D Prabhu
Approved revision: 776
Merge reported by: Raghavendra D Prabhu
Merged at revision: not available
Proposed branch: lp:~percona-core/percona-xtradb-cluster/bug1315588
Merge into: lp:percona-xtradb-cluster
Diff against target: 37 lines (+13/-7)
1 file modified
sql/mysqld.cc (+13/-7)
To merge this branch: bzr merge lp:~percona-core/percona-xtradb-cluster/bug1315588
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+222076@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sql/mysqld.cc'
2--- sql/mysqld.cc 2014-05-21 13:34:23 +0000
3+++ sql/mysqld.cc 2014-06-04 16:47:42 +0000
4@@ -2807,9 +2807,19 @@
5
6 void dec_connection_count(THD *thd)
7 {
8- mysql_mutex_lock(&LOCK_connection_count);
9- (*thd->scheduler->connection_count)--;
10- mysql_mutex_unlock(&LOCK_connection_count);
11+#ifdef WITH_WSREP
12+ /*
13+ Do not decrement when its wsrep system thread. wsrep_applier is set for
14+ applier as well as rollbacker threads.
15+ */
16+ if (!thd->wsrep_applier)
17+#endif /* WITH_WSREP */
18+ {
19+ DBUG_ASSERT(*thd->scheduler->connection_count > 0);
20+ mysql_mutex_lock(&LOCK_connection_count);
21+ (*thd->scheduler->connection_count)--;
22+ mysql_mutex_unlock(&LOCK_connection_count);
23+ }
24 }
25
26
27@@ -5507,10 +5517,6 @@
28 thd->set_time();
29 thd->init_for_queries();
30
31- mysql_mutex_lock(&LOCK_connection_count);
32- ++connection_count;
33- mysql_mutex_unlock(&LOCK_connection_count);
34-
35 processor(thd);
36
37 close_connection(thd, 0, 1);

Subscribers

People subscribed via source and target branches

to all changes: