Skip to content

KAFKA-4547: Avoid unnecessary offset commit that could lead to an invalid offset position if partition is paused#2341

Closed
vahidhashemian wants to merge 3 commits intoapache:trunkfrom
vahidhashemian:KAFKA-4547
Closed

KAFKA-4547: Avoid unnecessary offset commit that could lead to an invalid offset position if partition is paused#2341
vahidhashemian wants to merge 3 commits intoapache:trunkfrom
vahidhashemian:KAFKA-4547

Conversation

@vahidhashemian
Copy link
Copy Markdown
Contributor

No description provided.

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 10, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/700/
Test PASSed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 10, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/698/
Test PASSed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 10, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/698/
Test PASSed (JDK 8 and Scala 2.12).

@vahidhashemian
Copy link
Copy Markdown
Contributor Author

@hachikuji I submitted this PR without test(s) in case it needs to be included in 0.10.2.0. I'll work on creating some tests after I'm done with the PR for KIP-88.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use "has" for consistency?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll update it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"for the given partitions"?

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 11, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/717/
Test PASSed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 11, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/715/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 11, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/715/
Test FAILed (JDK 7 and Scala 2.10).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we could simplify this by delegating to the other method.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe we don't even need this method anymore (haven't checked)

Copy link
Copy Markdown
Contributor Author

@vahidhashemian vahidhashemian Jan 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's being used in a couple of place: here and here.

Even though they can be modified to leverage the new method, I'd prefer to keep it and just modify its implementation to delegate to the other one as you suggested. What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I submitted an update that refactors the original method. I'd be happy to take your second suggestion too if you think that's a better way to go. Thanks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's used, we can keep it. I wasn't sure, so thought I'd mention it.

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 11, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/752/
Test PASSed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 11, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/750/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 11, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/750/
Test FAILed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 14, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/876/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 14, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/876/
Test PASSed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 14, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/878/
Test PASSed (JDK 8 and Scala 2.11).

@ewencp
Copy link
Copy Markdown
Contributor

ewencp commented Jan 16, 2017

@hachikuji @vahidhashemian Please note that I've updated the affected versions to 0.10.0.2 and 0.10.1.0, 0.10.1.1. When we merge a fix, we want to make sure it makes it onto branches 0.10.0, 0.10.1, 0.10.2, and trunk.

@hachikuji
Copy link
Copy Markdown
Contributor

@vahidhashemian The fix looks good, but can you add a couple test cases?

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/1012/
Test FAILed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/1010/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/1010/
Test FAILed (JDK 7 and Scala 2.10).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the test. Would be good to have a more focused test in FetcherTest as well for the change there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll try to add that too. Thanks for the quick feedback.

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/1013/
Test PASSed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/1011/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/1011/
Test PASSed (JDK 7 and Scala 2.10).

@ijuma
Copy link
Copy Markdown
Member

ijuma commented Jan 19, 2017

@ewencp does it affect 0.10.0.2 as well? The reporter suggested that 0.10.0.1 worked fine while 0.10.1.0 did not, so I was wondering if you had additional information than what was in the JIRA.

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/1037/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/1039/
Test PASSed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/1037/
Test PASSed (JDK 7 and Scala 2.10).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have one more test case similar to this, but in which the paused partition already has a position? This verifies that updateFetchPositions does not overwrite the current position.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I'll add one more. Thanks.

@vahidhashemian vahidhashemian force-pushed the KAFKA-4547 branch 2 times, most recently from f2540d5 to fbdb44d Compare January 19, 2017 21:58
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if you use Utils.mkSet, then you won't need the conversion below.

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/1043/
Test FAILed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/1041/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 19, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/1041/
Test PASSed (JDK 7 and Scala 2.10).

@hachikuji
Copy link
Copy Markdown
Contributor

LGTM. I think @ijuma is right that this only needs to go into 0.10.1 and 0.10.2.

@asfgit asfgit closed this in 813897a Jan 20, 2017
asfgit pushed a commit that referenced this pull request Jan 20, 2017
…ed offsets

Author: Vahid Hashemian <vahidhashemian@us.ibm.com>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #2341 from vahidhashemian/KAFKA-4547
@hachikuji
Copy link
Copy Markdown
Contributor

@vahidhashemian Merged to trunk and 0.10.2. Unfortunately, it doesn't merge cleanly onto 0.10.1. Would you mind submitting a separate PR to that branch?

@vahidhashemian
Copy link
Copy Markdown
Contributor Author

@hachikuji Definitely.

soenkeliebau pushed a commit to soenkeliebau/kafka that referenced this pull request Feb 7, 2017
…ed offsets

Author: Vahid Hashemian <vahidhashemian@us.ibm.com>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes apache#2341 from vahidhashemian/KAFKA-4547
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants