You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by cp...@apache.org on 2022/03/07 12:37:29 UTC

[solr] branch branch_9x updated: SOLR-11094: avoid NumberFormatException in AbstractFullDistribZkTestBase.waitForReplicationFromReplicas (#620)

This is an automated email from the ASF dual-hosted git repository.

cpoerschke pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 576826e  SOLR-11094: avoid NumberFormatException in AbstractFullDistribZkTestBase.waitForReplicationFromReplicas (#620)
576826e is described below

commit 576826e25f28d0f6b7f493970d3d2f5d7dd059f7
Author: Christine Poerschke <cp...@apache.org>
AuthorDate: Mon Mar 7 12:35:02 2022 +0000

    SOLR-11094: avoid NumberFormatException in AbstractFullDistribZkTestBase.waitForReplicationFromReplicas (#620)
    
    (cherry picked from commit 527c1d1a5126a591b6dab465c887aa026debac74)
---
 .../solr/cloud/AbstractFullDistribZkTestBase.java  | 25 +++++++++++-----------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java
index f39cfc0..cc3ca38 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java
@@ -2676,7 +2676,8 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes
                         .getIndexCommit()
                         .getUserData()
                         .get(SolrIndexWriter.COMMIT_TIME_MSEC_KEY);
-                if (Long.parseLong(servingVersion) == replicaIndexVersion) {
+                if (servingVersion != null
+                    && Long.parseLong(servingVersion) == replicaIndexVersion) {
                   break;
                 } else {
                   if (log.isInfoEnabled()) {
@@ -2692,17 +2693,6 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes
               }
             }
           } else {
-            if (timeout.hasTimedOut()) {
-              logReplicaTypesReplicationInfo(collectionName, zkStateReader);
-              fail(
-                  String.format(
-                      Locale.ROOT,
-                      "Timed out waiting for replica %s (%d) to replicate from leader %s (%d)",
-                      pullReplica.getName(),
-                      replicaIndexVersion,
-                      leader.getName(),
-                      leaderIndexVersion));
-            }
             if (leaderIndexVersion > replicaIndexVersion) {
               if (log.isInfoEnabled()) {
                 log.info(
@@ -2722,6 +2712,17 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes
               }
             }
           }
+          if (timeout.hasTimedOut()) {
+            logReplicaTypesReplicationInfo(collectionName, zkStateReader);
+            fail(
+                String.format(
+                    Locale.ROOT,
+                    "Timed out waiting for replica %s (%d) to replicate from leader %s (%d)",
+                    pullReplica.getName(),
+                    replicaIndexVersion,
+                    leader.getName(),
+                    leaderIndexVersion));
+          }
           Thread.sleep(1000);
         }
       }