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

Make 0 as invalid value for min_children in has_child query #41347

Merged
merged 7 commits into from
Apr 25, 2019

Conversation

codebird
Copy link
Contributor

Just updated the test in file

modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java

from < 0 to <= 0 and changed the error message.

Copy link
Member

@cbuescher cbuescher left a comment

Choose a reason for hiding this comment

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

Hi @codebird, thanks for the PR. I left a minor comment around the error message. Also at least the unit test HasChildQueryBuilderTests needs adapting to the new illegal values and message. Maybe other tests are failing. You can take a look at the TESTING.txt file if you are unsure of how to run the tests. Since the change is in the "server" subproject, I think running "./gradlew -p server check" from the root folder should catch most test failures. Otherwise we'll catch them when running the final CI tests. Let me know if you have any questions.

@cbuescher cbuescher self-assigned this Apr 18, 2019
@cbuescher cbuescher added :Search/Search Search-related issues that do not fall into other categories >enhancement v7.2.0 v8.0.0 labels Apr 18, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@cbuescher cbuescher changed the title Fixing#32949 Make 0 as invalid value for min_children in has_child query Apr 18, 2019
@cbuescher
Copy link
Member

This relates to #32949.

@cbuescher
Copy link
Member

Another quick hint: apart from changing the min/max value cases in HasChildQueryBuilderTests#testIllegalValues, the #doCreateTestQueryBuilder method in the same test class will need some changes so we don't draw 0 values for min/max when randomly setting up the query builder.

@cbuescher
Copy link
Member

@codebird the change looks good from what I see, unfortunately the diff is a bit large now with the unrelated changes merged in from master. I'm not sure this is a Github quirk, but could you try squashing your branch down to one commit and force-push that to your PR branch? That would make it easier to read I think. I will kick of the larger CI test suite after that. Thanks.

@codebird
Copy link
Contributor Author

done @cbuescher Thanks for the help

@cbuescher
Copy link
Member

Something is weird. Your branch still shows changes in unrelated classes (e.g. TestingConventionsTasks.java), but when I look at the current state of that class on master it looks like that version is already similar with the one on your PR branch. Maybe a Github glitch. I will need to look into this more deeply before merging, but will run CI for now.
@elasticmachine test this please

@codebird
Copy link
Contributor Author

codebird commented Apr 18, 2019

@cbuescher that's because I did

git fetch upstream
git rebase upstream/master

shouldn't have done it on the branch...

…n case min_children is not provided it will be set to 1 by default.
@codebird
Copy link
Contributor Author

codebird commented Apr 18, 2019

I updated DEFAULT_MIN_CHILDREN to be 1 not 0, for the case where min_children is not provided at all, that's what was causing CI to fail. @cbuescher

@cbuescher
Copy link
Member

@codebird I hope you don't mind but I merged in master once more to fix a merge conflict. Now the diff also looks okay (only two files changed). Will run the full tests again.
@elasticmachine test this please

@cbuescher
Copy link
Member

@elasticmachine test this please

@codebird
Copy link
Contributor Author

codebird commented Apr 23, 2019

@cbuescher I think you need to re-initiate the tests. if I mention elasticmachine and say test this please will it run the tests?

@cbuescher
Copy link
Member

Unfortunately not. You need to be member of the "Elastic" organization to run the CI bot so our testing infrastructure cannot be DoS'ed. The current ci/1 failure seems unrelated to this change, I will just run that part again.
@elasticmachine run elasticsearch-ci/1

@codebird
Copy link
Contributor Author

cute this elasticmachine :) Yeah I know it is not related to us, that's why I said you need to re-initiate

@cbuescher
Copy link
Member

@elasticmachine run elasticsearch-ci/1

@cbuescher
Copy link
Member

The last ci/1 run died a while ago with "java.lang.OutOfMemoryError: Java heap space" https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+pull-request-1/12487/console
Kicking of another one.
@elasticmachine run elasticsearch-ci/1

@codebird
Copy link
Contributor Author

Failed again with errors not to do with this

@cbuescher
Copy link
Member

Unfortunately. Just for reference, the last ones were timeouts: https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+pull-request-1/12510/
@elasticmachine run elasticsearch-ci/1

@codebird
Copy link
Contributor Author

hmmm weird, it failed again

Failed to start elasticsearch: timed out after 30 seconds

Just for my info does this always happen like this? Or something causing it now, systems are busy or something?

@cbuescher
Copy link
Member

@codebird normally things pass more smoothly. We had some recent changes in the build system that might make this one a bit more bumpy. The latest failures are unrelated as well and look transient (some googleapis 500 Internal Server Errors in GCE plugin tests). This is unfortunate, but we want to have at least one clear run of the entire suite before merging anything, even if its only a few lines changed like this one.
@elasticmachine run elasticsearch-ci/1

@cbuescher
Copy link
Member

cbuescher commented Apr 24, 2019

@elasticmachine run elasticsearch-ci/1
Feels like kicking a can ;-)

@cbuescher
Copy link
Member

@codebird ^ latest one is gce failure again, feels like a general problem in the testing infra at the moment (not just this PR). I'm going to wait on internal feedback before continuing re-runs here.

@cbuescher
Copy link
Member

Merged master, maybe that helps.
@elasticmachine test this please

@codebird
Copy link
Contributor Author

Wooooo it worked

Copy link
Member

@cbuescher cbuescher left a comment

Choose a reason for hiding this comment

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

Today is the lucky day ;-)
LGTM and will merge to master now, probably backport to 7.1 after that.

@codebird
Copy link
Contributor Author

Thanks for the help @cbuescher. And sorry for the headache :P

@cbuescher
Copy link
Member

No problem, and thanks for picking this up, much appreciated. I would like to backport this to 7.1 but I see problems with this since it would mean introducing a slightly different behaviour for the has_child query on a minor release. We usually don't introduce breaking changes like this in minors unless it fixes some serious bugs. This is more of a safety enhancement, so I think it should only go to master.

@codebird
Copy link
Contributor Author

Maybe we should start with a warning on 7.1 just to prepare for this to go live some day. I don't know what are your rules for these warnings...

@cbuescher
Copy link
Member

That would be a nice follow up indeed. Are you interested in doing that in a small PR against the 7.x branch? Look at the way DeprecationLogger is used e.g. in TermsQueryBuilder. Adding something to the "minMaxChildren" method and log a short notice for 0 values (that this will be rejected in 8.0 but if using 1 this should behave the same). In that case we'd also need to adapt tests in a similar way like in this PR because triggering the warning will cause tests to fail. In additon we'd need a test that checks that the 0 value triggers the warning. See e.g. TermsQueryBuilderTests#testTypeField how this can be done using the "assertWarnings" method.
If you are not interested in this I can open an issue regardless to follow up on it.

@codebird
Copy link
Contributor Author

codebird commented Apr 25, 2019

Yes interested since this is not urgent and a bit busy at work (and obviously I am still slowly learning the code) . Let's do it

@cbuescher
Copy link
Member

Great, I opened #41548 just so we don't forget following up on it. Feel free to grab it and let me know if there are any questions.

@codebird codebird deleted the fixing#32949 branch April 25, 2019 19:32
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Apr 26, 2019
…s-in-all-the-places

* elastic/master: (70 commits)
  Remove experimental label froms script_score query (elastic#41572)
  [Ml-Dataframe] Update URLs in Data frame client java doc (elastic#41539)
  Reenable bwc Tests in master (elastic#41540)
  Fix search_as_you_type's sub-fields to pick their names from the full path of the root field (elastic#41541)
  Remove search analyzers from DocumentFieldMappers (elastic#41484)
  Update community client and integration docs (elastic#41513)
  Remove Version.V_6_x_x constants use in security (elastic#41185)
  Mute testDriverConfigurationWithSSLInURL
  Remove dedicated SSL network write buffer (elastic#41283)
  Disable max score optimization for queries with unbounded max scores (elastic#41361)
  [DOCS] Explicitly set section IDs for Asciidoctor migration (elastic#41547)
  [ML] add multi node integ tests for data frames (elastic#41508)
  [Docs] Fix common word repetitions (elastic#39703)
  [DOCS] Note TESTRESPONSE can't be used immediately after TESTSETUP (elastic#41542)
  Update configuring-ldap-realm.asciidoc (elastic#40427)
  Fixed very small typo in date (elastic#41398)
  Refactor GeoHashUtils (elastic#40869)
  Make 0 as invalid value for `min_children` in `has_child` query (elastic#41347)
  field_caps: adapt bwc version after backport (elastic#41427)
  Remove Exists Check from S3 Repository Deletes (elastic#40931)
  ...
akhil10x5 pushed a commit to akhil10x5/elasticsearch that referenced this pull request May 2, 2019
…tic#41347)

* squashing multiple commits

* fixing elastic#32949 updated DEFAULT_MIN_CHILDREN to be 1, this way in case min_children is not provided it will be set to 1 by default.

* Fix ChildQuerySearchIT
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
…tic#41347)

* squashing multiple commits

* fixing elastic#32949 updated DEFAULT_MIN_CHILDREN to be 1, this way in case min_children is not provided it will be set to 1 by default.

* Fix ChildQuerySearchIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants