-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
sql/distsqlrun: drain the source if the dest requests draining #22832
sql/distsqlrun: drain the source if the dest requests draining #22832
Conversation
Review status: 0 of 2 files reviewed at latest revision, all discussions resolved, all commit checks successful. pkg/sql/run_control_test.go, line 271 at r1 (raw file):
@andreimatei FYI, these seem to have appeared due to #22277. Seems like the new executor is no longer properly returning query canceled error in all cases. Comments from Reviewable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Review status: 0 of 2 files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/sql/distsqlrun/base.go, line 154 at r1 (raw file):
You could remove this Comments from Reviewable |
Reviewed 2 of 2 files at r1. pkg/sql/distsqlrun/base.go, line 154 at r1 (raw file): Previously, asubiotto (Alfonso Subiotto Marqués) wrote…
If you do that, you could do that for the Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/sql/run_control_test.go, line 271 at r1 (raw file): Previously, petermattis (Peter Mattis) wrote…
Let me see what differences are with what errors were generated before. Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/sql/run_control_test.go, line 271 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
One of the errors I see returned here is Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/sql/run_control_test.go, line 271 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
Yeah, either the test is funky or the new executor is. Let me try running with the old executor. I'll hold off on merging until you give this a thumbs-up. pkg/sql/distsqlrun/base.go, line 154 at r1 (raw file): Previously, arjunravinarayan (Arjun Narayan) wrote…
I tried making that change right now, and while it is correct, the control flow gets more confusing. I'd prefer to leave this as-is. I feel the original problem here was trying to get too clever with control flow, so perhaps I'm overreacting here. Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/sql/distsqlrun/base.go, line 154 at r1 (raw file): Previously, petermattis (Peter Mattis) wrote…
Leaving it as is seems fine to me. There's no benefit except reducing the LOC, which isn't really a worthwhile metric to optimize on. Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/sql/run_control_test.go, line 271 at r1 (raw file): Previously, petermattis (Peter Mattis) wrote…
I was fooling myself before - this test races a cancelation against a query and sometimes the query finishes before the cancelation does anything. That's what the error I pasted was about, and apparently that's expected and the test is cool with that. Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/sql/run_control_test.go, line 271 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
What should be expected I still have to figure out, but I know the difference between the old and new code. The Line 1277 in 6d162d2
I'll figure something out. Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/sql/run_control_test.go, line 271 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
Ack. Do you want me to merge this PR as-is? Hold off on merging? Revert the changes to this file? Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/sql/run_control_test.go, line 271 at r1 (raw file): Previously, petermattis (Peter Mattis) wrote…
Hold off for a bit pls. Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions, all commit checks successful. pkg/sql/run_control_test.go, line 269 at r1 (raw file):
btw, this Comments from Reviewable |
c15d2e7
to
c193f01
Compare
Review status: all files reviewed at latest revision, 3 unresolved discussions, all commit checks successful. pkg/sql/run_control_test.go, line 271 at r1 (raw file): Previously, andreimatei (Andrei Matei) wrote…
the crux of the issue here, I believe, is that, upon (DistSQL) query cancelation, a query's context gets canceled. Depending on how far along the flow setup has gone, I think one of the following things can happen:
The race itself isn't a problem, but the fact that it can result in different errors is. I think there's two ways to go about it - either ensure that the query's error is set before we set off the race for observing context cancelation, and make sure that once it's set, it stays frozen or the opposite - let things race, but introduce a way to overwrite a query's error once things have settled down. cc @abhimadan if any of this is helpful to the stuff he's looking at Comments from Reviewable |
Fix a bug in `Run` where the source was not drainined and closed if the producer requested draining. Fixes cockroachdb#22665 Fixes cockroachdb#22642 See cockroachdb#22654 Release note: None
c193f01
to
3512354
Compare
Reviewed 1 of 2 files at r1, 1 of 1 files at r2. pkg/sql/distsqlrun/base.go, line 154 at r1 (raw file): Previously, arjunravinarayan (Arjun Narayan) wrote…
This logic is the cause of the panic in #22772, so I'm enlisting you to fix it. :-) In the scenario where My first thought is that calling In general, the contract around this stuff is confusing and may have changed. The new contract seems to be "you may not call Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions, all commit checks successful. pkg/sql/distsqlrun/base.go, line 154 at r1 (raw file): Previously, jordanlewis (Jordan Lewis) wrote…
Ack. Pretty sure that #22772 is a different issue. I'll take a look. Comments from Reviewable |
Fix a bug in
Run
where the source was not drainined and closed if theproducer requested draining.
Closes #22824
Fixes #22655
Fixes #22654
Fixes #22642
Release note: None