# Pt-table-sync tool not working

**URL:** <https://forums.percona.com/t/pt-table-sync-tool-not-working/3557>\
**Category:** Percona Toolkit\
**Created:** [June 19, 2014, 2:18am UTC](https://forums.percona.com/t/pt-table-sync-tool-not-working/3557 "2014-06-19T02:18:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![krishmysqldba](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@krishmysqldba](https://forums.percona.com/u/krishmysqldba)\
**Post date:** [June 19, 2014, 2:18am UTC](https://forums.percona.com/t/pt-table-sync-tool-not-working/3557/1 "2014-06-19T02:18:49Z")

</div>

Hi Team,

I have setup pt-table-checksum and pt-table-sync for fixing the data issues between master and slaves.  
when i ran pt-table-checksum i found few tables were not sink with the master tables,then i fired pt-table-sync it’s applied some inserts into that particular table.

Then in the next pt-table-checksum run i’m able to see the old table which had updated by the pt-table-sync(this shouldn’t come right ?). what is reason of this ?

Below are the commands i’m using.

pt-table-checksum -u xxxx -pxxxx --replicate-check --databases db --replicate percona.checksum P=3306,h=Master IP

Output :

db tbl total\_rows chunks  
db tb11 60 1  
db tbl3 38 1

Then i fired pt-table-sync,

pt-table-sync h=Master IP,P=3306,D=“db”,t=“tbl1”,u=“xxxxx”,p=“xxxxx” h=Slave IP,P=3306 --print --no-check-trigger --no-foreign-key-checks --no-check-slave

Output : this fired few inserts on “tbl1” table

Then i fired pt-table-checksum again, but i could see the old output which i had seen before the pt-table-sync

pt-table-checksum -u xxxx -pxxxx --replicate-check --databases db --replicate percona.checksum P=3372,h=Master IP

Output :

db tbl total\_rows chunks  
db tb11 60 1  
db tbl3 38 1

Please provide the solution of this ASAP.

Thanks,  
Krish

---

<div class="post-metadata">

**Author:** ![psong](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/psong/32/16894_2.png) [@psong](https://forums.percona.com/u/psong)\
**Post date:** [July 6, 2014, 5:05am UTC](https://forums.percona.com/t/pt-table-sync-tool-not-working/3557/2 "2014-07-06T05:05:53Z")

</div>

Krish,

The output from pt-table-checksum should look like below:

```auto

TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
10-20T08:36:50 0 0 200 1 0 0.005 db1.tbl1
10-20T08:36:50 0 0 603 7 0 0.035 db1.tbl2

```

The ERRORS and DIFFS columns are the ones to check for problems. What are these values from your check?

Also the sync command you used,

pt-table-sync h=Master IP,P=3306,D=“db”,t=“tbl1”,u=“xxxxx”,p=“xxxxx” h=Slave IP,P=3306 --print --no-check-trigger --no-foreign-key-checks --no-check-slave

would make changes directly on specified. If you have other slaves, they would not be touched and if they are out-of-sync with the master, then when you run pt-table-checksum again, the diff would remain.

The recommended way to sync master and all slaves is to use --replicate, e.g.

pt-table-sync --print --replicate=percona.checksum --database=db --tables=tbl1 h=,p=3306,u=user,p=passwd

Does tbl1 have no primary key nor unique key? Is that why you choose --no-check-slave?
