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

kv: hook Raft StoreLiveness into storeliveness package #126533

Merged

Conversation

nvanbenschoten
Copy link
Member

Fixes #125242.

This commit adds a replicaRLockedStoreLiveness adapter type to hook the raft store liveness into the storeliveness package.

This is currently unused.

Release note: None

@nvanbenschoten nvanbenschoten requested a review from a team as a code owner July 2, 2024 03:38
Copy link

blathers-crl bot commented Jul 2, 2024

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@miraradeva miraradeva left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @arulajmani and @nvanbenschoten)


pkg/kv/kvserver/replica_store_liveness.go line 73 at r1 (raw file):

// SupportInPast implements the raftstoreliveness.StoreLiveness interface.
func (r *replicaRLockedStoreLiveness) SupportInPast(ts hlc.Timestamp) bool {

The name of this method was a bit confusing until I saw what it actually does. The name on its own seems to imply (to me at least) that it's checking for support at some past timestamp from a history of provided support.

Where will we use this? Anywhere we check if support is still provided? Maybe SupportExpired fits better?

Copy link
Collaborator

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

:lgtm:

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

@nvanbenschoten nvanbenschoten force-pushed the nvanbenschoten/storeLivenessHook branch from 59a6fe4 to e1a7df6 Compare July 2, 2024 15:05
@nvanbenschoten nvanbenschoten requested review from a team, arulajmani and miraradeva July 2, 2024 15:05
Copy link
Member Author

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

TFTRs!

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @arulajmani and @miraradeva)


pkg/kv/kvserver/replica_store_liveness.go line 73 at r1 (raw file):
I like SupportExpired. I think it's actually what we had until I convinced @arulajmani to switch to SupportInPast. Switched back here and in the raftstoreliveness.StoreLiveness interface.

Where will we use this? Anywhere we check if support is still provided?

We will use this when determining whether we should step down as the Raft leader. If support is in the past / expired, we step down.

Fixes cockroachdb#125242.

This commit adds a `replicaRLockedStoreLiveness` adapter type to
hook the raft store liveness into the storeliveness package.

This is currently unused.

Release note: None
@nvanbenschoten nvanbenschoten force-pushed the nvanbenschoten/storeLivenessHook branch from e1a7df6 to 393d1ee Compare July 2, 2024 16:21
@nvanbenschoten
Copy link
Member Author

bors r+

@craig craig bot merged commit 786cb46 into cockroachdb:master Jul 2, 2024
21 of 22 checks passed
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.

kv: hook Raft StoreLiveness into storeliveness package
4 participants