Skip to content

[SPARK-22900] [Spark-Streaming] Remove unnecessary restrict for streaming dynamic allocation - #20078

Closed
sharkdtu wants to merge 1 commit into
apache:masterfrom
sharkdtu:master
Closed

[SPARK-22900] [Spark-Streaming] Remove unnecessary restrict for streaming dynamic allocation#20078
sharkdtu wants to merge 1 commit into
apache:masterfrom
sharkdtu:master

Conversation

@sharkdtu

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

When i set the conf spark.streaming.dynamicAllocation.enabled=true, the conf num-executors can not be set. As a result, it will allocate default 2 executors and all receivers will be run on this 2 executors, there may not be redundant cpu cores for tasks. it will stuck all the time.

in my opinion, we should remove unnecessary restrict for streaming dynamic allocation. we can set num-executors and spark.streaming.dynamicAllocation.enabled=true together. when application starts, each receiver will be run on an executor.

How was this patch tested?

Manual test.

@felixcheungfelixcheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shouldn't you use spark.streaming.dynamicAllocation.minExecutors?

@sharkdtu

Copy link
Copy Markdown
ContributorAuthor

@felixcheung
At the beginning, if numReceivers > totleExecutorCores, there is not cpu cores for batch processing, and ExecutorAllocationManager can't listen metrics of any batches. As a result, it doesn't work.

@felixcheung

Copy link
Copy Markdown
Member

hmm, that sounds like a different problem, why is numReceivers set to > spark.cores.max?

@sharkdtu

Copy link
Copy Markdown
ContributorAuthor

@felixcheung
if you submit spark on yarn with spark.streaming.dynamicAllocation.enabled=true, the num-executors can not be set. So, at the begining, there are only 2(default value) executors.

@jerryshao

Copy link
Copy Markdown
Contributor

Sorry to chime in. This feature (streaming dynamic allocation) is obsolete and has bugs, users seldom enabled this feature, does it still worth to fix?

@sharkdtu

Copy link
Copy Markdown
ContributorAuthor

@jerryshao
if this PR can fix bugs as you said. why not fix it. Or, it should be marked as deprecated.

@jerryshao

jerryshao commented Jan 3, 2018

Copy link
Copy Markdown
Contributor

I'm not against the fix. My concern is that we've shifted to structured streaming, also this feature (streaming dynamic allocation) is seldom used/tested, this might not be the only issue regarding to it (in dynamic allocation we updated a lot), do we still need to put effort on it?

Just my concern.

@felixcheung

felixcheung commented Jan 4, 2018

Copy link
Copy Markdown
Member

not saying about this change, but I've used streaming dynamic allocation quite a bit back in the day.

but in this case I think simply is to set spark.streaming.dynamicAllocation.minExecutors instead of num-executors as pointed out above.

@jerryshao

Copy link
Copy Markdown
Contributor

Originally in Spark dynamic allocation, "spark.executor.instances" and dynamic allocation conf cannot be co-existed, if "spark.executor.instances" is set, dynamic allocation will not be enabled. But this behavior is changed after 2.0.

I think here for streaming dynamic allocation, we'd better keep it consistent with Spark dynamic allocation.

@felixcheung

Copy link
Copy Markdown
Member

hmm, I didn't know that was changed actually (SPARK-13723)
But it seems to me spark.streaming.dynamicAllocation.minExecutors is still a valid approach. To match the non-streaming behavior would be a bigger change that I'd agree not sure we should take at this point.

@sharkdtu

Copy link
Copy Markdown
ContributorAuthor

@felixcheung
Have you ever thought about initial num-executors? Actually, it is default 2 executors when you run spark on yarn. How can you make sure that this 2 executors have enougth cores for receivers at the begining?

@AmplabJenkins

Copy link
Copy Markdown

Can one of the admins verify this patch?

@vc60er

Copy link
Copy Markdown

by set spark.streaming.dynamicAllocation.minExecutors also has same issue .https://issues.apache.org/jira/browse/SPARK-14788

@felixcheung

@srowensrowen mentioned this pull request May 11, 2018
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 22, 2025
Closesapache#20458Closesapache#20530Closesapache#20557Closesapache#20966Closesapache#20857Closesapache#19694Closesapache#18227Closesapache#20683Closesapache#20881Closesapache#20347Closesapache#20825Closesapache#20078Closesapache#21281Closesapache#19951Closesapache#20905Closesapache#20635
Author: Sean Owen <srowen@gmail.com>
Closesapache#21303 from srowen/ClosePRs.
Sign up for freeto 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.

5 participants

@sharkdtu@felixcheung@jerryshao@AmplabJenkins@vc60er