pt-table-sync: unneeded replication of temporary tables

Bug #1428549 reported by Daniel Black
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
New
Undecided
Unassigned

Bug Description

When http://bazaar.launchpad.net/~percona-toolkit-dev/percona-toolkit/2.2/view/head:/bin/pt-table-sync#L4013 it creates a temporary table that is replicated. As this create table /insert/drop table are only needed locally they can be run between sql_log_bin=0 ... sql_log_bin={what it was before} to prevent this.

Another micro optimisation is a BTREE PK on the temp table:

"CREATE TEMPORARY TABLE $tmp_db_tbl ($col_def) " ->

"CREATE TEMPORARY TABLE $tmp_db_tbl ($col_def, PRIMARY KEY USING BTREE ($qchunk_col) ) "

Revision history for this message
Daniel Black (daniel-black) wrote :

note set sql_log_bin patch will ignore results if not running as super - #982381

PK patch could have side effects if the column is too big for being a PK.

Revision history for this message
Daniel Black (daniel-black) wrote :

Can't just set sql_log_bin as its in a transaction at that point when running sync

Cannot modify @@session.sql_log_bin inside a transaction at line 4019 while doing drupal_prod.cache_form on 10.24.17.8

Revision history for this message
Daniel Black (daniel-black) wrote :

only a single character is inserted into this temp table so contrain the index size to that.

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/PT-1270

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.