Configurable brokerService for console queries#19069
Configurable brokerService for console queries#19069aho135 wants to merge 1 commit intoapache:masterfrom
Conversation
|
There is also the case where broker1 watches ["t1","t2"] and broker2 watches ["t3","t4"]. In this case, to get a complete view both need to be queried. Would this case work as well? |
Thanks for the review @abhishek-chouhan! This case is not covered. This would be more invasive as it requires merging BrokerServerView from broker1 and broker2. In this scenario I think it would be simpler to spin up an additional broker (e.g. druid/broker-admin) which watches all tiers and configure consoleBrokerService to point there. |
|
|
||
| // Broker service name to use for all console SQL queries (for tier isolation) | ||
| // This injects "brokerService" into the query context for routing via the manual strategy | ||
| consoleBrokerService?: string; |
There was a problem hiding this comment.
What do you think about exposing this config via web-console-config.tsx as well? It has this dialog on the console, which seems cool:
I think web-console-config.tsx is session-based that stores config overrides in the browser, while the ConsoleConfig from console-config.js is persistent via the build. Not super familiar with the web-console code here, so correct me if I'm missing something here.
Can console-config.js be overridden per environment, given that this file is baked into the build as part of the source code?
| export function getConsoleBrokerService(): string | undefined { | ||
| return consoleBrokerService; | ||
| } |
There was a problem hiding this comment.
Is this used anywhere?
| } | ||
| : sqlQueryPayload; | ||
|
|
||
| sqlResultResp = await Api.instance.post('/druid/v2/sql', payload, { signal }); |
There was a problem hiding this comment.
I see that https://github.com/apache/druid/blob/master/web-console/src/views/explore-view/explore-view.tsx#L64
directly calls the /druid/v2/sql endpoint without invoking queryDruidSql. Should we update it to use this function instead, so the context is appended for the Explore view as well?
I do think we need the merging functionality to support the watchedTiers functionality in its entirety. While the workaround with a separate broker works, its too heavy of a workaround just to make the console work with watchedTiers. |
There was a problem hiding this comment.
Since brokerService is part of the query context, would setting baseQueryContext or defaultQueryContext in console-config.js work out of the box?
Description
When using the manual routing strategy in combination with
druid.broker.segment.watchedTierswe are losing console visibility for Historicals. This can happen with the combination of configurationsRouter
broker1
broker2
Since the Router query goes to druid/broker1 which has limited segment visibility, the console will incorrectly report Historicals in t3/t4 as having no data. This patch allows us to configure Router console queries to go to druid/broker2 instead so that the console can have full visibility over Historicals.
Release note
Allows operators to configure brokerService for Router console queries. This can be accomplished by setting something like
in web-console/console-config.js
Key changed/added classes in this PR
druid-query.tsentry.tsxThis PR has: