Skip to content
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

KAFKA-8147: Add changelog topic configuration to KTable suppress #8029

Merged
merged 1 commit into from
Feb 25, 2020

Conversation

highluck
Copy link
Contributor

@highluck highluck commented Feb 1, 2020

Committer Checklist (excluded from commit message)

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

@highluck
Copy link
Contributor Author

highluck commented Feb 1, 2020

@vvcephei @bbejeck
Can I ask for your opinion? thanks !

@mjsax mjsax added the streams label Feb 1, 2020
@bbejeck
Copy link
Contributor

bbejeck commented Feb 5, 2020

Ok to test

@highluck
Copy link
Contributor Author

highluck commented Feb 7, 2020

@bbejeck
retest this please

@bbejeck
Copy link
Contributor

bbejeck commented Feb 9, 2020

Both Java 11 and 8 failed. Test results already cleaned up.

Retest this please.

@highluck
Copy link
Contributor Author

@bbejeck @vvcephei
I'm sorry, but can you test it again?

Copy link
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.

Hi @highluck , sorry for the slow review cycle. I was waiting for the opportunity to really give you a good review.

I have three high level comments:

  1. The javadocs are not quite right, see the suggestions below.
  2. If we're going to start using BufferConfigInternal as the internally-facing interface for BufferConfig, I'd like to keep it more like an interface by maintaining all the state in the implementation classes, just for future maintainability. I wasn't 100% sure how clean this would be, so I tried it out myself. Here's my suggestion: SUGGESTION: KAFKA-8147: Add changelog topic configuration to KTable suppress highluck/kafka#1
  3. We need at least one more test to demonstrate that the desired log configuration (or disablement) would actually be used. This should probably take the form of an integration test, in which we start a Streams application and then inspect the resulting topic to verify it got configured properly. Otherwise, we'd have no regression test that the KTableImpl logging code actually takes effect and continues to work after future modifications to the code base.

@highluck
Copy link
Contributor Author

@vvcephei
thank you for your suggestion and review
It was better than my code!

i'm code update and add test code
Please confirm!
thank you

Copy link
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.

Hi @highluck , thanks for the update!

Thanks for adding the integration test. It doesn't look like we are actually verifying the changelog topic. I think you can query the EmbeddedKafkaCluster to get the actual log configuration. I'd consider the following two tests sufficient:

  1. Add a non-default configuration, such as setting the retention time to some magic number, then query CLUSTER to see if that configuration did indeed take effect
  2. Disable logging and then query CLUSTER to verify that the topic is in fact absent.

Additionally, we should verify (either in a new or just in an existing test) that the changelog is present by default.

Thanks!
-John

@highluck
Copy link
Contributor Author

highluck commented Feb 19, 2020

@vvcephei
While writing the test code, I realized that I was wrong
Your review was great!

I added two cases of test code
Please comment again!
Thank you!

Copy link
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, @highluck !

I suggested a few tweaks.

Also, we'd need one more test like shouldAllowDisablingChangelog() that does withLoggingDisabled(), and then verifies assertThat(CLUSTER.getAllTopicsInCluster(), not(contains(changeLog)));. Although that verification might be brittle. Maybe it would be safer to just verify that there is no changelog in the cluster that contains the word "KTABLE-SUPPRESS".

@vvcephei
Copy link
Contributor

Ok to test

@highluck
Copy link
Contributor Author

@vvcephei
i'm test update and add
Please comment again
thankyou!

@highluck
Copy link
Contributor Author

Retest this please.

Copy link
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.

Look good! Thanks, @highluck

@vvcephei
Copy link
Contributor

Ok to test.

@vvcephei
Copy link
Contributor

Retest this, please.

@vvcephei
Copy link
Contributor

Hey @highluck , it looks like the tests can't build because of:

00:05:02.608 > Task :streams:test-utils:jar
00:05:05.208 
00:05:05.208 > Task :streams:compileTestJava
00:05:05.208 /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13@2/streams/src/test/java/org/apache/kafka/streams/integration/utils/EmbeddedKafkaCluster.java:349: warning: [deprecation] <A>setAsJavaSet(scala.collection.Set<A>) in JavaConverters has been deprecated
00:05:05.208         return JavaConverters.setAsJavaSet(brokers[0].kafkaServer().zkClient().getAllTopicsInCluster());
00:05:05.208                              ^
00:05:05.208   where A is a type-variable:
00:05:05.209     A extends Object declared in method <A>setAsJavaSet(scala.collection.Set<A>)
00:05:05.209 error: warnings found and -Werror specified
00:05:17.007 1 error
00:05:17.007 1 warning

@vvcephei
Copy link
Contributor

You should be able to reproduce this with :

./gradlew clean :sterams:test :streams:test-utils:test

@highluck
Copy link
Contributor Author

@vvcephei
oh! thankyou
i'm fixed!

Retest this, please.

@vvcephei
Copy link
Contributor

test this please

@vvcephei
Copy link
Contributor

ok to test

@highluck
Copy link
Contributor Author

@vvcephei
retest this please

@vvcephei
Copy link
Contributor

It looks like the Java 11 build was terminated (maybe timed out, or maybe terminated due to some ops on the host). But, since the java 8 build passed, and the java 11 build was so close to passing, I'm going to run the Streams tests locally and then merge.

@vvcephei
Copy link
Contributor

Local build passed:

$ ./gradlew clean systemTestLibs :streams:test :streams:test-utils:test
...
BUILD SUCCESSFUL in 8m 51s

@vvcephei vvcephei merged commit 9064026 into apache:trunk Feb 25, 2020
@vvcephei
Copy link
Contributor

Merged to trunk, updated Jira and KIP to reflect the completed status. Thanks for the contribution, @highluck !

@highluck
Copy link
Contributor Author

@vvcephei
thank you!!

@mjsax
Copy link
Member

mjsax commented Apr 15, 2020

@highluck @vvcephei I just going over merged KIP PR -- seems we did not update any docs with this PR...

@highluck Would you like to do a follow up PR to update the docs?

@highluck
Copy link
Contributor Author

highluck commented Apr 15, 2020

@mjsax
thank you
I want to proceed!
Could you explain if it's okay?

@mjsax
Copy link
Member

mjsax commented Apr 15, 2020

Cool. Just open a new PR using the same Jira number in the title and ping for review.

Let us know if you have any questions.

@mjsax mjsax added the kip Requires or implements a KIP label Jun 12, 2020
@highluck
Copy link
Contributor Author

highluck commented Jun 21, 2020

@mjsax
Could you please provide feedback on how to update the docs?

@mjsax
Copy link
Member

mjsax commented Jun 22, 2020

There is a directory docs -- with sub-directory streams (cf https://github.com/apache/kafka/tree/trunk/docs).

As this PR implements a KIP, you should update docs/streams/upgrade-guide.html (there is a section about "Public API changes in 2.6"). Not sure atm, but maybe developer-guide/dsl-api.html would also need an update.

\cc @vvcephei

@highluck
Copy link
Contributor Author

@mjsax thank you for comment!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kip Requires or implements a KIP streams
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants