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

Report dynamic filtering stats in QueryStats #4440

Merged
merged 1 commit into from Aug 20, 2020

Conversation

raunaqmorarka
Copy link
Member

@raunaqmorarka raunaqmorarka commented Jul 13, 2020

Fixes: #3005

@sopel39
Copy link
Member

sopel39 commented Jul 31, 2020

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 finalQueryInfo

Copy link
Member

@sopel39 sopel39 left a comment

Choose a reason for hiding this comment

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

small comments

@@ -666,6 +671,17 @@ public void setRoutines(List<RoutineInfo> routines)
this.routines.set(ImmutableList.copyOf(routines));
}

private synchronized DynamicFiltersStats getDynamicFiltersStats()
Copy link
Member

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()

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

that makes sense, thanks

@sopel39
Copy link
Member

sopel39 commented Aug 20, 2020

merged thanks!

@sopel39 sopel39 mentioned this pull request Aug 20, 2020
9 tasks
@raunaqmorarka raunaqmorarka deleted the dfs_stats branch August 20, 2020 11:02
@martint martint added this to the 341 milestone Sep 9, 2020
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.

Report dynamic filtering stats for DynamicFilterSourceOperator and scan operator
4 participants