github / github/gh-ost

Replica HA_ERR_FOUND_DUPP_KEY after migration-on-replica cutover

Open
#1,556 0 comments 0 reactions 0 assignees View on GitHub
bug data-integrity
Dominant language
Go
Stars
13.6k
Forks
1.4k
Avg merge
2h 31m
Merged PRs (30d)
4

Description

I am doing table migration with gh-ost with migration-on-replica and there is transactions being processed at same time.

After cutover, there is replica failure.

Error message:
`Duplicate entry '0' for key 'transaction.PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY`

**MySQL Version**: 8.0.41-commercial

**gh-ost Version**: 1.1.7 (git commit: 41e72706c8caac24dc8225758eb688aae69a0ce8)

**Command**
```shell
./gh-ost \
-migrate-on-replica \
-ssl-allow-insecure \
-ssl \
-max-load=Threads_running=25 \
-critical-load=Threads_running=1000 \
-chunk-size=1000 \
-max-lag-millis=1500 \
-user="ghost" \
-password="xxxx" \
-host=slave-ip \
-port=3306 \
-database="transaction" \
-table="transaction" \
-verbose \
-initially-drop-ghost-table \
-initially-drop-old-table \
-alter="CHANGE ID ID BIGINT unsigned not null auto_increment" \
-cut-over=default \
-exact-rowcount \
-concurrent-rowcount \
-default-retries=120 \
-panic-flag-file=/tmp/ghost.panic.flag \
-postpone-cut-over-flag-file=./ghost.postpone.flag \
-execute
```

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.