SOLR-14058: fix peersync bounds check iterating over versions

This commit is contained in:
yonik 2020-02-11 10:43:21 -08:00
parent 9a4f7661e9
commit c3e44e1fec
2 changed files with 4 additions and 1 deletions

View File

@ -153,6 +153,9 @@ Bug Fixes
* SOLR-14038: Admin UI display for "state.json" should be in a scollable region (Kevin Risden) * 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 Other Changes
--------------------- ---------------------

View File

@ -753,7 +753,7 @@ public class PeerSync implements SolrMetricProducer {
ourUpdatesIndex--; ourUpdatesIndex--;
} else { } else {
long rangeStart = otherVersions.get(otherUpdatesIndex); long rangeStart = otherVersions.get(otherUpdatesIndex);
while ((otherUpdatesIndex < otherVersions.size()) while (otherUpdatesIndex >= 0
&& (Math.abs(otherVersions.get(otherUpdatesIndex)) < Math.abs(ourUpdates.get(ourUpdatesIndex)))) { && (Math.abs(otherVersions.get(otherUpdatesIndex)) < Math.abs(ourUpdates.get(ourUpdatesIndex)))) {
otherUpdatesIndex--; otherUpdatesIndex--;
totalRequestedVersions++; totalRequestedVersions++;