Skip to content

Replica HA_ERR_FOUND_DUPP_KEY after migration-on-replica cutover #1556

Open
@sniperliu

Description

@sniperliu

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

./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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions