Skip to content

同步数据失败 #375

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

Open
logmecn opened this issue May 29, 2020 · 6 comments
Open

同步数据失败 #375

logmecn opened this issue May 29, 2020 · 6 comments

Comments

@logmecn
Copy link

logmecn commented May 29, 2020

配置和同步都正常,但在同步数据到如下数据时,就会出错而停止同步。怀疑是因为有事务的数据,而同步数据不被支持。
[2020/05/29 14:32:12] [info] master.go:54 save position (mysql-bin.000024, 131978390)
[2020/05/29 14:32:13] [error] sync.go:121 parse query(SAVEPOINT trans2) err line 1 column 9 near "SAVEPOINT trans2"
[2020/05/29 14:32:13] [error] canal.go:230 canal start sync binlog err: line 1 column 9 near "SAVEPOINT trans2"
[2020/05/29 14:32:13] [info] river.go:298 errline 1 column 9 near "SAVEPOINT trans2"

@ansonhorse
Copy link

同遇到该问题。全量同步(也就是mysqldump)之后,就是这个错误了。

@ansonhorse
Copy link

大概找到原因了:依赖的某个module版本没更新。不过首先说明一下,我对go没什么了解(比如go.mod也只是大致了解了一下),下面的操作可能存在不规范的地方。

在这个issue:go-mysql-org/go-mysql#393
看到说修复了,而且PR也合并了,所以我查看了一下这个工具引用的go-mysql,发现是一个比较旧的版本,反正应该是修复问题前的版本。

https://github.com/siddontang/go-mysql-elasticsearch/blob/d4e881274861e5c33b37cce17abcdac508149c32/go.mod#L12

然后,我把版本修改为latest,然后重新make,接着再运行,OK了。

[2020/08/05 21:45:57] [info] master.go:54 save position (mysql-bin.004946, 55920121)
[2020/08/05 21:46:01] [info] master.go:54 save position (mysql-bin.004946, 55920818)
[2020/08/05 21:46:04] [error] sync.go:145 parse query(SAVEPOINT `LEVEL1`) err line 1 column 9 near "SAVEPOINT `LEVEL1`" , will skip this event
[2020/08/05 21:46:04] [info] master.go:54 save position (mysql-bin.004946, 56073332)
[2020/08/05 21:46:07] [info] master.go:54 save position (mysql-bin.004946, 56187450)

@ansonhorse
Copy link

ansonhorse commented Aug 5, 2020

看了一下make之后的go.mod,发现版本号自动由latest更新为v1.1.0了,所以估计修改时这么写也行吧。

module github.com/siddontang/go-mysql-elasticsearch

go 1.12

require (
    github.com/BurntSushi/toml v0.3.1
    github.com/juju/errors v0.0.0-20190207033735-e65537c515d7
    github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8
    github.com/prometheus/client_golang v0.9.3
    github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726
    github.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed
    github.com/siddontang/go-mysql v1.1.0
)

@WangXiangUSTC
Copy link
Contributor

@ansonhorse could you please file a pr to update the version of go-mysql?

ansonhorse added a commit to ansonhorse/go-mysql-elasticsearch that referenced this issue Aug 6, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@ansonhorse
Copy link

@WangXiangUSTC #381

@WangXiangUSTC
Copy link
Contributor

WangXiangUSTC commented Aug 6, 2020

@WangXiangUSTC #381

thanks

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

No branches or pull requests

3 participants