# pt-table-checksum complains replica is stopped when replica is not.

**URL:** <https://forums.percona.com/t/pt-table-checksum-complains-replica-is-stopped-when-replica-is-not/5631>\
**Category:** Percona Toolkit\
**Created:** [May 22, 2017, 11:30pm UTC](https://forums.percona.com/t/pt-table-checksum-complains-replica-is-stopped-when-replica-is-not/5631 "2017-05-22T23:30:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzc](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jzc](https://forums.percona.com/u/jzc)\
**Post date:** [May 22, 2017, 11:30pm UTC](https://forums.percona.com/t/pt-table-checksum-complains-replica-is-stopped-when-replica-is-not/5631/1 "2017-05-22T23:30:55Z")

</div>

Hiya,

I’m having some problems with pt-table-checksum where its reporting that the replica server is stopped when actually the replica server is running as far as I can tell.

The following is the version of toolkit being used

[root@master]# rpm -qa | grep percona-toolkit

percona-toolkit-3.0.2-1.el7.x86\_64

[root@master]# pt-table-checksum --version

pt-table-checksum 3.0.2

MariaDB version for both master and slave

[root@master]# rpm -qa | grep -i MariaDB-server

MariaDB-server-10.2.5-1.el7.centos.x86\_64

The following is the config file for the tool on the master:

[root@master]# cat /etc/percona-toolkit/pt-table-checksum.conf

binary-index

no-check-binlog-format

recursion-method = processlist

replicate = percona.epa\_sum

#replicate-check = TRUE

#replicate-check-only = TRUE

user = slave1

password = \<slave1\_password\>

host = 127.0.0.1

ignore-databases = mysql,information\_schema,performance\_schema

databases = epa

engines = InnoDB

tables = Persons

The following is from the master server when executing the pt-table-checksum tool:

[root@master ~]# pt-table-checksum

Replica zasperdump.androgogic.local is stopped. Waiting.

Replica zasperdump.androgogic.local is stopped. Waiting.

Replica zasperdump.androgogic.local is stopped. Waiting.

Replica zasperdump.androgogic.local is stopped. Waiting.

Replica zasperdump.androgogic.local is stopped. Waiting.

:

^C# Caught SIGINT.

TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE

05-23T13:40:33 0 1 2 1 0 278.173 epa.Persons

The “Replica zasperdump.androgogic.local is stopped. Waiting.” server repeats itself indefinitely until I break the process.

The following is the slave status for the master instance where the pt-table-checksum program was executed.

MariaDB [(none)]\> show slave ‘master2’ status\G;

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

Slave\_IO\_State: Waiting for master to send event

Master\_Host: 192.168.82.23

Master\_User: slave1

Master\_Port: 3306

Connect\_Retry: 10

Master\_Log\_File: master2-bin.000010

Read\_Master\_Log\_Pos: 3235061

Relay\_Log\_File: mariadb-relay-bin-master2.000002

Relay\_Log\_Pos: 2359544

Relay\_Master\_Log\_File: master2-bin.000010

Slave\_IO\_Running: Yes

Slave\_SQL\_Running: Yes

Replicate\_Do\_DB: epa,percona

Replicate\_Ignore\_DB:

Replicate\_Do\_Table:

Replicate\_Ignore\_Table:

Replicate\_Wild\_Do\_Table: epa.%,percona.%

Replicate\_Wild\_Ignore\_Table:

Last\_Errno: 0

Last\_Error:

Skip\_Counter: 0

Exec\_Master\_Log\_Pos: 3235061

Relay\_Log\_Space: 2359863

Until\_Condition: None

Until\_Log\_File:

Until\_Log\_Pos: 0

Master\_SSL\_Allowed: No

Master\_SSL\_CA\_File:

Master\_SSL\_CA\_Path:

Master\_SSL\_Cert:

Master\_SSL\_Cipher:

Master\_SSL\_Key:

Seconds\_Behind\_Master: 0

Master\_SSL\_Verify\_Server\_Cert: No

Last\_IO\_Errno: 0

Last\_IO\_Error:

Last\_SQL\_Errno: 0

Last\_SQL\_Error:

Replicate\_Ignore\_Server\_Ids:

Master\_Server\_Id: 2

Master\_SSL\_Crl:

Master\_SSL\_Crlpath:

Using\_Gtid: Current\_Pos

Gtid\_IO\_Pos: 101-1-7772,0-1-7,102-2-20215,30-3-7953

Replicate\_Do\_Domain\_Ids: 102

Replicate\_Ignore\_Domain\_Ids:

Parallel\_Mode: conservative

SQL\_Delay: 0

SQL\_Remaining\_Delay: NULL

Slave\_SQL\_Running\_State: Slave has read all relay log; waiting for the slave I/O thread to update it

1 row in set (0.00 sec)

As it may be obvious, the master is a test instance with no traffic on it and from what I’m able to discern there is no apparent lag on the slave as well.

From the master server:

MariaDB [(none)]\> show master status;

±-------------------±---------±-------------±-----------------+

| File | Position | Binlog\_Do\_DB | Binlog\_Ignore\_DB |

±-------------------±---------±-------------±-----------------+

| master2-bin.000010 | 3235061 | | |

±-------------------±---------±-------------±-----------------+

1 row in set (0.00 sec)

MariaDB [(none)]\> select binlog\_gtid\_pos(‘master2-bin.000010’,3235061);

±----------------------------------------------+

| binlog\_gtid\_pos(‘master2-bin.000010’,3235061) |

±----------------------------------------------+

| 102-2-20215 |

±----------------------------------------------+

1 row in set (0.00 sec)

The Gtid\_IO\_Pos seems to be perfectly matched on both the master and the slave.

After a bit of digging into the /bin/pt-table-checksum code I found the below code where I think it was failing at:

my @lagged\_slaves = map { {cxn=\>$\_, lag=\>undef} } @$slaves;

while ( $oktorun-\>() && @lagged\_slaves ) {

PTDEBUG && \_d(‘Checking slave lag’);

for my $i ( 0…$#lagged\_slaves ) {

my $lag = $get\_lag-\>($lagged\_slaves[$i]-\>{cxn});

PTDEBUG && \_d($lagged\_slaves[$i]-\>{cxn}-\>name(),

‘slave lag:’, $lag);

if ( !defined $lag || $lag \> $max\_lag ) {

$lagged\_slaves[$i]-\>{lag} = $lag;

}

else {

delete $lagged\_slaves[$i];

}

}

If I changed the first line from

my @lagged\_slaves = map { {cxn=\>$\_, lag=\>undef} } @$slaves;

to

my @lagged\_slaves = ();

the program immediately works and returns the expected results.

I’m not sure how the program is determining the slave lag but I suspect its missing something and hence throwing the “Replica zasperdump.androgogic.local is stopped. Waiting.”

Any assistance you can provide to get pt-table-checksum to work properly on my setup without the code hack is deeply appreciated.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![adityakamana](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@adityakamana](https://forums.percona.com/u/adityakamana)\
**Post date:** [September 27, 2017, 8:47am UTC](https://forums.percona.com/t/pt-table-checksum-complains-replica-is-stopped-when-replica-is-not/5631/2 "2017-09-27T08:47:06Z")

</div>

Hi,

I am running into the same issue. Have you found the fix for this yet.

Thanks.
