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
Remove NoneGateway, NoneGatewayAllocator, & NoneGatewayModule #8537
Conversation
I haven't started looking but I already like the title and the diff stats. :-) |
This looks good to me, maybe we could try to have a static variable in ElasticsearchTestCase holding a no-op gateway allocator so that we don't have to create a new anonymous instance whenever we need it? Would also be nice if someone else could give it a look since it's a part of elasticsearch that I don't kno well. |
@@ -354,7 +354,22 @@ public void testNoRebalanceOnPrimaryOverload() { | |||
ImmutableSettings.Builder settings = settingsBuilder(); | |||
AllocationService strategy = new AllocationService(settings.build(), randomAllocationDeciders(settings.build(), | |||
new NodeSettingsService(ImmutableSettings.Builder.EMPTY_SETTINGS), getRandom()), new ShardsAllocators(settings.build(), | |||
new NoneGatewayAllocator(), new ShardsAllocator() { | |||
new GatewayAllocator() { |
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.
Can we make a NoopGatewayAllocator (alla NoopClusterService) and put it in org.elasticsearch.test.gateway? then we can reuse it bellow
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.
Yep, I'll do that.
LGTM. Left some minor comments + a question about removed test. |
nice work @dakrone ! I just bumped into the gateway documentation, I think it should be updated as part of this PR as |
One more thing, if I understand correctly the |
@javanna good catch! I've updated the documentation and The setting remains configurable, but only for internal (plugin) use only. |
+1
+1 (we may want to mock it at some point) Left one minor comment LGTM (with the change to elasticsearch.yml) |
c98b0b9
to
9efdd83
Compare
Always use the LocalGateway* equivalents We already check in the LocalGateway whether a node is a client node, or is not master-eligible, and skip writing the state there. This allows us to remove this code that was previously used only for tribe nodes (which are not master eligible anyway and wouldn't write state) and in tests (which can shake more bugs out)
9efdd83
to
e482bdd
Compare
Merged to master |
w00t |
Always use the LocalGateway* equivalents
The reason of this change is that we already check in the
LocalGateway
whether a node is a client node, or is not master-eligible, and skip writing the state there. This allows us to remove this code that was previously used only for tribe nodes (which are not master eligible anyway and wouldn't write state) and in tests (which can shake more bugs out).