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

roachpb: use LocalUncertaintyLimit from err in readWithinUncertaintyIntervalRetryTimestamp #60021

Merged

Conversation

nvanbenschoten
Copy link
Member

@nvanbenschoten nvanbenschoten commented Feb 9, 2021

Fixes #57685.

This commit updates readWithinUncertaintyIntervalRetryTimestamp to use the the LocalUncertaintyLimit field from ReadWithinUncertaintyIntervalError in place of ObservedTimestamps. This addresses a bug where ReadWithinUncertaintyIntervalErrors thrown by follower replicas during follower reads would use meaningless observed timestamps.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r8.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @nvanbenschoten)


pkg/roachpb/data.go, line 1499 at r8 (raw file):

	// global uncertainty limit. This, in turn, means that we can't rely on the
	// local uncertainty limit being a "clock timestamp". An alternative would
	// be to say that the local uncertainty limit is optional and only exists if

optionality does sound cleaner since it imposes a stronger invariant that it is never synthetic.
is it messy to plumb it as optional?

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.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @sumeerbhola)


pkg/roachpb/data.go, line 1499 at r8 (raw file):

Previously, sumeerbhola wrote…

optionality does sound cleaner since it imposes a stronger invariant that it is never synthetic.
is it messy to plumb it as optional?

Done over in #60021. I've now updated the comment to reflect this, along with the discussion we were having over there.

Copy link
Collaborator

@sumeerbhola sumeerbhola 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 1 of 9 files at r9.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @nvanbenschoten)


pkg/roachpb/data.go, line 1499 at r8 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Done over in #60021. I've now updated the comment to reflect this, along with the discussion we were having over there.

Looks good.
It is a little bit nuanced that advancing past a synthetic timestamp corresponding to the uncertainty error is essential for liveness, so we do it, even though it may be in the future, but advancing past the global uncertainty limit is safe, not needed for liveness, and bad for performance, so we don't do it.

…ntervalRetryTimestamp

Fixes cockroachdb#57685.

This commit updates readWithinUncertaintyIntervalRetryTimestamp to use the the
LocalUncertaintyLimit field from ReadWithinUncertaintyIntervalError in place of
ObservedTimestamps directly in readWithinUncertaintyIntervalRetryTimestamp. This
addresses a bug where ReadWithinUncertaintyIntervalErrors thrown by follower
replicas during follower reads would use meaningless observed timestamps.

Release note: None
@nvanbenschoten
Copy link
Member Author

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 18, 2021

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Feb 18, 2021

Build succeeded:

@craig craig bot merged commit ca1a1a7 into cockroachdb:master Feb 18, 2021
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/rwuiFollowerRead branch February 18, 2021 19:29
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: handle ReadWithinUncertaintyInterval errors on follower reads
3 participants