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

REST high-level client: add support for Indices Update Settings API [take 2] #29327

Merged
merged 6 commits into from
Apr 16, 2018

Conversation

olcbean
Copy link
Contributor

@olcbean olcbean commented Mar 31, 2018

Relates to #27205

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

1 similar comment
@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@javanna javanna self-requested a review April 3, 2018 10:22
@javanna
Copy link
Member

javanna commented Apr 3, 2018

hi @olcbean thanks for your effort, of trying to address the issue caused in x-pack tests that you can't even look at :)

I didn't see this coming unfortunately. The problem in your previous PR, and partially in this updated one too, is that we change equals/hashcode implementation for base classes that are subclassed by a lot of classes. At that point we should also update all those classes otherwise e.g. two different cluster health requests are deemed equal as we only use fields from its base class to do the comparison. Rather than making this PR huge though I think I would only modify equals/hashcode for the request that we are working on without affecting its base classes hence all of the sublcasses of such base classes. One day, or in a follow-up PR, we can do this properly, but for now I think that makes the change too big and unnecessary. How does this sound to you?

@olcbean
Copy link
Contributor Author

olcbean commented Apr 3, 2018

@javanna it is definitely better to address the equals / hashCode gradually rather than as part of this PR ;)

@olcbean
Copy link
Contributor Author

olcbean commented Apr 3, 2018

btw is this the first Request for which AbstractStreamableTestCase and AbstractXContentTestCase were added ? Do you think such tests should be added for the majority of the Requests ( while implementing the high level client ) ?

@javanna
Copy link
Member

javanna commented Apr 4, 2018

btw is this the first Request for which AbstractStreamableTestCase and AbstractXContentTestCase were added ? Do you think such tests should be added for the majority of the Requests ( while implementing the high level client ) ?

Yes it may be the first one, most of the request tests are probably just ESTestCase. As we've seen in this PR, for requests it's a bit more complicated than for responses, because requests are made of url parameters and optional body, so there is a mismatch between transport serialization (body plus parameters) and xcontent serialization (body only) which makes things like equality comparisons and assertions complicated. I would go case by case. Probably dividing the two tests is the best solution in most cases, but we will see as we go I guess.

return Objects.equals(settings, that.settings)
&& Objects.equals(indicesOptions, that.indicesOptions)
&& Objects.equals(preserveExisting, that.preserveExisting)
&& Arrays.equals(indices, that.indices);
Copy link
Member

Choose a reason for hiding this comment

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

don't you need to take also timeout and masterNodeTimeout into account?

Copy link
Member

Choose a reason for hiding this comment

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

I would suspect proper equals/hashcode tests to fail currently, maybe also tests need to be updated to mutate such fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now the equals and the hashCode use all request fields except for the flatSettings ( as the flatSettings are not serialized ).

@javanna
Copy link
Member

javanna commented Apr 5, 2018

test this please

@javanna
Copy link
Member

javanna commented Apr 5, 2018

retest this please

@javanna
Copy link
Member

javanna commented Apr 10, 2018

retest this please

1 similar comment
@javanna
Copy link
Member

javanna commented Apr 10, 2018

retest this please

@javanna
Copy link
Member

javanna commented Apr 16, 2018

retest this please

@javanna javanna merged commit b3e3b80 into elastic:master Apr 16, 2018
@javanna
Copy link
Member

javanna commented Apr 16, 2018

Thanks @olcbean once again and sorry it took me a while to merge it.

jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Apr 17, 2018
* master: (96 commits)
  TEST: Mute testEnsureWeReconnect
  Mute full cluster restart test recovery test
  REST high-level client: add support for Indices Update Settings API [take 2] (elastic#29327)
  Plugins: Fix native controller confirmation for non-meta plugin (elastic#29434)
  Remove PipelineExecutionService#executeIndexRequest (elastic#29537)
  Fix overflow error in parsing of long geohashes (elastic#29418)
  Remove unused index.ttl.disable_purge setting (elastic#29527)
  FullClusterRestartIT.testRecovery should wait for all initializing shards
  Build: Fail if any libs depend on non-core libs (elastic#29336)
  [TEST] REST client request without leading '/' (elastic#29471)
  Using ObjectParser in UpdateRequest (elastic#29293)
  Prevent accidental changes of default values (elastic#29528)
  [Docs] Add definitions to glossary  (elastic#29127)
  Avoid self-deadlock in the translog (elastic#29520)
  Minor cleanup in NodeInfo.groovy
  Lazy configure build tasks that require older JDKs (elastic#29519)
  Simplify snapshot check in root build file
  Make NodeInfo#nodeVersion strongly-typed as Version (elastic#29515)
  Enable license header exclusions (elastic#29379)
  Use proper Java version for BWC builds (elastic#29493)
  ...
javanna pushed a commit that referenced this pull request Apr 17, 2018
@olcbean olcbean deleted the hlrc_update_index_settings_take2 branch May 18, 2018 08:19
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.

5 participants