Skip to content

Conversation

@toddwan
Copy link
Contributor

@toddwan toddwan commented Nov 21, 2015

  • According to below doc and validation logic in SparkSubmit.scala, master URL for a mesos cluster should always start with mesos://

http://spark.apache.org/docs/latest/running-on-mesos.html
The Master URLs for Mesos are in the form mesos://host:5050 for a single-master Mesos cluster, or mesos://zk://host:2181 for a multi-master Mesos cluster using ZooKeeper.

  • However, SparkContext.scala fails the validation and can receive master URL in the form zk://host:port
  • For the master URLs in the form zk:host:port, the valid form should be mesos://zk://host:port
  • This PR restrict the validation in SparkContext.scala, and now only mesos master URLs prefixed with mesos:// can be accepted.
  • This PR also updated corresponding unit test.

@dragos
Copy link
Contributor

dragos commented Nov 21, 2015

@andrewor14 I wonder if we shouldn't first warn about this, and defer the actual failure until 2.0. There might be people relying on this loophole. If I understand correctly, people could connect using zk:// urls if they didn't go through spark-submit (spark-shell or hard coded).

@srowen
Copy link
Member

srowen commented Nov 21, 2015

LGTM, though I tend to agree there's a little risk here in making something that shouldn't work actually not work.

@srowen
Copy link
Member

srowen commented Nov 23, 2015

@toddwan what do you think about writing a separate code path to handle the incorrect zk://... syntax? It could use the same "case", if it's a regex that captures the whole string. And then embed a warning if the actual arg starts with zk://

@tnachen
Copy link
Contributor

tnachen commented Nov 23, 2015

+1 on having a fall back with a warning message as well. Everything else LGTM

@toddwan
Copy link
Contributor Author

toddwan commented Nov 24, 2015

A new commit has been appended to the PR. Now a warning message is printed first if the given mesos Master URL starts with zk://, then a correct mesos Master URL is constructed by prefixing mesos:// to the current one, and pass the new URL to SparkContext.createTaskScheduler() again.

@srowen
Copy link
Member

srowen commented Nov 24, 2015

Yes, that's pretty nice and clean.

@andrewor14
Copy link
Contributor

retest this please

@andrewor14
Copy link
Contributor

LGTM, I'll merge this once tests pass.

@SparkQA
Copy link

SparkQA commented Nov 24, 2015

Test build #46618 has finished for PR 9886 at commit 8896264.

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicking, but I would be more explicit: "This will stop working in Spark 2.0".

@dragos
Copy link
Contributor

dragos commented Nov 24, 2015

other than that, LGTM

@toddwan
Copy link
Contributor Author

toddwan commented Nov 25, 2015

retest this please

1 similar comment
@andrewor14
Copy link
Contributor

retest this please

@SparkQA
Copy link

SparkQA commented Nov 25, 2015

Test build #46705 has finished for PR 9886 at commit 1eeb933.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@andrewor14
Copy link
Contributor

retest this please

@SparkQA
Copy link

SparkQA commented Nov 26, 2015

Test build #46711 has finished for PR 9886 at commit 1eeb933.

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

@andrewor14
Copy link
Contributor

retest this please

@SparkQA
Copy link

SparkQA commented Nov 26, 2015

Test build #46732 has finished for PR 9886 at commit 1eeb933.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@toddwan
Copy link
Contributor Author

toddwan commented Nov 26, 2015

@andrewor14 I am not sure about the cause of the unit test failure, but the failed test reported in the latest test build can pass on my machine.

@SparkQA
Copy link

SparkQA commented Nov 27, 2015

Test build #2123 has finished for PR 9886 at commit 1eeb933.

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

@srowen
Copy link
Member

srowen commented Nov 28, 2015

LGTM, will merge soon.

@dragos
Copy link
Contributor

dragos commented Nov 28, 2015

LGTM

asfgit pushed a commit that referenced this pull request Nov 30, 2015
…form zk://host:port for a multi-master Mesos cluster using ZooKeeper

* According to below doc and validation logic in [SparkSubmit.scala](https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#L231), master URL for a mesos cluster should always start with `mesos://`

http://spark.apache.org/docs/latest/running-on-mesos.html
`The Master URLs for Mesos are in the form mesos://host:5050 for a single-master Mesos cluster, or mesos://zk://host:2181 for a multi-master Mesos cluster using ZooKeeper.`

* However, [SparkContext.scala](https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/SparkContext.scala#L2749) fails the validation and can receive master URL in the form `zk://host:port`

* For the master URLs in the form `zk:host:port`, the valid form should be `mesos://zk://host:port`

* This PR restrict the validation in `SparkContext.scala`, and now only mesos master URLs prefixed with `mesos://` can be accepted.

* This PR also updated corresponding unit test.

Author: toddwan <[email protected]>

Closes #9886 from toddwan/S11859.

(cherry picked from commit e074944)
Signed-off-by: Sean Owen <[email protected]>
@asfgit asfgit closed this in e074944 Nov 30, 2015
@srowen
Copy link
Member

srowen commented Nov 30, 2015

@toddwan let me know your JIRA handle and I'll credit you. Merged to master/1.6

@tawan0109
Copy link

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.

7 participants