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

Integration test for labelled children in nested documents #899

Merged
merged 6 commits into from
Dec 30, 2020

Conversation

thomascorthals
Copy link
Member

This closes #870. This also closes #717. This also closes #577.

The integration test adds nested documents and queries them both with a [child] tranformer and block join queries. There's quite some differences between Solr 7 and Solr 8 when using [child]. Between this test and the one for anonymous children, I believe I have all possibilities covered.

Solr 7 has no support for atomic updates of child documents. Solr 8 does, but they don't work with XML update requests because of SOLR-12677. In spite of the claim there, I also couldn't get them to work with anonymous children. That might be because I introduced a _nest_path_ field in our schema to fully support labelled children. You probably shouldn't use the combination of _nest_path_ and anonymous children in a production environment.

One exception is removing all child documents by setting them to []. There doesn't need to be any nested data in the XML for that atomic update and it does result in the expected behaviour. I've set a watch on SOLR-12677. When it gets fixed, I'll expand the test to cover the full range of atomic operations.

@thomascorthals
Copy link
Member Author

I had to exclude the test for atomic updates of anonymous children from SolrCloud mode. Occasionally it would pass, but on most of my runs (both locally and on GitHub) it would result in an error for 1 or 2 of the 3 adapters. It's not the same adapters every time and I've never seen it fail on all 3 adapters in the same run. I couldn't find anything about it on Solr's JIRA.

[Run Tests/PHP 7.4, Solr 8 cloud]   | 1) Solarium\Tests\Integration\SolrCloud\CurlTest::testAnonymouslyNestedDocuments
[Run Tests/PHP 7.4, Solr 8 cloud]   | Solarium\Exception\HttpException: Solr HTTP error: OK (500)
[Run Tests/PHP 7.4, Solr 8 cloud]   | {
[Run Tests/PHP 7.4, Solr 8 cloud]   |   "responseHeader":{
[Run Tests/PHP 7.4, Solr 8 cloud]   |     "rf":1,
[Run Tests/PHP 7.4, Solr 8 cloud]   |     "status":500,
[Run Tests/PHP 7.4, Solr 8 cloud]   |     "QTime":25},
[Run Tests/PHP 7.4, Solr 8 cloud]   |   "error":{
[Run Tests/PHP 7.4, Solr 8 cloud]   |     "metadata":[
[Run Tests/PHP 7.4, Solr 8 cloud]   |       "error-class","org.apache.solr.update.processor.DistributedUpdateProcessor$DistributedUpdatesAsyncException",
[Run Tests/PHP 7.4, Solr 8 cloud]   |       "root-error-class","org.apache.solr.update.processor.DistributedUpdateProcessor$DistributedUpdatesAsyncException"],
[Run Tests/PHP 7.4, Solr 8 cloud]   |     "msg":"Async exception during distributed update: Error from server at http://172.21.0.2:8987/solr/5fe0d1040f76a_shard1_replica_n1/: null\n\n\n\nrequest: http://172.21.0.2:8987/solr/5fe0d1040f76a_shard1_replica_n1/\nRemote error message: class java.util.LinkedHashMap cannot be cast to class java.lang.String (java.util.LinkedHashMap and java.lang.String are in module java.base of loader 'bootstrap')",
[Run Tests/PHP 7.4, Solr 8 cloud]   |     "trace":"org.apache.solr.update.processor.DistributedUpdateProcessor$DistributedUpdatesAsyncException: Async exception during distributed update: Error from server at http://172.21.0.2:8987/solr/5fe0d1040f76a_shard1_replica_n1/: null\n\n\n\nrequest: http://172.21.0.2:8987/solr/5fe0d1040f76a_shard1_replica_n1/\nRemote error message: class java.util.LinkedHashMap cannot be cast to class java.lang.String (java.util.LinkedHashMap and java.lang.String are in module java.base of loader 'bootstrap')\n\tat org.apache.solr.update.processor.DistributedZkUpdateProcessor.doDistribFinish(DistributedZkUpdateProcessor.java:1193)\n\tat org.apache.solr.update.processor.DistributedUpdateProcessor.finish(DistributedUpdateProcessor.java:1125)\n\tat org.apache.solr.update.processor.LogUpdateProcessorFactory$LogUpdateProcessor.finish(LogUpdateProcessorFactory.java:195)\n\tat org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:78)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:214)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:2627)\n\tat org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:795)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:568)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:415)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:345)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:590)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1610)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1300)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1215)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)\n\tat org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:177)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n\tat org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:500)\n\tat org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)\n\tat org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)\n\tat org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)\n\tat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)\n\tat java.base/java.lang.Thread.run(Unknown Source)\n",
[Run Tests/PHP 7.4, Solr 8 cloud]   |     "code":500}}
[Run Tests/PHP 7.4, Solr 8 cloud]   |
[Run Tests/PHP 7.4, Solr 8 cloud]   |
[Run Tests/PHP 7.4, Solr 8 cloud]   | /github/workspace/src/Core/Query/Result/Result.php:64
[Run Tests/PHP 7.4, Solr 8 cloud]   | /github/workspace/src/Core/Client/Client.php:762
[Run Tests/PHP 7.4, Solr 8 cloud]   | /github/workspace/src/Core/Client/Client.php:792
[Run Tests/PHP 7.4, Solr 8 cloud]   | /github/workspace/src/Core/Client/Client.php:873
[Run Tests/PHP 7.4, Solr 8 cloud]   | /github/workspace/tests/Integration/AbstractTechproductsTest.php:1517

@codecov-io
Copy link

codecov-io commented Dec 23, 2020

Codecov Report

Merging #899 (3368fad) into master (710b0f8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #899   +/-   ##
=========================================
  Coverage     91.21%   91.21%           
  Complexity     3802     3802           
=========================================
  Files           328      328           
  Lines          8146     8146           
=========================================
  Hits           7430     7430           
  Misses          716      716           
Flag Coverage Δ Complexity Δ
unittests 91.21% <ø> (ø) 0.00 <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 710b0f8...3368fad. Read the comment docs.

@mkalkbrenner mkalkbrenner merged commit 1ebff68 into solariumphp:master Dec 30, 2020
@thomascorthals thomascorthals deleted the integration branch December 30, 2020 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants