We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 98108dd + 411b75d commit 9bd5965Copy full SHA for 9bd5965
replication/binlogsyncer.go
@@ -19,7 +19,8 @@ import (
19
)
20
21
var (
22
- errSyncRunning = errors.New("Sync is running, must Close first")
+ errSyncRunning = errors.New("Sync is running, must Close first")
23
+ maxHostNameLength = 60
24
25
26
// BinlogSyncerConfig is the configuration for BinlogSyncer.
@@ -524,7 +525,10 @@ func (b *BinlogSyncer) writeRegisterSlaveCommand() error {
524
525
b.c.ResetSequence()
526
527
hostname := b.localHostname()
-
528
+ if len(hostname) > maxHostNameLength {
529
+ runes := []rune(hostname)
530
+ hostname = string(runes[0:maxHostNameLength])
531
+ }
532
// This should be the name of slave host not the host we are connecting to.
533
data := make([]byte, 4+1+4+1+len(hostname)+1+len(b.cfg.User)+1+len(b.cfg.Password)+2+4+4)
534
pos := 4
0 commit comments