Comments (8)
Great job with the diagrams!
I think there may be a simpler solution to the routing. The PartitionDispatcher assumes somewhat even distribution of data, which is being violated here. So instead you can keep the buffer/queue per partition, then you store an index into which partition you must read from next, and you do so in cycles. You can do so with two changes:
- Have map %{partition => queue}, which I believe you already do
- Keep a ring to rate which partition to read next. This code can do it:
# Creates a new ring
defp new_ring([_ | _] = list), do: {list, []}
# Returns the {next_element_in_the_ring, ring}
defp next_ring({[], reversed}), do: next_partition({Enum.reverse(reversed), []})
defp next_ring({[head | tail], reversed}), do: {head, {tail, [head | reversed]}}
WDYT?
from broadway_kafka.
Thanks!
I did kind use a lame way to make the ring 😬
here and here
I'd say still checking acks count is important. In my example all the data were processed in 50ms but not the case in real life. It's the checking the acks that make sure we don't overload the Dispatcher and able to join new generation on time
from broadway_kafka.
I am worried about the checking acks count because it is hard for me to wrap around its impact under all possible scenarios. So I would like to start with a version without the acks count, improve that, and then consider the acks count. We can always add it later. :)
from broadway_kafka.
Fair enough! I did remove the queue ack checking from my code and in the local env looks good enough to remedy the rebalancing as well. we can run it on prod when it's ready and monitor it.
I'll create a PR for queue change
from broadway_kafka.
Fair enough! I did remove the queue from my code and in the local env looks good enough to remedy the rebalancing as well. we can run it on prod when it's ready and monitor it.
Sorry I meant I did remove checks for ack and rebalancing was done quickly
from broadway_kafka.
@slashmili great work! Can you tell me please, with your feature should I set producers count for each partition for max concurrency or I should set it to 1?
from broadway_kafka.
@slashmili great work! Can you tell me please, with your feature should I set producers count for each partition for max concurrency or I should set it to 1?
I haven't had a chance to work on the complete PR yet. When it's ready, you can choose whatever option suits you best.
from broadway_kafka.
Fair enough! I did remove the
queueack checking from my code and in the local env looks good enough to remedy the rebalancing as well. we can run it on prod when it's ready and monitor it.
In the final implementation, it turns out that overloading PartitionDispatcher is still happening. I thought it solves the problem but there was a bug in my first code that the some demands were getting lost.
from broadway_kafka.
Related Issues (20)
- Offsets accumulating in the producer ack state HOT 5
- Support :query_api_versions brod option HOT 1
- Cut release 0.3.6 ? HOT 2
- Consumer Static Membership HOT 9
- No rejoin after "payload connection down :shutdown, :tcp_closed}" deadlock on race between assigments_revoked call and handle DOWN message HOT 16
- the table identifier does not refer to an existing ETS table HOT 5
- Deadlock on race between assigments_revoked call and handle DOWN message HOT 3
- drain_after_revoke failed due to killed process HOT 3
- Producers stuck in :assignments_revoked causing endless group rebalancing HOT 24
- Feature: Add option to set the starting offset for new consumer HOT 6
- Backoff strategy HOT 1
- Manual Partition Assignment HOT 4
- Allow to force consume the topic from the beginning or the end
- Undesirable resource usage related to producer concurrency HOT 8
- Add support for reseting offsets to a specific timestamp HOT 1
- Request for a new release HOT 1
- Offsets accumulating in the producer ack state (take 2) HOT 6
- Updates on the release date of the next version? HOT 5
- Fails to compile on otp 27 HOT 9
- Implementing offset lag telemetry HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from broadway_kafka.