From 911de24ef147b580a18ed19bc2c17685b53e0136 Mon Sep 17 00:00:00 2001 From: Oleksandr Kolomiiets Date: Tue, 8 Jul 2025 15:36:03 -0700 Subject: [PATCH] Fixes based on resharding disruption tests --- .../org/elasticsearch/cluster/routing/RecoverySource.java | 2 +- .../indices/cluster/IndicesClusterStateService.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/RecoverySource.java b/server/src/main/java/org/elasticsearch/cluster/routing/RecoverySource.java index 838d3cf539b3b..4f8f1c2d8d64e 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/RecoverySource.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/RecoverySource.java @@ -355,7 +355,7 @@ protected void writeAdditionalFields(StreamOutput out) throws IOException { @Override public void addAdditionalFields(XContentBuilder builder, Params params) throws IOException { - sourceShardId.toXContent(builder, params); + builder.field("sourceShardId", sourceShardId); } } } diff --git a/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java b/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java index 83be37d553fef..9862ff9d30338 100644 --- a/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java +++ b/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java @@ -1004,8 +1004,8 @@ private static DiscoveryNode findSourceNodeForReshardSplitRecovery( ShardRouting sourceShardRouting = routingTable.shardRoutingTable(sourceShardId).primaryShard(); if (sourceShardRouting.active() == false) { - assert false : sourceShardRouting.shortSummary(); - logger.trace("can't find reshard split source node because source shard {} is not active.", sourceShardRouting); + // Source shard is unassigned (likely due to failure), we will retry. + logger.trace("can't find reshard split source node because source shard {} is not active.", sourceShardRouting.shortSummary()); return null; }