From 17c576a36f7419166554c1cfd3438d063b751e2b Mon Sep 17 00:00:00 2001 From: Pushkar Raste Date: Tue, 25 Feb 2020 11:37:44 -0500 Subject: [PATCH] SOLR-14299 IndexFetcher doesn't reset count to 0 after the last packet is received --- solr/CHANGES.txt | 2 ++ .../core/src/java/org/apache/solr/handler/IndexFetcher.java | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index e9df9b13317..1d213c8472f 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -194,6 +194,8 @@ Bug Fixes * SOLR-14287: Admin UI Properties screen does not show colons (janhoy) +* SOLR-14299 IndexFetcher doesn't reset error count to 0 after the last packet is received (Pushkar Raste via Mike Drob) + Other Changes --------------------- diff --git a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java index 0f873af9c81..842c40615cb 100644 --- a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java +++ b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java @@ -1728,7 +1728,7 @@ public class IndexFetcher { 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; } } @@ -1736,10 +1736,10 @@ public class IndexFetcher { 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) { throw e;