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

"shard started" should show index and shard ID #25157

Conversation

pickypg
Copy link
Member

@pickypg pickypg commented Jun 9, 2017

When the cluster state is updated with Shard Started entries, it simply adds "shard-started" as the source of the change.

This adds the index name and shard ID so that we can see who/what is spamming the changes when the index creation step has already left the cluster state.

For example, while debugging this, it would have been helpful to know what shards these were because both indices only had a single shard, but there are three shard-started messages:

   > {time_in_queue=670ms, time_in_queue_millis=670, source=create-index [index1], cause [auto(bulk api)], executing=true, priority=URGENT, insert_order=209}
   > {time_in_queue=647ms, time_in_queue_millis=647, source=create-index [index2], cause [auto(bulk api)], executing=false, priority=URGENT, insert_order=210}
   > {time_in_queue=647ms, time_in_queue_millis=647, source=create-index [index2], cause [auto(bulk api)], executing=false, priority=URGENT, insert_order=211}
   > {time_in_queue=641ms, time_in_queue_millis=641, source=create-index [index2], cause [auto(bulk api)], executing=false, priority=URGENT, insert_order=212}
   > {time_in_queue=632ms, time_in_queue_millis=632, source=create-index-template [templateA], cause [api], executing=false, priority=URGENT, insert_order=214}
   > {time_in_queue=632ms, time_in_queue_millis=632, source=create-index-template [templateB], cause [api], executing=false, priority=URGENT, insert_order=216}
   > {time_in_queue=631ms, time_in_queue_millis=631, source=create-index-template [templateC], cause [api], executing=false, priority=URGENT, insert_order=218}
   > {time_in_queue=632ms, time_in_queue_millis=632, source=create-index [index2], cause [auto(bulk api)], executing=false, priority=URGENT, insert_order=213}
   > {time_in_queue=631ms, time_in_queue_millis=631, source=create-index-template [templateD], cause [api], executing=false, priority=URGENT, insert_order=219}
   > {time_in_queue=632ms, time_in_queue_millis=632, source=create-index-template [templateE], cause [api], executing=false, priority=URGENT, insert_order=215}
   > {time_in_queue=630ms, time_in_queue_millis=630, source=create-index-template [templateF], cause [api], executing=false, priority=URGENT, insert_order=220}
   > {time_in_queue=631ms, time_in_queue_millis=631, source=create-index-template [templateG], cause [api], executing=false, priority=URGENT, insert_order=217}
   > {time_in_queue=629ms, time_in_queue_millis=629, source=create-index-template [templateH], cause [api], executing=false, priority=URGENT, insert_order=221}
   > {time_in_queue=98ms, time_in_queue_millis=98, source=shard-started, executing=false, priority=URGENT, insert_order=222}
   > {time_in_queue=46ms, time_in_queue_millis=46, source=shard-started, executing=false, priority=URGENT, insert_order=223}
   > {time_in_queue=10ms, time_in_queue_millis=10, source=shard-started, executing=false, priority=URGENT, insert_order=224}

When the cluster state is updated with Shard Started entries, it simply
adds "shard-started" as the source of the change.

This adds the index name and shard ID so that we can see who/what is
spamming the changes when the index creation step has already left the
cluster state.
@@ -375,7 +375,7 @@ public void shardStarted(final ShardRouting shardRouting, final String message,
public void messageReceived(ShardEntry request, TransportChannel channel) throws Exception {
logger.debug("{} received shard started for [{}]", request.shardId, request);
clusterService.submitStateUpdateTask(
"shard-started",
"shard-started " + request.shardId,
Copy link
Contributor

@bleskes bleskes Jun 9, 2017

Choose a reason for hiding this comment

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

why not the whole request while we're at it?

@pickypg pickypg force-pushed the feature/add-index-name-and-shard-id-to-cluster-state-message branch from 42f7982 to 3f9d7e6 Compare June 9, 2017 16:50
@elastic elastic deleted a comment from karmi Jun 9, 2017
@pickypg pickypg merged commit af7b479 into elastic:master Jun 9, 2017
@pickypg pickypg deleted the feature/add-index-name-and-shard-id-to-cluster-state-message branch June 9, 2017 18:52
pickypg added a commit that referenced this pull request Jun 9, 2017
When the cluster state is updated with Shard Started entries, it simply adds "shard-started" as the source of the change.

This adds the index name and shard ID so that we can see who/what is spamming the changes when the index creation step has already left the cluster state.
pickypg added a commit that referenced this pull request Jun 9, 2017
When the cluster state is updated with Shard Started entries, it simply adds "shard-started" as the source of the change.

This adds the index name and shard ID so that we can see who/what is spamming the changes when the index creation step has already left the cluster state.
@pickypg
Copy link
Member Author

pickypg commented Jun 9, 2017

5.x/5.6: 398d786
5.5: 0907e56

jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jun 10, 2017
* master: (53 commits)
  Log checkout so SHA is known
  Add link to community Rust Client (elastic#22897)
  "shard started" should show index and shard ID (elastic#25157)
  await fix testWithRandomException
  Change BWC versions on create index response
  Return the index name on a create index response
  Remove incorrect bwc branch logic from master
  Correctly format arrays in output
  [Test] Extending parsing checks for SearchResponse (elastic#25148)
  Scripting: Change keys for inline/stored scripts to source/id (elastic#25127)
  [Test] Add test for custom requests in High Level Rest Client (elastic#25106)
  nested: In case of a single type the _id field should be added to the nested document instead of _uid field.
  `type` and `id` are lost upon serialization of `Translog.Delete`. (elastic#24586)
  fix highlighting docs
  Fix NPE in token_count datatype with null value (elastic#25046)
  Remove the postings highlighter and make unified the default highlighter choice (elastic#25028)
  [Test] Adding test for parsing SearchShardFailure leniently (elastic#25144)
  Fix typo in shards.asciidoc (elastic#25143)
  List Hibernate Search (elastic#25145)
  [DOCS] update maxRetryTimeout in java REST client usage page
  ...
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jun 10, 2017
* master: (80 commits)
  Test: remove faling test that relies on merge order
  Log checkout so SHA is known
  Add link to community Rust Client (elastic#22897)
  "shard started" should show index and shard ID (elastic#25157)
  await fix testWithRandomException
  Change BWC versions on create index response
  Return the index name on a create index response
  Remove incorrect bwc branch logic from master
  Correctly format arrays in output
  [Test] Extending parsing checks for SearchResponse (elastic#25148)
  Scripting: Change keys for inline/stored scripts to source/id (elastic#25127)
  [Test] Add test for custom requests in High Level Rest Client (elastic#25106)
  nested: In case of a single type the _id field should be added to the nested document instead of _uid field.
  `type` and `id` are lost upon serialization of `Translog.Delete`. (elastic#24586)
  fix highlighting docs
  Fix NPE in token_count datatype with null value (elastic#25046)
  Remove the postings highlighter and make unified the default highlighter choice (elastic#25028)
  [Test] Adding test for parsing SearchShardFailure leniently (elastic#25144)
  Fix typo in shards.asciidoc (elastic#25143)
  List Hibernate Search (elastic#25145)
  ...
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jun 10, 2017
* master: (1889 commits)
  Test: remove faling test that relies on merge order
  Log checkout so SHA is known
  Add link to community Rust Client (elastic#22897)
  "shard started" should show index and shard ID (elastic#25157)
  await fix testWithRandomException
  Change BWC versions on create index response
  Return the index name on a create index response
  Remove incorrect bwc branch logic from master
  Correctly format arrays in output
  [Test] Extending parsing checks for SearchResponse (elastic#25148)
  Scripting: Change keys for inline/stored scripts to source/id (elastic#25127)
  [Test] Add test for custom requests in High Level Rest Client (elastic#25106)
  nested: In case of a single type the _id field should be added to the nested document instead of _uid field.
  `type` and `id` are lost upon serialization of `Translog.Delete`. (elastic#24586)
  fix highlighting docs
  Fix NPE in token_count datatype with null value (elastic#25046)
  Remove the postings highlighter and make unified the default highlighter choice (elastic#25028)
  [Test] Adding test for parsing SearchShardFailure leniently (elastic#25144)
  Fix typo in shards.asciidoc (elastic#25143)
  List Hibernate Search (elastic#25145)
  ...
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.

3 participants