pt-online-schema-change usage between master and slave mysql server


I have Master and slave setup with version: 5.5.56-MariaDB MariaDB Server

I need to add index for “create_time” column. I am planning to alter using pt-osc running such command in Master server

Do I need to add anymore options for slave?
Will slave get replicated instantly?

Please advise…


There are some safeguards in pt-online-schema-change tool to avoid incurring huge slave lags. You can use either of these options:
type: time; default: 1s

Pause the data copy until all replicas lag is less than this value. After each data-copy query (each chunk), the tool looks at the replication lag of all replicas to which it connects, using Seconds_Behind_Master.–max-lag

type: string

Pause the data copy until this replica’s lag is less than --max-lag.–check-slave-lag

The data copy process is performed in small chunks of data and these queries are replicated to slave(s) instantly.