-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-12807] [YARN] Spark External Shuffle not working in Hadoop clusters with Jackson 2.2.3: branch-1.6 patch #10782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,8 @@ | |
| <sbt.project.name>network-yarn</sbt.project.name> | ||
| <!-- Make sure all Hadoop dependencies are provided to avoid repackaging. --> | ||
| <hadoop.deps.scope>provided</hadoop.deps.scope> | ||
| <shuffle.jar>${project.build.directory}/scala-${scala.binary.version}/spark-${project.version}-yarn-shuffle.jar</shuffle.jar> | ||
| <shaded.jackson>org/spark-project/com/fasterxml/jackson</shaded.jackson> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
|
|
@@ -70,7 +72,7 @@ | |
| <artifactId>maven-shade-plugin</artifactId> | ||
| <configuration> | ||
| <shadedArtifactAttached>false</shadedArtifactAttached> | ||
| <outputFile>${project.build.directory}/scala-${scala.binary.version}/spark-${project.version}-yarn-shuffle.jar</outputFile> | ||
| <outputFile>${shuffle.jar}</outputFile> | ||
| <artifactSet> | ||
| <includes> | ||
| <include>*:*</include> | ||
|
|
@@ -86,6 +88,15 @@ | |
| </excludes> | ||
| </filter> | ||
| </filters> | ||
| <relocations> | ||
| <relocation> | ||
| <pattern>com.fasterxml.jackson</pattern> | ||
| <shadedPattern>org.spark-project.com.fasterxml.jackson</shadedPattern> | ||
| <includes> | ||
| <include>com.fasterxml.jackson.**</include> | ||
| </includes> | ||
| </relocation> | ||
| </relocations> | ||
| </configuration> | ||
| <executions> | ||
| <execution> | ||
|
|
@@ -96,6 +107,54 @@ | |
| </execution> | ||
| </executions> | ||
| </plugin> | ||
|
|
||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem worth the complexity; why would the shading fail?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. regression control. How do you think I got it to work in the first place? How to verify that it keeps working? I want to add some more shading; for that I'll use a small ant macro to make things terser. Consider this: A build is an execution of a program; programs needs tests. This is the test of the shading process. |
||
| <artifactId>maven-antrun-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <phase>verify</phase> | ||
| <goals> | ||
| <goal>run</goal> | ||
| </goals> | ||
| <configuration> | ||
| <target> | ||
| <fail message="Not found: ${shaded.jackson}/core/JsonParser.class"> | ||
| <condition> | ||
| <not> | ||
| <resourceexists> | ||
| <zipentry zipfile="${shuffle.jar}" | ||
| name="${shaded.jackson}/core/JsonParser.class"/> | ||
| </resourceexists> | ||
| </not> | ||
| </condition> | ||
| </fail> | ||
| <fail message="Not found: ${shaded.jackson}/annotation/JacksonAnnotation.class"> | ||
| <condition> | ||
| <not> | ||
| <resourceexists> | ||
| <zipentry zipfile="${shuffle.jar}" | ||
| name="${shaded.jackson}/annotation/JacksonAnnotation.class"/> | ||
| </resourceexists> | ||
| </not> | ||
| </condition> | ||
| </fail> | ||
| <fail message="Not found: ${shaded.jackson}/databind/JsonSerializer.class"> | ||
| <condition> | ||
| <not> | ||
| <resourceexists> | ||
| <zipentry zipfile="${shuffle.jar}" | ||
| name="${shaded.jackson}/databind/JsonSerializer.class"/> | ||
| </resourceexists> | ||
| </not> | ||
| </condition> | ||
| </fail> | ||
| <echo>Verified shading of Jackson ${fasterxml.jackson.version}</echo> | ||
| </target> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about doing this for all of Spark?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm now thinking all the dependencies should be relocated, with the exception of the jni leveldb stuff —not the thing you can shade; not the thing you can isolate in a classloader hierarchy instead.
What I can do there is add a profile,
leveldb-providedwhich excludes leveldb in this situation. That's important as leveldb does creep onto the classpath from elsewhere —and while the version in Hadoop currently matches that in this JAR, there's no guarantee of that continuing to hold.