Skip to content

KAFKA-10049: Fixed FKJ bug where wrapped serdes are set incorrectly when using default StreamsConfig serdes#8764

Merged
vvcephei merged 2 commits intoapache:trunkfrom
bellemare:10049
Jun 12, 2020
Merged

KAFKA-10049: Fixed FKJ bug where wrapped serdes are set incorrectly when using default StreamsConfig serdes#8764
vvcephei merged 2 commits intoapache:trunkfrom
bellemare:10049

Conversation

@bellemare
Copy link
Copy Markdown
Contributor

Bug Details:
Mistakenly setting the value serde to the key serde for an internal wrapped serde in the FKJ workflow.

Testing:
Added integration test to use a non-primitive Serde, in this case the JSONSerde that the original bug finder reported using. Expanded integration test to ensure that the default Serdes work for the entire happy path of the FKJ.

Introduces a testing dependency on com.fasterxml.jackson, though this is already the case in other modules so I suspect it won't be a big issue.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@vvcephei vvcephei self-requested a review June 1, 2020 14:52
Copy link
Copy Markdown
Contributor

@vvcephei vvcephei left a comment

Choose a reason for hiding this comment

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

Thanks, @bellemare , just a high-level question about the testing strategy.

Copy link
Copy Markdown
Contributor

@guozhangwang guozhangwang left a comment

Choose a reason for hiding this comment

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

@bellemare could you point to me which line is the actual fix?

@guozhangwang
Copy link
Copy Markdown
Contributor

test this please

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.

@guozhangwang This is 1/2 of the areas that needed the fix. The valueSerde was being passed into the underlying Serde, despite it really needing the keySerde.

@bellemare
Copy link
Copy Markdown
Contributor Author

Updated KTableKTableForeignKeyJoinScenarioTest from (String,String) to (Integer,String). This would have caught this particular bug. Reverted the JSON-related test since it's not essential for our coverage.

@vvcephei
Copy link
Copy Markdown
Contributor

vvcephei commented Jun 8, 2020

Test this please

@vvcephei
Copy link
Copy Markdown
Contributor

vvcephei commented Jun 8, 2020

Thanks, @bellemare ! I'll give it a look today.

@vvcephei
Copy link
Copy Markdown
Contributor

vvcephei commented Jun 8, 2020

Looks like checkstyle failed. I may submit a patch, just to get the tests running.

Copy link
Copy Markdown
Contributor

@vvcephei vvcephei left a comment

Choose a reason for hiding this comment

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

Thanks for the update, @bellemare ! Just a couple of minor comments on the tests, but it looks great overall.

Comment on lines 254 to 255
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.

Might be nice for demonstration purposes if the two records actually have different keys. Maybe:

Suggested change
aTopic.pipeInput(1, "1-alpha");
bTopic.pipeInput(1, "beta");
aTopic.pipeInput(1, "999-alpha");
bTopic.pipeInput(999, "beta");

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.

Agreed. Good catch.

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.

bump (it looks like this didn't get changed)

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 swear I know how to read... T_T

@vvcephei
Copy link
Copy Markdown
Contributor

vvcephei commented Jun 8, 2020

Ok, since I had a couple of small requests, I won't push a fix for the checkstyle errors. In case they're gone by the time you come back to this, it was:

00:11:48.980 > Task :streams:checkstyleTest
00:11:48.981 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:71: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:48.981 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:72: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:48.981 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:78: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:48.982 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:94: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:48.982 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:95: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.132 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:101: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.132 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:117: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.132 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:118: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.133 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:126: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.133 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:142: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.133 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:143: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.133 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:149: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.133 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:166: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.133 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:167: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.133 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:173: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.134 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:206: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
00:11:49.134 [ant:checkstyle] [ERROR] /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/src/test/java/org/apache/kafka/streams/kstream/internals/KTableKTableForeignKeyJoinScenarioTest.java:207: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]

By the way, if you run ./gradlew :streams:test, it includes the checkstyle rules. It takes a while to run the tests, but it's faster than waiting for Jenkins. Often, if I don't want to wait before pushing to the branch, I'll run it on my machine after pushing, just so I'll catch stuff like this.

@bellemare
Copy link
Copy Markdown
Contributor Author

I swear it ran checkstyle when I compiled it... bah! I guess not. I did run ./gradlew :streams:test it had one unrelated error (I think) so lets see how it does now.

@vvcephei
Copy link
Copy Markdown
Contributor

vvcephei commented Jun 9, 2020

Test this please

1 similar comment
@vvcephei
Copy link
Copy Markdown
Contributor

vvcephei commented Jun 9, 2020

Test this please

@vvcephei
Copy link
Copy Markdown
Contributor

vvcephei commented Jun 9, 2020

retest this please

@bellemare
Copy link
Copy Markdown
Contributor Author

retest this please

@vvcephei
Copy link
Copy Markdown
Contributor

Test this please

1 similar comment
@vvcephei
Copy link
Copy Markdown
Contributor

Test this please

@vvcephei
Copy link
Copy Markdown
Contributor

Test this please

1 similar comment
@vvcephei
Copy link
Copy Markdown
Contributor

Test this please

@vvcephei
Copy link
Copy Markdown
Contributor

Hey @bellemare , Thanks so much for the update! Jenkins has been a bit lazy recently, so I'll probably be pinging it for a while...

@vvcephei
Copy link
Copy Markdown
Contributor

Ah, there we go :)

@vvcephei
Copy link
Copy Markdown
Contributor

I've noticed that if you complain, you tend to get results...

@vvcephei
Copy link
Copy Markdown
Contributor

All the test failures were kafka.admin.ReassignPartitionsUnitTest.testModifyBrokerThrottles

@vvcephei vvcephei merged commit bcf45b0 into apache:trunk Jun 12, 2020
@bellemare
Copy link
Copy Markdown
Contributor Author

Thanks John!

@bellemare bellemare deleted the 10049 branch June 12, 2020 15:26
@vvcephei
Copy link
Copy Markdown
Contributor

Np, Thanks for the fix, @bellemare !

vvcephei pushed a commit that referenced this pull request Jun 12, 2020
…hen using default StreamsConfig serdes (#8764)

Bug Details:
Mistakenly setting the value serde to the key serde for an internal wrapped serde in the FKJ workflow.

Testing:
Modified the existing test to reproduce the issue, then verified that the test passes.

Reviewers: Guozhang Wang <wangguoz@gmail.com>, John Roesler <vvcephei@apache.org>
vvcephei pushed a commit that referenced this pull request Jun 12, 2020
…hen using default StreamsConfig serdes (#8764)

Bug Details:
Mistakenly setting the value serde to the key serde for an internal wrapped serde in the FKJ workflow.

Testing:
Modified the existing test to reproduce the issue, then verified that the test passes.

Reviewers: Guozhang Wang <wangguoz@gmail.com>, John Roesler <vvcephei@apache.org>
@vvcephei
Copy link
Copy Markdown
Contributor

Cherry-picked to 2.6 and 2.5

Kvicii pushed a commit to Kvicii/kafka that referenced this pull request Jun 13, 2020
* 'trunk' of github.com:apache/kafka: (42 commits)
  HOTFIX: Fix compile error in TopicAdminTest (apache#8866)
  KAFKA-10144: clean up corrupted standby tasks before attempting a commit (apache#8849)
  KAFKA-10157: Fix broken tests due to InterruptedException from FinalizedFeatureChangeListener (apache#8857)
  KAFKA-9432: automated protocol for DescribeConfigs (apache#8312)
  KAFKA-10049: Fixed FKJ bug where wrapped serdes are set incorrectly when using default StreamsConfig serdes (apache#8764)
  KAFKA-10027: Implement read path for feature versioning system (KIP-584) (apache#8680)
  KAFKA-10085: correctly compute lag for optimized source changelogs (apache#8787)
  KAFKA-10086: Integration test for ensuring warmups are effective (apache#8818)
  KAFKA-9374: Make connector interactions asynchronous (apache#8069)
  MINOR: reduce sizeInBytes for percentiles metrics (apache#8835)
  KAFKA-10115: Incorporate errors.tolerance with the Errant Record Reporter (apache#8829)
  KAFKA-9216: Enforce that Connect’s internal topics use `compact` cleanup policy (apache#8828)
  KAFKA-9845: Warn users about using config providers with plugin.path property (apache#8455)
  KAFKA-7833: Add missing test (apache#8847)
  KAFKA-9066: Retain metrics for failed tasks (apache#8502)
  KAFKA-9841: Revoke duplicate connectors and tasks when zombie workers return with an outdated assignment (apache#8453)
  KAFKA-9985: Sink connector may exhaust broker when writing in DLQ (apache#8663)
  KAFKA-9441: remove prepareClose() to simplify task management (apache#8833)
  KAFKA-7833: Add Global/StateStore name conflict check (apache#8825)
  KAFKA-9969: Exclude ConnectorClientConfigRequest from class loading isolation (apache#8630)
  ...
ijuma added a commit to ijuma/kafka that referenced this pull request Nov 17, 2020
…t-for-generated-requests

* apache-github/trunk: (248 commits)
  KAFKA-10049: Fixed FKJ bug where wrapped serdes are set incorrectly when using default StreamsConfig serdes (apache#8764)
  KAFKA-10027: Implement read path for feature versioning system (KIP-584) (apache#8680)
  KAFKA-10085: correctly compute lag for optimized source changelogs (apache#8787)
  KAFKA-10086: Integration test for ensuring warmups are effective (apache#8818)
  KAFKA-9374: Make connector interactions asynchronous (apache#8069)
  MINOR: reduce sizeInBytes for percentiles metrics (apache#8835)
  KAFKA-10115: Incorporate errors.tolerance with the Errant Record Reporter (apache#8829)
  KAFKA-9216: Enforce that Connect’s internal topics use `compact` cleanup policy (apache#8828)
  KAFKA-9845: Warn users about using config providers with plugin.path property (apache#8455)
  KAFKA-7833: Add missing test (apache#8847)
  KAFKA-9066: Retain metrics for failed tasks (apache#8502)
  KAFKA-9841: Revoke duplicate connectors and tasks when zombie workers return with an outdated assignment (apache#8453)
  KAFKA-9985: Sink connector may exhaust broker when writing in DLQ (apache#8663)
  KAFKA-9441: remove prepareClose() to simplify task management (apache#8833)
  KAFKA-7833: Add Global/StateStore name conflict check (apache#8825)
  KAFKA-9969: Exclude ConnectorClientConfigRequest from class loading isolation (apache#8630)
  KAFKA-9991: Fix flaky unit tests (apache#8843)
  KAFKA-10014; Always try to close all channels in Selector#close (apache#8685)
  KAFKA-10079: improve thread-level stickiness (apache#8775)
  MINOR: Print all removed dynamic members during join complete (apache#8816)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants