Skip to content

Update Zstd minimum for RocksDB and Titan - #4

Merged
Sergey Madaminov (sergey-ditto) merged 1 commit into
ditto-8.10from
sergeymadaminov/big2-1471-enable-zstd-compression-for-big
Nov 24, 2026
Merged

Sergey Madaminov (sergey-ditto) merged 1 commit into
ditto-8.10from
sergeymadaminov/big2-1471-enable-zstd-compression-for-big

Conversation

@sergey-ditto

@sergey-ditto Sergey Madaminov (sergey-ditto) commented Nov 24, 2026 •

Copy link
Copy Markdown

Contributes to BIG2-1471

Summary

Require zstd-sys 2.2.0 in the RocksDB and Titan bindings. It bundles native Zstd 1.6.0, which fixes CVE-2026-124851. This lets the two storage bindings share the patched library with the maintained Kafka fork when Ditto enables Kafka Zstd support.

Upstream history. Ditto inherited the <=2.0.13 cap from TiKV’s April 2025 manual compaction change. The original PR leaves the reason for the cap unspecified. In October 2026, TiKV removed the cap in both RocksDB and Titan and adopted a 2.1.2 minimum after validating compression, compaction, and Titan blob reads. This PR follows that approach with the CVE-patched 2.2.0 minimum. Original cap · Upstream removal

After this PR merges, update getditto/ditto#28640 to the landed RocksDB revision and refresh its lockfiles. The maintained ditto/send_batch_0.38.0 Kafka branch already accepts zstd-sys 2.2.0.

Verification

  • The fork’s Cargo graph resolves one zstd-sys 2.2.0+zstd.1.6.0 for librocksdb_sys and libtitan_sys.
  • Storage upgrade and rollback on Linux and macOS ARM64. RocksDB and Titan opened data written with Zstd 1.5.6, wrote and compacted it with 1.6.0, then reopened it with 1.5.6 and verified all 2,000 records in each database. The harness confirmed Zstd-compressed SSTs and Titan blobs.
  • Kafka cross-version reads on macOS ARM64. Zstd-enabled clients linked against 1.5.6 and 1.6.0 read each other’s batches. Each verified all 48 mixed LZ4 and Zstd records byte-for-byte and at the expected offsets.
  • Existing Big Peer compression paths on Linux ARM64. All 17 checks passed with Zstd 1.6.0, including HTTP request decoding, peer-response compression, and MongoDB wire compression.
  • The fork’s test_compression, test_titandb, and test_compact_range_bottommost_level_compaction passed with encryption,portable and Ditto’s RUSTC_BOOTSTRAP=1 setting on macOS ARM64.
  • With this published commit and the maintained Kafka branch, Ditto’s root, vnext, and standalone load-generator graphs all resolve zstd-sys 2.2.0+zstd.1.6.0 under --locked.

Downstream Linux AMD64 CI

Ditto #28640 tested this PR’s commit 9bae363.

Check Result What it verified
Patched Zstd in CI Confirmed The Store, CDC, vNext smoke-binary, and load-generator builds compiled zstd-sys 2.2.0+zstd.1.6.0. Store · CDC · vNext smoke binaries · Load generator
Hydra image builds Passed All four image groups built, including Store, CDC, CDC Counts, the stream splitter, and the Mongo connector. Big Peer CI
vNext CDC smoke Passed The MongoDB-backed CDC smoke ran with the patched library and default LZ4 output. CDC smoke
Trix image workflow Passed Cargo tests and the Trix, standalone load-generator, and CDC stress image builds passed. Trix CI
CDC with Zstd enabled Passed locally The end-to-end test verified CDC writes, and Kafka’s stored batch headers confirmed Zstd compression.
Store diagnostic tools Ubuntu package ldb and sst_dump build with Ubuntu’s Zstd package. The Cargo version check covers the Rust service binaries. Store Dockerfile

Codex prepared the two manifest changes and ran the verification above.

Co-Authored-By: Codex <noreply@openai.com>
@sergey-ditto
Sergey Madaminov (sergey-ditto) marked this pull request as ready for review November 24, 2026 20:47
@baz-reviewer

baz-reviewer Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Review this PR on Baz

Merger   ✅ Ready to Merge

The diff updates both RocksDB and Titan manifests to require zstd-sys 2.2.0, matching the PR’s stated deliverable. CI ran and there are no unresolved discussions.

Risk 🔴 High · Data change, Public API or contract

  • librocksdb_sys/Cargo.toml and libtitan_sys/Cargo.toml change the compression library used for persistent RocksDB and Titan data, so an incompatibility could make stored records unreadable.
  • The same manifest changes affect the on-disk compression format consumed by existing databases and downstream bindings.
    Facts: 4 lines changed in 2 files

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sergey-ditto
Sergey Madaminov (sergey-ditto) merged commit 4dbf7d2 into ditto-8.10 Nov 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants