Suboptimal srv_pass_corrupt_table checks

Bug #1125248 reported by Alexey Kopytov on 2013-02-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to
Fix Released
Laurynas Biveinis
Won't Fix
Fix Released
Alexey Kopytov
Fix Released
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) {

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

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.

Percona now uses JIRA for bug reports so this bug report is migrated to:

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

Other bug subscribers