Reduce default max # of subTasks to 1 for native parallel task#7181
Reduce default max # of subTasks to 1 for native parallel task#7181fjy merged 7 commits intoapache:masterfrom
Conversation
| |pushTimeout|Milliseconds to wait for pushing segments. It must be >= 0, where 0 means to wait forever.|0|no| | ||
| |segmentWriteOutMediumFactory|Segment write-out medium to use when creating segments. See [SegmentWriteOutMediumFactory](#segmentWriteOutMediumFactory).|Not specified, the value from `druid.peon.defaultSegmentWriteOutMediumFactory.type` is used|no| | ||
| |maxNumSubTasks|Maximum number of tasks which can be run at the same time.|Integer.MAX_VALUE|no| | ||
| |maxNumSubTasks|Maximum number of tasks which can be run at the same time. The supervisor task would spawn sub tasks up to `maxNumSubTasks` regardless of the reamining task slots. If this value is set to too large, too many sub tasks can be created which might block other ingestion.|2|no| |
There was a problem hiding this comment.
Thanks. I'll fix this and add a new section to emphasize the importance of setting this value properly.
There was a problem hiding this comment.
Added Capacity Planning section.
There was a problem hiding this comment.
Since the value is so critical and tough to set automatically, how about setting it to 1 by default and logging a warning in the task log when it's not raised higher? That way users are more likely to notice it if they didn't read the documentation.
There was a problem hiding this comment.
I thought about it, but set to 2 because I’m thinking to make the supervisor task do the ingestion job on its own instead of spawning sub tasks if this is 1.
What do you think about more aggressive way like making this option mandatory and throwing error if it’s missing?
There was a problem hiding this comment.
I thought about it, but set to 2 because I’m thinking to make the supervisor task do the ingestion job on its own instead of spawning sub tasks if this is 1.
If this is the case, I think 1 is an even better default.
What do you think about more aggressive way like making this option mandatory and throwing error if it’s missing?
I think there should be some kind of default (we want to minimize the # of mandatory parameters) and at least "1" + a warning is something where it's fairly clear what's going on if you forgot to set it.
There was a problem hiding this comment.
Default of 1 with a warning message that tells the user to set "maxNumSubTasks" if they want parallelism sounds good to me.
There was a problem hiding this comment.
Changed default to 1 and added a warning. I also changed the behavior of default to the sequential mode to emphasize the importance.
| |pushTimeout|Milliseconds to wait for pushing segments. It must be >= 0, where 0 means to wait forever.|0|no| | ||
| |segmentWriteOutMediumFactory|Segment write-out medium to use when creating segments. See [SegmentWriteOutMediumFactory](#segmentWriteOutMediumFactory).|Not specified, the value from `druid.peon.defaultSegmentWriteOutMediumFactory.type` is used|no| | ||
| |maxNumSubTasks|Maximum number of tasks which can be run at the same time.|Integer.MAX_VALUE|no| | ||
| |maxNumSubTasks|Maximum number of tasks which can be run at the same time. The supervisor task would spawn worker tasks up to `maxNumSubTasks` regardless of the available task slots. If this value is set to too large, too many worker tasks can be created which might block other ingestion. Check [Capacity Planning](#capacity-planning) for more details.|2|no| |
|
I fixed a wrong if clause in |
|
Fixed the failing IT test. |
…e#7181) * Reduce # of max subTasks to 2 * fix typo and add more doc * add more doc and link * change default and add warning * fix doc * add test * fix it test
#7200) * Reduce # of max subTasks to 2 * fix typo and add more doc * add more doc and link * change default and add warning * fix doc * add test * fix it test
|
The concern here is that batch ingestion tasks will get in the way of other ingestion tasks. But isn't that what the task priority system solves? |
|
Would you please elaborate a bit more about your concern? Currently the task priority is actually just a lock priority. I think we should improve it to be able to run higher priority tasks faster. |
|
Ah, my assumption about how priority works was that if there are more tasks scheduled for the cluster than available capacity, higher priority tasks would take precedence (and maybe even kill existing lower-prioritytasks?). Sounds like I'm wrong? |
|
Right now, priority doesn't affect scheduling, only ability of tasks that are already-scheduled to acquire locks. |
|
That's good to know, and this change makes lots of sense given that! |
|
@jihoonson I just rebased #7048 on top of this and noticed that ITParallelIndexTest no longer actually runs in parallel. I assume that is not intended; I'll send off a PR. |
|
@glasser OMG, it's my bad. That test should be run in parallel. Would you please fix it by adding |
|
Yep, #7211. |
The unlimited
maxNumSubTasksis easy to spawn a huge number of sub tasks. This PR is to reduce its default value to 1, so that people would think about how many tasks they want. When it's 1, the supervisor task prints a warning and does ingestion job on its own instead of spawning sub tasks.I also added a section of 'Capacity Planning' to give a brief idea about how to set
maxNumSubTasksproperly.