Skip to content

Replication compression configs and handshake negotiation#16

Open
roshkhatri wants to merge 1 commit into
streaming-compression-rio-prfrom
repl-compression-handshake-v2
Open

Replication compression configs and handshake negotiation#16
roshkhatri wants to merge 1 commit into
streaming-compression-rio-prfrom
repl-compression-handshake-v2

Conversation

@roshkhatri

Copy link
Copy Markdown
Owner

… config

Introduces REPLICA_CAPA_COMPRESSION handshake negotiation and a replcompression boolean config. A replica with replcompression=yes advertises capa compression during the PSYNC handshake when using diskless load. The primary records REPLICA_CAPA_COMPRESSION on the replica's capa bitmask but takes no action on it yet — compressed replication transport lands in a follow-up.

Compression parameters (algorithm, level) are fixed internally via REPL_COMPRESSION_ALGO (ALGO_LZ4) and REPL_COMPRESSION_LEVEL (5, HC mode) and will become configurable in a later release.

  • src/server.h: new REPLICA_CAPA_COMPRESSION (1<<4) flag, matching STR, repl_compression field, and REPL_COMPRESSION{ALGO,LEVEL} constants
  • src/config.c: new replcompression bool config
  • src/replication.c: primary records capa in replconfCommand; replica advertises capa compression when server.repl_compression and useDisklessLoad(); argv/lens arrays grown from 9 to 11 entries; useDisklessLoad() extracted into a local reused by skip-rdb-checksum and compression checks
  • valkey.conf: new replcompression config documentation block
  • src/unit/test_repl_compression.cpp: 3 GTest cases covering capa bit uniqueness, capa string, and ALGO_LZ4 non-zero
  • tests/integration/repl-compression.tcl: 9 TCL integration tests covering config CRUD, CONFIG REWRITE persistence, and handshake behavior

… config

Introduces REPLICA_CAPA_COMPRESSION handshake negotiation and a
replcompression boolean config. A replica with replcompression=yes
advertises capa compression during the PSYNC handshake when using
diskless load. The primary records REPLICA_CAPA_COMPRESSION on the
replica's capa bitmask but takes no action on it yet — compressed
replication transport lands in a follow-up.

Compression parameters (algorithm, level) are fixed internally via
REPL_COMPRESSION_ALGO (ALGO_LZ4) and REPL_COMPRESSION_LEVEL (5, HC
mode) and will become configurable in a later release.

- src/server.h: new REPLICA_CAPA_COMPRESSION (1<<4) flag, matching
  _STR, repl_compression field, and REPL_COMPRESSION_{ALGO,LEVEL}
  constants
- src/config.c: new replcompression bool config
- src/replication.c: primary records capa in replconfCommand; replica
  advertises capa compression when server.repl_compression and
  useDisklessLoad(); argv/lens arrays grown from 9 to 11 entries;
  useDisklessLoad() extracted into a local reused by skip-rdb-checksum
  and compression checks
- valkey.conf: new replcompression config documentation block
- src/unit/test_repl_compression.cpp: 3 GTest cases covering capa bit
  uniqueness, capa string, and ALGO_LZ4 non-zero
- tests/integration/repl-compression.tcl: 9 TCL integration tests
  covering config CRUD, CONFIG REWRITE persistence, and handshake
  behavior

Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
@roshkhatri roshkhatri force-pushed the repl-compression-handshake-v2 branch from c5ecfeb to 92db9be Compare May 22, 2026 19:38
@roshkhatri roshkhatri force-pushed the streaming-compression-rio-pr branch from 750a667 to 68b9d75 Compare May 22, 2026 19:41
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.

1 participant