Skip to content

Full-sync streaming compression - standalone on #3531 base - #23

Open
roshkhatri wants to merge 1 commit into
streaming-compression-rio-prfrom
repl-streaming-compression-fullsync-v3
Open

Full-sync streaming compression - standalone on #3531 base#23
roshkhatri wants to merge 1 commit into
streaming-compression-rio-prfrom
repl-streaming-compression-fullsync-v3

Conversation

@roshkhatri

@roshkhatri roshkhatri commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Full-sync RDB payload compression (disk-based, diskless, dual-channel) as one commit directly on sarthak's streaming-compression-rio-pr (valkey-io#3531) tip dfcc37a, independent of the incremental replication PR.

Adds the pieces fullsync needs: REPLCONF capa compression negotiation, the repl-compression config (no | lz4, modifiable, applies to subsequent syncs), the per-handshake provisional latch, and the rio conn partial-read machinery (rioConnFillBuffer/rioConnReadSome) deferred from valkey-io#3531 review.

Compression rule: the primary compresses a full sync only when every replica in the attaching cohort advertised the capability; if any attaching replica is not capable, the payload is sent plaintext to all of them. $EOF framing stays plaintext; the frame checksum replaces the RDB CRC64; a link dropped mid-frame is recoverable truncation (resync), not corruption.

Verified: build zero warnings, unit 329/329, fullsync suite 16/16, repl-compression matrix green, replication 68/68, aof-sync 7/7, clang-format clean.

Siblings: PR #22 (same feature stacked on the incremental base), PR #21 (incremental), upstream valkey-io#4075.

@roshkhatri
roshkhatri force-pushed the repl-streaming-compression-fullsync-v3 branch 15 times, most recently from aaafee1 to 20d0431 Compare August 11, 2026 22:22
@roshkhatri
roshkhatri force-pushed the streaming-compression-rio-pr branch from dfcc37a to 62a5899 Compare August 11, 2026 23:12
@roshkhatri
roshkhatri force-pushed the repl-streaming-compression-fullsync-v3 branch 5 times, most recently from 8a5389c to c274d2d Compare August 13, 2026 16:54
Comment thread src/replication.c Outdated
retval = rdbSaveToReplicasSockets(req, rdbver, rsiptr);
else {
int save_flags = RDBFLAGS_REPLICATION | RDBFLAGS_KEEP_CACHE;
/* The round is compressed when mincapa carries the compress-sync bit

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

simplify this and reduce the compress the comment in a gist

Comment thread src/rdb.c Outdated
* Disk-based sync snapshots can also become AOF bases, which currently do
* not record whether the reused RDB has whole-stream compression. */
if (rdbflags & RDBFLAGS_REPLICATION) use_streaming_compression = false;
/* Replication full sync compresses only when the cohort negotiated it

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

reduce and compress the comment to a gist

@roshkhatri
roshkhatri force-pushed the streaming-compression-rio-pr branch from 62a5899 to 26d48a4 Compare August 13, 2026 18:28
@roshkhatri
roshkhatri force-pushed the repl-streaming-compression-fullsync-v3 branch from c274d2d to fb3c3cc Compare August 13, 2026 18:28
@roshkhatri
roshkhatri force-pushed the streaming-compression-rio-pr branch from 26d48a4 to e45f2d6 Compare August 14, 2026 19:43
@roshkhatri
roshkhatri force-pushed the repl-streaming-compression-fullsync-v3 branch 3 times, most recently from ce8f008 to 8212f1d Compare August 14, 2026 21:39
@roshkhatri
roshkhatri force-pushed the repl-streaming-compression-fullsync-v3 branch 2 times, most recently from 40c6617 to 30f5934 Compare August 14, 2026 22:36
Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
@roshkhatri
roshkhatri force-pushed the repl-streaming-compression-fullsync-v3 branch from 30f5934 to 67ed2b5 Compare August 14, 2026 23:51
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