Suboptimal srv_pass_corrupt_table checks

Bug #1125248 reported by Alexey Kopytov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Laurynas Biveinis
5.1
Won't Fix
Undecided
Unassigned
5.5
Fix Released
Medium
Alexey Kopytov
5.6
Fix Released
Medium
Laurynas Biveinis

Bug Description

srv_pass_corrupt_table is checked in many places in the code, sometimes on critical paths. In most cases the check looks like this:

 block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH,
         index, mtr);

 if (srv_pass_corrupt_table && !block) {
  return(0);
 }
 ut_a(block);

3 problems for the common (i.e. non- corrupted case):

- it is more efficient to first check for the 'block' value, since it is already in a register, and then the value of srv_pass_corrupt_table does not have to be loaded
- no branch prediction info for the compiler
- if srv_pass_corrupt_table is enabled, but block is not zero, it's value is checked twice.

Related branches

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

So it happens that corrupt table action feature was merged to 5.6, in unfinished state, probably by mistake.
In any case we have to track this bug for 5.6 too, in order no to lose it.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1316

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.