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:44:10 UTC
[lucene-solr] branch branch_8x 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 branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/branch_8x by this push:
new c2125f3 SOLR-14058: fix peersync bounds check iterating over versions
c2125f3 is described below
commit c2125f331b0d35ea284242476780040675479f6f
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 a0ff476..a89c386 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -132,6 +132,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 8fd3bef..b8353b8 100644
--- a/solr/core/src/java/org/apache/solr/update/PeerSync.java
+++ b/solr/core/src/java/org/apache/solr/update/PeerSync.java
@@ -746,7 +746,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++;