github / github/gh-ost

Got "Timeout while waiting for events up to lock" and unable to proceed with cutover.

Open
#625 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
13.6k
Forks
1.4k
Avg merge
2h 31m
Merged PRs (30d)
4

Description

Hi,

We running gh-ost to add partitions to a 400Gb table.

We're getting this error:

```
# Migrating `client_prod`.`table`; Ghost table is `client_prod`.`_table_gho`
# Migrating master.datacenter.client.com:3306; inspecting slave.datacenter.client.com:3306; executing on master.datacenter.client.com
# Migration started at Fri Aug 10 04:02:20 -0700 2018
# chunk-size: 1000; max-lag-millis: 10000ms; dml-batch-size: 10; max-load: Threads_running=75; critical-load: Threads_running=1000; nice-ratio: 0.000000
# throttle-additional-flag-file: /tmp/gh-ost.throttle
# postpone-cut-over-flag-file: /tmp/ghost.postpone.flag [set]
# panic-flag-file: /tmp/ghost.panic.flag
# Serving on unix socket: /tmp/gh-ost.client_prod.table.sock
Copy: 20837002/20837002 100.0%; Applied: 6851; Backlog: 0/1000; Time: 71h8m17s(total), 20h54m38s(copy); streamer: master-bin.039663:3282126; State: postponing cut-over; ETA: due
2018-08-13 03:10:38 INFO Grabbing voluntary lock: gh-ost.59512317.lock
2018-08-13 03:10:38 INFO Setting LOCK timeout as 20 seconds
2018-08-13 03:10:38 INFO Looking for magic cut-over table
2018-08-13 03:10:38 INFO Creating magic cut-over table `client_prod`.`_table_del`
2018-08-13 03:10:38 INFO Magic cut-over table created
2018-08-13 03:10:38 INFO Locking `client_prod`.`table`, `client_prod`.`_table_del`
2018-08-13 03:10:38 INFO Tables locked
2018-08-13 03:10:38 INFO Session locking original & magic tables is 59512317
2018-08-13 03:10:38 INFO Writing changelog state: AllEventsUpToLockProcessed:1534155038694450863
2018-08-13 03:10:38 INFO Waiting for events up to lock
Copy: 20837002/20837002 100.0%; Applied: 6851; Backlog: 0/1000; Time: 71h8m20s(total), 20h54m38s(copy); streamer: master-bin.039663:3282126; State: migrating; ETA: due
Copy: 20837002/20837002 100.0%; Applied: 6851; Backlog: 0/1000; Time: 71h8m25s(total), 20h54m38s(copy); streamer: master-bin.039663:3282126; State: migrating; ETA: due
2018-08-13 03:10:48 ERROR Timeout while waiting for events up to lock
2018-08-13 03:10:48 ERROR 2018-08-13 03:10:48 ERROR Timeout while waiting for events up to lock
2018-08-13 03:10:48 INFO Looking for magic cut-over table
2018-08-13 03:10:48 INFO Will now proceed to drop magic table and unlock tables
2018-08-13 03:10:48 INFO Dropping magic cut-over table
2018-08-13 03:10:48 INFO Releasing lock from `client_prod`.`table`, `client_prod`.`_table_del`
2018-08-13 03:10:48 INFO Tables unlocked
2018-08-13 03:10:49 INFO executing gh-ost-on-begin-postponed hook: /root/ghost_hooks/gh-ost-on-begin-postponed-hook
Mail Delivery Status Report will be mailed to .
Copy: 20837002/20837002 100.0%; Applied: 6851; Backlog: 0/1000; Time: 71h8m30s(total), 20h54m38s(copy); streamer: master-bin.039663:3282126; State: postponing cut-over; ETA: due
```
This is the script we're executing:
```
echo "enter current tungsten master:"
read master
echo "enter slave to monitor lag (needs to be set up with log-slave-updates):"
read slave
echo "enter db user:"
read user
echo "enter password:"
read -s pass
echo "enter database name:"
read database
table="table"
echo "Partitioning table ............"
gh-ost \
--assume-master-host=$master \
--tungsten \
--max-load=Threads_running=75 \
--critical-load=Threads_running=1000 \
--critical-load-interval-millis=10000 \
--critical-load-hibernate-seconds=300 \
--chunk-size=1000 \
--max-lag-millis=1000 \
--user="$user" \
--password="$pass" \
--host=$slave \
--database="$database" \
--table="$table" \
--verbose \
--alter="partition by range (unix_timestamp(date_field))
(partition p0 values less than (1167609600),
partition p1 values less than (1199145600),
partition p2 values less than (1230768000),
partition p3 values less than (1262304000),
partition p4 values less than (1293840000),
partition p5 values less than (1325376000),
partition p6 values less than (1356998400),
partition p7 values less than (1388534400),
partition p8 values less than (1420070400),
partition p9 values less than (1451606400),
partition p10 values less than (1483228800),
partition p11 values less than (1514764800),
partition p12 values less than (1522627200),
partition p13 values less than (1523232000),
partition p14 values less than (1523836800),
partition p15 values less than (1524441600),
partition p16 values less than (1525046400),
partition p17 values less than (1525651200),
partition p18 values less than (1526256000),
partition p19 values less than (1526860800),
partition p20 values less than (1527465600),
partition p21 values less than (1528070400),
partition p22 values less than (1528675200),
partition p23 values less than (1529280000),
partition p24 values less than (1529884800),
partition p25 values less than (1530489600),
partition p26 values less than (1531094400),
partition p27 values less than (1531699200),
partition p28 values less than (1532304000),
partition p29 values less than (1532908800),
partition p30 values less than (1533513600),
partition p31 values less than (1534118400),
partition p32 values less than (1534723200),
partition p33 values less than (1535328000),
partition p34 values less than (1535932800),
partition p35 values less than (1536537600),
partition p36 values less than (1537142400),
partition p37 values less than (1537747200),
partition p38 values less than (1538352000),
partition p39 values less than (1538956800),
partition p40 values less than (1539561600),
partition p41 values less than (1540166400),
partition p42 values less than (1540771200),
partition p43 values less than (1541376000),
partition p44 values less than (1541980800),
partition p45 values less than (1542585600),
partition p46 values less than (1543190400),
partition p47 values less than (1543795200),
partition p48 values less than (1544400000),
partition p49 values less than (1545004800),
partition p50 values less than (1545609600),
partition p51 values less than (1546214400),
partition p52 values less than (1546819200),
partition p53 values less than (1547424000))" \
--cut-over=default \
--default-retries=120 \
--panic-flag-file=/tmp/ghost.panic.flag \
--postpone-cut-over-flag-file=/tmp/ghost.postpone.flag \
--initially-drop-ghost-table \
--initially-drop-old-table \
--exact-rowcount \
--cut-over-lock-timeout-seconds=10 \
--hooks-path=/root/ghost_hooks/ \
--execute
```
Looks like there is timeout in:
```
atomic.StoreInt64(&this.migrationContext.AllEventsUpToLockProcessedInjectedFlag, 1)
```
We're using tungsten and we're not seeing any significant replication delays at cutover time.

We're running with these parameters both at master and slave.
```
Sync_binlog=0
Innodb_flush_logs_at_trx_commit=1
```
We tried the cutover multiple times and is always failing with this error.

Thank you for your help!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.