Skip to content

Commit 10082a9

Browse files
author
Shlomi Noach
authored
Merge branch 'master' into old-table-name-timestamp
2 parents d155948 + bd77a9b commit 10082a9

161 files changed

Lines changed: 25951 additions & 381 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

go/binlog/gomysql_reader.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/outbrain/golib/log"
1717
gomysql "github.com/siddontang/go-mysql/mysql"
1818
"github.com/siddontang/go-mysql/replication"
19+
"golang.org/x/net/context"
1920
)
2021

2122
type GoMySQLReader struct {
@@ -39,7 +40,16 @@ func NewGoMySQLReader(connectionConfig *mysql.ConnectionConfig) (binlogReader *G
3940
}
4041

4142
serverId := uint32(binlogReader.MigrationContext.ReplicaServerId)
42-
binlogReader.binlogSyncer = replication.NewBinlogSyncer(serverId, "mysql")
43+
44+
binlogSyncerConfig := &replication.BinlogSyncerConfig{
45+
ServerID: serverId,
46+
Flavor: "mysql",
47+
Host: connectionConfig.Key.Hostname,
48+
Port: uint16(connectionConfig.Key.Port),
49+
User: connectionConfig.User,
50+
Password: connectionConfig.Password,
51+
}
52+
binlogReader.binlogSyncer = replication.NewBinlogSyncer(binlogSyncerConfig)
4353

4454
return binlogReader, err
4555
}
@@ -49,10 +59,6 @@ func (this *GoMySQLReader) ConnectBinlogStreamer(coordinates mysql.BinlogCoordin
4959
if coordinates.IsEmpty() {
5060
return log.Errorf("Emptry coordinates at ConnectBinlogStreamer()")
5161
}
52-
log.Infof("Registering replica at %+v:%+v", this.connectionConfig.Key.Hostname, uint16(this.connectionConfig.Key.Port))
53-
if err := this.binlogSyncer.RegisterSlave(this.connectionConfig.Key.Hostname, uint16(this.connectionConfig.Key.Port), this.connectionConfig.User, this.connectionConfig.Password); err != nil {
54-
return err
55-
}
5662

5763
this.currentCoordinates = coordinates
5864
log.Infof("Connecting binlog streamer at %+v", this.currentCoordinates)
@@ -126,7 +132,7 @@ func (this *GoMySQLReader) StreamEvents(canStopStreaming func() bool, entriesCha
126132
if canStopStreaming() {
127133
break
128134
}
129-
ev, err := this.binlogStreamer.GetEvent()
135+
ev, err := this.binlogStreamer.GetEvent(context.Background())
130136
if err != nil {
131137
return err
132138
}

vendor/github.com/ngaut/deadline/rw.go

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ngaut/log/LICENSE

Lines changed: 165 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ngaut/log/README.md

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ngaut/log/crash_unix.go

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ngaut/log/crash_win.go

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)