Skip to content

kv: extract etcd/raft utilities into raftutil library#82797

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/raftutil
Jun 13, 2022
Merged

kv: extract etcd/raft utilities into raftutil library#82797
craig[bot] merged 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/raftutil

Conversation

@nvb
Copy link
Copy Markdown
Contributor

@nvb nvb commented Jun 12, 2022

Commit pulled from #82758.

This commit extracts some scattered logic to interpret the state of an etcd/raft Status into a new raftutil library. The library initially has two functions: ReplicaIsBehind and ReplicaMayNeedSnapshot. In the future, I expect that we'll extract more helper functions that make working with etcd/raft easier into this library.

This commit extracts some scattered logic to interpret the state of an
etcd/raft Status into a new `raftutil` library. The library initially
has two functions: `ReplicaIsBehind` and `ReplicaMayNeedSnapshot`. In
the future, I expect that we'll extract more helper functions that
make working with etcd/raft easier into this library.
@nvb nvb requested a review from irfansharif June 12, 2022 15:55
@nvb nvb requested a review from a team as a code owner June 12, 2022 15:55
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

Nice refactor.

Reviewed 13 of 13 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @irfansharif)

Copy link
Copy Markdown
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.

Appreciate the extra tests too.

@nvb
Copy link
Copy Markdown
Contributor Author

nvb commented Jun 13, 2022

TFTRs!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 13, 2022

Build failed:

@nvb
Copy link
Copy Markdown
Contributor Author

nvb commented Jun 13, 2022

Service 'kdc' failed to build: Head "https://registry-1.docker.io/v2/library/alpine/manifests/3.14": received unexpected HTTP status: 500 Internal Server Error

Docker hub flake.

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 13, 2022

This PR was included in a batch that was canceled, it will be automatically retried

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 13, 2022

Build succeeded:

@craig craig bot merged commit 0e5927a into cockroachdb:master Jun 13, 2022
@nvb nvb deleted the nvanbenschoten/raftutil branch June 21, 2022 13:32
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.

5 participants