pt-table-sync to detect galera nodes
I noticed pt-table-sync is not able to detect galera nodes. To illustrate this problem, I intentionally unsync one node in three node Percona XtraDB Cluster to see how it works to sync node with data drift but it fails. See below.
root@node1:~# pt-table-sync --dry-run h=localhost,
# NOTE: --dry-run does not show if data needs to be synced because it
# does not access, compare or sync data. --dry-run only shows
# the work that would be done.
# Syncing D=test,
# DELETE REPLACE INSERT UPDATE ALGORITHM START END EXIT DATABASE.TABLE
# 0 0 0 0 Chunk 03:22:40 03:22:40 0 test.dummy
In dry-run it shows 0 for DELETE/REPLACE and so on.
root@node1:~# pt-table-sync --print h=localhost,
INSERT INTO `test`.
UPDATE `test`.`dummy` SET `name`='d' WHERE `id`='4' LIMIT 1 /*percona-toolkit src_db:test src_tbl:dummy src_dsn:
pt-table-sync --print option prints actual INSERT/UPDATE statements instead REPLACE. I thought it's because pt-table-sync fails to detect PXC nodes.
root@node1:~# pt-table-sync --print --replace h=localhost,
REPLACE INTO `test`.
REPLACE INTO `test`.
As soon as I use --replace with --print option it prints REPLACE statements.
root@node1:~# pt-table-sync --execute h=localhost,
Again, If i use --execute it will execute actual INSERT/UPDATE statements instead REPLACE and crashes already synchronized nodes with "Duplicate Key error" To workaround this problem, I have to use --execute along --replace option to execute REPLACE statements so those are "no-op" changes for already synchronized nodes as it will be for master in replication environment. However, --execute along --replace option also prints below warning/error but actually synchronizes the differences.
root@node1:~# pt-table-sync --execute --replace h=localhost,
DBD::mysql::db commit failed: Deadlock found when trying to get lock; try restarting transaction at /usr/bin/
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle test;host=
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- Muhammad Irfan
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by