WL#12039: Add support for zstd compression to classic protocol in the server

Affects: Server-8.0   —   Status: Complete

SUMMARY

The goal of this worklog is to add support to specify zstd compression algorithm in the network communication between client and server. The worklog shall depend on WL#12475 which will add the user interface necessary to specify compression algorithms by clients (replication and classic clients) in their interaction with the server.

USER STORIES

  • As an application developer against MySQL, I want to be able to specify in my client application the zstd compression algorithm in my connection, so that I am able to minimize the amount of bytes transferred over my limited bandwidth network.

  • As an application developer against MySQL, I want to be able to specify in my client application the zstd compression algorithm in my connection, so that I do not saturate the server NIC by transferring a smaller amount of bytes at the cost of a little higher CPU usage.

  • As a MySQL DBA, I want to setup a specific slave [channel] to use compression provided by zstd in it's client connection to the master, so that I am able to minimize the network bandwidth used to transfer binary logs from the master to the slave.

  • As a MySQL DBA, I want to setup a slave [channel] to use compression provided by zstd in it's client connection to the master, so that I do not saturate the server NIC by transferring smaller amount of bytes at the cost of a little higher CPU usage.

  • As an application developer against MySQL, I shall to be able to specify in my client application a compression level for zstd algorithm.This enables me to trade off between CPU usage and network latency based on requirements.

  • As a MYSQL DBA, I want to associate a compression level with the zstd compression algorithm for a slave [channel]. This shall allow me to trade off between the CPU usage and network latency based on requirements.

SCOPE

The scope of work involves the following:

  1. Allow for build option to specify zstd to be bundled with mysqld or link mysqld with system provided library. This is in line with existing compression libraries addded to mysqld server (lz4, zlib).

  2. Add stripped down version of the zstd library (providing the minimal required APIs for compression and decompression) in the server.

  3. Add compression generic API to the vio layer. This generic API will present a unified interface to the server and client code. It would allow call the underlying library API based on the compression algorithm specified.

  4. Necessary code changes in server/client and test cases demonstrating the use of zstd compression when connection is made by replication client or classic client.

REFERENCES

  • BUG#88567 Add zstd compression option for replication.