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/spanlatch: add test for overlapping spans #40260

Merged
merged 1 commit into from
Aug 30, 2019

Conversation

irfansharif
Copy link
Contributor

When overlapping spans are acquired, the spanlatch Manager should
grant access based on the more restrictive latch over the specific
overlapped sub-span.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@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.

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


pkg/storage/spanlatch/manager_test.go, line 169 at r1 (raw file):

	latchCs = append(latchCs, m.MustAcquireCh(spans("a", "b", write), zeroTS))
	latchCs = append(latchCs, m.MustAcquireCh(spans("b", "c", read), zeroTS))
	latchCs = append(latchCs, m.MustAcquireCh(spans("b", "c", write), zeroTS))

Right now this case and the last case are getting blocked on their previous cases, not the original latches, right? Can we avoid that by putting the reads at lower timestamps than the writes?

When overlapping spans are acquired, the spanlatch Manager should
grant access based on the more restrictive latch over the specific
overlapped sub-span.

Release note: None
Copy link
Contributor Author

@irfansharif irfansharif 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)


pkg/storage/spanlatch/manager_test.go, line 169 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Right now this case and the last case are getting blocked on their previous cases, not the original latches, right? Can we avoid that by putting the reads at lower timestamps than the writes?

oh woops, and yep that does it.

Copy link
Member

@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.

:lgtm:

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

@irfansharif
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Aug 30, 2019
40260: storage/spanlatch: add test for overlapping spans r=irfansharif a=irfansharif

When overlapping spans are acquired, the spanlatch Manager should
grant access based on the more restrictive latch over the specific
overlapped sub-span.

Release note: None

Co-authored-by: irfan sharif <irfanmahmoudsharif@gmail.com>
@craig
Copy link
Contributor

craig bot commented Aug 30, 2019

Build succeeded

@craig craig bot merged commit b98fef3 into cockroachdb:master Aug 30, 2019
@irfansharif irfansharif deleted the spanlatch-test branch August 30, 2019 14:59
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