Skip to content

Comments

[SPARK-42392][CORE] Add a new case of TriggeredByExecutorDecommissionInfo to remove unnecessary param#39962

Closed
smallzhongfeng wants to merge 3 commits intoapache:masterfrom
smallzhongfeng:SPARK-42392
Closed

[SPARK-42392][CORE] Add a new case of TriggeredByExecutorDecommissionInfo to remove unnecessary param#39962
smallzhongfeng wants to merge 3 commits intoapache:masterfrom
smallzhongfeng:SPARK-42392

Conversation

@smallzhongfeng
Copy link
Contributor

@smallzhongfeng smallzhongfeng commented Feb 10, 2023

What changes were proposed in this pull request?

For TODO: add a new type like 'ExecutorDecommissionInfo' for the case where executor is decommissioned at executor first, so we don't need this extra parameter, I add a new case class named TriggeredByExecutorDecommissionInfo to resolve it.

Why are the changes needed?

Remove unnecessary param.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Fix uts.

@smallzhongfeng smallzhongfeng changed the title [SPARK-42392] Add a new case of TriggeredByExecutorDecommissionInfo to remove unnecessary param [SPARK-42392][CORE] Add a new case of TriggeredByExecutorDecommissionInfo to remove unnecessary param Feb 10, 2023
@smallzhongfeng
Copy link
Contributor Author

Could you help me review this? @HyukjinKwon @LuciferYang @Ngone51 Thanks a lot. :-)

@smallzhongfeng smallzhongfeng changed the title [SPARK-42392][CORE] Add a new case of TriggeredByExecutorDecommissionInfo to remove unnecessary param [SPARK-42392][CORE] Add a new case of TriggeredByExecutorDecommissionInfo to remove unnecessary param Feb 10, 2023
@smallzhongfeng
Copy link
Contributor Author

Gentle ping. @LuciferYang @Ngone51 @dongjoon-hyun @HyukjinKwon :-)

abstract class DecommissionInfo

private[spark]
case class ExecutorDecommissionInfo(
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm... Who triggered this? And I think we should add some comments for these two new classes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Executor will triggered this. Maybe we can see this comment

// A message that sent from executor to driver to tell driver that the executor has started

Copy link
Contributor

@LuciferYang LuciferYang Feb 17, 2023

Choose a reason for hiding this comment

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

Could we also rename this one to TriggeredByXXXDecommissionInfo? Is it possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, how about ExecutorTriggerExecutorDecommissionInfo and DriverTriggerExecutorDecommissionInfo? Or could you give me a better opinion ?

Copy link
Contributor

Choose a reason for hiding this comment

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

fine to me, it's good to be able to distinguish them clearly

*/
private[spark]
case class ExecutorDecommissionInfo(message: String, workerHost: Option[String] = None)
abstract class DecommissionInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

If all subclasses must to be defined in this file, maybe sealed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, sounds good!

adjustTargetNumExecutors: Boolean): Boolean = {
val decommissionedExecutors = decommissionInfo match {
case _: ExecutorDecommissionInfo =>
decommissionExecutors(
Copy link
Contributor

Choose a reason for hiding this comment

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

A little confused. Seems decommissionExecutors don't use triggeredByExecutor flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually triggeredByExecutor was used in ExecutorAllocationClient 's implementation class CoarseGrainedSchedulerBackend and KubernetesClusterSchedulerBackend. We can see this

Copy link
Contributor

Choose a reason for hiding this comment

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

cc @pan3793 FYI

Copy link
Contributor

@LuciferYang LuciferYang Feb 17, 2023

Choose a reason for hiding this comment

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

OK, I see

package org.apache.spark.scheduler

private[spark]
sealed abstract class DecommissionInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

abstract class? trait?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should not be necessary. After all, the case class here only needs to inherit this class DecommissionInfo. If the case class need multiple inheritance, it is more appropriate to use the trait here.

@github-actions
Copy link

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label May 30, 2023
@github-actions github-actions bot closed this May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants