# tool for checking data consistency for PXC

**URL:** <https://forums.percona.com/t/tool-for-checking-data-consistency-for-pxc/7794>\
**Category:** Other MySQL® Questions\
**Created:** [July 21, 2020, 5:08am UTC](https://forums.percona.com/t/tool-for-checking-data-consistency-for-pxc/7794 "2020-07-21T05:08:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![split-brain](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/split-brain/32/65_2.png) [@split-brain](https://forums.percona.com/u/split-brain)\
**Post date:** [July 21, 2020, 5:08am UTC](https://forums.percona.com/t/tool-for-checking-data-consistency-for-pxc/7794/1 "2020-07-21T05:08:21Z")

</div>

Hi there!I’m looking for some tool, which will be helpful for testing write data consistency in case of a node crash.The scenario: 3 node PXC cluster governed by proxysql configured for r/w split with a backup writer node. The tool would feed the proxysql with data and in case of simulated crash of the writer node, proxysql will then redirect the connection to the new writer. Tool would then check, if the dataset was correctly written to the cluster.Is there some tool, that can be used for this?  
Many thanks

---

<div class="post-metadata">

**Author:** ![DGB](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dgb/32/79_2.png) [@DGB](https://forums.percona.com/u/DGB)\
**Post date:** [July 23, 2020, 9:42am UTC](https://forums.percona.com/t/tool-for-checking-data-consistency-for-pxc/7794/2 "2020-07-23T09:42:45Z")

</div>

Hi, by design PXC guarantees data consistency, if properly used and configured with safes like pxc\_strict\_mode enabled. Now, pt-table-checksum can be used for check data consistency (see:&nbsp;[https://www.percona.com/doc/percona-toolkit/LATEST/pt-table-checksum.html#percona-xtradb-cluster](https://www.percona.com/doc/percona-toolkit/LATEST/pt-table-checksum.html#percona-xtradb-cluster "Link: https://www.percona.com/doc/percona-toolkit/LATEST/pt-table-checksum.html#percona-xtradb-cluster")&nbsp;)  
More on data consistency for PXC:&nbsp;[https://github.com/nethalo/pxc-break-fix-lab/blob/master/docs/Data\_Consistency.md](https://github.com/nethalo/pxc-break-fix-lab/blob/master/docs/Data_Consistency.md "Link: https://github.com/nethalo/pxc-break-fix-lab/blob/master/docs/Data\_Consistency.md")

---

<div class="post-metadata">

**Author:** ![split-brain](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/split-brain/32/65_2.png) [@split-brain](https://forums.percona.com/u/split-brain)\
**Post date:** [July 24, 2020, 7:42am UTC](https://forums.percona.com/t/tool-for-checking-data-consistency-for-pxc/7794/3 "2020-07-24T07:42:47Z")

</div>

Hi DGB, thanks for reply!I’m sorry I should have formulated the question better. My concern here isn’t to compare data among nodes for differences, but rather to test what happens, when the writer node dies during the different stages of&nbsp; processing the query. Also I would like to set up proxysql to be able to gracefully reroute the client connection to backup writer node. I need to know how to properly handle db calls in case of dropped connection, timeouts etc. I’m using sysbench, but would rather use some other tool that will allow me to see which queries were successful and some error codes in cases, where for some reason they failed.

---

<div class="post-metadata">

**Author:** ![DGB](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dgb/32/79_2.png) [@DGB](https://forums.percona.com/u/DGB)\
**Post date:** [July 24, 2020, 8:33am UTC](https://forums.percona.com/t/tool-for-checking-data-consistency-for-pxc/7794/4 "2020-07-24T08:33:02Z")

</div>

At the end, everything is classic InnoDB so it works the same regardless of Galera or not been used.&nbsp;  
Now, to setup ProxySQL along with PXC here’s a handy tutorial on how to do it:&nbsp;[https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/proxysql.html](https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/proxysql.html "Link: https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/proxysql.html")

---

<div class="post-metadata">

**Author:** ![split-brain](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/split-brain/32/65_2.png) [@split-brain](https://forums.percona.com/u/split-brain)\
**Post date:** [July 27, 2020, 6:57am UTC](https://forums.percona.com/t/tool-for-checking-data-consistency-for-pxc/7794/5 "2020-07-27T06:57:36Z")

</div>

I have followed this tutorial as well as many others, regarding the integration of PXC with ProxySQL. Still I’m failing to prove, that proxysql is capable of handling the client connection in case of backend node failure. Everytime I do grateful shutdown, mark node as ‘OFFLINE\_SOFT’ or kill the mysqld process, I sysbench get disconnected with error 1213, or 2013.   
I’m stuck at the point, where I can’t deploy PXC + proxysql, because its dropping connections in case of node failure.

---

<div class="post-metadata">

**Author:** ![Guru](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@Guru](https://forums.percona.com/u/Guru)\
**Post date:** [August 7, 2020, 3:41am UTC](https://forums.percona.com/t/tool-for-checking-data-consistency-for-pxc/7794/6 "2020-08-07T03:41:18Z")

</div>

maybe you have to setup the user accounts on ProxySQL? PXC + proxysql need the same User with the same Passwords!

---

<div class="post-metadata">

**Author:** ![split-brain](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/split-brain/32/65_2.png) [@split-brain](https://forums.percona.com/u/split-brain)\
**Post date:** [August 10, 2020, 6:12am UTC](https://forums.percona.com/t/tool-for-checking-data-consistency-for-pxc/7794/7 "2020-08-10T06:12:57Z")

</div>

Hi Yoda,yes I have the same user/password in mysql as well as in proxysql.
