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

raft: clean up raftLog entry slice indexing #130980

Merged
merged 6 commits into from
Sep 18, 2024

Conversation

pav-kv
Copy link
Collaborator

@pav-kv pav-kv commented Sep 18, 2024

This PR cleans up various raftLog/unstable methods, and converts the sub-slicing methods to (lo, hi] semantics instead of [lo, hi).

All raft log slices are constructed in context of being appended after a certain index, so (lo, hi] addressing makes more sense, and simplifies a bunch of +-1 arithmetics.

Related to #130967, #130955

Epic: none
Release note: none
All raft log slices are constructed in context of being appended after a
certain index, so (lo, hi] addressing makes more sense.

This also removes the redundant unstable.slice method.

Epic: none
Release note: none
Epic: none
Release note: none
Epic: none
Release note: none
@pav-kv pav-kv requested a review from tbg September 18, 2024 22:30
@pav-kv pav-kv requested a review from a team as a code owner September 18, 2024 22:30
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@pav-kv
Copy link
Collaborator Author

pav-kv commented Sep 18, 2024

@tbg I moved this clean-up out of #130967, to declutter the snapshot API change. Mind taking a final look / stamping?

Copy link
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

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

@pav-kv
Copy link
Collaborator Author

pav-kv commented Sep 18, 2024

Yeah, same commits. TFTR!

bors r=tbg

@craig craig bot merged commit 93f325f into cockroachdb:master Sep 18, 2024
22 of 23 checks passed
@pav-kv pav-kv deleted the raft-log-clean-up branch September 18, 2024 23:12
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