Replica HA_ERR_FOUND_DUPP_KEY after migration-on-replica cutover

オープン
#1,556 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 10 日以内に返信

まだ誰も着手していません。

評価

難易度
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時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/gh-ost のほかの issue

github/gh-ost の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。