Skip to content

skip CRC checksumming during diskless full sync with TLS enabled. - #1479

Merged
ranshid merged 18 commits into
valkey-io:unstablefrom
talxsha:unstable
Feb 4, 2025
Merged

ranshid merged 18 commits into
valkey-io:unstablefrom
talxsha:unstable

Conversation

@talxsha

@talxsha talxsha commented Dec 23, 2024 •

Copy link
Copy Markdown
Contributor

Implemented a mechanism to eliminate CRC64 checksumming during full sync when not writing to disk (using a connection that has data integrity checks such as TLS), as it adds overhead with minimal benefit.

Nodes can skip CRC calculations when these conditions are met:

  1. Running diskless sync on primary.
  2. Running diskless load on the replica.
  3. Primary-replica connection is integrity checked.

Closes #1129

@ranshid

ranshid commented Dec 23, 2024

Copy link
Copy Markdown
Member

@talxsha before I look into this, lets put some details in the top comment. linking the issue is not what we susually do.
Please state shortly what is the problem we are solving and what this solution includes.

Comment thread src/replication.c Resolved
Comment thread src/config.c Resolved
Comment thread src/server.c Resolved
Comment thread src/server.h Resolved
Comment thread src/rdb.c Resolved
Comment thread src/rdb.c Resolved
@madolson

Copy link
Copy Markdown
Member

Added the functionality to disable CRC calculations during diskless full sync with TLS enabled.

Also add justification for why we should do this only when TLS is enabled. Given that the network has built in checksumming, I'm still not convinced about the tradeoff we are making given that the steady state replication is not checksummed.

@ranshid

ranshid commented Dec 24, 2024

Copy link
Copy Markdown
Member

@madolson should I tag it as a major-decision ? I think it worth discussion.

Comment thread src/replication.c Resolved
@madolson

Copy link
Copy Markdown
Member

@madolson should I tag it as a major-decision ? I think it worth discussion.

For now it's not. It's just an internal one. I would probably just ping PingXie directly and core team if anyone else is interested.

@talxsha
talxsha marked this pull request as ready for review December 29, 2024 16:24
Signed-off-by: Tal Shachar <talxsha@amazon.com>
โ€ฆo bypass_crc, encapsulated condition checks for skipping CRC, and chenged connIsTLS condition to connIntegrityChecked in ConnectionType. Some changes in the test as well

Signed-off-by: Tal Shachar <talxsha@amazon.com>
Signed-off-by: talxsha <160726520+talxsha@users.noreply.github.com>
Comment thread src/connection.h Resolved
Comment thread src/server.h Resolved
Comment thread src/replication.c Resolved
Comment thread src/replication.c Resolved
Comment thread src/rdb.c Resolved
Comment thread src/rdb.c Resolved
Comment thread src/rdb.c Resolved
Comment thread src/rdb.c Resolved
Signed-off-by: ranshid <88133677+ranshid@users.noreply.github.com>
Signed-off-by: ranshid <88133677+ranshid@users.noreply.github.com>
Signed-off-by: ranshid <88133677+ranshid@users.noreply.github.com>
Signed-off-by: ranshid <88133677+ranshid@users.noreply.github.com>

@ranshid ranshid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@madolson the code seems fine now. would you like to take a quick look as well?

Signed-off-by: Ran Shidlansik <ranshid@amazon.com>

@madolson madolson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code looks okay, mostly some nits to improve clarity.

Comment thread src/tls.c Resolved
Comment thread src/unix.c Resolved
Comment thread src/server.c Resolved
Comment thread src/socket.c Resolved
Comment thread src/replication.c Resolved
Comment thread tests/integration/bypass-crc.tcl Resolved
Comment thread tests/integration/bypass-crc.tcl Resolved
Comment thread src/replication.c Resolved
Comment thread src/rdb.c Resolved
Comment thread src/replication.c Resolved
talxsha and others added 3 commits January 5, 2025 11:22
Signed-off-by: talxsha <160726520+talxsha@users.noreply.github.com>
โ€ฆecessary metric and added a log instead. Using sendCommandArgv when sendding replica capa

Signed-off-by: Tal Shachar <talxsha@amazon.com>
@ranshid ranshid changed the title CRC removal during diskless full sync with TLS enabled. skip CRC checksumming during diskless full sync with TLS enabled. Jan 14, 2025
@madolson madolson added the release-notes This issue should get a line item in the release notes label Jan 15, 2025
@codecov

codecov Bot commented Jan 17, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 73.52941% with 9 lines in your changes missing coverage. Please review.

Project coverage is 71.00%. Comparing base (12ec3d5) to head (7c74b58).
Report is 7 commits behind head on unstable.

Files with missing lines Patch % Lines
src/replication.c 66.66% 8 Missing โš ๏ธ
src/rdb.c 85.71% 1 Missing โš ๏ธ
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1479      +/-   ##
============================================
+ Coverage     70.98%   71.00%   +0.01%     
============================================
  Files           121      121              
  Lines         65176    65238      +62     
============================================
+ Hits          46264    46321      +57     
- Misses        18912    18917       +5     
Files with missing lines Coverage ฮ”
src/connection.h 87.77% <100.00%> (+0.27%) โฌ†๏ธ
src/rdma.c 100.00% <รธ> (รธ)
src/rio.c 84.83% <100.00%> (รธ)
src/rio.h 100.00% <รธ> (รธ)
src/server.h 100.00% <รธ> (รธ)
src/socket.c 91.62% <รธ> (รธ)
src/tls.c 100.00% <รธ> (รธ)
src/unix.c 73.49% <รธ> (รธ)
src/rdb.c 76.85% <85.71%> (-0.36%) โฌ‡๏ธ
src/replication.c 87.31% <66.66%> (-0.14%) โฌ‡๏ธ

... and 17 files with indirect coverage changes

@ranshid

ranshid commented Jan 17, 2025

Copy link
Copy Markdown
Member

@talxsha please fix the spellcheck/format issues and also the tests should probably be tagged with cluster:skip

Comment thread tests/integration/skip-rdb-checksum.tcl Resolved
Signed-off-by: Tal Shachar <talxsha@amazon.com>
Signed-off-by: Tal Shachar <talxsha@amazon.com>
@ranshid
ranshid merged commit 2eac2cc into valkey-io:unstable Feb 4, 2025
murphyjacob4 pushed a commit to enjoy-binbin/valkey that referenced this pull request Apr 13, 2025
โ€ฆlkey-io#1479)

Implemented a mechanism to eliminate CRC64 checksumming during full sync
when not writing to disk (using a connection that has data integrity
checks such as TLS), as it adds overhead with minimal benefit.

Nodes can skip CRC calculations when these conditions are met:
1. Running diskless sync on primary.
2. Running diskless load on the replica.
3. Primary-replica connection is integrity checked.

Closes valkey-io#1129

---------

Signed-off-by: Tal Shachar <talxsha@amazon.com>
Signed-off-by: talxsha <160726520+talxsha@users.noreply.github.com>
Signed-off-by: ranshid <88133677+ranshid@users.noreply.github.com>
Signed-off-by: Ran Shidlansik <ranshid@amazon.com>
Co-authored-by: ranshid <88133677+ranshid@users.noreply.github.com>
Co-authored-by: Ran Shidlansik <ranshid@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes This issue should get a line item in the release notes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Skip CRC64 checksumming when doing diskless replication

3 participants