interval chunk query runner now processes individual chunk in a threadpool#1150
Conversation
There was a problem hiding this comment.
can you double check the broker docs for druid.processing.numThreads? I think they will need to be updated as well
There was a problem hiding this comment.
Can we document how the chunkPeriod context parameter interacts with the existing druid.query.chunkPeriod and druid.query.<queryType>.chunkPeriod configuration parameter?
There was a problem hiding this comment.
actually it replaces
druid.query.chunkPeriod, druid.query.<queryType>.chunkPeriod
they are not valid after this pull request. in my experience we found the chunking behavior really needs to be tuned per query [ sometimes based on size of its interval] .
There was a problem hiding this comment.
In that case, can we remove the old configs from docs and code as well, instead of keeping unused config around.
|
@fjy updated as per the review comments. |
|
It also looks like we are ignoring the query config chunk Period, which is changing behavior. We should document that in the PR description and in the docs. |
There was a problem hiding this comment.
Is this supposed to be a repository for "context":{.....} reserved words?
There was a problem hiding this comment.
yes, I created it as those strings were slowly getting hard coded in different places.
this pull request does not have the refactoring done for old code though.
|
Why do we need another means of adding a decorator to the tool chest as part of the constructor? Did the needed manipulators not fit in the pre/post merge decorators for some reason? |
|
Or a better thing to say is that most of the other runner decorators are expressed as a titled method to make them a little more descriptive and a little more generic-use. Is there a particular reason this decorator cannot follow that workflow? |
There was a problem hiding this comment.
Can you please add a comment something along the lines of "Static strings in this class should be considered 'reserved words' for the context of a query."
We'll slowly move over the other reserved words to this class.
There was a problem hiding this comment.
yeah, but, class name in this case is conveying that intent and comment really seems redundant.
@drcrallen query toolchest needs to instantiate IntervalChunkingQueryRunner which needs ExecutorService, QueryWatcher, ServiceEmitter . One way was that I could add 3 of those in the constructors of each query toolchest and have them instantiate IntervalChunkingQueryRunner directly. IntervalChunkingQueryRunnerDecorator allowed me to do that more cleanly by just adding one thing in query toolchest constructors(also, say, one more thing gets added to IntervalChunkingQueryRunner constructor, then only decorator needs to be updated instead of having to modify all the toolchest constructors) Can you further explain the alternative you're suggesting? |
|
IIRC, the purpose of interval chunking was to handle memory pressure on bards when running queries for very long intervals. I wonder how processing the chunks parallely affect the memory usage on bards. |
There was a problem hiding this comment.
should this be toolchest.makeMetricBuilder(input) instead ?
There was a problem hiding this comment.
also can you check that the query/time emitted contains the correct chunked interval instead of full query interval
There was a problem hiding this comment.
thatz a good catch, I haven't checked it yet, but looks like it should indeed be toolChest.makeMetricBuilder(input).
|
@himanshug : The alternative would be to have another method for a decorator that handles whatever part of the query execution chain the InteralChunkingQueryRunner would need to be inserted. It just feels weird to me to have a very specific query runner instance that gets passed instead of a method for properly handling that logical step of the query. As an alternative, for example, there could be a "queryPlanningRunnerDecorator" method (similar to pre or post merger decorators) or something that properly describes the step the IntervalChunkingQueryRunner does. I'm not convinced that's the way to go by any means. In general, if possible I'd rather have |
|
@nishantmonu51 also has a very good point. Can you please get some JVM / performance stats on this patch for inclusion in this PR? |
|
@drcrallen @nishantmonu51
Also, to tell you the truth, it seems that interval chunking query runner never really did any chunking :P "period.getMillis()" will pretty much always be 0 for e.g. P1D, P1M etc. it should've been "period.toStandardDuration().getMillis()". |
|
@himanshug Can you squash the commits and I will merge |
…d pool and prints metrics query/time per chunk
4e16e80 to
29039fd
Compare
|
@fjy squashing done. |
interval chunk query runner now processes individual chunk in a threadpool
There was a problem hiding this comment.
@himanshug any reason this got removed? It looks like we lost a bunch of metrics when upgrading to 0.7.1
There was a problem hiding this comment.
@xvrl sorry to keep you waiting, i have been away.
anyways, it used to report pretty much same metric as the request/time from QueryResource. Instead we moved it to IntervalChunkingQueryRunner which now reports query/time for each chunk (if chunking is used).
There was a problem hiding this comment.
I see, the problem is that IntervalChunkingQueryRunner is not always used by default, so we lost those metrics when upgrading.
There was a problem hiding this comment.
losing that metric should be ok (when no chunking) as numbers reported in query/time and request/time were pretty much the same.
There was a problem hiding this comment.
I agree that we are not losing too much information, but for systems that rely on existing metrics to be present that can be an issue. Either we should notify users of backwards incompatible changes, or try to maintain backwards compatibility whenever possible.
There was a problem hiding this comment.
I think notifying the users makes sense, release-notes for 0.7.1 would be the best place. Is there a way for me to update those?
I updated the unofficial metrics doc though https://docs.google.com/spreadsheets/d/15XxGrGv2ggdt4SnCoIsckqUNJBZ9ludyhC9hNQa3l-M/edit#gid=0
this patch enables