Skip to content

[SPARK-26463][CORE] Use ConfigEntry for hardcoded configs for scheduler categories.#23416

Closed
kiszk wants to merge 19 commits intoapache:masterfrom
kiszk:SPARK-26463
Closed

[SPARK-26463][CORE] Use ConfigEntry for hardcoded configs for scheduler categories.#23416
kiszk wants to merge 19 commits intoapache:masterfrom
kiszk:SPARK-26463

Conversation

@kiszk
Copy link
Member

@kiszk kiszk commented Dec 30, 2018

What changes were proposed in this pull request?

The PR makes hardcoded spark.dynamicAllocation, spark.scheduler, spark.rpc, spark.task, spark.speculation, and spark.cleaner configs to use ConfigEntry.

How was this patch tested?

Existing tests

@SparkQA
Copy link

SparkQA commented Dec 30, 2018

Test build #100568 has finished for PR 23416 at commit d426930.

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

@SparkQA
Copy link

SparkQA commented Dec 30, 2018

Test build #100569 has finished for PR 23416 at commit 8efb913.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 31, 2018

Test build #100576 has finished for PR 23416 at commit 4fae0f6.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 31, 2018

Test build #100581 has finished for PR 23416 at commit c2f1d9e.

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

@SparkQA
Copy link

SparkQA commented Dec 31, 2018

Test build #100578 has finished for PR 23416 at commit 1e95d0c.

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

@kiszk kiszk changed the title [SPARK-26463][WIP][CORE] Use ConfigEntry for hardcoded configs for scheduler categories. [SPARK-26463][CORE] Use ConfigEntry for hardcoded configs for scheduler categories. Dec 31, 2018
@SparkQA
Copy link

SparkQA commented Dec 31, 2018

Test build #100583 has finished for PR 23416 at commit 7ae645e.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@kiszk
Copy link
Member Author

kiszk commented Dec 31, 2018

retest this please

Copy link
Member

Choose a reason for hiding this comment

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

I feels that SPECULATION_ENABLED is better than SPECULATION.

@SparkQA
Copy link

SparkQA commented Dec 31, 2018

Test build #100589 has finished for PR 23416 at commit 7ae645e.

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

Copy link
Member

Choose a reason for hiding this comment

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

MAX_TASK_MAX_DIRECT_RESULT_SIZE -> MAX_TASK_DIRECT_RESULT_SIZE?

Copy link
Contributor

@vanzin vanzin left a comment

Choose a reason for hiding this comment

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

Seems like we could also have a new Scheduler object with the settings you're adding?

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a new Network.scala for these? If there are any existing network settings in this file you could also move them over.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see. I will create Network.scala

@SparkQA
Copy link

SparkQA commented Jan 6, 2019

Test build #100836 has finished for PR 23416 at commit 4be75ff.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member Author

Choose a reason for hiding this comment

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

This seems to be convervative movements.

Copy link
Member Author

Choose a reason for hiding this comment

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

cc @vanzin

@SparkQA
Copy link

SparkQA commented Jan 6, 2019

Test build #100841 has finished for PR 23416 at commit 5b8ccbb.

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

Copy link
Member

Choose a reason for hiding this comment

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

fallbackConf(DYN_ALLOCATION_SCHEDULER_BACKLOG_TIMEOUT)? Otherwise seems like the behavior will change in ExecutorAllocationManager.

Copy link
Member

Choose a reason for hiding this comment

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

We need .key?

Copy link
Member

Choose a reason for hiding this comment

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

ditto.

Copy link
Member

Choose a reason for hiding this comment

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

Shall we use config. prefix here instead of import config._ just for these?

Copy link
Member

Choose a reason for hiding this comment

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

ditto.

Copy link
Member

Choose a reason for hiding this comment

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

ditto. and some more in this file.

Copy link
Member

Choose a reason for hiding this comment

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

ditto. and some more in this file.

Copy link
Member

Choose a reason for hiding this comment

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

ditto.

@SparkQA
Copy link

SparkQA commented Jan 11, 2019

Test build #101045 has finished for PR 23416 at commit 0706d9a.

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

@dongjoon-hyun
Copy link
Member

Retest this please

@SparkQA
Copy link

SparkQA commented Jan 11, 2019

Test build #101062 has finished for PR 23416 at commit 0706d9a.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member

Retest this please.

Copy link
Member Author

Choose a reason for hiding this comment

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

Here requires #23447 to set default value in Network.scala.

@SparkQA
Copy link

SparkQA commented Jan 11, 2019

Test build #101072 has finished for PR 23416 at commit 0de0e76.

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

@SparkQA
Copy link

SparkQA commented Jan 11, 2019

Test build #101070 has finished for PR 23416 at commit 0706d9a.

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

@SparkQA
Copy link

SparkQA commented Jan 12, 2019

Test build #101118 has finished for PR 23416 at commit 2854b76.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jan 12, 2019

Test build #101119 has finished for PR 23416 at commit e0f231a.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jan 19, 2019

Test build #101431 has finished for PR 23416 at commit fbf9953.

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

@SparkQA
Copy link

SparkQA commented Jan 19, 2019

Test build #101432 has finished for PR 23416 at commit 1a8d84b.

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

@dongjoon-hyun
Copy link
Member

Retest this please.

@SparkQA
Copy link

SparkQA commented Jan 19, 2019

Test build #101438 has finished for PR 23416 at commit 1a8d84b.

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

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

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

A few more questions but this is looking good. I appreciate all the work to finish out this important refactoring.

private[spark] object TaskSchedulerImpl {

val SCHEDULER_MODE_PROPERTY = "spark.scheduler.mode"
val SCHEDULER_MODE_PROPERTY = SCHEDULER_MODE.key
Copy link
Member

Choose a reason for hiding this comment

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

I think this becomes unused after your change on line 135?

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunally, this is still used in two files.


protected override val minRegisteredRatio =
if (conf.getOption("spark.scheduler.minRegisteredResourcesRatio").isEmpty) {
if (conf.get(SCHEDULER_MIN_REGISTERED_RESOURCES_RATIO).isEmpty) {
Copy link
Member

Choose a reason for hiding this comment

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

getOrElse?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because this is very interesting code that does not use it value even if SCHEDULER_MIN_REGISTERED_RESOURCES_RATIO is declared, we cannot use getOrElse. I am not sure why it is.

This code just checks whether SCHEDULER_MIN_REGISTERED_RESOURCES_RATIO is declared or not.

// is equal to at least this value, that is double between 0 and 1.
private val _minRegisteredRatio =
math.min(1, conf.getDouble("spark.scheduler.minRegisteredResourcesRatio", 0))
math.min(1, conf.get(SCHEDULER_MIN_REGISTERED_RESOURCES_RATIO).getOrElse(0.0))
Copy link
Member

Choose a reason for hiding this comment

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

Can this prop just have a default value of 0 where it's declared?

Copy link
Member Author

Choose a reason for hiding this comment

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

We cannot have a defalut value 0 where it is declared due to the interesting code at KubernetesClusterSchedulerBackend.scala.
We need to know SCHEDULER_MIN_REGISTERED_RESOURCES_RATIO is declared or not.


test("cluster mode, FIFO scheduler") {
val conf = new SparkConf().set("spark.scheduler.mode", "FIFO")
val conf = new SparkConf().set(SCHEDULER_MODE, "FIFO")
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to use SchedulingMode.FIFO.toString in cases like this? no big deal, it doesn't matter much

newConf.set("spark.rpc.message.maxSize", "1")
newConf.set("spark.rpc.askTimeout", "1") // Fail fast
newConf.set(RPC_MESSAGE_MAX_SIZE, 1)
newConf.set(RPC_ASK_TIMEOUT, "1") // Fail fast
Copy link
Member

Choose a reason for hiding this comment

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

In cases like this can you set the value to 1 instead of a string?

@SparkQA
Copy link

SparkQA commented Jan 20, 2019

Test build #101447 has finished for PR 23416 at commit 2b8a923.

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

@srowen
Copy link
Member

srowen commented Jan 22, 2019

OK, the rest looks OK to me. Merging to master

@srowen srowen closed this in 7bf0794 Jan 22, 2019
jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
…er categories.

## What changes were proposed in this pull request?

The PR makes hardcoded `spark.dynamicAllocation`, `spark.scheduler`, `spark.rpc`, `spark.task`, `spark.speculation`, and `spark.cleaner` configs to use `ConfigEntry`.

## How was this patch tested?

Existing tests

Closes apache#23416 from kiszk/SPARK-26463.

Authored-by: Kazuaki Ishizaki <ishizaki@jp.ibm.com>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
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