Skip to content

[SPARK-12413] Fix Mesos ZK persistence #10366

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

Closed
wants to merge 3 commits into from

Conversation

mgummelt
Copy link

I believe this fixes SPARK-12413. I'm currently running an integration test to verify.

@andrewor14
Copy link
Contributor

add to whitelist

//
// Due to https://issues.scala-lang.org/browse/SI-6654, `filterKeys` returns an
// unserializable object,so we must call `.map(identity)` on the result.
val environmentVariables = request.environmentVariables.filterKeys(!_.equals("SPARK_HOME")).map(identity)
Copy link
Contributor

Choose a reason for hiding this comment

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

this line will fail style tests because it's too long. Need to break it into 2

Copy link
Author

Choose a reason for hiding this comment

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

fixed. thanks.

@SparkQA
Copy link

SparkQA commented Dec 17, 2015

Test build #47959 has finished for PR 10366 at commit bbfbbdf.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@andrewor14
Copy link
Contributor

I was able to verify SI-6654 in the REPL and I believe this patch is the correct fix:

val map = Map[String, String]("a" -> "b", "c" -> "d")
val filteredMap = map.filterKeys(_ != "a")
val identitiedMap = filteredMap.map(identity)

// OK
(new ObjectOutputStream(new ByteArrayOutputStream)).writeObject(map)

// NotSerializableException: scala.collection.immutable.MapLike$$anon$1
(new ObjectOutputStream(new ByteArrayOutputStream)).writeObject(filteredMap)

// OK
(new ObjectOutputStream(new ByteArrayOutputStream)).writeObject(identitiedMap)

@andrewor14
Copy link
Contributor

LGTM, retest this please

@andrewor14
Copy link
Contributor

@mgummelt is this still WIP? If not can you remove that from the title? Also, any updates from your integration tests?

@mgummelt
Copy link
Author

I included [WIP] to indicate that my integration test hasn't finished yet (still pending). Code should be frozen though. Would you like me to remove [WIP]?

@andrewor14
Copy link
Contributor

Yes

@mgummelt mgummelt changed the title [WIP] [SPARK-12413] Fix Mesos ZK persistence [SPARK-12413] Fix Mesos ZK persistence Dec 17, 2015
val environmentVariables = request.environmentVariables.filterKeys(!_.equals("SPARK_HOME"))
.map(identity)
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, there's a slightly nicer way...

// Do not use `filterKeys` here to avoid SI-6654, which breaks ZK persistence
val environmentVariables = request.environmentVariables.filter { case (k, _) =>
  k != "SPARK_HOME"
}

so we don't have to do the weird filterKeys(...).map(identity) thing

Copy link
Author

Choose a reason for hiding this comment

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

Yes, that's better. Fixed.

@mgummelt
Copy link
Author

Fixed

@mgummelt mgummelt closed this Dec 17, 2015
@mgummelt mgummelt reopened this Dec 17, 2015
@SparkQA
Copy link

SparkQA commented Dec 17, 2015

Test build #2226 has started for PR 10366 at commit d70bcee.

@SparkQA
Copy link

SparkQA commented Dec 17, 2015

Test build #2225 has started for PR 10366 at commit d70bcee.

@mgummelt
Copy link
Author

Test failure looks like some sort of timeout? https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/47962/console

@andrewor14
Copy link
Contributor

It's OK, we have 2 builds that are actually running. Hopefully one of them will pass.

@andrewor14
Copy link
Contributor

retest this please. I'm not sure why it's timing out on tests. AFAIK this file isn't even used in tests.

@SparkQA
Copy link

SparkQA commented Dec 18, 2015

Test build #2229 has started for PR 10366 at commit d70bcee.

@SparkQA
Copy link

SparkQA commented Dec 18, 2015

Test build #47960 has finished for PR 10366 at commit 05c4da3.

  • This patch fails from timeout after a configured wait of 250m.
  • This patch merges cleanly.
  • This patch adds no public classes.

@nraychaudhuri
Copy link
Contributor

retest this please

@SparkQA
Copy link

SparkQA commented Dec 18, 2015

Test build #47974 has finished for PR 10366 at commit d70bcee.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 18, 2015

Test build #2228 has finished for PR 10366 at commit d70bcee.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 18, 2015

Test build #2230 has finished for PR 10366 at commit d70bcee.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@keithchambers
Copy link

Will this make 1.6.0?

@dragos
Copy link
Contributor

dragos commented Dec 18, 2015

LGTM. Thanks @mgummelt for catching and fixing this!

@tnachen
Copy link
Contributor

tnachen commented Dec 18, 2015

LGTM as well.

@sarutak
Copy link
Member

sarutak commented Dec 18, 2015

LGTM. Merging into master and branch-1.6. Thanks @mgummelt !

@asfgit asfgit closed this in 2bebaa3 Dec 18, 2015
asfgit pushed a commit that referenced this pull request Dec 18, 2015
I believe this fixes SPARK-12413.  I'm currently running an integration test to verify.

Author: Michael Gummelt <mgummelt@mesosphere.io>

Closes #10366 from mgummelt/fix-zk-mesos.

(cherry picked from commit 2bebaa3)
Signed-off-by: Kousuke Saruta <sarutak@oss.nttdata.co.jp>
@andrewor14
Copy link
Contributor

Note: I'm reverting this patch in master only since #10329, the better alternative, is merged there.
This patch continues to exist in branch-1.6.

@keithchambers
Copy link

@andrewor14 makes sense. Thank you!

@@ -99,7 +99,11 @@ private[mesos] class MesosSubmitRequestServlet(
// cause spark-submit script to look for files in SPARK_HOME instead.
// We only need the ability to specify where to find spark-submit script
// which user can user spark.executor.home or spark.home configurations.
val environmentVariables = request.environmentVariables.filterKeys(!_.equals("SPARK_HOME"))
//
// Do not use `filterKeys` here to avoid SI-6654, which breaks ZK persistence
Copy link
Contributor

Choose a reason for hiding this comment

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

Should a scalastyle rule be added which prevents filterKeys to be used in future PRs ?

@mgummelt mgummelt deleted the fix-zk-mesos branch August 2, 2016 20:58
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.

9 participants