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: return empty LeaseStatus from leaseGoodToGoRLocked during follower reads #60901

Conversation

nvanbenschoten
Copy link
Member

Fixes #60830.

This was broken in c44b357 and started causing problems after 0668efb.
A non-empty LeaseStatus during follower reads was tripping up logic that
assumed that a VALID LeaseStatus indicated that the serving replica was
the leaseholder. This assumption used to hold, but unintentionally did
not anymore.

Returning an empty LeaseStatus on follower reads instead of expanding
the meaning of a VALID LeaseStatus to include follower reads seems like
the right change. This is because we want to get to a place where the
lease is only checked if a replica does not have a sufficient closed
timestamp, so follower reads should never even need to consult the
lease - see #57992.

…r reads

Fixes cockroachdb#60830.

This was broken in c44b357 and started causing problems after 0668efb.
A non-empty LeaseStatus during follower reads was tripping up logic that
assumed that a VALID LeaseStatus indicated that the serving replica was
the leaseholder. This assumption used to hold, but unintentionally did
not anymore.

Returning an empty LeaseStatus on follower reads instead of expanding
the meaning of a VALID LeaseStatus to include follower reads seems like
the right change. This is because we want to get to a place where the
lease is only checked if a replica does not have a sufficient closed
timestamp, so follower reads should never even need to consult the
lease - see cockroachdb#57992.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@ajwerner ajwerner 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 3 of 3 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

These flakes are extremely frequent. I'm going to bors this for you. Hope that's okay by you.

bors r=ajwerner

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

oh I just saw your note that this may not be the root cause, err, my bad. Feel free to bors r- but this still seems reasonable.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@nvanbenschoten
Copy link
Member Author

Hope that's okay by you.

Perfectly fine by me. Thanks for the review. I do think this is the root cause - 0668efb just revealed the issue because it made follower reads so much more consistent.

@craig
Copy link
Contributor

craig bot commented Feb 22, 2021

Build failed:

@nvanbenschoten
Copy link
Member Author

Let’s try that again now that the revert landed.

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 22, 2021

Build failed:

@nvanbenschoten
Copy link
Member Author

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 22, 2021

Build succeeded:

@craig craig bot merged commit 5b88d80 into cockroachdb:master Feb 22, 2021
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/followerReadLeaseStatus branch February 22, 2021 16:48
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/kvserver: TestStrictGCEnforcement failed
3 participants