-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add Broker config druid.broker.segment.ignoredTiers
#11766
Add Broker config druid.broker.segment.ignoredTiers
#11766
Conversation
what is desired behavior if an operator has Tier N I could imagine an operator error configuring their broker causing some confusion if they included |
Thanks a lot for the review, @capistrant ! Please consider the alternatives below. Alternative 1: I feel failing the broker start-up might be a little heavy-handed but the next alternative is more of a silent failure, which is worse 😅 . Alternative 2: I do agree that this could create data inconsistencies for the user as their intent is not clear and would involve poring through the Broker logs to see what went wrong. Possible Cases
With Alternative 1: We fail at start-up and don't need to clarify any of these scenarios (except With Alternative 2 Please let me know what you think 😃 |
+1 for hard failure and complaining loudly in the logs if both watched and ignored are configured, i can't see any use case for having them both at the same time |
docs/configuration/index.md
Outdated
@@ -1794,6 +1794,7 @@ See [cache configuration](#cache-configuration) for how to configure cache setti | |||
|--------|---------------|-----------|-------| | |||
|`druid.serverview.type`|batch or http|Segment discovery method to use. "http" enables discovering segments using HTTP instead of zookeeper.|batch| | |||
|`druid.broker.segment.watchedTiers`|List of strings|Broker watches the segment announcements from processes serving segments to build cache of which process is serving which segments, this configuration allows to only consider segments being served from a whitelist of tiers. By default, Broker would consider all tiers. This can be used to partition your dataSources in specific Historical tiers and configure brokers in partitions so that they are only queryable for specific dataSources.|none| | |||
|`druid.broker.segment.ignoredTiers`|List of strings|The Broker watches the segment announcements from processes that serve segments to build a cache to relate each process to the segments it serves. This configuration allows the Broker to ignore the segments being served from a list of tiers. By default, Broker considers all tiers. This config is mutually exclusive from `druid.broker.segment.watchedTiers` and at most only one of these can be configured on a Broker.|none| |
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.
should druid.broker.segment.watchedTiers
docs also be updated to indicate that it is mutually exclusive with ignoredTiers
?
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.
Yes, I think that would help remove any ambiguity.
this.clients = new ConcurrentHashMap<>(); | ||
this.selectors = new HashMap<>(); | ||
this.timelines = new HashMap<>(); | ||
|
||
// Validate and set the segment watcher config | ||
this.segmentWatcherConfig = segmentWatcherConfig; | ||
if (segmentWatcherConfig.getWatchedTiers() != null |
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 know this isn't new, but I wonder since we now doing some validation here if we should also explode if watchedTiers
is empty, which also seems like an invalid configuration
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.
Do you think it would make sense to add a validate
method in BrokerSegmentWatcherConfig
that contains all these validations and just invoke segmentWatcherConfig.validate()
from here or should we keep them here itself?
|
||
//non-defaults | ||
json = "{ \"watchedTiers\": [\"t1\", \"t2\"], \"watchedDataSources\": [\"ds1\", \"ds2\"] }"; | ||
json = "{ \"watchedTiers\": [\"t1\", \"t2\"], \"watchedDataSources\": [\"ds1\", \"ds2\"], \"ignoredTiers\": [\"t3\", \"t4\"] }"; |
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.
this test is sort of strange now that it is an invalid configuration, though technically it isn't enforced by the config itself so it isn't problematic here. maybe we should at least leave a comment that this config is illegal in practice?
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.
No, you are right, we should not use an invalid configuration here. Fixing.
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.
👍 after green CI
Thank you @kfaraz. I have merged your change. |
Description
The new config is an extension of the concept of "watchedTiers" where
the Broker can choose to add the info of only the specified tiers to its timeline.
Similarly, with this config, Broker can choose to ignore the segments being served
by the specified historical tiers. By default, no tier is ignored.
This config is useful when you want a completely isolated tier amongst many other tiers.
Say there are several tiers of historicals Tier T1, Tier T2 ... Tier Tn
and there are several brokers Broker B1, Broker B2 .... Broker Bm
If we want only Broker B1 to query Tier T1, instead of setting a long list of
watchedTiers
on each of the other Brokers B2 ... Bm, we could just set
druid.broker.segment.ignoredTiers=["T1"]
for these Brokers, while Broker B1 could have
druid.broker.segment.watchedTiers=["T1"]
Changes
druid.broker.segment.ignoredTiers
ignoredTiers
orwatchedTiers
is configured, fail otherwiseThis PR has: