-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Implement rebalance mechanism in Pulsar Functions #7388
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
Conversation
@@ -93,6 +94,8 @@ | |||
|
|||
private final IScheduler scheduler; | |||
|
|||
private final IRebalance rebalancer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: IRebalancer?
* @param workers | ||
* @return | ||
*/ | ||
List<Function.Assignment> rebalance(List<Function.Assignment> currentAssignments, Set<String> workers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a default implementation that just returns the current assignment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure we can do it for BC reasons. It would return a empty list because there will be no change
conf/functions_worker.yml
Outdated
@@ -78,6 +78,7 @@ numHttpServerThreads: 8 | |||
# function assignment and scheduler | |||
|
|||
schedulerClassName: "org.apache.pulsar.functions.worker.scheduler.RoundRobinScheduler" | |||
rebalancerClassName: "org.apache.pulsar.functions.worker.scheduler.RoundRobinScheduler" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be needed anymore, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will remove
22ee6d6
to
0ac832c
Compare
Co-authored-by: Jerry Peng <[email protected]>
Motivation
Currently there no mechanism for rebalancing functions scheduler on workers. Workload for functions may become skewed.
Modifications
Will add mechanism to run the rebalance periodically automatically in subsequent PR.