Skip to content

Conversation

@jimczi
Copy link
Contributor

@jimczi jimczi commented Jan 19, 2017

In 5.2 the FieldStats API can return null min/max values.
These values cannot be deserialized by a node with version pre 5.2 so if this node
is pick to coordinate a FieldStats request in a mixed cluster an NPE can be thrown.
This change prevents the NPE by removing the non serializable FieldStats object directly in the field stats shard request.
The filtered fields will not be present in the response when a node pre 5.2 acts as a coordinating node.

In 5.2 the FieldStats API can return null min/max values.
These values cannot be deserialized by a node with version pre 5.2 so if this node
is pick to coordinate a FieldStats request in a mixed cluster an NPE can be thrown.
This change prevents the NPE by removing the non serializable FieldStats object directly in the field stats shard request.
The filtered fields will not be present in the response when a node pre 5.2 acts as a coordinating node.
Copy link
Contributor

@s1monw s1monw left a comment

Choose a reason for hiding this comment

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

LGTM I left one question / suggestion

}
} else {
if (hasMinMax == false) {
throw new IllegalArgumentException("cannot serialize null min/max fieldstats in a mixed-cluster " +
Copy link
Contributor

Choose a reason for hiding this comment

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

this only happens if we mess something up right? I wonder if we should make it an assertion instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes if it happens it's a bug, I'll make it an assertion

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks!

@jimczi jimczi merged commit d145d45 into elastic:master Jan 19, 2017
@jimczi
Copy link
Contributor Author

jimczi commented Jan 19, 2017

Thansk @s1monw. Now merging to the 5.x and 5.2

jimczi added a commit that referenced this pull request Jan 19, 2017
)

* Fix NPE on FieldStats with mixed cluster on version pre/post 5.2

In 5.2 the FieldStats API can return null min/max values.
These values cannot be deserialized by a node with version pre 5.2 so if this node
is pick to coordinate a FieldStats request in a mixed cluster an NPE can be thrown.
This change prevents the NPE by removing the non serializable FieldStats object directly in the field stats shard request.
The filtered fields will not be present in the response when a node pre 5.2 acts as a coordinating node.
jimczi added a commit that referenced this pull request Jan 19, 2017
)

* Fix NPE on FieldStats with mixed cluster on version pre/post 5.2

In 5.2 the FieldStats API can return null min/max values.
These values cannot be deserialized by a node with version pre 5.2 so if this node
is pick to coordinate a FieldStats request in a mixed cluster an NPE can be thrown.
This change prevents the NPE by removing the non serializable FieldStats object directly in the field stats shard request.
The filtered fields will not be present in the response when a node pre 5.2 acts as a coordinating node.
@jimczi jimczi deleted the field_stats_bwc branch January 19, 2017 15:23
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jan 20, 2017
* master: (117 commits)
  Add missing serialization BWC for disk usage estimates
  Expose disk usage estimates in nodes stats
  S3 repository: Deprecate specifying credentials through env vars, sys props, and remove profile files (elastic#22567)
  Fix Eclipse project generation
  Fix deprecation logging for lenient booleans
  Remove @Header we no longer need
  Make lexer abstract
  [Docs] Remove outdated info about enabling/disabling doc_values (elastic#22694)
  Move lexer hacks to EnhancedPainlessLexer
  Fix incorrect args order passed to createAggregator
  Improve painless's javadocs
  Add TestWithDependenciesPlugin to build (elastic#22646)
  Add parsing from xContent to SearchProfileShardResults and nested classes (elastic#22649)
  Add unit tests for FiltersAggregator (elastic#22678)
  Don't register search response listener in transport clients
  unmute FieldStatsIntegrationIT.testGeoPointNotIndexed, fix already pushed
  Mute FieldStatsIntegrationIT.testGeoPointNotIndexed, for now
  Painless: Add augmentation to string for base 64 (elastic#22665)
  Fix NPE on FieldStats with mixed cluster on version pre/post 5.2 (elastic#22688)
  Add parsing methods for UpdateResponse (elastic#22586)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants