Replica HA_ERR_FOUND_DUPP_KEY after migration-on-replica cutover

未关闭
#1,556 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 10 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
go, mysql
领域
databases

调研方向

首先,使用 issue 中描述的命令和并发事务,通过 MySQL 8.0.41 和 gh-ost 1.1.7 重现 migration-on-replica cutover。跟踪报告的 HA_ERR_FOUND_DUPP_KEY 错误附近的 cutover 和副本行为;完成的标准是确定原因,并在不破坏 migration-on-replica cutover 的情况下防止副本失败。

由索引模型根据 Issue 内容生成。

描述

bug data-integrity

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
主要语言
Go
星标
13.6k
派生
1.4k
平均合并
9 天 19 小时
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/gh-ost 的其他 Issue

查看 github/gh-ost 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。