I encountered a problem when using gh-ost to alter primary key , Please help me
维护者通常 10 天内回复
还没有人认领这个 Issue。
评估
调研方向
未指定源文件、测试或入口点。先从提供的 gh-ost 命令、表定义和主键重复错误开始,然后调查在带有副本的 MySQL 5.7 Aurora 上的复现;完成的标准是确定原因,并记录经过验证的解决方案或有针对性的代码更改。
由索引模型根据 Issue 内容生成。
描述
This is the command:
gh-ost -allow-on-master -assume-rbr -exact-rowcount -initially-drop-ghost-table -initially-drop-old-table -initially-drop-socket-file -critical-load-hibernate-seconds 60 -database xxx -nice-ratio 0.1 -chunk-size 3888 -ask-pass -table ixxx_logging -user username -host host1 -alter 'ALTER TABLE ixxx_logging MODIFY COLUMN id varchar(50) NOT NULL' -verbose -execute 2>&1 | tee gh-ost.log
DB: 5.7.mysql_aurora.2.11.1 . This db has five slaves.
TABLE :
CREATE TABLE ixxx_logging (
id bigint(20) NOT NULL AUTO_INCREMENT,
x9 VARCHAR(32),
x8 VARCHAR(32),
x7 INT DEFAULT 0,
x6 INT DEFAULT 0,
x5 INT DEFAULT 1,
x4 VARCHAR(2) DEFAULT 0,
x3 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
x2 TIMESTAMP timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
x1 DATETIME DEFAULT null,
xxxxx1 VARCHAR(1000),
xxxx9 VARCHAR(32),
xxxx8 VARCHAR(32),
xxxx7 VARCHAR(70),
xxxx6 INT DEFAULT 0,
xxxx5 VARCHAR(1) DEFAULT 0,
xxxx4 VARCHAR(1) DEFAULT 0,
xxxx3 VARCHAR(256),
xxxx2 VARCHAR(256),
xxx1 VARCHAR(1) DEFAULT 0,
bb1 VARCHAR(10),
bb2 CHAR(30),
bb3 VARCHAR(30),
bb4 VARCHAR(2) DEFAULT 0,
bb5 VARCHAR(100) DEFAULT null,
bb6 VARCHAR(100) DEFAULT null,
bb7 VARCHAR(20) DEFAULT null,
PRIMARY KEY (id) USING BTREE,
KEY idx_x9 (x9) USING BTREE,
KEY idx_x8 (x8) USING BTREE,
KEY idx_x3 (x3)
) ENGINE=InnoDB AUTO_INCREMENT=2694513087735591693 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
error:
2023-08-15 02:16:06 ERROR Error 1062: Duplicate entry '26945130xxxx5506529' for key 'PRIMARY'; query=
update /* gh-ost schema1._ixxx_logging_gho */
schema1._ixxx_logging_gho
set
id=?, x9=?, x8=?, x7=?, x6=?, x5=?, x3=?, ....
where
((id = ?));
args=[26945130xxxx5506529 242920747xxx526657 242920747xxx526657 2 2 1 9D0C49xxxx08118 2024-08-14 01:37:07 0 0 1 2 2023-08-15 01:37:11 +0000 UTC 2023-08-15 01:44:57 +0000 UTC 0 0 2694513087xxxx06524 242920747xxx526657 26945130xxxx5506529]
- 主要语言
- Go
- 星标
- 13.6k
- 派生
- 1.4k
- 平均合并
- 9 天 19 小时
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/gh-ost 的其他 Issue
-
`--resume` without `--execute` drops the ghost table it correctly skipped altering可能已有人在做 @ajm188 于 56 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 10 天内回复
-
[Suggestion] Apply simple validation to alter command可能已有人在做 @drkemp187 于 106 天前认领。 未关闭enhancement good first issue
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 10 天内回复
-
Migration hangs when --attempt-instant-ddl succeeds可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 30/100
维护者通常 10 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
维护者通常 10 天内回复
-
Atomic cut-over always fails on MySQL 9.1+: information_schema.processlist errors out (3854) while another session runs a non-BMP utf8mb4 statement可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 52/100
维护者通常 10 天内回复
相似的 Issue
-
type:bug
难度 2/5 1-3 小时 新手友好度 72/100
nightgauge/nightgauge#3266 ·
维护者通常 1 天内回复
-
area: ai-models priority: normal
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
prime-radiant-inc/evener#6325 ·
维护者通常 1 天内回复
-
team:library-maintainers
难度 2/5 1-3 小时 新手友好度 82/100
padok-team/burrito#1208 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
bazel-contrib/rules_go#4784 · 1 条评论 ·
维护者通常 1 天内回复