Skip to content

Commit

Permalink
SOLR-11094: avoid NumberFormatException in AbstractFullDistribZkTestB…
Browse files Browse the repository at this point in the history
…ase.waitForReplicationFromReplicas (apache#620)
  • Loading branch information
cpoerschke authored Mar 7, 2022
1 parent 0557cf5 commit 527c1d1
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2676,7 +2676,8 @@ protected void waitForReplicationFromReplicas(
.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()) {
Expand All @@ -2692,17 +2693,6 @@ protected void waitForReplicationFromReplicas(
}
}
} 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(
Expand All @@ -2722,6 +2712,17 @@ protected void waitForReplicationFromReplicas(
}
}
}
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);
}
}
Expand Down

0 comments on commit 527c1d1

Please sign in to comment.