Skip to content

[SPARK-59332][CORE] Scope standalone shuffle service local dirs - #58619

Open
holdenk wants to merge 2 commits into
apache:masterfrom
holdenk:SPARK-59332-add-optional-validation-on-ess-worker-dir
Open

[SPARK-59332][CORE] Scope standalone shuffle service local dirs#58619
holdenk wants to merge 2 commits into
apache:masterfrom
holdenk:SPARK-59332-add-optional-validation-on-ess-worker-dir

Conversation

@holdenk

@holdenk holdenk commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Nest executor local directories under //executor-* on the Worker, and add an opt-in config spark.shuffle.service.requireAppScopedLocalDirs (default false) that makes the external shuffle service reject executor registrations whose local directories do not lie inside the registering application's own per-application directory. The check is opt-in for rolling-upgrade compatibility: enable it only after every Worker is upgraded. The underlying LocalDirValidator already supported this mode (used by the YARN shuffle service); this wires standalone to use it.

Why are the changes needed?

Possible race condition.

Does this PR introduce any user-facing change?

There is a new, administrator configurable, config flag.

How was this patch tested?

New test

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

Yes, claude and cursor

sfc-gh-hkarau and others added 2 commits September 8, 2026 05:52
…stering app

Nest executor local directories under <root>/<appId>/executor-* on the
Worker, and add an opt-in config spark.shuffle.service.requireAppScopedLocalDirs
(default false) that makes the external shuffle service reject executor
registrations whose local directories do not lie inside the registering
application's own per-application directory. The check is opt-in for
rolling-upgrade compatibility: enable it only after every Worker is upgraded.
The underlying LocalDirValidator already supported this mode (used by the
YARN shuffle service); this wires standalone to use it.

Co-authored-by: Cursor <cursoragent@cursor.com>
@pan3793 pan3793 changed the title [SPARK-59332][CORE][MINOR] Scope standalone shuffle service local dirs [SPARK-59332][CORE] Scope standalone shuffle service local dirs Sep 8, 2026

@HyukjinKwon HyukjinKwon 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.

0 blocking, 0 non-blocking, 1 nit.
A clean, well-tested change; one comment-wording nit that would otherwise contradict the config doc.

Nits: 1 minor item (see inline comments).

Verification

Traced the Worker layout against LocalDirValidator: the Worker writes <root>/<appId>/executor-*, and the validator (when scoped) requires the appId to appear as an exact path segment of the canonicalized path under a configured root — the produced layout satisfies it, and pre-upgrade <root>/executor-* paths correctly fail the segment check. The cleanup parent-removal is guarded by appIdDir.getName == id plus an empty-directory check, so the shared root of the pre-upgrade layout is never deleted; WorkerSuite exercises all three cases.

// application's own per-app directory (the Worker creates executor local dirs under a
// path containing the app id). The check is opt-in: executors launched by Workers that
// predate the per-app layout register unscoped paths and would be rejected, so enable it
// only once every Spark application is upgraded.

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.

The rollout unit is the Worker, not the application: the config doc and docs/spark-standalone.md both say to upgrade every Worker first, and the sentence just above already attributes the per-app layout to Workers.

Suggested change
// only once every Spark application is upgraded.
// only once every Worker is upgraded.

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.

3 participants