-
Notifications
You must be signed in to change notification settings - Fork 447
fix lost one message when consumer restart #141
Conversation
when consumer restart will lost first message in partisions i have send 5 messages ,but get only get 4 message my kafka version is 1.0.0
@nmred while working on #147 I've found out that this patch is actually wrong, as you can see on the logs in Travis, the second execution of the consumer gets more messages instead of 30 (which is the amount of messages sent by the producers). This got fixed by reverting this PR. @tongsq is it possible that you have the consumer offset reset action set as |
earliest means not offset from 0 but from the offset stored in offset manager server |
i meet the problem in the production machine. and i past the log message at the below |
|
here get offset 695186
but here was 695187
|
i replace the real topic name and the groupid use the fake in the pasted log info |
@noname007 can you please send a PR with a failing functional test that reproduces that? The changes in this PR were causing the current tests to fail (incorrectly) |
e.....how to write?i feel a litter hard to me...... |
@noname007 it's not that hard, and we're here to help you (in the worst case scenario you will learn new things). In https://github.com/weiboad/kafka-php/tree/be0c26199eb89f0f3a032b0fb271b1dd2656155c/tests/Functional you will find the tests I've wrote (which are quite basic), you can use them as base. What you'll have to think more is how can you reproduce that wrong behaviour (without changing anything in the
The great thing about adding new functional tests is that it's executed for the most important Kafka versions (0.9+) so we'll be able to guarantee 100% that this bug will never come back. Thanks for your contribution! |
By the way, we're executing the tests using docker, if you don't have it installed or don't have any experience with it you can simply create the PR and push new commits to the branch. Travis will execute everything and validate your code (check |
in my production machine i use the libuv ext and kafka version 0.10.2 the docker use the libuv extension? |
i just add test code to the test/ ,that's all the work?don't modify travis.yml? |
@noname007 the docker container doesn't use the libuv but that shouldn't necessarily be a problem (unless amphp doesn't cover things properly or we are using it in the wrong way). I'll check this...
That's the idea, isolate the failure in a functional test ( |
@lcobucci thanks for your help , i will have a try |
@noname007 just to give you an update, I've executed the current test suite using libuv and didn't have any issue (Kafka 1.0.0 and PHP 7.1.12). |
hi i meet this again
ev version 1.0.5 , i compile this manually |
i found when i throw a exception in the function of Consumer::start ,then, this problem appear.....
|
when consumer restart will lost first message in partisions
i have send 5 messages ,but get only get 4 message
my kafka version is 1.0.0