LP #1428549: pt-table-sync: unneeded replication of temporary tables

Description

**Reported in Launchpad by Daniel Black last update 10-03-2015 23:14:22

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) ) "

Environment

None

Smart Checklist

Activity

Show:

Lalit Choudhary March 8, 2019 at 2:25 PM

Hi Daniel,

Thank you for the report.

There are many changes and improvement implemented from PT version 2.2 to 3.0.13.

Please upgrade to the latest version of Percona software and test with it. In case if you are still able to reproduce the issue, please, update the report with the repeatable test case.

lpjirasync January 24, 2018 at 8:34 PM

**Comment from Launchpad by: Daniel Black on: 10-03-2015 23:14:22

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

lpjirasync January 24, 2018 at 8:34 PM

**Comment from Launchpad by: Daniel Black on: 10-03-2015 23:12:40

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

lpjirasync January 24, 2018 at 8:34 PM

**Comment from Launchpad by: Daniel Black on: 10-03-2015 04:42:32

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.

Cannot Reproduce

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 8:33 PM
Updated March 4, 2024 at 4:45 PM
Resolved March 8, 2019 at 2:25 PM

Flag notifications