Skip to content

[CELEBORN-2499] Show shuffle slot assignments in the Spark UI Celeborn tab - #3891

Open
ForVic wants to merge 1 commit into
apache:mainfrom
ForVic:ForVic/spark-ui-shuffle-assignments
Open

ForVic wants to merge 1 commit into
apache:mainfrom
ForVic:ForVic/spark-ui-shuffle-assignments

Conversation

@ForVic

@ForVic ForVic commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

JIRA: https://issues.apache.org/jira/browse/CELEBORN-2499

Show the slots reserved on each worker for every Celeborn shuffle on the Celeborn tab of the Spark UI and the History Server. This is the "Shuffle Assignments" follow-up planned in CELEBORN-2415. The driver-side LifecycleManager already knows the assignment, so no executor instrumentation is needed.

  • client: once a shuffle is registered, LifecycleManager reports the slots reserved on each worker to a ShuffleAssignmentListener, together with the Celeborn shuffle id and the application (Spark) shuffle id. With stage rerun enabled, the two ids differ. SparkShuffleManager.registerShuffleAssignmentListener hands the listener to its lazily created LifecycleManager.
  • spark-ui:
    • CelebornPlugin registers the listener and posts a CelebornShuffleAssignmentEvent per shuffle, so applications without the plugin post nothing. Registration happens in registerMetrics because Spark 4 initializes the shuffle manager after the driver plugins' init.
    • CelebornListener persists two things, for both the live UI and History Server replay:
      • a compact per-shuffle summary, retaining up to spark.ui.retainedStages shuffles;
      • the shuffles and slots of each worker over all shuffles, which stay exact after old shuffles are dropped.
    • The tab gains a Shuffle Assignments summary line and two collapsed tables:
      • Shuffle Assignments: Spark and Celeborn shuffle ids, workers, reserved slots, and slots per worker as min / avg / max.
      • Worker Slots: the shuffles and reserved slots of each worker.

Why are the changes needed?

The Celeborn tab shows nothing about which workers serve an application's shuffles or how evenly their slots are spread, which is needed to understand worker hotspots for a specific application.

Does this PR resolve a correctness bug?

  • Yes

Does this PR introduce any user-facing change?

  • Yes

The Celeborn tab gains the Shuffle Assignments summary line and two collapsed tables. Nothing changes for applications that don't enable CelebornPlugin. Some cases are not covered:

  • Slots that partition splits or revives reallocate later are not included.
  • Shuffle managers that create their own LifecycleManager instead of using Celeborn's SparkShuffleManager (e.g. Gluten's) report no assignments.

Same workload and cluster (Spark 3.5.9, 3 workers, replication enabled).

Before (main):

before

After, with the collapsed sections expanded:

after

How was this patch tested?

  • CelebornListenerSuite:
    • per-shuffle summaries and per-worker totals are persisted from the event;
    • per-worker totals stay exact beyond spark.ui.retainedStages;
    • the History Server KVStore serializer round trip works.
  • CelebornPluginSuite: a local SparkContext with CelebornPlugin and SparkShuffleManager has the listener registered, and reported assignments reach the UI store.
  • LifecycleManagerSuite: against a mini cluster, the listener receives both shuffle ids and primary plus replica slots for every partition.
  • ./build/mvn -P<profile> -pl client-spark/spark-3-ui test passes for spark-3.0, spark-3.5 and spark-4.0.
  • Manual: the screenshots above, from a local cluster with 3 Celeborn workers, Spark 3.5.9 standalone and the History Server, which shows the same data on replay.

@ForVic
ForVic force-pushed the ForVic/spark-ui-shuffle-assignments branch 2 times, most recently from 8ae8155 to da3470e Compare October 22, 2026 07:11
@ForVic ForVic changed the title [CELEBORN-XXXX] Add shuffle slot assignments to the Spark UI Celeborn tab [CELEBORN-2499] Show shuffle slot assignments in the Spark UI Celeborn tab Oct 22, 2026
…n tab

Show the slots reserved on each worker for every Celeborn shuffle on the
Celeborn tab of the Spark UI and History Server.

- LifecycleManager reports the slots reserved on each worker once a shuffle
  is registered to a ShuffleAssignmentListener, with both the Celeborn and
  the application shuffle id. SparkShuffleManager hands the listener to its
  lazily created LifecycleManager.
- The Celeborn UI plugin registers the listener and posts a
  CelebornShuffleAssignmentEvent per shuffle, so applications without the
  plugin post nothing. CelebornListener persists a per-shuffle summary,
  retaining up to spark.ui.retainedStages shuffles, and the shuffles and
  slots of each worker over all shuffles.
- The Celeborn tab gains a summary line and two collapsed tables: Shuffle
  Assignments and Worker Slots.
@ForVic
ForVic force-pushed the ForVic/spark-ui-shuffle-assignments branch from da3470e to d1e7651 Compare October 22, 2026 07:52
@ForVic
ForVic marked this pull request as ready for review October 22, 2026 17:59
@ForVic

ForVic commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

cc @zaynt4606 if you could take a look when you get the chance

@zaynt4606 zaynt4606 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants