Replica HA_ERR_FOUND_DUPP_KEY after migration-on-replica cutover
- 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
Assessment
This issue has not been assessed yet.