Bug #121935 CHANGE REPLICATION SOURCE accepts ZSTD compression level 0

Submitted: 26 Nov 2:36
Reporter: QiFan Liu Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:26.10.0 OS:Linux
Assigned to: CPU Architecture:x86
Tags: CHANGE REPLICATION SOURCE, SOURCE_ZSTD_COMPRESSION_LEVEL, zstd

[26 Nov 2:36] QiFan Liu
Description:
The MySQL 26.10 Reference Manual, “CHANGE REPLICATION SOURCE TO Statement,” says: “The permitted levels are from 1 to 22, with larger values indicating increasing levels of compression.”

However, SOURCE_ZSTD_COMPRESSION_LEVEL=0 is accepted without an error. If the channel was previously configured with level 3, specifying level 0 silently retains level 3:

SEEDED_ZSTD_LEVEL
3
OBSERVED_LEVEL
3

The statement should reject level 0 because it is outside the documented permitted range.

How to repeat:
Run as root:

CHANGE REPLICATION SOURCE TO
  SOURCE_HOST='127.0.0.1',
  SOURCE_COMPRESSION_ALGORITHMS='zstd',
  SOURCE_ZSTD_COMPRESSION_LEVEL=3
  FOR CHANNEL 'zstd_zero';

SELECT ZSTD_COMPRESSION_LEVEL AS SEEDED_ZSTD_LEVEL
FROM performance_schema.replication_connection_configuration
WHERE CHANNEL_NAME='zstd_zero';

-- Succeeds, but should report that the permitted range is 1 through 22.
CHANGE REPLICATION SOURCE TO SOURCE_ZSTD_COMPRESSION_LEVEL=0
  FOR CHANNEL 'zstd_zero';

-- Returns 3, showing that the explicitly supplied zero was ignored.
SELECT ZSTD_COMPRESSION_LEVEL AS OBSERVED_LEVEL
FROM performance_schema.replication_connection_configuration
WHERE CHANNEL_NAME='zstd_zero';

RESET REPLICA ALL FOR CHANNEL 'zstd_zero';

Suggested fix:
Track whether SOURCE_ZSTD_COMPRESSION_LEVEL was specified separately from its numeric value, and validate every specified value against the permitted range of 1 through 22.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.048 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.