Percona Server with XtraDB

Suboptimal srv_pass_corrupt_table checks

Reported by Alexey Kopytov on 2013-02-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server
Status tracked in 5.6
5.1
Undecided
Unassigned
5.5
Medium
Alexey Kopytov
5.6
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.

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.

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

Other bug subscribers