Comments (6)
@dtykocki thanks to @gabrielgiordan we have a fix for this which has just been merged. Please let me know if any of you are still facing any issue, otherwise, I'll release a new version with both PRs merged.
Cheers.
from broadway_kafka.
@sweco-semtne we're adding an offset_reset_policy
option 👍
@dtykocki thanks for the detailed report. It was very helpful.
from broadway_kafka.
🎉 Looking good now. Thanks @msaraiva and @gabrielgiordan!
from broadway_kafka.
Hi @sweco-semtne!
The default behaviour is already starting from the latest committed offset. This value is sent to the group member (the Broadway producer) by the group coordinator as soon as the topic/partition is assigned to it. There should be only two situations where it should be 0
:
- The Broadway producer is fetching records from a new stream
- The client crashed before sending the commit offset request, so the newly assigned group member will start from
0
again.
Can you confirm you're not falling into one of those situations? If case you're not, can you send us details of your pipeline configuration?
Thanks a lot for reporting this issue.
from broadway_kafka.
Closed in #14.
Please let me know if you run into any issue.
from broadway_kafka.
Thanks @msaraiva. Took this one for a test drive and seeing crashes while attempting to determine the offset:
06:22:32.057 [error] GenServer ExampleBroadwayKafka.MyBroadway.Broadway.Producer_9 terminating
** (RuntimeError) cannot resolve begin offset (hosts=["host-1": 9096, "host-2": 9096, "host-3": 9096] topic=whitelist partition=1).
Reason: [{{:"host-1", 9096},
{{{:kpro_req, #Reference<0.662181211.1724383238.252780>, :api_versions, 0, false, ""}, :closed},
[{:kpro_lib, :send_and_recv_raw, 4, [file: 'src/kpro_lib.erl', line: 71]}, {:kpro_lib, :send_and_recv, 5, [file: 'src/kpro_lib.erl', line: 82]}, {:kpro_connection, :query_api_versions, 4, [file: 'src/kpro_connection.erl', line: 246]}, {:kpro_connection, :init_connection, 2, [file: 'src/kpro_connection.erl', line: 233]}, {:kpro_connection, :init, 4, [file: 'src/kpro_connection.erl', line: 170]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}},
{{:"host-2", 9096},
{{{:kpro_req, #Reference<0.662181211.1724383238.252795>, :api_versions, 0, false, ""}, :closed},
[{:kpro_lib, :send_and_recv_raw, 4, [file: 'src/kpro_lib.erl', line: 71]}, {:kpro_lib, :send_and_recv, 5, [file: 'src/kpro_lib.erl', line: 82]}, {:kpro_connection, :query_api_versions, 4, [file: 'src/kpro_connection.erl', line: 246]}, {:kpro_connection, :init_connection, 2, [file: 'src/kpro_connection.erl', line: 233]}, {:kpro_connection, :init, 4, [file: 'src/kpro_connection.erl', line: 170]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}},
{{:"host-3", 9096},
{{{:kpro_req, #Reference<0.662181211.1724383238.252812>, :api_versions, 0, false, ""}, :closed},
[{:kpro_lib, :send_and_recv_raw, 4, [file: 'src/kpro_lib.erl', line: 71]}, {:kpro_lib, :send_and_recv, 5, [file: 'src/kpro_lib.erl', line: 82]}, {:kpro_connection, :query_api_versions, 4, [file: 'src/kpro_connection.erl', line: 246]}, {:kpro_connection, :init_connection, 2, [file: 'src/kpro_connection.erl', line: 233]}, {:kpro_connection, :init, 4, [file: 'src/kpro_connection.erl', line: 170]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}]
(broadway_kafka) lib/brod_client.ex:137: BroadwayKafka.BrodClient.resolve_offset/5
(broadway_kafka) lib/producer.ex:252: anonymous fn/3 in BroadwayKafka.Producer.handle_info/2
(elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
(broadway_kafka) lib/producer.ex:241: BroadwayKafka.Producer.handle_info/2
(broadway) lib/broadway/producer.ex:258: Broadway.Producer.handle_info/2
(gen_stage) lib/gen_stage.ex:2086: GenStage.noreply_callback/3
(stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:711: :gen_server.handle_msg/6
This very well could be related to running Kafka in Heroku. I'll poke around a bit to see if something more subtle is going on.
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
- When a new node joins, two consumers never go to a balancing state HOT 27
- Proposal: Use per partition internal buffer HOT 8
- Question: About a pipeline with a Batcher HOT 1
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.