Skip to content
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

[Fault tolerance] Make executor actor restartable and fetch data from blockManager in actor calls #249

Merged
merged 40 commits into from
Jan 3, 2023

Conversation

kira-lin
Copy link
Collaborator

No description provided.

@kira-lin
Copy link
Collaborator Author

If we use a normal task, which calls the actor internally, the actor method still need to be resubmitted because it's a dependency. I'm not sure if using spark to call the executors will work, but I think sparkcontext would be needed to do so.

@kira-lin kira-lin changed the title [WIP] Implement fault tolerance by executor actor calls [Fault tolerance] Make executor actor restartable and fetch data from blockManager in actor calls Sep 16, 2022
Copy link
Collaborator

@carsonwang carsonwang left a comment

Choose a reason for hiding this comment

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

Thanks for the work!

@@ -138,6 +142,12 @@ private[spark] class ApplicationInfo(
registeredExecutors
}

def isRemovedExecutor(executorId: String): Boolean = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this used anywhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was used in previous implementation. I'll remove it

val memory = appInfo.desc.memoryPerExecutorMB
val newExecutorId = s"${appInfo.getNextExecutorId()}"
// ray actor will restart using the old ID
val handlerOpt = Ray.getActor("raydp-executor-" + executorId)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if the executor failed twice and restart? In the second time, the executor Id is not the original Id and there is a problem to get the actor? Can you add a test for this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No matter how many time it has failed, it is restarted using the parameters given when first created. The name won't change, either.

Copy link
Collaborator

Choose a reason for hiding this comment

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

After the first restart, I saw the executorId was modified in RayCoarseGrainedExecutorBackend? Where is the original Id stored and can be got?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it is changed. The original id is not stored in executor. It is saved in a mapping in RayAppMaster restartedExecutors. Ray also stores it in task's lineage.

if (appInfo.remainingUnRegisteredExecutors > 0) {
val cores = appInfo.desc.coresPerExecutor.getOrElse(1)
val memory = appInfo.desc.memoryPerExecutorMB
val newExecutorId = s"${appInfo.getNextExecutorId()}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we move this line into else {}? Otherwise if we go to the if {} code path, we don't need this new executor Id but we still increase the Id.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right

def getRDDPartition(rddId: Int,
partitionId: Int,
schemaStr: String,
driverAgentUrl: String): Array[Byte] = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we follow Spark's code style for the indent? Please also check other places in the code. see https://github.com/databricks/scala-style-guide#indent

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

from py4j.java_gateway import JavaGateway, GatewayParameters
from py4j.java_gateway import java_import, JavaGateway, GatewayParameters
from py4j.clientserver import ClientServer, JavaParameters, PythonParameters
from pyspark.find_spark_home import _find_spark_home
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems this is not used. Can you please remove it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

@kira-lin kira-lin merged commit 1315d93 into oap-project:master Jan 3, 2023
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.

2 participants