Skip to content

[SPARK-59138][CORE] Preserve reliably-stored shuffle map outputs on executor loss - #58437

Open
venkata91 wants to merge 1 commit into
apache:masterfrom
venkata91:dra-per-shuffle-reliable-storage
Open

[SPARK-59138][CORE] Preserve reliably-stored shuffle map outputs on executor loss#58437
venkata91 wants to merge 1 commit into
apache:masterfrom
venkata91:dra-per-shuffle-reliable-storage

Conversation

@venkata91

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

On executor loss, DAGScheduler unregisters all map outputs on that executor and forces a map-stage recompute. For shuffles whose output is reliably stored off-executor (e.g. a remote shuffle service such as Celeborn), the data survives the executor, so the recompute is wasteful.

Reliability is per-shuffle, not app-global. ShuffleDriverComponents.supportsReliableStorage() is a single application-wide flag, but under a mixed/fallback setup one shuffle can live on the remote service while another falls back to local disk on the same executor.

This PR makes reliability per-shuffle:

  • ShuffleHandle.isReliablyStored (default false), overridable by a ShuffleManager that routes a shuffle to reliable storage.
  • MapOutputTracker stores the bit per shuffle (ShuffleStatus), exposes isReliablyStored(shuffleId), and removeOutputsOnExecutor / removeOutputsOnHost gain a skipReliablyStored overload that leaves reliably-stored shuffles registered.
  • DAGScheduler passes skipReliablyStored = true on executor loss (handleExecutorLost) and worker loss (handleWorkerRemoved); the FetchFailed path keeps false so a genuine fetch failure still unregisters everything.
  • TaskSetManager.executorLost honors per-shuffle reliability in its re-run gate.

Why are the changes needed?

With a remote shuffle service in a mixed configuration, losing an executor needlessly recomputes map stages whose output is safely stored on the service. The existing app-global flag cannot express "this shuffle is reliable but that one is not," so it either recomputes reliable shuffles or skips recompute for local-disk fallback shuffles that were genuinely lost.

Does this PR introduce any user-facing change?

No. ShuffleHandle.isReliablyStored defaults to false, so behavior is unchanged unless a ShuffleManager opts in.

How was this patch tested?

  • New MapOutputTrackerSuite test covering a mixed reliable / local-disk scenario: executor loss preserves the reliably-stored shuffle and drops the local-disk one, while a fetch failure removes both.
  • Extended DAGSchedulerSuite verifications for the executor-loss vs fetch-failure skipReliablyStored wiring.
  • DAGSchedulerSuite, MapOutputTrackerSuite, and TaskSetManagerSuite pass; scalastyle clean.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 4.8)

@venkata91
venkata91 force-pushed the dra-per-shuffle-reliable-storage branch from 16721fb to cbd2ad3 Compare August 31, 2026 23:23
@venkata91 venkata91 changed the title [SPARK-XXXXX][CORE] Preserve reliably-stored shuffle map outputs on executor loss [SPARK-59138][CORE] Preserve reliably-stored shuffle map outputs on executor loss Aug 31, 2026
@venkata91
venkata91 marked this pull request as ready for review August 31, 2026 23:49
@venkata91
venkata91 force-pushed the dra-per-shuffle-reliable-storage branch from cbd2ad3 to 7c2854b Compare September 1, 2026 00:51
@venkata91

Copy link
Copy Markdown
Contributor Author

cc @mridulm @Ngone51

@venkata91
venkata91 force-pushed the dra-per-shuffle-reliable-storage branch from 7c2854b to 4350c69 Compare September 1, 2026 01:10

@uros-b uros-b left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment here, but please also ping committers with deeper shuffle and executor-loss expertise, for further PR review

status.removeOutputsOnHost(host)
}
}
incrementEpoch()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removeOutputsOnHost/removeOutputsOnExecutor unconditionally call incrementEpoch() even when skipReliablyStored = true and every shuffle is reliably stored (nothing was actually removed from the tracker). The epoch bump causes every executor worker to invalidate its cached map-output info and issue a round-trip to the driver on next use, even though the tracker state is unchanged. In the mixed-configuration scenario this optimization targets (remote shuffle service with frequent spot-instance turnover) this produces spurious cache churn on every executor loss. Fix: track whether any status's removal call changed state and guard incrementEpoch() accordingly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed it. Yes, we can avoid the incrementEpoch if all the shuffles are reliably stored during an executor loss.

Thanks for your review. Long time back, I have worked on this layer for push-based-shuffle. It is been a while now, looks like lot has changed. :)

…xecutor loss

On executor loss the DAGScheduler unregisters all map outputs on that
executor, forcing a map-stage recompute. For shuffles whose output is
reliably stored off-executor (e.g. a remote shuffle service like Celeborn),
the data survives the executor, so the recompute is wasteful.

Reliability is per-shuffle, not app-global: under a mixed/fallback setup one
shuffle can live on the remote service while another falls back to local
disk on the same executor. Carry the bit on ShuffleHandle.isReliablyStored,
store it per shuffle in MapOutputTracker, and skip only reliably-stored
shuffles on executor/worker loss. Genuine fetch failures still unregister
everything.
@venkata91
venkata91 force-pushed the dra-per-shuffle-reliable-storage branch from 4350c69 to c499375 Compare September 1, 2026 21:50
@venkata91

Copy link
Copy Markdown
Contributor Author

cc @cloud-fan @SteNicholas

@venkata91

Copy link
Copy Markdown
Contributor Author

Gentle ping ! @Ngone51 @sunchao @mridulm thanks !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants