-
Notifications
You must be signed in to change notification settings - Fork 1k
Why does binlog syncer need to register as a slave? #966
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
Comments
I was able to bypass the 32 char limitation by commenting out register slave and replication worked as expected still. |
Oh, do you mean we can directly send COM_BINLOG_DUMP/COM_BINLOG_DUMP_GTID without COM_REGISTER_SLAVE? I didn't think of it before. Will take a look soon. |
Yes exactly. @lance6716 |
If we can safely skip Maybe we should change the title of this issue to "replication user password limited to 32 characters"? |
This seems to work: diff --git a/replication/binlogsyncer.go b/replication/binlogsyncer.go
index ccbfb9f..161fd69 100644
--- a/replication/binlogsyncer.go
+++ b/replication/binlogsyncer.go
@@ -348,13 +348,13 @@ func (b *BinlogSyncer) registerSlave() error {
}
}
- if err = b.writeRegisterSlaveCommand(); err != nil {
- return errors.Trace(err)
- }
+ // if err = b.writeRegisterSlaveCommand(); err != nil {
+ // return errors.Trace(err)
+ // }
- if _, err = b.c.ReadOKPacket(); err != nil {
- return errors.Trace(err)
- }
+ // if _, err = b.c.ReadOKPacket(); err != nil {
+ // return errors.Trace(err)
+ // }
serverUUID, err := uuid.NewUUID()
if err != nil { Test for this issue: mysql-9.1.0> create user 'repl' identified by 'replreplreplreplreplreplreplreplrepl';
Query OK, 0 rows affected (0.02 sec)
mysql-9.1.0> grant all on *.* to 'repl'@'%';
Query OK, 0 rows affected (0.01 sec)
mysql-9.1.0> select char_length('replreplreplreplreplreplreplreplrepl');
+-----------------------------------------------------+
| char_length('replreplreplreplreplreplreplreplrepl') |
+-----------------------------------------------------+
| 36 |
+-----------------------------------------------------+
1 row in set (0.00 sec)
|
So it With MySQL this contains:
This information is NOT used for authenticating to the replication source. These things can be useful for things like Note that |
Testing shows that |
Test with this in my
And with a replication source (master) running with
|
Why does it need to register as a slave? Code ref
By making this additional network call, we are running into a MySQL password limitation as outlined here.
This has been flagged by the community before in the past. Example
mysql-binlog-connector-java provides a similar capability and does not invoke
COM_REGISTER_SLAVE
The text was updated successfully, but these errors were encountered: