Percona Server with XtraDB

Excessive and unneccessary current_thd usage in Percona Server

Reported by Alexey Kopytov on 2013-02-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server
High
Alexey Kopytov
5.1
Undecided
Unassigned
5.5
High
Alexey Kopytov

Bug Description

A call to _current_thd() is expensive, and some Percona patches use
current_thd unnecessarily, sometimes on critical code paths.

For example, benchmarks show that removing the following _current_thd()
call in innobase_commit_low() introduced by
innodb_overwrite_relay_log_info increased sysbench point select
high-concurrency results by about 1k tps:

 if (trx_is_started(trx)) {

  /* Save the current replication position for write to trx sys
  header for undo purposes, see the comment at corresponding call
  at innobase_xa_prepare(). */

  innobase_copy_repl_coords_to_trx(current_thd, trx);

  trx_commit_for_mysql(trx);
 }

The THD pointer is available in trx->mysql_thd, there's no need to use
current_thd there.

A quick inspection of the code shows there are many more unnecessary
current_thd occurrences in our code. Some of them are trivial to fix, while
others may require re-architecting certain features.

Related branches

lp:~akopytov/percona-server/bug1121794
Merged into lp:percona-server/5.5 at revision 451
Stewart Smith (community): Approve on 2013-02-20
Percona Reviewers G2: Pending requested 2013-02-17
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers