Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Nov 18, 2014

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).

@jpountz
Copy link
Contributor

jpountz commented Nov 18, 2014

I haven't started looking but I already like the title and the diff stats. :-)

@jpountz
Copy link
Contributor

jpountz commented Nov 18, 2014

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() {
Copy link
Contributor

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

Copy link
Member Author

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.

@bleskes
Copy link
Contributor

bleskes commented Nov 18, 2014

LGTM. Left some minor comments + a question about removed test.

@javanna
Copy link
Member

javanna commented Nov 19, 2014

nice work @dakrone ! I just bumped into the gateway documentation, I think it should be updated as part of this PR as gateway: none is not an option anymore.

@javanna
Copy link
Member

javanna commented Nov 19, 2014

One more thing, if I understand correctly the gateway.type can only have local value after this change. Does the setting remain configurable? Would it make sense to remove it from the default elasticsearch.yml (and also look for any other place where it's mentioned)?

@dakrone
Copy link
Member Author

dakrone commented Nov 19, 2014

@javanna good catch! I've updated the documentation and elasticsearch.yml for the removal of the none gateway.

The setting remains configurable, but only for internal (plugin) use only.

@bleskes
Copy link
Contributor

bleskes commented Nov 19, 2014

Would it make sense to remove it from the default elasticsearch.yml

+1

The setting remains configurable, but only for internal (plugin) use only.

+1 (we may want to mock it at some point)

Left one minor comment LGTM (with the change to elasticsearch.yml)

@dakrone dakrone force-pushed the remove-none-gateway branch 7 times, most recently from c98b0b9 to 9efdd83 Compare November 21, 2014 11:36
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)
@dakrone
Copy link
Member Author

dakrone commented Nov 24, 2014

Merged to master

@dakrone dakrone closed this Nov 24, 2014
@s1monw
Copy link
Contributor

s1monw commented Nov 24, 2014

w00t

@dakrone dakrone deleted the remove-none-gateway branch November 28, 2014 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants