-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve][broker]Only create extended partitions when updating partition number #17349
Conversation
/pulsarbot run-failure-checks |
6c9b348
to
d3ae3e6
Compare
/pulsarbot run-failure-checks |
for (int i = oldNumPartitions; i < numPartitions; i++) { | ||
futures.add(tryCreatePartitionAsync(i, null)); | ||
} |
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.
@mattisonchao @Technoboy- This is a good example of the challenges with asynchronous code. When using loops that trigger async calls, all operations will be started in parallel. This simply doesn't scale. Let's say that you would create 50000 partitions this way. All operations will be sent off at once.
There should be better ways to control the level of concurrency. When using threads and executors, we don't have this problem since threads will be the way to handle the level of concurrency. Obviously that has a tradeoff since threads are idling when they are waiting for responses. When using the asynchronous programming model, there should be ways to implement flow control ("back pressure") by limiting the number of operations in flight. Otherwise it will lead to a lot of requests piling up in memory when the system gets overloaded. That happens eventually if there is no way for flow control and there are a lot of operations and there are peaks in usage where the utilization of the system goes over it's throughput capacity and queues start to grow.
This particular detail was never addressed in the sync->async transformation and it will be necessary to address it to make the solution reliable.
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.
We need to discuss this in ML. Thanks a lot for you point it out.
d3ae3e6
to
7a99303
Compare
/pulsarbot run-failure-checks |
2 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
@AnonHxy re-running failed builds won't make this PR mergeable. Please read the mailing list thread about this. https://lists.apache.org/thread/lv358906mnroq7tkk72xtsxfyjpbyvor |
Motivation
Modifications
Describe the modifications you've done.
Verifying this change
PersistentTopicsTest#testUpdatePartitionedTopic
Documentation
Check the box below or label this PR directly.
Need to update docs?
doc-required
(Your PR needs to update docs and you will update later)
doc-not-needed
(Please explain why)
doc
(Your PR contains doc changes)
doc-complete
(Docs have been already added)