Add support for selective loading of broadcast datasources in the task layer#17027
Merged
abhishekrb19 merged 12 commits intoapache:masterfrom Sep 12, 2024
Merged
Conversation
georgew5656
approved these changes
Sep 10, 2024
cryptoe
reviewed
Sep 11, 2024
Contributor
Author
|
The failing UTs are unrelated: other module test failed with OOM (ongoing investigation with heap dumps from #17029) and flaky CDS test. |
cecemei
pushed a commit
to cecemei/druid
that referenced
this pull request
Sep 12, 2024
…k layer (apache#17027) Tasks control the loading of broadcast datasources via BroadcastDatasourceLoadingSpec getBroadcastDatasourceLoadingSpec(). By default, tasks download all broadcast datasources, unless there's an override as with kill and MSQ controller task. The CLIPeon command line option --loadBroadcastSegments is deprecated in favor of --loadBroadcastDatasourceMode. Broadcast datasources can be specified in SQL queries through JOIN and FROM clauses, or obtained from other sources such as lookups.To this effect, we have introduced a BroadcastDatasourceLoadingSpec. Finding the set of broadcast datasources during SQL planning will be done in a follow-up, which will apply only to MSQ tasks, so they load only required broadcast datasources. This PR primarily focuses on the skeletal changes around BroadcastDatasourceLoadingSpec and integrating it from the Task interface via CliPeon to SegmentBootstrapper. Currently, only kill tasks and MSQ controller tasks skip loading broadcast datasources.
pranavbhole
pushed a commit
to pranavbhole/druid
that referenced
this pull request
Sep 17, 2024
…k layer (apache#17027) Tasks control the loading of broadcast datasources via BroadcastDatasourceLoadingSpec getBroadcastDatasourceLoadingSpec(). By default, tasks download all broadcast datasources, unless there's an override as with kill and MSQ controller task. The CLIPeon command line option --loadBroadcastSegments is deprecated in favor of --loadBroadcastDatasourceMode. Broadcast datasources can be specified in SQL queries through JOIN and FROM clauses, or obtained from other sources such as lookups.To this effect, we have introduced a BroadcastDatasourceLoadingSpec. Finding the set of broadcast datasources during SQL planning will be done in a follow-up, which will apply only to MSQ tasks, so they load only required broadcast datasources. This PR primarily focuses on the skeletal changes around BroadcastDatasourceLoadingSpec and integrating it from the Task interface via CliPeon to SegmentBootstrapper. Currently, only kill tasks and MSQ controller tasks skip loading broadcast datasources.
kfaraz
pushed a commit
to kfaraz/druid
that referenced
this pull request
Oct 1, 2024
…k layer (apache#17027) Tasks control the loading of broadcast datasources via BroadcastDatasourceLoadingSpec getBroadcastDatasourceLoadingSpec(). By default, tasks download all broadcast datasources, unless there's an override as with kill and MSQ controller task. The CLIPeon command line option --loadBroadcastSegments is deprecated in favor of --loadBroadcastDatasourceMode. Broadcast datasources can be specified in SQL queries through JOIN and FROM clauses, or obtained from other sources such as lookups.To this effect, we have introduced a BroadcastDatasourceLoadingSpec. Finding the set of broadcast datasources during SQL planning will be done in a follow-up, which will apply only to MSQ tasks, so they load only required broadcast datasources. This PR primarily focuses on the skeletal changes around BroadcastDatasourceLoadingSpec and integrating it from the Task interface via CliPeon to SegmentBootstrapper. Currently, only kill tasks and MSQ controller tasks skip loading broadcast datasources.
kfaraz
added a commit
that referenced
this pull request
Oct 1, 2024
…k layer (#17027) (#17206) Tasks control the loading of broadcast datasources via BroadcastDatasourceLoadingSpec getBroadcastDatasourceLoadingSpec(). By default, tasks download all broadcast datasources, unless there's an override as with kill and MSQ controller task. The CLIPeon command line option --loadBroadcastSegments is deprecated in favor of --loadBroadcastDatasourceMode. Broadcast datasources can be specified in SQL queries through JOIN and FROM clauses, or obtained from other sources such as lookups.To this effect, we have introduced a BroadcastDatasourceLoadingSpec. Finding the set of broadcast datasources during SQL planning will be done in a follow-up, which will apply only to MSQ tasks, so they load only required broadcast datasources. This PR primarily focuses on the skeletal changes around BroadcastDatasourceLoadingSpec and integrating it from the Task interface via CliPeon to SegmentBootstrapper. Currently, only kill tasks and MSQ controller tasks skip loading broadcast datasources. Co-authored-by: Abhishek Radhakrishnan <abhishek.rb19@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Currently, servers and tasks download all broadcast datasources. While the downloading of bootstrap segments is generally fast, as it happens in parallel during startup, it does consume storage space. This is especially relevant for tasks like kill tasks and MSQ worker tasks, which either don't need to load any broadcast datasources or only selectively load those that are required. This optimization will save task storage space and speed up the task startup time a bit.
Description
The design for loading broadcast datasources follows a similar approach to what was implemented for loading lookups in #16328.
Broadcast datasources can be specified in SQL queries through
JOINandFROMclauses, or obtained from other sources such as lookups.To this effect, we have introduced aBroadcastDatasourceLoadingSpec. Finding the set of broadcast datasources during SQL planning will be done in a follow-up, which will apply only to MSQ tasks, so they load only required broadcast datasources. This PR primarily focuses on the skeletal changes aroundBroadcastDatasourceLoadingSpecand integrating it from theTaskinterface viaCliPeontoSegmentBootstrapper.Changes
BroadcastDatasourceLoadingSpecclass andTask.getBroadcastDatasourceLoadingSpec()tasks to control how broadcast datasources are loaded.ALL,NONEandONLY_REQUIRED.KillTaskandMSQControllerTaskoverridegetBroadcastDatasourceLoadingSpec()toNONE.CliPeoninitializes the broadcast module by parsing the command line option--loadBroadcastDatasourceMode.--loadBroadcastSegmentshave been marked as deprecated in favor of--loadBroadcastDatasourceMode. This can be removed in a future release.PodTemplateTaskAdapterandK8sTaskAdaptersupport wiring for the optionLOAD_BROADCAST_DATASOURCE_MODE, similar to existingLOAD_BROADCAST_SEGMENTS.In summary:
Release note:
Tasks control the loading of broadcast datasources via
BroadcastDatasourceLoadingSpec getBroadcastDatasourceLoadingSpec(). By default, tasks download all broadcast datasources, unless there's an override as with kill and MSQ controller task.The
CLIPeoncommand line option--loadBroadcastSegmentsis deprecated in favor of--loadBroadcastDatasourceMode.This PR has: