Skip to content

FATAL ERROR 1105 (HY000): Failed to register slave: too long 'report-host' #388

Closed
@ealter

Description

@ealter

I have been running into this issue when running gh-ost inside of some of our docker containers. When the hostname of the docker container is at least 61 characters in length, I get the following error when trying to run gh-ost.

$ cat /tmp/ghost_user.cnf
[client]
user = ghost
$ /usr/bin/gh-ost --database yelp_pushplan_execution --table pushplan_run --alter ENGINE=InnoDB --conf /tmp/ghost_user.cnf --host xx.xx.xx.xx --chunk-size 500 --force-table-names 1557255792_pushplan_run --assume-rbr
2019/05/07 20:20:05 binlogsyncer.go:79: [info] create BinlogSyncer with config {99999 mysql 10.121.133.170 3306 ghost   false false <nil>}
2019/05/07 20:20:05 binlogsyncer.go:246: [info] begin to sync binlog from position (mysql-bin.000008, 951800672)
2019/05/07 20:20:05 binlogsyncer.go:139: [info] register slave for master server 10.121.133.170:3306
2019-05-07 20:20:05 FATAL ERROR 1105 (HY000): Failed to register slave: too long 'report-host'

The docker container is running on Ubuntu Bionic.

When I specified --hostname when creating the same docker container to be 61 characters instead, gh-ost ran without any issues.

The error message comes from https://github.com/mysql/mysql-server/blob/124c7ab1d6f914637521fd4463a993aa73403513/sql/rpl_master.cc#L161 and it looks like hostname is chosen from https://github.com/siddontang/go-mysql/blob/master/replication/binlogsyncer.go#L495

Let me know if you need any other information to reproduce this.

It looks like this is an actual limit defined in mysql: https://github.com/mysql/mysql-server/blob/124c7ab1d6f914637521fd4463a993aa73403513/sql/sql_const.h#L59

Would it be possible for go-mysql to allow clients to override the hostname used when setting up replication?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions