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/03/02 18:46:04 UTC

[GitHub] [lucene-solr] praste opened a new pull request #1306: SOLR-14299: IndexFetcher doesnt' reset count to 0 after the last packet is received

praste opened a new pull request #1306: SOLR-14299: IndexFetcher doesnt' reset count to 0 after the last packet is received
URL: https://github.com/apache/lucene-solr/pull/1306
 
 
   * SOLR-14299: IndexFetcher should reset the `errorCount` to 0 after successfully receive the last packet while fetching the file.
   
   # Description
   While fetching the files from master `IndexFetcher` retries 5 times before giving up. It resets the  errorCount after successfully receiving the packet except for the last packet. Seems like an oversight. 
   
   # Solution
   
   Reset the errorCount to 0 before verifying if it is last packet for the while.
   
   # Tests
   This is a trivial change, no test cases added for now
   
   # Checklist
   Please review the following and check all that apply:
   
   - [ ] 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.
   - [ ] 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)
   - [ ] I have developed this patch against the `master` branch.
   - [ ] I have run `ant precommit` and the appropriate test suite.
   - [ ] I have added tests for my changes.
   - [ ] 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


With regards,
Apache Git Services

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


[GitHub] [lucene-solr] praste commented on a change in pull request #1306: SOLR-14299: IndexFetcher doesnt' reset count to 0 after the last packet is received

Posted by GitBox <gi...@apache.org>.
praste commented on a change in pull request #1306: SOLR-14299: IndexFetcher doesnt' reset count to 0 after the last packet is received
URL: https://github.com/apache/lucene-solr/pull/1306#discussion_r386591132
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
 ##########
 @@ -1728,20 +1728,21 @@ private int fetchPackets(FastInputStream fis) throws Exception {
             long checkSumClient = checksum.getValue();
             if (checkSumClient != checkSumServer) {
               log.error("Checksum not matched between client and server for file: {}", fileName);
-              //if checksum is wrong it is a problem return for retry
+              //if checksum is wrong it is a problem return (there doesn't seem to be a retry in this case.)
               return 1;
             }
           }
           //if everything is fine, write down the packet to the file
           file.write(buf, packetSize);
           bytesDownloaded += packetSize;
           log.debug("Fetched and wrote {} bytes of file: {}", bytesDownloaded, fileName);
-          if (bytesDownloaded >= size)
-            return 0;
           //errorCount is always set to zero after a successful packet
           errorCount = 0;
+          if (bytesDownloaded >= size)
+            return 0;
         }
       } catch (ReplicationHandlerException e) {
+        log.warn("Aborting index replication", e);
 
 Review comment:
   agreed. Logging here is not needed.

----------------------------------------------------------------
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


With regards,
Apache Git Services

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


[GitHub] [lucene-solr] madrob closed pull request #1306: SOLR-14299: IndexFetcher doesnt' reset count to 0 after the last packet is received

Posted by GitBox <gi...@apache.org>.
madrob closed pull request #1306: SOLR-14299: IndexFetcher doesnt' reset count to 0 after the last packet is received
URL: https://github.com/apache/lucene-solr/pull/1306
 
 
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

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


[GitHub] [lucene-solr] madrob commented on a change in pull request #1306: SOLR-14299: IndexFetcher doesnt' reset count to 0 after the last packet is received

Posted by GitBox <gi...@apache.org>.
madrob commented on a change in pull request #1306: SOLR-14299: IndexFetcher doesnt' reset count to 0 after the last packet is received
URL: https://github.com/apache/lucene-solr/pull/1306#discussion_r386585563
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
 ##########
 @@ -1728,20 +1728,21 @@ private int fetchPackets(FastInputStream fis) throws Exception {
             long checkSumClient = checksum.getValue();
             if (checkSumClient != checkSumServer) {
               log.error("Checksum not matched between client and server for file: {}", fileName);
-              //if checksum is wrong it is a problem return for retry
+              //if checksum is wrong it is a problem return (there doesn't seem to be a retry in this case.)
               return 1;
             }
           }
           //if everything is fine, write down the packet to the file
           file.write(buf, packetSize);
           bytesDownloaded += packetSize;
           log.debug("Fetched and wrote {} bytes of file: {}", bytesDownloaded, fileName);
-          if (bytesDownloaded >= size)
-            return 0;
           //errorCount is always set to zero after a successful packet
           errorCount = 0;
+          if (bytesDownloaded >= size)
+            return 0;
         }
       } catch (ReplicationHandlerException e) {
+        log.warn("Aborting index replication", e);
 
 Review comment:
   Is log-and-throw necessary here? it looks like we already log this higher up in the call stack.

----------------------------------------------------------------
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


With regards,
Apache Git Services

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


[GitHub] [lucene-solr] madrob commented on issue #1306: SOLR-14299: IndexFetcher doesnt' reset count to 0 after the last packet is received

Posted by GitBox <gi...@apache.org>.
madrob commented on issue #1306: SOLR-14299: IndexFetcher doesnt' reset count to 0 after the last packet is received
URL: https://github.com/apache/lucene-solr/pull/1306#issuecomment-604724539
 
 
   This was committed to 8.5 and master

----------------------------------------------------------------
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


With regards,
Apache Git Services

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