mtr is not committed if detect corruption in btr_estimate_number_of_different_key_vals

Bug #1426610 reported by zhai weixiang on 2015-02-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to
Fix Released
Krunal Bauskar
Fix Released
Krunal Bauskar
Fix Released
Krunal Bauskar

Bug Description

Version : percona-server-5.6.22-71.0

Check the function btr_estimate_number_of_different_key_vals:

4118 for (i = 0; i < n_sample_pages; i++) {
4119 mtr_start(&mtr);
4121 btr_cur_open_at_rnd_pos(index, BTR_SEARCH_LEAF, &cursor, &mtr);
4123 /* Count the number of different key values for each prefix of
4124 the key on this index page. If the prefix does not determine
4125 the index record uniquely in the B-tree, then we subtract one
4126 because otherwise our algorithm would give a wrong estimate
4127 for an index where there is just one key value. */
4129 page = btr_cur_get_page(&cursor);
4131 SRV_CORRUPT_TABLE_CHECK(page, goto exit_loop;);

If found a corrupted page, it will goto exit_loop, and the mtr is not committed.

tags: added: xtradb
Sveta Smirnova (svetasmirnova) wrote :

Thank you for the report.

Verified as described using source code analysis.

Changed in percona-server:
status: New → Confirmed

While fixing, an error-injecting testcase should be added

tags: added: low-hanging-fruit
Krunal Bauskar (krunal-bauskar) wrote :

    - Bug#1426610: mtr is not committed if detect corruption in

      Starting 5.5 percona server has an option to define what happens if server
      encounters a corrupted page. (Assert/Warn/Salvage)
      (Configurable through innodb_corrupt_table_action)

      If user has configured server to Warn/Salvage then loop to estimate stats
      make a safe exit if it encounters a corrupt page.
      This safe exit path failed to close (commit) and open (started)
      mtr which would then lead to an issue while closing transaction.

PR#148 - 5.5
PR#150 - 5.6

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