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

Support mysql protocol compression #22605

Closed
xqinghu opened this issue Jan 28, 2021 · 6 comments · Fixed by #36780
Closed

Support mysql protocol compression #22605

xqinghu opened this issue Jan 28, 2021 · 6 comments · Fixed by #36780
Assignees
Labels
component/mysql-protocol sig/sql-infra SIG: SQL Infra type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@xqinghu
Copy link

xqinghu commented Jan 28, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

Release Version: v4.0.0
Edition: Community
Git Commit Hash: 689a6b6
Git Branch: heads/refs/tags/v4.0.0
UTC Build Time: 2020-05-28 01:37:40
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@xqinghu xqinghu added the type/bug The issue is confirmed as a bug. label Jan 28, 2021
@morgo
Copy link
Contributor

morgo commented Jan 28, 2021

It looks like TiDB parses but ignores the compression set option. i.e.
https://github.com/pingcap/tidb/blob/master/server/conn_stmt.go#L614-L635

The parser can handle it, the const is ClientCompress. But a grep of server/* shows it is not present.

@morgo morgo changed the title JDBC useCompression=true does not work tidb-server does not support mysql protocol compression Jan 28, 2021
@bb7133
Copy link
Member

bb7133 commented Aug 9, 2021

Hi @xqinghu ,compression is not supported by TiDB(there's no plan for it before).

I'm going to change your issue for 'bug' to 'feature request', FYI.

@bb7133 bb7133 changed the title tidb-server does not support mysql protocol compression Support mysql protocol compression Aug 9, 2021
@bb7133 bb7133 added type/feature-request Categorizes issue or PR as related to a new feature. and removed type/bug The issue is confirmed as a bug. severity/moderate labels Aug 9, 2021
@dveeden
Copy link
Contributor

dveeden commented Aug 9, 2021

I looked at the compressed protocol in 2016 to implement part of this in Wirshark: https://code.wireshark.org/review/#/c/14603/

I don't think it would be very difficult to implement this for TiDB. However I don't think the compressed protocol is very useful, so I don't think this is a high priority issue. But please add a detailed description if anyone things this would make a real improvement for their usecase.

@dveeden
Copy link
Contributor

dveeden commented Aug 10, 2021

https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_basic_compression.html does have the docs for this.

There seems to be a new flag for zstandard compression.

@dveeden
Copy link
Contributor

dveeden commented Aug 10, 2021

It looks like the Go MySQL driver doesn't support compression: go-sql-driver/mysql#24
This makes this difficult for unittesting and means tools like dumpling etc might not be able to take advantage of this. So if we implement this we should try to contribute support for this to the driver as well.

@xqinghu
Copy link
Author

xqinghu commented Aug 10, 2021

The bottleneck of ETL extraction task is bandwidth (1g), and the CPU is very idle, client is Java. Thanks @dveeden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/mysql-protocol sig/sql-infra SIG: SQL Infra type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants