Suboptimal fake changes handling in online ALTER storage engine API

Bug #1204422 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Low
Krunal Bauskar
5.1
Invalid
Undecided
Unassigned
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
Low
Krunal Bauskar

Bug Description

Based on Facebook patch 5.6 port review:

1) prepare_inplace_alter_table_dict() handles fake changes as follows:

 if (UNIV_UNLIKELY(ctx->trx->fake_changes)) {
  trx_rollback_to_savepoint(ctx->trx, NULL);
  trx_free_for_mysql(ctx->trx);
  DBUG_RETURN(HA_ERR_WRONG_COMMAND);
 }

This is dead code, and ut_ad(!ctx->trx->fake_changes) is an adequate replacement. Fake changes have been checked in a previous online ALTER SE API call.

2) Generalizing the above, ha_innobase::check_if_supported_inplace_alter() can return HA_ALTER_INPLACE_NOT_SUPPORTED with reason ER_READ_ONLY_MODE if fake changes supported, and then the rest online ALTER SE API implementations can simply assert no fake changes in the alter trx context.

tags: added: fake-changes xtradb
Revision history for this message
Krunal Bauskar (krunal-bauskar) wrote :

As per the discussion and investigation.

- #1 is dead code as the blocking is done at higher level for inplace ha_innobase::prepare_inplace_alter_table
- #2 is more logical but changes rejecting inplace will put the flow in copy mode giving a weird create table failure message vs "Got error 131 during COMMIT" std message seen from most stmt while operating in fake-change mode. So given this we will retain the existing checks but will get rid of dead code as part of this bug fix.

Revision history for this message
Krunal Bauskar (krunal-bauskar) wrote :

commit 87e5bedc9cd459afed84ee8d99e93d106868d95c
Merge: fd6682d 6044385
Author: Krunal Bauskar <email address hidden>
Date: Mon Sep 21 21:04:20 2015 +0530

    Merge pull request #187 from kbauskar/5.6-ps-bug1204422

    - bug#1204422 : Suboptimal fake changes handling in online ALTER stor…

commit 6044385e3aee2f10196fd27fb92b61ec83e7b494
Author: Krunal Bauskar <email address hidden>
Date: Mon Sep 21 13:32:10 2015 +0530

    - bug#1204422 : Suboptimal fake changes handling in online ALTER storage engine API

      Removal of dead-code.
      ALTER Table is blocked at higher level and so the lower level API doesn't need
      to block it as control is never expected to reach there.
      Replaced the dead-code with DEBUG ASSERT for safe check.

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

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.