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

execstats: fix flakey TestTraceAnalyzer #75632

Merged
merged 1 commit into from
Jan 29, 2022

Conversation

adityamaru
Copy link
Contributor

Fixes: #75546

Release note: None

@adityamaru adityamaru requested a review from a team as a code owner January 27, 2022 21:51
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@irfansharif
Copy link
Contributor

#75546 (comment).

With the spanconfig job running in the background, and parts
of it using the internal executor, it is incorrect for this test
to reach into SetSessionData. This method has a comment indicating
that it is not to be used concurrently with query execution. The fix
is to create a session bound internal executor in the test.

Fixes: cockroachdb#75546

Release note: None
@adityamaru adityamaru changed the title spanconfigsqltranslator: fix data race when using pts provider execstats: fix flakey TestTraceAnalyzer @adityamaru Jan 28, 2022
@adityamaru adityamaru requested review from yuzefovich and removed request for a team January 28, 2022 14:25
@adityamaru adityamaru changed the title execstats: fix flakey TestTraceAnalyzer @adityamaru execstats: fix flakey TestTraceAnalyzer Jan 28, 2022
Copy link
Member

@yuzefovich yuzefovich 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 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @irfansharif)

@adityamaru
Copy link
Contributor Author

bors r=yuzefovich

craig bot pushed a commit that referenced this pull request Jan 28, 2022
70159: kvclient: switch error in ctx cancel edge case r=andreimatei a=andreimatei

This patch changes the error returned by the DistSender on a cancelled
ctx. Depending on the exactly who detects the ctx as cancelled, there
are a number of different possibilities - too many to enumerate here.
Generally, the client is supposed to get a context.Canceled error,
wrapped in different layers. The code path that this patch changes is
about the cancellation being detected by sendPartialBatch() without it
having been previously detected by sendToReplicas(). This path is
unusual (sendToReplicas() generally detects the ctx cancelled).
Depending on the exact cancellation timing, it's possible though for
sendPartialBatch() to detect it instead. In this case, this patch makes
it so that, if sendToReplicas() returned a sendError (indicating that
a suitable replica could not be reached and that the higher layer is
expected to continue trying other replicas), the error returned to the
client is a cancellation error instead of the sendError.

Touches #69419

Release note: None

75632: execstats: fix flakey TestTraceAnalyzer r=yuzefovich a=adityamaru

Fixes: #75546

Release note: None

Co-authored-by: Andrei Matei <[email protected]>
Co-authored-by: Aditya Maru <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jan 28, 2022

Build failed (retrying...):

@adityamaru
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 28, 2022

Already running a review

@craig
Copy link
Contributor

craig bot commented Jan 28, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jan 29, 2022

Build succeeded:

@craig craig bot merged commit bb85ddc into cockroachdb:master Jan 29, 2022
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.

sql/execstats: TestTraceAnalyzer data race
4 participants