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
MINOR: Split ConsumerCoordinator#testCommitOffsetMetadata onto two test cases testing commitSync and commitAsync #13665
Conversation
@ableegoldman @showuon can you've a look at this draft PR once you've sometime? I'll love to get your early feedback Thanks |
I'll try to have a look this week. Thanks. |
Thanks @showuon I appreciate it. |
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.
@machi1990 , thanks for the patch. Left some comments.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
Outdated
Show resolved
Hide resolved
Thank you for the review @showuon I'll address the comments by pushing code change in the next while. |
401fb41
to
a4fe7dd
Compare
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.
Overall LGTM. Could we add tests to verify the committed offsets cache will be updated when the consumer committed some offests? Also, you could change to "non-draft" state when you're ready. Thanks.
Thank you @showuon for the review. I was away on public holiday yesterday, I am catching up today and I'l have a look on adding more tests tomorrow. Once that is done, I'll promote the PR and mark it ready for review and ping you then. Cheers! |
Hey @showuon the PR should be ready for another round of review. Thank you. |
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.
@machi1990 , thanks for the update, left some more comments.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
Outdated
Show resolved
Hide resolved
5ca33ba
to
76f3297
Compare
Thanks for the thorough review @showuon I've addressed all the comments. Please have another look when you've some time, thanks. |
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.
@machi1990 , thanks for the update. Left some more comments.
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java
Outdated
Show resolved
Hide resolved
Thanks @showuon for your review on this. I've addressed the comments. |
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.
LGTM! Just one minor comment. After addressing it, I'll check the CI build result tomorrow. Thank you for the patch!
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java
Outdated
Show resolved
Hide resolved
Thank you so much for the review and help on this @showuon |
Re-triggering CI build |
@machi1990 , looks like this change breaks some tests. Could you take a look? https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-13665/12 |
Thank you @showuon I am re-running the whole test suite on my machine again. I'll report back what I find. In the meanwhile, let me know if you prefer me to mark this PR as draft? I am okay either way. |
No need to mark as "draft". No worries! :) |
@showuon I was looking onto this and after several local runs, I managed to eliminate some flasky test and came up with the list of failures that are only caused by this change. The failure total number of failures that I've seen locally are:
And only the I was thinking of dropping off cache update when fetching committed offsets i.e in [1] and only perform cache update when during offset commit [2]
That would align to the comment you raised in #13665 (comment) |
I've pushed this change in 9539c55 |
@machi1990 , could you explain more about this:
If it don't commit anything, then the expected committed value should be 0, right? And if the expected value are all greater than 0, there should be somewhere doing offset commit, right? It could be auto commit in the consumer side. (maybe?) |
Sorry @showuon , I should have clarified: There is no manual sync/async commit of offsets. I didn't think of this earlier on and it changes a few thing, making me think that I might need to revisit the caching logic for committed offsets e.g re-use I am keen to know what you think? |
Oh, EOS case! I didn't consider it, sorry! |
…ConsumerCoordinatorTest#testCommitOffsetMetadataSync test cases
Thanks @showuon I've marked the JIRA as invalid. |
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.
LGTM! Thanks for the work. Let's wait for the CI build completed.
Failed tests are unrelated:
|
Committer Checklist (excluded from commit message)