Skip to content

feat: enable zstd compression auto-negotiation - #3081

Merged
oferchen merged 1 commit into
masterfrom
feat/enable-zstd-lz4-negotiation
Mar 31, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/enable-zstd-lz4-negotiation

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

Changes

  • algorithms.rs: supported_compressions() now includes "zstd" behind #[cfg(feature = "zstd")]
  • run_interop.sh: Remove 2 zstd entries from KNOWN_FAILURES

Test plan

  • CI interop compress-zstd tests pass in both directions
  • Auto-negotiation selects zstd when both peers have it compiled
  • No regressions in other interop tests

Advertise zstd in the compression capability string for protocol 30+
negotiation, matching upstream rsync 3.4.1's preference order
(zstd > lz4 > zlibx > zlib > none). Zstd wire framing was validated
in PR #1376.

LZ4 remains gated pending wire framing fix (#1378).

Remove oc:compress-zstd and up:compress-zstd from KNOWN_FAILURES.
@github-actions github-actions Bot added the enhancement New feature or request label Mar 31, 2026
@oferchen
oferchen merged commit 78b840b into master Mar 31, 2026
32 of 44 checks passed
@oferchen
oferchen deleted the feat/enable-zstd-lz4-negotiation branch March 31, 2026 14:07
oferchen added a commit that referenced this pull request Apr 5, 2026
Add zstd to the supported compression list advertised during vstring
negotiation, gated on the `zstd` feature flag. When both peers support
zstd, it is automatically selected as the preferred compression codec
instead of falling back to zlibx/zlib. This mirrors upstream rsync's
compat.c:100-112 where SUPPORT_ZSTD gates zstd in the preference list.

The zstd per-token wire framing was validated in PR #3081, making it
safe for auto-negotiation. Lz4 remains excluded until its wire format
is interop-validated (task #1380). Graceful fallback to zlibx/zlib
occurs when the remote peer does not advertise zstd support.
oferchen added a commit that referenced this pull request Apr 6, 2026
Add zstd to the supported compression list advertised during vstring
negotiation, gated on the `zstd` feature flag. When both peers support
zstd, it is automatically selected as the preferred compression codec
instead of falling back to zlibx/zlib. This mirrors upstream rsync's
compat.c:100-112 where SUPPORT_ZSTD gates zstd in the preference list.

The zstd per-token wire framing was validated in PR #3081, making it
safe for auto-negotiation. Lz4 remains excluded until its wire format
is interop-validated (task #1380). Graceful fallback to zlibx/zlib
occurs when the remote peer does not advertise zstd support.
oferchen added a commit that referenced this pull request Apr 6, 2026
Add zstd to the supported compression list advertised during vstring
negotiation, gated on the `zstd` feature flag. When both peers support
zstd, it is automatically selected as the preferred compression codec
instead of falling back to zlibx/zlib. This mirrors upstream rsync's
compat.c:100-112 where SUPPORT_ZSTD gates zstd in the preference list.

The zstd per-token wire framing was validated in PR #3081, making it
safe for auto-negotiation. Lz4 remains excluded until its wire format
is interop-validated (task #1380). Graceful fallback to zlibx/zlib
occurs when the remote peer does not advertise zstd support.
oferchen added a commit that referenced this pull request Apr 6, 2026
* feat: enable zstd compression auto-negotiation

Add zstd to the supported compression list advertised during vstring
negotiation, gated on the `zstd` feature flag. When both peers support
zstd, it is automatically selected as the preferred compression codec
instead of falling back to zlibx/zlib. This mirrors upstream rsync's
compat.c:100-112 where SUPPORT_ZSTD gates zstd in the preference list.

The zstd per-token wire framing was validated in PR #3081, making it
safe for auto-negotiation. Lz4 remains excluded until its wire format
is interop-validated (task #1380). Graceful fallback to zlibx/zlib
occurs when the remote peer does not advertise zstd support.

* fix: reuse sender-side CompressedTokenEncoder across files for zstd

Create the CompressedTokenEncoder once at session level in
run_transfer_loop() and pass it to per-file functions, matching
upstream token.c's single compression context pattern. Previously
each file created a new encoder (new ZSTD_CCtx), breaking zstd's
continuous-stream contract where the receiver expects one DCtx
for the entire session.

upstream: token.c uses a single compression context across all files
oferchen added a commit that referenced this pull request Apr 11, 2026
Add a standalone interop test that validates zstd compression
auto-negotiation against upstream rsync 3.4.1 (PR #3081). Tests both
daemon push directions: upstream client to oc-rsync daemon and oc-rsync
client to upstream daemon. Verifies transferred files match via byte
comparison. Gated on upstream zstd support availability.
oferchen added a commit that referenced this pull request Apr 11, 2026
Add a standalone interop test that validates zstd compression
auto-negotiation against upstream rsync 3.4.1 (PR #3081). Tests both
daemon push directions: upstream client to oc-rsync daemon and oc-rsync
client to upstream daemon. Verifies transferred files match via byte
comparison. Gated on upstream zstd support availability.
oferchen added a commit that referenced this pull request May 1, 2026
Advertise zstd in the compression capability string for protocol 30+
negotiation, matching upstream rsync 3.4.1's preference order
(zstd > lz4 > zlibx > zlib > none). Zstd wire framing was validated
in PR #1376.

LZ4 remains gated pending wire framing fix (#1378).

Remove oc:compress-zstd and up:compress-zstd from KNOWN_FAILURES.
oferchen added a commit that referenced this pull request May 1, 2026
* feat: enable zstd compression auto-negotiation

Add zstd to the supported compression list advertised during vstring
negotiation, gated on the `zstd` feature flag. When both peers support
zstd, it is automatically selected as the preferred compression codec
instead of falling back to zlibx/zlib. This mirrors upstream rsync's
compat.c:100-112 where SUPPORT_ZSTD gates zstd in the preference list.

The zstd per-token wire framing was validated in PR #3081, making it
safe for auto-negotiation. Lz4 remains excluded until its wire format
is interop-validated (task #1380). Graceful fallback to zlibx/zlib
occurs when the remote peer does not advertise zstd support.

* fix: reuse sender-side CompressedTokenEncoder across files for zstd

Create the CompressedTokenEncoder once at session level in
run_transfer_loop() and pass it to per-file functions, matching
upstream token.c's single compression context pattern. Previously
each file created a new encoder (new ZSTD_CCtx), breaking zstd's
continuous-stream contract where the receiver expects one DCtx
for the entire session.

upstream: token.c uses a single compression context across all files
oferchen added a commit that referenced this pull request May 1, 2026
Add a standalone interop test that validates zstd compression
auto-negotiation against upstream rsync 3.4.1 (PR #3081). Tests both
daemon push directions: upstream client to oc-rsync daemon and oc-rsync
client to upstream daemon. Verifies transferred files match via byte
comparison. Gated on upstream zstd support availability.
oferchen added a commit that referenced this pull request May 5, 2026
Advertise zstd in the compression capability string for protocol 30+
negotiation, matching upstream rsync 3.4.1's preference order
(zstd > lz4 > zlibx > zlib > none). Zstd wire framing was validated
in PR #1376.

LZ4 remains gated pending wire framing fix (#1378).

Remove oc:compress-zstd and up:compress-zstd from KNOWN_FAILURES.
oferchen added a commit that referenced this pull request May 5, 2026
* feat: enable zstd compression auto-negotiation

Add zstd to the supported compression list advertised during vstring
negotiation, gated on the `zstd` feature flag. When both peers support
zstd, it is automatically selected as the preferred compression codec
instead of falling back to zlibx/zlib. This mirrors upstream rsync's
compat.c:100-112 where SUPPORT_ZSTD gates zstd in the preference list.

The zstd per-token wire framing was validated in PR #3081, making it
safe for auto-negotiation. Lz4 remains excluded until its wire format
is interop-validated (task #1380). Graceful fallback to zlibx/zlib
occurs when the remote peer does not advertise zstd support.

* fix: reuse sender-side CompressedTokenEncoder across files for zstd

Create the CompressedTokenEncoder once at session level in
run_transfer_loop() and pass it to per-file functions, matching
upstream token.c's single compression context pattern. Previously
each file created a new encoder (new ZSTD_CCtx), breaking zstd's
continuous-stream contract where the receiver expects one DCtx
for the entire session.

upstream: token.c uses a single compression context across all files
oferchen added a commit that referenced this pull request May 5, 2026
Add a standalone interop test that validates zstd compression
auto-negotiation against upstream rsync 3.4.1 (PR #3081). Tests both
daemon push directions: upstream client to oc-rsync daemon and oc-rsync
client to upstream daemon. Verifies transferred files match via byte
comparison. Gated on upstream zstd support availability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant