MSQ should load even if node roles are not set#13318
MSQ should load even if node roles are not set#13318abhishekagarwal87 merged 1 commit intoapache:masterfrom
Conversation
| @Provides | ||
| @LazySingleton | ||
| public Bouncer makeBouncer(final DruidProcessingConfig processingConfig, @Self final Set<NodeRole> nodeRoles) | ||
| public Bouncer makeBouncer(final DruidProcessingConfig processingConfig, Injector injector) |
There was a problem hiding this comment.
In the current code, if the node roles are not set, does this Set<NodeRole> come out as empty or null?
Can't we just use a condition on that null or emptiness instead of using Injector?
There was a problem hiding this comment.
I think the issue is that there is nothing binded to @self annotation so the injector usage seems correct to me.
There was a problem hiding this comment.
For a generic fix, we could also try adding ServerInjectorBuilder.registerNodeRoleModule to the HadoopTask injector with empty role list.
That will also require some change in registerNodeRoleModule to bind an empty set incase of an empty role list.
There was a problem hiding this comment.
the caller chain starts from a static initialization block in HadoopDruidIndexerConfig. It's hard to say where does this static block can be called from. (another reason to not like static initialization blocks)
There was a problem hiding this comment.
the HadoopDruidIndexerConfig injector would also bind an empty set of node roles if we fix registerNodeRoleModule to do so. The current code flow of Initialization.makeInjectorWithModules itself never passes any node roles to the injector
There was a problem hiding this comment.
Right. The current fix felt more generic to me. This is how it's done in the MetricsModule class as well. I am happy to do it that way too.
There was a problem hiding this comment.
I think the MetricsModule change might also be obsolete after the recent refactoring in injector creation. FWIU, the module is initialized in CoreInjectorBuilder and that builder should have the nodeRoleModule.
for generic solution, I was actually thinking of a way where we could always inject the node roles set from the bottom itself instead of fetching from the injector so that all extensions can just use the injection directly.
Fixes #13276.
Release note
For tips about how to write a good release note, see Release notes.
This PR has: