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: remove span declaration for merges #41036

Merged
merged 1 commit into from
Nov 11, 2019

Conversation

irfansharif
Copy link
Contributor

I'm just re-sending #40261 (reverted in #40446). These changes are
intended for 20.1 and will not be merged until after branching.


Prior to #28661, we used to include a snapshot of the RHS in the merge
trigger. Due to this, we declared a read only span over the RHS data
range. Now that we require ranges to be collocated during merges, we
didn't need to include the snapshot nor declare the span.

Orthogonal to this are Subsume requests that block out concurrent
commands to the RHS, with the appropriate span declarations contained
therein.

Release justification: N/A
Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@irfansharif irfansharif force-pushed the merge-spans-cleanup-v2 branch from a0ef58a to 10b7910 Compare October 19, 2019 03:48
@irfansharif irfansharif requested a review from ajwerner October 19, 2019 03:48
@irfansharif
Copy link
Contributor Author

@ajwerner: Nothing changed here since #40261, was just waiting for 19.2 cut. Now rebased, PTAL.

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.

Are there any meaningful implications to this change? Something that comes to mind is that now that we're not latching the LHS rangeID prefix it seems like concurrent lease transfers could proceed. That doesn't seem great as in the face of a re-ordering of commands we might fail out of a merge in the critical phase.

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

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.

Put another way, would we accept a PR that did the opposite of this to address the case of lease transfers during merges (given merges typically take place with dwindling load)? I'm inclined to think no. I prefer this change if only to be internally consistent, spans are declared across affected keys except when there's a compelling reason to break this rule. But happy to drop this if you disagree, no horses in this race.

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

@ajwerner
Copy link
Contributor

What do you mean by the opposite? If you mean latching the abort spans during a lease transfer, I'm inclined to think absolutely yes, in fact I don't think it's a crazy idea to add those latches to #41473 (which I would love for you to take a look at, really just the second commit). I'm interested in expanding that second commit to cover the entire RangeID prefix for the lease transfer. I think that would address my one in the tail concern about this PR.

@irfansharif
Copy link
Contributor Author

irfansharif commented Oct 22, 2019

Just took a look at #41473 (somehow this flew under my radar). I agree it makes sense latching abort spans during lease transfers, and would play well with this. I'll gate this on #41473 going in if nothing else here seems wonky.

edit: err, I have it the other way around. This should go in first for that added latching to make sense.

Prior to cockroachdb#28661, we used to include a snapshot of the RHS in the merge
trigger. Due to this, we declared a read only span over the RHS data
range. After we required ranges to be collocated during merges, we
didn't need to include the snapshot, so now now longer need to declare
the span.

Orthogonal to this are Subsume requests that block out concurrent
commands to the RHS, with the appropriate span declarations contained
therein.

Release note: None
@irfansharif irfansharif force-pushed the merge-spans-cleanup-v2 branch from 10b7910 to 0a24e27 Compare November 11, 2019 14:55
@irfansharif
Copy link
Contributor Author

@ajwerner: Want to take another look here now that #41473 is in?

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

@irfansharif
Copy link
Contributor Author

I saw a flaky build getting stuck on acceptance cdc/bank, kv/splits that I'm attributing to #41177. I'll be keeping a close look at incoming issues to see if I'm mistaken and I caused this breakage somehow.

@irfansharif
Copy link
Contributor Author

bors r=ajwerner

craig bot pushed a commit that referenced this pull request Nov 11, 2019
41036: storage: remove span declaration for merges r=ajwerner a=irfansharif

I'm just re-sending #40261 (reverted in #40446). These changes are 
intended for 20.1 and will not be merged until after branching.

---

Prior to #28661, we used to include a snapshot of the RHS in the merge
trigger. Due to this, we declared a read only span over the RHS data
range. Now that we require ranges to be collocated during merges, we
didn't need to include the snapshot nor declare the span.

Orthogonal to this are Subsume requests that block out concurrent
commands to the RHS, with the appropriate span declarations contained
therein.

Release justification: N/A
Release note: None

Co-authored-by: irfan sharif <[email protected]>
@craig
Copy link
Contributor

craig bot commented Nov 11, 2019

Build succeeded

@craig craig bot merged commit 0a24e27 into cockroachdb:master Nov 11, 2019
@irfansharif irfansharif deleted the merge-spans-cleanup-v2 branch November 11, 2019 18:58
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