You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2020/02/11 18:43:19 UTC
[lucene-solr] branch master updated: SOLR-14058: fix peersync
bounds check iterating over versions
This is an automated email from the ASF dual-hosted git repository.
yonik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/master by this push:
new c3e44e1 SOLR-14058: fix peersync bounds check iterating over versions
c3e44e1 is described below
commit c3e44e1fecc7295ace6bbc12d320581a90c41839
Author: yonik <yo...@apache.org>
AuthorDate: Tue Feb 11 10:43:21 2020 -0800
SOLR-14058: fix peersync bounds check iterating over versions
---
solr/CHANGES.txt | 3 +++
solr/core/src/java/org/apache/solr/update/PeerSync.java | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 86c0e20..72a566b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -153,6 +153,9 @@ Bug Fixes
* SOLR-14038: Admin UI display for "state.json" should be in a scollable region (Kevin Risden)
+* SOLR-14058: Fix IndexOutOfBoundsException in PeerSync that can prevent nodes from recovering
+ under certain circumstances. (yonik)
+
Other Changes
---------------------
diff --git a/solr/core/src/java/org/apache/solr/update/PeerSync.java b/solr/core/src/java/org/apache/solr/update/PeerSync.java
index 801e48f..187a416 100644
--- a/solr/core/src/java/org/apache/solr/update/PeerSync.java
+++ b/solr/core/src/java/org/apache/solr/update/PeerSync.java
@@ -753,7 +753,7 @@ public class PeerSync implements SolrMetricProducer {
ourUpdatesIndex--;
} else {
long rangeStart = otherVersions.get(otherUpdatesIndex);
- while ((otherUpdatesIndex < otherVersions.size())
+ while (otherUpdatesIndex >= 0
&& (Math.abs(otherVersions.get(otherUpdatesIndex)) < Math.abs(ourUpdates.get(ourUpdatesIndex)))) {
otherUpdatesIndex--;
totalRequestedVersions++;