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

storage/roachpb: various cleanup around Refresh{Range}Request #34566

Merged

Conversation

nvanbenschoten
Copy link
Member

This PR includes a few small changes that I noticed while investigating #34025.

We no longer need special cases for these two request types in
updateTimestampCache.

Release note: None
@nvanbenschoten nvanbenschoten requested a review from a team February 5, 2019 06:59
@cockroach-teamcity
Copy link
Member

This change is Reviewable

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.

Reviewed 2 of 2 files at r1, 2 of 2 files at r2, 2 of 2 files at r3.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @nvanbenschoten)


pkg/storage/batcheval/cmd_refresh.go, line 59 at r3 (raw file):

		//   !ts.Less(h.Txn.PrevRefreshTimestamp)
		// This could avoid failed refreshes due to requests performed after
		// earlier refreshes.

How would that happen? The previous refresh seals the timestamp cache for PrevRefreshTimestamp. Doesn't that guarantee that nothing new ever happens below?


pkg/storage/batcheval/cmd_refresh_range.go, line 55 at r3 (raw file):

		Tombstones:   true,
	}, func(kv roachpb.KeyValue) (bool, error) {
		// TODO(nvanbenschoten): This is pessimistic. We only need to check

Ditto.

Also improve a comment.

Release note: None
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 @nvanbenschoten and @tbg)


pkg/storage/batcheval/cmd_refresh.go, line 59 at r3 (raw file):

Previously, tbg (Tobias Grieger) wrote…

How would that happen? The previous refresh seals the timestamp cache for PrevRefreshTimestamp. Doesn't that guarantee that nothing new ever happens below?

This is talking about requests issued for the first time after a refresh has already happened. For instance, consider:

txnA (orig=1) - read X
txnA (orig=1) - read Y, find intent at ts 3

txnB (orig=2) - write Z @ ts=2

txnA refresh to 3
txnA (ref=3) - read Z and respect the write to Z
txnA refresh to 4 for some other reason

When refreshing key Z, we shouldn't fail because of the intent at time 2.

I tried to make the comment more clear.

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.

:lgtm:

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

@nvanbenschoten
Copy link
Member Author

bors r+

craig bot pushed a commit that referenced this pull request Feb 5, 2019
34566: storage/roachpb: various cleanup around Refresh{Range}Request r=nvanbenschoten a=nvanbenschoten

This PR includes a few small changes that I noticed while investigating #34025.

Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
@craig
Copy link
Contributor

craig bot commented Feb 5, 2019

Build succeeded

@craig craig bot merged commit e7d470a into cockroachdb:master Feb 5, 2019
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/replicaCleanup branch February 11, 2019 18:54
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