tiflow icon indicating copy to clipboard operation
tiflow copied to clipboard

`go-sql-driver` errors should be logged properly

Open zhaoxinyu opened this issue 1 year ago • 0 comments

Is your feature request related to a problem?

At present, if errors occur in go-sql-driver, they will be mixed in the normal cdc log. For example:

[mysql] 2022/07/20 08:19:59 packets.go:37: read tcp 192.168.86.25:52322->192.168.86.38:4000: read: connection reset by peer
[mysql] 2022/07/20 08:19:59 packets.go:37: read tcp 192.168.86.25:52319->192.168.86.38:4000: read: connection reset by peer
[mysql] 2022/07/20 08:20:02 packets.go:37: read tcp 192.168.86.25:52314->192.168.86.38:4000: read: connection reset by peer
[mysql] 2022/07/20 08:20:03 packets.go:37: read tcp 192.168.86.25:52237->192.168.86.38:4000: read: connection reset by peer
[mysql] 2022/07/20 08:20:05 packets.go:37: read tcp 192.168.86.25:52315->192.168.86.38:4000: read: connection reset by peer
[mysql] 2022/07/20 08:20:07 packets.go:123: closing bad idle connection: connection reset by peer
[mysql] 2022/07/20 08:20:07 packets.go:123: closing bad idle connection: connection reset by peer
[mysql] 2022/07/20 08:20:08 packets.go:123: closing bad idle connection: connection reset by peer
[mysql] 2022/07/20 08:20:08 packets.go:123: closing bad idle connection: connection reset by peer
[mysql] 2022/07/20 08:20:13 packets.go:123: closing bad idle connection: connection reset by peer
[mysql] 2022/07/20 08:20:17 packets.go:123: closing bad idle connection: connection reset by peer
[mysql] 2022/07/20 08:20:17 packets.go:123: closing bad idle connection: connection reset by peer
[mysql] 2022/07/20 08:20:17 packets.go:123: closing bad idle connection: connection reset by peer
[mysql] 2022/07/20 08:20:17 packets.go:123: closing bad idle connection: connection reset by peer
[mysql] 2022/07/20 08:20:17 packets.go:123: closing bad idle connection: connection reset by peer
[mysql] 2022/07/20 08:20:17 packets.go:123: closing bad idle connection: connection reset by peer
/?interpolateParams=true&multiStatements=true&allow_auto_random_explicit_insert=1&charset=utf8mb4&readTimeout=2m&tidb_placement_mode=%22ignore%22&tidb_txn_mode=optimistic&time_zone=%22America%2FEdmonton%22&timeout=2m&transaction_isolation=%22READ-COMMITTED%22&writeTimeout=2m"]
[2022/07/19 14:16:19.978 -06:00] [INFO] [mysql_syncpoint_store.go:138] ["Start mysql syncpoint sink"]
[2022/07/19 14:16:20.144 -06:00] [INFO] [ddl_sink.go:136] ["ddl sink initialized, start processing..."] [namespace=default] [changefeed=simple-replication-task] [duration=249.55275ms]

This makes debugging quite hard and confuse the users.

Describe the feature you'd like

TiCDC log should be chronologically ordered.

Describe alternatives you've considered

We can log the go-sql-driver errors to an independent log file.

Teachability, Documentation, Adoption, Migration Strategy

No response

zhaoxinyu avatar Aug 03 '22 03:08 zhaoxinyu