Repository navigation
[SPARK-60773][CONNECT] Make server-side Maven resolution opt-in - #59982
Open
qianlan717 wants to merge 3 commits into
Open
qianlan717 wants to merge 3 commits into
qianlan717 wants to merge 3 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR adds the public session configuration
spark.connect.session.serverSideMavenResolution.enabled, defaulting tofalse.The Spark Connect JVM client sends an eligible
ivy://dependency to the server only when theserver advertises support, the session configuration is enabled, and the URI does not specify
repositories through
repos. Otherwise, the dependency is resolved by the client. The servercapability remains cached support metadata, while the routing preference is read for every
addArtifactoraddArtifactscall so it can change at runtime.For client-resolved Ivy URIs, the JVM client reads
spark.jars.ivySettingsthrough the Config RPC,including configuration substitution. It uses the setting only when it resolves to a readable
regular local file, loads that Ivy settings file during resolution, and uploads the resolved jars
to the server. Missing, unreadable, or non-local settings retain the built-in Ivy defaults.
The routing configuration is a JVM-client preference, not a server-side enforcement control. The
server continues to accept Maven dependency requests sent directly by protocol clients.
This is split from #59977, which is limited to reading Maven settings from the owning SparkSession
for driver/server resolution. The two PRs have no code dependency and can be reviewed separately.
Why are the changes needed?
JIRA: https://issues.apache.org/jira/browse/SPARK-60773
Server capability advertisement describes whether server-side Maven resolution is supported, but
it should not automatically select that path for every session. Separating cached capability
detection from the mutable session preference keeps client-side resolution as the default and lets
a session opt in when server-side repository access is desired.
When resolution stays on the JVM client, it must honor a locally available
spark.jars.ivySettings; otherwise switching to the client can bypass the configured repositorysettings and use only the built-in defaults.
Does this PR introduce any user-facing change?
Yes, relative to the unreleased
masterbehavior. An eligible Spark Connect JVMivy://dependency is now resolved on the client by default instead of automatically using the server when
the server advertises support. A session can opt in with:
Client-side resolution now uses
spark.jars.ivySettingswhen it names a locally readable file.Dependencies with an explicit
reposquery parameter remain client-resolved. Spark Classic isunaffected by the routing configuration.
How was this patch tested?
Added
ArtifactSuitecoverage for client and server routing, runtime configuration changes,whitespace accepted by the Boolean configuration, locally readable Ivy settings with substitution
and URI escaping, single and batch artifact calls, explicit repositories, and missing server
capability.
Added
SparkConnectConfigHandlerSuitecoverage confirming that Config RPC reads return theregistered
falsedefault.Ran:
ArtifactSuite: 23 tests passed.SparkConnectConfigHandlerSuite: 19 tests passed.git diff --check, changed-source line-length checks, and non-ASCII checks also passed.Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5)