Skip to content

Keep only none/zstd138 compression#857

Open
hnwyllmm wants to merge 8 commits into
masterfrom
task/2026060200116500678
Open

Keep only none/zstd138 compression#857
hnwyllmm wants to merge 8 commits into
masterfrom
task/2026060200116500678

Conversation

@hnwyllmm

@hnwyllmm hnwyllmm commented Jun 4, 2026

Copy link
Copy Markdown
Member

Task Description

Keep only the none and zstd138 compression algorithms in the codebase.

Solution Description

This change removes support for other compression libraries (lz4, snappy, and older versions of zstd), retaining only the none (no compression) and zstd138 compression options.

Passed Regressions

Upgrade Compatibility

Other Information

Code Changes

┌──────────────┬───────────┐
│ Metric       │ Count     │
├──────────────┼───────────┤
│ Files Changed│ 866       │
├──────────────┼───────────┤
│ Lines Added  │ 12,115    │
├──────────────┼───────────┤
│ Lines Deleted│ 76,071    │
├──────────────┼───────────┤
│ Net Deletion │ 63,956    │
└──────────────┴───────────┘

Breakdown:

  • Deleted source code for compression libraries (lz4/snappy/zstd directories): 53,548 lines
  • Modified mysqltest/obtest files (name replacements): ~11,600 lines
  • Modified C++ source files and unit tests: ~900 lines

Binary Size Impact

Using the zstd_1_3_8 compilation artifact as a reference (848KB .text segment / 2.4M .o file), the estimated impact of removing the three libraries:

┌─────────────┬──────────┬───────────────┐
│ Library     │ Source Lines │ Est. .text  │
├─────────────┼──────────┼───────────────┤
│ lz4         │ 6,765    │ ~200-300KB   │
├─────────────┼──────────┼───────────────┤
│ snappy      │ 2,987    │ ~150-200KB   │
├─────────────┼──────────┼───────────────┤
│ zstd (old)  │ 39,994   │ ~800-1000KB  │
├─────────────┼──────────┼───────────────┤
│ Total       │ 49,746   │ ~1.2-1.5MB   │
└─────────────┴──────────┴───────────────┘

The stripped binary is approximately 534MB. A reduction of ~1.2-1.5MB in the .text segment represents about 0.2-0.3% of the stripped binary size. The compression libraries themselves are not large; the primary benefits are in code simplicity and reduced maintenance cost.

Related Links

  • DIMA-2026060200116500678

Release Note

hnwyllmm and others added 8 commits June 3, 2026 09:44
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- test_ob_log_compressor: invalid compressor names now return
OB_NOT_SUPPORTED from the pool instead of OB_INVALID_ARGUMENT
- test_compressor: use zstd_1_3_8 namespace and class

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace all references to removed compressor names (lz4_1.0, snappy_1.0
zlib_1.0, zstd_1.0, lz4_1.9.1) with zstd_1.3.8 in mysqltest .test and
.result files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Map old compressor names (lz4_1.0, snappy_1.0, zlib_1.0, zstd_1.0
lz4_1.9.1, stream_lz4_1.0, stream_zstd_1.0) to zstd_1.3.8 in
get_compressor_type so existing SQL statements and external tools
that reference removed compressor names continue to work.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ObZlibCompressor was kept for MySQL protocol but returned
NONE_COMPRESSOR type. Add ZLIB_COMPRESSOR back to the enum
and register it in ObCompressorPool so zlib is a first-class
compressor backed by the system zlib static library.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
  - deps/oblib/src/lib/thread/thread.cpp
  - src/objit/CMakeLists.txt
Remove LZ4, Snappy, and old ZSTD compression libraries from the codebase
retaining only NONE_COMPRESSOR, ZSTD_1_3_8_COMPRESSOR, and
STREAM_ZSTD_1_3_8_COMPRESSOR. The zlib wrapper is kept as it is required
by MySQL protocol compression and SQL engine gzip functionality.

Enum values are renumbered: ZSTD_1_3_8_COMPRESSOR=2
STREAM_ZSTD_1_3_8_COMPRESSOR=3. All default compressor references
(previously LZ4) are updated to ZSTD_1_3_8.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hnwyllmm hnwyllmm force-pushed the task/2026060200116500678 branch from 00b1bb1 to d72cf3b Compare June 8, 2026 06:05
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


虹武 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants