diff --git a/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java b/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java index 4b71a5f3bd8..7ef1bfe3a1a 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java @@ -113,7 +113,7 @@ public class TransportRefreshAction extends TransportBroadcastOperationAction 0) { - sb.append(","); + FirstResult result = firstResults.get(i); + if (result == null) { + continue; // failure } - sb.append(shard); + if (hadOne) { + sb.append(","); + } else { + hadOne = true; + } + sb.append(result.shardTarget()); } + logger.debug("Moving to second phase, based on results from: {}", sb); } moveToSecondPhase();