@@ -291,7 +291,7 @@ public void onResponse(DataNodeComputeResponse response) {
291291 final ShardId shardId = entry .getKey ();
292292 trackShardLevelFailure (shardId , false , entry .getValue ());
293293 pendingShardIds .add (shardId );
294- maybeScheduleRetry (shardId , entry .getValue ());
294+ maybeScheduleRetry (shardId , false , entry .getValue ());
295295 }
296296 onAfter (response .completionInfo ());
297297 }
@@ -301,7 +301,7 @@ public void onFailure(Exception e, boolean receivedData) {
301301 for (ShardId shardId : request .shardIds ) {
302302 trackShardLevelFailure (shardId , receivedData , e );
303303 pendingShardIds .add (shardId );
304- maybeScheduleRetry (shardId , e );
304+ maybeScheduleRetry (shardId , receivedData , e );
305305 }
306306 onAfter (DriverCompletionInfo .EMPTY );
307307 }
@@ -316,8 +316,9 @@ public void onSkip() {
316316 }
317317 }
318318
319- private void maybeScheduleRetry (ShardId shardId , Exception e ) {
320- if (targetShards .getShard (shardId ).remainingNodes .isEmpty ()
319+ private void maybeScheduleRetry (ShardId shardId , boolean receivedData , Exception e ) {
320+ if (receivedData == false
321+ && targetShards .getShard (shardId ).remainingNodes .isEmpty ()
321322 && unwrapFailure (e ) instanceof NoShardAvailableActionException ) {
322323 pendingRetries .add (shardId );
323324 }
0 commit comments