Skip to content

Fix events collector#13274

Merged
dain merged 3 commits intotrinodb:masterfrom
dain:fix-events-collector
Jul 23, 2022
Merged

Fix events collector#13274
dain merged 3 commits intotrinodb:masterfrom
dain:fix-events-collector

Conversation

@dain
Copy link
Copy Markdown
Member

@dain dain commented Jul 21, 2022

Description

This is a new attempt at fixing #5922. The new fix rewrites EventsCollector to collect events on a per query basis, which eliminates the concurrency issues of separating events from different queries. This requires exposing the QueryId to results from QueryRunner executions including in exceptions.

Related issues, pull requests, and links

Documentation

(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

(x) No release notes entries required.
( ) Release notes entries required with the following suggested text:

@dain dain requested review from electrum and losipiuk July 21, 2022 02:04
@cla-bot cla-bot bot added the cla-signed label Jul 21, 2022
@dain dain force-pushed the fix-events-collector branch from d0c6cf3 to e66d39c Compare July 21, 2022 04:00
Copy link
Copy Markdown
Member

@losipiuk losipiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dain dain force-pushed the fix-events-collector branch 2 times, most recently from 465ff89 to 63322ff Compare July 21, 2022 18:03
@dain
Copy link
Copy Markdown
Member Author

dain commented Jul 21, 2022

I simplified this PR by not adding the new method to query runner since the logic is only needed with a DistrbutedQueryRunner. This simplifies the exception change, because it is only needed in DistrbutedQueryRunner and it already wrapped exceptions in a RuntimeException.

dain added 3 commits July 22, 2022 15:27
Uses of ResultWithQueryId out side of some AbstractTestingTrinoClient
always use MaterializedResult, and this change simplifies those usages.
The new class will be used in QueryRunner to get results and query id
for testing events.
When testing it can be important to know the query id when a query
fails.
The old design was more complex because all events were collected
together and this caused complex threading issues.
@dain dain force-pushed the fix-events-collector branch from 2a80d3d to 92533f9 Compare July 22, 2022 22:28
@dain dain merged commit b370bf8 into trinodb:master Jul 23, 2022
@dain dain deleted the fix-events-collector branch July 23, 2022 01:32
@github-actions github-actions bot added this to the 392 milestone Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Flaky test TestEventListener.testPlanningFailure

3 participants