mtr is not committed if detect corruption in btr_estimate_number_of_different_key_vals

Bug #1426610 reported by zhai weixiang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
High
Krunal Bauskar
5.1
Invalid
Undecided
Unassigned
5.5
Fix Released
High
Krunal Bauskar
5.6
Fix Released
High
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);
4120
4121 btr_cur_open_at_rnd_pos(index, BTR_SEARCH_LEAF, &cursor, &mtr);
4122
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. */
4128
4129 page = btr_cur_get_page(&cursor);
4130
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
Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

Thank you for the report.

Verified as described using source code analysis.

Changed in percona-server:
status: New → Confirmed
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

While fixing, an error-injecting testcase should be added

tags: added: low-hanging-fruit
Revision history for this message
Krunal Bauskar (krunal-bauskar) wrote :

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

      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

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-875

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.