Skip to content

Skip shard management code when updating cluster state on client/tribe nodes#20731

Merged
ywelsch merged 1 commit intoelastic:masterfrom
ywelsch:enhance/disable-icss-and-indicesstore-on-client-nodes
Oct 4, 2016
Merged

Skip shard management code when updating cluster state on client/tribe nodes#20731
ywelsch merged 1 commit intoelastic:masterfrom
ywelsch:enhance/disable-icss-and-indicesstore-on-client-nodes

Conversation

@ywelsch
Copy link
Copy Markdown
Contributor

@ywelsch ywelsch commented Oct 4, 2016

IndicesClusterStateService and IndicesStore are responsible for synchronizing local shard state based on incoming cluster state updates. Actions that are taking are initializing shards, starting recoveries, or deleting shard and index data. On client or tribe nodes, which don't store any shard/index data, all of this is unnecessary, wasting unnecessary cycles to apply cluster state updates.

Copy link
Copy Markdown
Contributor

@bleskes bleskes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change. Left some very minor comments. +1 to push it everywhere.

Copy link
Copy Markdown
Contributor

@bleskes bleskes Oct 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I prefer the following check:

        if(clusterService.localNode().isDataNode() || clusterService.localNode().isMasterNode()) {
            clusterService.addFirst(this);
        }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ClusterService has not been started at that point and clusterService.localNode() throws an java.lang.IllegalStateException when invoked here. We might do some reordering in the initialization logic etc. but as this commit targets multiple versions I wanted the change to be simple.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to leaving as is then.

Copy link
Copy Markdown
Contributor

@bleskes bleskes Oct 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont' think we need master nodes here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, I'll enable it only for data nodes.

…e nodes

IndicesClusterStateService and IndicesStore are responsible for synchronizing local shard state based on incoming
cluster state updates. Cluster state updates trigger shard initializations, starting recoveries or deleting shard
and index data / metadata. On client/tribe nodes, which don't store any shard/index data/metadata, all of this is
unnecessary, wasting precious CPU cycles.
@ywelsch ywelsch changed the title Don't call shard management code when updating cluster state on client nodes Skip shard management code when updating cluster state on client/tribe nodes Oct 4, 2016
@ywelsch ywelsch force-pushed the enhance/disable-icss-and-indicesstore-on-client-nodes branch from 23afd25 to abc35cd Compare October 4, 2016 09:53
@ywelsch ywelsch merged commit 3dcf1d5 into elastic:master Oct 4, 2016
@ywelsch
Copy link
Copy Markdown
Contributor Author

ywelsch commented Oct 4, 2016

Thanks @bleskes!

ywelsch added a commit that referenced this pull request Oct 4, 2016
…e nodes (#20731)

IndicesClusterStateService and IndicesStore are responsible for synchronizing local shard state based on incoming cluster state updates. On client/tribe nodes, which don't store any such shard/index data/metadata, all of the logic that computes which data is to be deleted, which shards to be initialized etc. can be completely skipped, saving precious CPU cycles.
ywelsch added a commit that referenced this pull request Oct 4, 2016
…e nodes (#20731)

IndicesClusterStateService and IndicesStore are responsible for synchronizing local shard state based on incoming cluster state updates. On client/tribe nodes, which don't store any such shard/index data/metadata, all of the logic that computes which data is to be deleted, which shards to be initialized etc. can be completely skipped, saving precious CPU cycles.
ywelsch added a commit that referenced this pull request Oct 4, 2016
…e nodes (#20731)

IndicesClusterStateService and IndicesStore are responsible for synchronizing local shard state based on incoming cluster state updates. On client/tribe nodes, which don't store any such shard/index data/metadata, all of the logic that computes which data is to be deleted, which shards to be initialized etc. can be completely skipped, saving precious CPU cycles.
@clintongormley clintongormley added :Distributed/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. and removed :Cluster labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. >enhancement v2.4.2 v5.0.0-rc1 v6.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants