Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvserver: remove legacy snapshot and diff code #89813

Merged
merged 2 commits into from
Oct 17, 2022

Conversation

pav-kv
Copy link
Collaborator

@pav-kv pav-kv commented Oct 12, 2022

This commit removes the proto and code for RaftDataSnapshot. This type was used for reporting replica snapshots and computing diffs, but now this functionality has been removed in favor of storage checkpoints and offline tooling.

Part of #21128
Epic: none

Release note: None

@pav-kv pav-kv requested a review from erikgrinaker October 12, 2022 13:44
@pav-kv pav-kv requested a review from a team as a code owner October 12, 2022 13:44
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@erikgrinaker
Copy link
Contributor

Let's hold off until we know what's up with 22.1 compatibility. I think we can still get rid of the diffs, because 22.1 will degrade gracefully if we omit them from the responses, but let's confirm.

This commit removes the proto and code for RaftDataSnapshot. This type was used
for reporting replica snapshots and computing diffs, but now this functionality
has been removed in favor of storage checkpoints and offline tooling.

Release note: None
Copy link
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

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

Good riddance!

As you may know, version-skipping upgrades were pushed back, so we don't need 22.1 compatibility for 23.1. In other words, let's merge this.

func ChecksumRange(
ctx context.Context, desc roachpb.RangeDescriptor, snap storage.Reader,
) ([]byte, error) {
var r *Replica // TODO(pavelkalinnikov): make this less ugly.
Copy link
Contributor

@erikgrinaker erikgrinaker Oct 17, 2022

Choose a reason for hiding this comment

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

sha512() doesn't use the Replica receiver for anything, so we can just rename and export the function instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made it a stand-alone replicaSHA512 function, but not exported for now. It would require changing signature, or exporting the ad-hoc replicaHash type together with it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll see tomorrow if I can make this even cleaner, and will send a follow-up PR if so.

This function does not use the replica, so does not have to be a method.

Epic: None
Release note: None
@pav-kv
Copy link
Collaborator Author

pav-kv commented Oct 17, 2022

bors r=erikgrinaker

@craig
Copy link
Contributor

craig bot commented Oct 17, 2022

Build succeeded:

@craig craig bot merged commit c68e94a into cockroachdb:master Oct 17, 2022
@pav-kv pav-kv deleted the rm_diff_code branch October 17, 2022 20:42
craig bot pushed a commit that referenced this pull request Oct 26, 2022
90313: kvserver: cleanup replica checksum computation func r=erikgrinaker a=pavelkalinnikov

This commit makes the replica checksum helper more convenient for tests, and simplifies the tests using it.

Follows up on #89813 (comment)

Epic: None
Release note: None

Co-authored-by: Pavel Kalinnikov <[email protected]>
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.

3 participants