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

Canal starts sync by GTID #146

Merged
merged 8 commits into from
Aug 1, 2017
Merged

Conversation

NearTan
Copy link
Contributor

@NearTan NearTan commented Jul 28, 2017

#144

  • Add a Canal entry function for GTID
  • Provide GTID in masterInfo
  • Handle GTID events
  • Fix typo writeBinglogDumpCommand -> writeBinlogDumpCommand

canal/sync.go Outdated
)

var (
expAlterTable = regexp.MustCompile("(?i)^ALTER\\sTABLE\\s.*?`{0,1}(.*?)`{0,1}\\.{0,1}`{0,1}([^`\\.]+?)`{0,1}\\s.*")
)

func (c *Canal) startSyncBinlog() error {
pos := c.master.Position()
func getSyncer(c *Canal) (*replication.BinlogStreamer, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getSyncer here is not proper. This function seems to start the sync.

you can name to (c *Canal) startSyncer() and then rename latter startSyncBinlog to runSyncBinlog

Copy link
Contributor Author

@NearTan NearTan Jul 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siddontang I think that rename startSyncBinlog to runSyncBinlog will cause compatibility issues.

What about delete getSyncer function and implement function logic in startSyncBinlog?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NearTan

startSyncBinlog is not exported, so it can't cause the compatibility issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siddontang fixed, plz review again

@siddontang
Copy link
Collaborator

Thanks @NearTan

@siddontang siddontang merged commit f6c08f3 into go-mysql-org:master Aug 1, 2017
@siddontang
Copy link
Collaborator

Thanks @NearTan

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

Successfully merging this pull request may close these issues.

2 participants