You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/10/09 18:55:33 UTC

[GitHub] [lucene-solr] barrotsteindev opened a new pull request #1970: SOLR-14869: do not add deleted docs in child doc transformer

barrotsteindev opened a new pull request #1970:
URL: https://github.com/apache/lucene-solr/pull/1970


   <!--
   _(If you are a project committer then you may remove some/all of the following template.)_
   
   Before creating a pull request, please file an issue in the ASF Jira system for Lucene or Solr:
   
   * https://issues.apache.org/jira/projects/LUCENE
   * https://issues.apache.org/jira/projects/SOLR
   
   You will need to create an account in Jira in order to create an issue.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * LUCENE-####: <short description of problem or changes>
   * SOLR-####: <short description of problem or changes>
   
   LUCENE and SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
   
   
   # Description
   
   Please provide a short description of the changes you're making with this pull request.
   
   # Solution
   
   Please provide a short description of the approach taken to implement your solution.
   
   # Tests
   
   Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request title.
   - [ ] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `master` branch.
   - [x] I have run `./gradlew check`.
   - [x] I have added tests for my changes.
   - [x] I have added documentation for the [Ref Guide](https://github.com/apache/lucene-solr/tree/master/solr/solr-ref-guide) (for Solr changes only).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dsmiley commented on a change in pull request #1970: SOLR-14869: do not add deleted docs in child doc transformer

Posted by GitBox <gi...@apache.org>.
dsmiley commented on a change in pull request #1970:
URL: https://github.com/apache/lucene-solr/pull/1970#discussion_r502934674



##########
File path: solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformerHierarchy.java
##########
@@ -136,12 +136,28 @@ public void testParentFilterLimitJSON() throws Exception {
   }
 
   @Test
-  public void testLiveDocs() throws Exception {
+  public void testWithDeletedChildren() throws Exception {
+    // add a doc to create another segment
+    final String addNonTestedDoc =
+        "{\n" +
+          "\"add\": {\n" +
+            "\"doc\": {\n" +
+                "\"id\": " + -1000 + ", \n" +
+                "\"type_s\": \"cake\", \n" +
+            "}\n" +
+          "}\n" +
+        "}";
+
     indexSampleData(numberOfDocsPerNestedTest);
     // delete toppings path
     assertU(delQ("_nest_path_:\\/toppings"));
     assertU(commit());
 
+    if (random().nextBoolean()) {

Review comment:
       Did you get this to trip the bug you had?  I'd be surprised/baffled if so.  The non-tested doc needs to be added _before_ the document you are testing so that you sometimes shift the document being tested into a segment that isn't the first one.  Otherwise `segBaseId` will always be 0 and won't expose the bug.  Make sense?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] barrotsteindev commented on a change in pull request #1970: SOLR-14869: do not add deleted docs in child doc transformer

Posted by GitBox <gi...@apache.org>.
barrotsteindev commented on a change in pull request #1970:
URL: https://github.com/apache/lucene-solr/pull/1970#discussion_r502779832



##########
File path: solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformer.java
##########
@@ -126,6 +128,12 @@ public void transform(SolrDocument rootDoc, int rootDocId) {
           continue;
         }
 
+        // check whether doc is "live"
+        if (liveDocs != null && !liveDocs.get(docId)) {

Review comment:
       Oh oops, my bad.
   Fixed and added your suggestion to the test.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dsmiley commented on pull request #1970: SOLR-14869: do not add deleted docs in child doc transformer

Posted by GitBox <gi...@apache.org>.
dsmiley commented on pull request #1970:
URL: https://github.com/apache/lucene-solr/pull/1970#issuecomment-706577771


   > Could you add the "hacktoberfest-accepted" label to this PR so it will count?
   
   Done.
   
   > Also, is there any reason why the lucene-solr repo isn't participating?
   
   I proposed this today; maybe we will, maybe we won't:
   https://lists.apache.org/thread.html/rb6ec0a342af6c54baf223afa0274a9f966a6cc8cd89c1d14a46b7f98%40%3Cdev.lucene.apache.org%3E


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] barrotsteindev commented on pull request #1970: SOLR-14869: do not add deleted docs in child doc transformer

Posted by GitBox <gi...@apache.org>.
barrotsteindev commented on pull request #1970:
URL: https://github.com/apache/lucene-solr/pull/1970#issuecomment-706953245


   Thanks @dsmiley 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] barrotsteindev commented on pull request #1970: SOLR-14869: do not add deleted docs in child doc transformer

Posted by GitBox <gi...@apache.org>.
barrotsteindev commented on pull request #1970:
URL: https://github.com/apache/lucene-solr/pull/1970#issuecomment-706536596


   It has come to my attention that the lucene-solr repo does not participate in Hacktoberfest.
   
   @dsmiley 
   Could you add the "hacktoberfest-accepted" label to this PR so it will count?
   
   Also, is there any reason why the lucene-solr repo isn't participating?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dsmiley commented on a change in pull request #1970: SOLR-14869: do not add deleted docs in child doc transformer

Posted by GitBox <gi...@apache.org>.
dsmiley commented on a change in pull request #1970:
URL: https://github.com/apache/lucene-solr/pull/1970#discussion_r502745875



##########
File path: solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformerHierarchy.java
##########
@@ -135,6 +135,37 @@ public void testParentFilterLimitJSON() throws Exception {
     );
   }
 
+  @Test
+  public void testLiveDocs() throws Exception {

Review comment:
       ```suggestion
     public void testWithDeletedChildren() throws Exception {
   ```
   
   "liveDocs" is Lucene level internal terminology.

##########
File path: solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformer.java
##########
@@ -126,6 +128,12 @@ public void transform(SolrDocument rootDoc, int rootDocId) {
           continue;
         }
 
+        // check whether doc is "live"

Review comment:
       Maybe do this at the top of the loop because it's cheap?

##########
File path: solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformer.java
##########
@@ -126,6 +128,12 @@ public void transform(SolrDocument rootDoc, int rootDocId) {
           continue;
         }
 
+        // check whether doc is "live"
+        if (liveDocs != null && !liveDocs.get(docId)) {

Review comment:
       ```suggestion
           if (liveDocs != null && !liveDocs.get(docId - segBaseId)) {
   ```
   See if your test could have caught this by adding a doc & committing up front, thus creating an additional segment?  You could wrap in a random().nextBoolean()




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dsmiley closed pull request #1970: SOLR-14869: do not add deleted docs in child doc transformer

Posted by GitBox <gi...@apache.org>.
dsmiley closed pull request #1970:
URL: https://github.com/apache/lucene-solr/pull/1970


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org