pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
37.11k stars 5.83k forks source link

create tso stream error: rpc error: code = Canceled desc = context canceled #8368

Closed evancao77 closed 5 years ago

evancao77 commented 5 years ago

1.tidb version: 2.0.4

2.TiDB-Binlog of the local version start drainer with err: INFO[0000] [pd] create pd client with endpoints [http://192.168.162.205:2379 http://192.168.162.218:2379 http://192.168.162.219:2379] INFO[0000] [pd] leader switches to: http://192.168.162.218:2379, previous:
INFO[0000] [pd] init cluster id 6581671567141738915
ERRO[0000] [pd] create tso stream error: rpc error: code = Canceled desc = context canceled INFO[0000] [pd] create pd client with endpoints [http://192.168.162.205:2379 http://192.168.162.218:2379 http://192.168.162.219:2379] INFO[0000] [pd] leader switches to: http://192.168.162.218:2379, previous:
INFO[0000] [pd] init cluster id 6581671567141738915
INFO[0000] new store
INFO[0000] [pd] create pd client with endpoints [192.168.162.205:2379 192.168.162.218:2379 192.168.162.219:2379] INFO[0000] [pd] leader switches to: http://192.168.162.218:2379, previous:
INFO[0000] [pd] init cluster id 6581671567141738915

evancao77 commented 5 years ago

the pump log: 2018/11/21 09:14:23 server.go:457: [info] generate fake binlog successfully 2018/11/21 09:14:23 binlogger.go:252: [info] [binlogger] walk from position {Suffix:0 Offset:1028990} 2018/11/21 09:14:25 binlogger.go:252: [info] [binlogger] walk from position {Suffix:0 Offset:1029030} 2018/11/21 09:14:26 binlogger.go:252: [info] [binlogger] walk from position {Suffix:0 Offset:1029030} 2018/11/21 09:14:26 server.go:457: [info] generate fake binlog successfully 2018/11/21 09:14:27 binlogger.go:252: [info] [binlogger] walk from position {Suffix:0 Offset:1029030} 2018/11/21 09:14:28 binlogger.go:252: [info] [binlogger] walk from position {Suffix:0 Offset:1029070} 2018/11/21 09:14:29 binlogger.go:252: [info] [binlogger] walk from position {Suffix:0 Offset:1029070}

crazycs520 commented 5 years ago

@kennytm PTAL

kennytm commented 5 years ago

@evancao77 Thanks for the report. This error log is printed when TiDB-Binlog closes its own PD client, which itself is harmless (pingcap/pd#1134). You may upgrade the TiDB-Binlog version to suppress this log.

evancao77 commented 5 years ago

I can't apply binlog mysql

kennytm commented 5 years ago

@evancao77 Sorry could you clarify?

You may find the deployment instructions of Drainer (which will feed binlog into downstream MySQL) in

evancao77 commented 5 years ago

I solved this problem by using kafka, the local method was not tested on the existing 2.0.4. The reason is the version of pump and drainer. Thank you!@kennytm

kennytm commented 5 years ago

Glad to help 🙂

evancao77 commented 5 years ago

I have another question, if I use the local approach in https://pingcap.github.io/docs/tools/tidb-binlog/ How does drainer get the binlog generated by pump and apply it to MySQL .

kennytm commented 5 years ago

@evancao77 The drainer will locate the pumps via PD, and replicate the binlog to MySQL. Would you mind showing which step you're currently stuck with? Thanks.