Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goInception 使用 gh-ost 二进制文件异常 #620

Closed
Jacklli opened this issue Nov 2, 2023 · 4 comments
Closed

goInception 使用 gh-ost 二进制文件异常 #620

Jacklli opened this issue Nov 2, 2023 · 4 comments

Comments

@Jacklli
Copy link

Jacklli commented Nov 2, 2023

描述
对问题简单清晰的描述
通过 goInception 的 gh-ost 二进制文件执行 mysql 表加字段语句时,gh-ost 给 goInception 返回异常。

goInception日志报错如下:
time="2023/11/02 16:11:16.947" level=info msg="con:2 use binary gh-ost: alter table sbtest1\n\tadd column name1 varchar(255) not null default 'kkkl' " file=session_inception.go func=executeRemoteStatement line=1442
time="2023/11/02 16:11:16.952" level=error msg="sh [-c gh-ost --alter "ADD COLUMN \name1\\ VARCHAR(255) NOT NULL DEFAULT 'kkkl' " --verbose --assume-master-host= --exact-rowcount=false --concurrent-rowcount=true --allow-on-master=true --allow-master-master=true --allow-nullable-unique-key=false --approve-renamed-columns=true --tungsten=false --discard-foreign-keys=false --skip-foreign-key-checks=false --aliyun-rds=false --gcp=false --ok-to-drop-table=false --initially-drop-old-table=false --initially-drop-ghost-table=false --cut-over=atomic --force-named-cut-over=false --assume-rbr=true --cut-over-exponential-backoff=false --exponential-backoff-max-interval=64 --chunk-size=1000 --dml-batch-size=21 --default-retries=60 --cut-over-lock-timeout-seconds=3 --nice-ratio=0.200000 --max-lag-millis=1500 --replication-lag-query=show slave status --heartbeat-interval-millis=500 --throttle-flag-file= --throttle-additional-flag-file=inception-all-stop --postpone-cut-over-flag-file= --initially-drop-socket-file=false --serve-socket-file=/tmp/gh-ost.xxx.3306.sbtest0.sbtest1.sock --panic-flag-file=/tmp/gh-ost.xxx.3306.sbtest0.sbtest1.panic --replica-server-id=2000100002 --critical-load-interval-millis=0 --critical-load-hibernate-seconds=0 --force-table-names=testindexname --critical-load='Threads_running=200,threads_connected=1500' --max-load='Threads_running=100,threads_connected=1000' --execute --user="xxx" --password='xxx' --host=xxx --port=3306 --database='sbtest0' --table='sbtest1']" file=osc.go func=execCommand line=902
time="2023/11/02 16:11:16.952" level=error msg="exit status 1" file=osc.go func=execCommand line=903
time="2023/11/02 16:11:16.952" level=info msg="con:2 close connection" file=server.go func=func1 line=321

将 goInception 日志中的 gh-ost 命令提取出来单独执行,报错如下:
./gh-ost --alter "ADD COLUMN name1 VARCHAR(255) NOT NULL DEFAULT 'kkkl' " --verbose --assume-master-host= --exact-rowcount=false --concurrent-rowcount=true --allow-on-master=true --allow-master-master=true --allow-nullable-unique-key=false --approve-renamed-columns=true --tungsten=false --discard-foreign-keys=false --skip-foreign-key-checks=false --aliyun-rds=false --gcp=false --ok-to-drop-table=false --initially-drop-old-table=false --initially-drop-ghost-table=false --cut-over=atomic --force-named-cut-over=false --assume-rbr=true --cut-over-exponential-backoff=false --exponential-backoff-max-interval=64 --chunk-size=1000 --dml-batch-size=21 --default-retries=60 --cut-over-lock-timeout-seconds=3 --nice-ratio=0.200000 --max-lag-millis=1500 --replication-lag-query=show slave status --heartbeat-interval-millis=500 --throttle-flag-file= --throttle-additional-flag-file=inception-all-stop --postpone-cut-over-flag-file= --initially-drop-socket-file=false --serve-socket-file=/tmp/gh-ost.xxx.3306.sbtest0.sbtest1.sock --panic-flag-file=/tmp/gh-ost.xxx.3306.sbtest0.sbtest1.panic --replica-server-id=2000100002 --critical-load-interval-millis=0 --critical-load-hibernate-seconds=0 --force-table-names=testindexname --critical-load='Threads_running=200,threads_connected=1500' --max-load='Threads_running=100,threads_connected=1000' --execute --user="xxx" --password='xxx' --host=xxx --port=3306 --database='sbtest0' --table='sbtest1'
2023-11-02 16:14:53 FATAL --database must be provided and database name must not be empty, or --alter must specify database name

重现
模拟重现的步骤
参考以上错误描述,问题是必现。

环境

  • 数据库: [mysql/mariadb]
  • 版本: [例如 5.7.21]
    mysql 5.7.27
    goInception: 1.3.0
    gh-ost 1.1.5 和 1.1.4 都是必现。

参数
可能与问题相关的设置参数
设置了 goInception 的 ghost_bin_dir 参数

@hanchuanchuan
Copy link
Owner

问题已确认, 由于参数--replication-lag-query的问题导致的. 其包含了空格, 但未使用引号

@hanchuanchuan
Copy link
Owner

请升级到v1.3.0-83版本后重试.

@Jacklli
Copy link
Author

Jacklli commented Nov 14, 2023

测试了 v1.3.0-84 二进制文件可以正常运行。
但是, v1.3.0 tag 的源代码貌似没有发新的版本。
是否可以给 v1.3.0 版本的源代码也发最新的版本呢?

@hanchuanchuan
Copy link
Owner

commit在的 1e87b37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants