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
Report dynamic filtering stats in QueryStats #4440
Conversation
presto-main/src/main/java/io/prestosql/execution/QueryStateMachine.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/execution/QueryStateMachine.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/server/DynamicFilterService.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/execution/QueryStateMachine.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/server/DynamicFilterService.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/server/DynamicFilterService.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/server/DynamicFilterService.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/server/DynamicFilterService.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/server/DynamicFilterService.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/server/DynamicFilterService.java
Outdated
Show resolved
Hide resolved
presto-spi/src/main/java/io/prestosql/spi/predicate/SortedRangeSet.java
Outdated
Show resolved
Hide resolved
presto-spi/src/main/java/io/prestosql/spi/predicate/Ranges.java
Outdated
Show resolved
Hide resolved
Could we add an "integration" test case where we run actual query and assert DFs at the end. That would ensure we don't have problem with |
a8b8891
to
c677914
Compare
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.
small comments
presto-main/src/main/java/io/prestosql/execution/QueryStateMachine.java
Outdated
Show resolved
Hide resolved
@@ -666,6 +671,17 @@ public void setRoutines(List<RoutineInfo> routines) | |||
this.routines.set(ImmutableList.copyOf(routines)); | |||
} | |||
|
|||
private synchronized DynamicFiltersStats getDynamicFiltersStats() |
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.
remote this method and inline dynamicFiltersStatsProvider.get()
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.
I avoided AtomicReference<Supplier<DynamicFiltersStats>>
because I think there is a potential for race condition with that. Example
In getQueryStats
, we get reference to the non-final df stats supplier, but the get
on supplier isn't executed yet.
Query finishes, unregisterDynamicFilteringQuery
is called, final df stats supplier is set and dynamicFilterService.removeQuery
runs.
Now we continue with execution of getQueryStats
, we still have reference to old supplier and calling get on it will give empty stats now as the dynamic filter service has cleaned up its maps.
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.
that makes sense, thanks
presto-main/src/main/java/io/prestosql/execution/QueryStateMachine.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/execution/QueryStateMachine.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/execution/SqlQueryExecution.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/server/TestDynamicFilterService.java
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/server/TestDynamicFilterService.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/server/TestDynamicFilterService.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/server/TestDynamicFilterService.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/io/prestosql/server/TestDynamicFilterService.java
Outdated
Show resolved
Hide resolved
c677914
to
23df640
Compare
presto-main/src/main/java/io/prestosql/execution/QueryStateMachine.java
Outdated
Show resolved
Hide resolved
23df640
to
28b84ce
Compare
merged thanks! |
Fixes: #3005