# Error while waiting for replica lag: Use of uninitialized value in string eq at /usr/bin/pt-online-schema-change line 4357

**URL:** <https://forums.percona.com/t/error-while-waiting-for-replica-lag-use-of-uninitialized-value-in-string-eq-at-usr-bin-pt-online-schema-change-line-4357/27586>\
**Category:** Percona XtraDB Cluster\
**Created:** [January 4, 2024, 9:17am UTC](https://forums.percona.com/t/error-while-waiting-for-replica-lag-use-of-uninitialized-value-in-string-eq-at-usr-bin-pt-online-schema-change-line-4357/27586 "2024-01-04T09:17:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Modestas\_Mockus](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/modestas_mockus/32/9024_2.png) [@Modestas\_Mockus](https://forums.percona.com/u/Modestas_Mockus)\
**Post date:** [January 4, 2024, 9:17am UTC](https://forums.percona.com/t/error-while-waiting-for-replica-lag-use-of-uninitialized-value-in-string-eq-at-usr-bin-pt-online-schema-change-line-4357/27586/1 "2024-01-04T09:17:41Z")

</div>

I started replica host. Now my pt-online-schema-change ends with error:

```auto
pt-online-schema-change -u dev-mm --ask-pass --alter "drop index risk_rules_groups_id" D=isac_is_core,t=test --max-load=threads_running:4 --max-lag=10 --statistic --execute 
Enter MySQL password:
Found 1 slaves:
ip-10-0-23-220 -> 10.0.23.220:socket
Will check slave lag on:
ip-10-0-23-220 -> 10.0.23.220:socket

# A software update is available:
Operation, tries, wait:
  analyze_table, 10, 1
  copy_rows, 10, 0.25
  create_triggers, 10, 1
  drop_triggers, 10, 1
  swap_tables, 10, 1
  update_foreign_keys, 10, 1
Altering `isac_is_core`.`test`...
Creating new table...
Created new table isac_is_core._test_new OK.
Altering new table...
Altered `isac_is_core`.`_test_new` OK.
2024-01-04T08:58:32 Creating triggers...
2024-01-04T08:58:32 Created triggers OK.
2024-01-04T08:58:32 Copying approximately 1 rows...
Error while waiting for replica lag: Use of uninitialized value in string eq at /usr/bin/pt-online-schema-change line 4339.
2024-01-04T08:58:32 Dropping triggers...
2024-01-04T08:58:32 Dropped triggers OK.
2024-01-04T08:58:32 Dropping new table...
2024-01-04T08:58:33 Dropped new table OK.
# Event Count
# ====== =====
# INSERT 1
`isac_is_core`.`test` was not altered.
        (in cleanup) Use of uninitialized value in string eq at /usr/bin/pt-online-schema-change line 4339.

```

pt-online-schema-change ends succesfully only if i add --recursion-method=none

```auto
Enter MySQL password:
No slaves found. See --recursion-method if host pre-7-db-7 has slaves.
Not checking slave lag because no slaves were found and --check-slave-lag was not specified.
...

```

I updated tools the eror just cange error line:

```auto
apt update && apt list --upgradable 
percona-toolkit/stable 3.5.7-1.bullseye amd64 [upgradable from: 3.5.5-1.bullseye]
apt-get install --only-upgrade percona-toolkit

pt-online-schema-change -u dev-mm --ask-pass --alter "drop index risk_rules_groups_id" D=isac_is_core,t=test --max-load=threads_running:4 --max-lag=10 --statistic --execute 
...
Error while waiting for replica lag: Use of uninitialized value in string eq at /usr/bin/pt-online-schema-change line 4357.
...

```

What setup i am missing?  
Maybe related to this connection through socket?  
10.0.23.220:socket

---

<div class="post-metadata">

**Author:** ![Denis\_Subbota](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/denis_subbota/32/23607_2.png) [@Denis\_Subbota](https://forums.percona.com/u/Denis_Subbota)\
**Post date:** [January 4, 2024, 12:56pm UTC](https://forums.percona.com/t/error-while-waiting-for-replica-lag-use-of-uninitialized-value-in-string-eq-at-usr-bin-pt-online-schema-change-line-4357/27586/2 "2024-01-04T12:56:11Z")

</div>

Hello [Modestas\_Mockus](https://forums.percona.com/u/Modestas_Mockus),  
In case if you want to use pt-online-schema-change with monitoring slave lag, you need first is to create a table percona.dsns:

```auto
create database percona;
use percona; 
CREATE TABLE `dsns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `parent_id` int(11) DEFAULT NULL,
  `dsn` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
);

```

add replica connection information into the table

```auto
insert into percona.dsns values (1,NULL,"h=<ip-of-replica>");

```

and add to the pt-online-schema-change command flag `--recursion-method=dsn=h=<ip-of-primary>,D=percona,t=dsns`

Regards,  
Denis Subbota.  
Managed Services, Percona.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 4, 2024, 4:33pm UTC](https://forums.percona.com/t/error-while-waiting-for-replica-lag-use-of-uninitialized-value-in-string-eq-at-usr-bin-pt-online-schema-change-line-4357/27586/3 "2024-01-04T16:33:52Z")

</div>

@Modestas_Mockus, why do you use pt-osc with DROP INDEX? Dropping an index is a non-blocking, background operation in MySQL. You should not need to use pt-osc to simply drop an index.

---

<div class="post-metadata">

**Author:** ![Modestas\_Mockus](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/modestas_mockus/32/9024_2.png) [@Modestas\_Mockus](https://forums.percona.com/u/Modestas_Mockus)\
**Post date:** [January 5, 2024, 8:05am UTC](https://forums.percona.com/t/error-while-waiting-for-replica-lag-use-of-uninitialized-value-in-string-eq-at-usr-bin-pt-online-schema-change-line-4357/27586/4 "2024-01-05T08:05:18Z")

</div>

Thank you [matthewb](https://forums.percona.com/u/matthewb) for reminding about droping index. I will try drop without percona tool. In this case this is for testing purpose on small test table.
