Skip to content

KAFKA-14586: Moving StreamResetter to tools#13127

Merged
cadonna merged 5 commits intoapache:trunkfrom
vamossagar12:KAFKA-14586
Mar 28, 2023
Merged

KAFKA-14586: Moving StreamResetter to tools#13127
cadonna merged 5 commits intoapache:trunkfrom
vamossagar12:KAFKA-14586

Conversation

@vamossagar12
Copy link
Copy Markdown
Contributor

More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.

Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.

Committer Checklist (excluded from commit message)

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

@vamossagar12
Copy link
Copy Markdown
Contributor Author

@mjsax , I noticed you had worked on the StreamsResetter tool. Would you be able to review this smallish PR? The idea is to move it from core module to tools module which is part of this: https://issues.apache.org/jira/browse/KAFKA-14525

@vamossagar12
Copy link
Copy Markdown
Contributor Author

Adding @fvaleri . There are checkstyle issues, which I would fix.

Copy link
Copy Markdown
Member

@cadonna cadonna left a comment

Choose a reason for hiding this comment

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

@vamossagar12 Thanks for the PR!

I had one major comment.

Comment thread build.gradle Outdated
@vamossagar12 vamossagar12 changed the title Kafka 14586: Moving StreamResetter to tools KAFKA-14586: Moving StreamResetter to tools Jan 24, 2023
@vamossagar12
Copy link
Copy Markdown
Contributor Author

@vamossagar12 Thanks for the PR!

I had one major comment.

Thanks @cadonna . I think that comment has been addressed now based on the conversation.

@vamossagar12
Copy link
Copy Markdown
Contributor Author

@cadonna , bumping this thread again.

@fvaleri
Copy link
Copy Markdown
Contributor

fvaleri commented Feb 8, 2023

@vamossagar12 as you can see from the CI output, there are checkstyle errors. Have you tried to run at least one of the system tests that are using the tool?

@vamossagar12
Copy link
Copy Markdown
Contributor Author

@vamossagar12 as you can see from the CI output, there are checkstyle errors. Have you tried to run at least one of the system tests that are using the tool?

hi @fvaleri , yes I am aware of the checkstyle issue and pointed it out here: #13127 (comment). I have run the StreamResetter tests and also modified the system test.

@cadonna
Copy link
Copy Markdown
Member

cadonna commented Feb 9, 2023

@vamossagar12 The PR LGTM except for the checkstyle issues. Could you also please post a link to a successful system test run of the system tests that use the streams resetter?

@vamossagar12
Copy link
Copy Markdown
Contributor Author

Thanks @cadonna , would do the same.

@vamossagar12
Copy link
Copy Markdown
Contributor Author

@cadonna , @fvaleri I ran the system test for StreamsResetter from my local (and fixed the checkstyle). The tests are running, would keep an eye on it =>

./gradlew clean systemTestLibs                                                                                         

> Configure project :
Starting build with version 3.5.0-SNAPSHOT (commit id af3bedfd) using Gradle 7.6, Java 1.8 and Scala 2.13.10
Build properties: maxParallelForks=8, maxScalacThreads=8, maxTestRetries=0

BUILD SUCCESSFUL in 5m 44s
220 actionable tasks: 212 executed, 8 up-to-date
(ducktape) sarao@C02GG1KCML7H kafka % TC_PATHS="tests/kafkatest/tests/streams/streams_optimized_test.py::StreamsOptimizedTest" bash tests/docker/run_tests.sh

> Configure project :
Starting build with version 3.5.0-SNAPSHOT (commit id af3bedfd) using Gradle 7.6, Java 1.8 and Scala 2.13.10
Build properties: maxParallelForks=8, maxScalacThreads=8, maxTestRetries=0

BUILD SUCCESSFUL in 9s
172 actionable tasks: 172 up-to-date
docker exec ducker01 bash -c "cd /opt/kafka-dev && ducktape --cluster-file /opt/kafka-dev/tests/docker/build/cluster.json  ./tests/kafkatest/tests/streams/streams_optimized_test.py::StreamsOptimizedTest "
/usr/local/lib/python3.9/dist-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
  "class": algorithms.Blowfish,
[INFO:2023-02-10 01:05:18,393]: starting test run with session id 2023-02-10--002...
[INFO:2023-02-10 01:05:18,395]: running 1 tests...
[INFO:2023-02-10 01:05:18,398]: Triggering test 1 of 1...
[INFO:2023-02-10 01:05:18,454]: RunnerClient: Loading test {'directory': '/opt/kafka-dev/tests/kafkatest/tests/streams', 'file_name': 'streams_optimized_test.py', 'cls_name': 'StreamsOptimizedTest', 'method_name': 'test_upgrade_optimized_topology', 'injected_args': {'metadata_quorum': 'REMOTE_KRAFT'}}
[INFO:2023-02-10 01:05:18,480]: RunnerClient: kafkatest.tests.streams.streams_optimized_test.StreamsOptimizedTest.test_upgrade_optimized_topology.metadata_quorum=REMOTE_KRAFT: on run 1/1
[INFO:2023-02-10 01:05:18,498]: RunnerClient: kafkatest.tests.streams.streams_optimized_test.StreamsOptimizedTest.test_upgrade_optimized_topology.metadata_quorum=REMOTE_KRAFT: Setting up...
[INFO:2023-02-10 01:05:18,503]: RunnerClient: kafkatest.tests.streams.streams_optimized_test.StreamsOptimizedTest.test_upgrade_optimized_topology.metadata_quorum=REMOTE_KRAFT: Running...
[INFO:2023-02-10 01:08:00,049]: RunnerClient: kafkatest.tests.streams.streams_optimized_test.StreamsOptimizedTest.test_upgrade_optimized_topology.metadata_quorum=REMOTE_KRAFT: Tearing down...
[INFO:2023-02-10 01:08:26,433]: RunnerClient: kafkatest.tests.streams.streams_optimized_test.StreamsOptimizedTest.test_upgrade_optimized_topology.metadata_quorum=REMOTE_KRAFT: PASS
[INFO:2023-02-10 01:08:26,437]: RunnerClient: kafkatest.tests.streams.streams_optimized_test.StreamsOptimizedTest.test_upgrade_optimized_topology.metadata_quorum=REMOTE_KRAFT: Data: None
================================================================================
SESSION REPORT (ALL TESTS)
ducktape version: 0.11.3
session_id:       2023-02-10--002
run time:         3 minutes 8.101 seconds
tests run:        1
passed:           1
flaky:            0
failed:           0
ignored:          0
================================================================================
test_id:    kafkatest.tests.streams.streams_optimized_test.StreamsOptimizedTest.test_upgrade_optimized_topology.metadata_quorum=REMOTE_KRAFT
status:     PASS
run time:   3 minutes 7.954 seconds
--------------------------------------------------------------------------------

@vamossagar12
Copy link
Copy Markdown
Contributor Author

vamossagar12 commented Feb 10, 2023

Tests seemed to have passed for one of the builds. The tests that failed (even the one is Streams) seem unrelated to me.

Copy link
Copy Markdown
Contributor

@fvaleri fvaleri left a comment

Choose a reason for hiding this comment

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

Hi @vamossagar12, thanks for fixing the checkstyle errors.

I left a few comments. I also think that it would be better to use the shared CommandDefaultOptions class, like in all the other joptsimple tools (help and version code is duplicated here).

The system test looks good:

test_id:    kafkatest.tests.streams.streams_optimized_test.StreamsOptimizedTest.test_upgrade_optimized_topology.metadata_quorum=REMOTE_KRAFT
status:     PASS
run time:   1 minute 12.791 seconds

Comment thread build.gradle Outdated
Comment thread checkstyle/import-control.xml Outdated
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.

This subpackage is not needed if you move StreamsResetterTest to tools test.

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 guess this is related to my comment #13127 (comment)?

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.

I think this test belongs to the tools module, where the class under test lives.

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.

Yeah even I had thought so. But the original layout was also similar (i.e StreamsResetter was under tools and the test lived here) so I didn't change it. @cadonna , WDYT?

Copy link
Copy Markdown
Member

@cadonna cadonna Feb 14, 2023

Choose a reason for hiding this comment

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

I would also move it to the tools module.
@mjsax @guozhangwang Was there a specific reason not to have the test in the same module as the StreamsResetter?

Copy link
Copy Markdown
Contributor Author

@vamossagar12 vamossagar12 Feb 16, 2023

Choose a reason for hiding this comment

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

Got it @cadonna . Would wait for the response. Even I think it can move but let's see what guozhang and Mathias have to say.
Also, while we are at it, would like to know your opinion on #13127 (comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would not wait for the answer. We can do that in a follow-up PR. Could you open a ticket for the move?

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.

Thanks @cadonna , here's the follow up ticket: https://issues.apache.org/jira/browse/KAFKA-14851

@vamossagar12
Copy link
Copy Markdown
Contributor Author

Thanks for the review @fvaleri . I addressed/responded to the comments. Regarding moving to CommandDefaultOptions, is it better if we do it in a follow up PR as that is not directly connected to migrating to tools module. I am not saying it isn't important but trying to keep the scope of this PR limited to the migration since StreamsResetter has been working this way since the beginning. WDYT?

@fvaleri
Copy link
Copy Markdown
Contributor

fvaleri commented Feb 16, 2023

Regarding moving to CommandDefaultOptions, is it better if we do it in a follow up PR as that is not directly connected to migrating to tools module.

Hi @vamossagar12, I'm ok with doing it in a follow up PR. Do we have a Jira for that?

@vamossagar12
Copy link
Copy Markdown
Contributor Author

Regarding moving to CommandDefaultOptions, is it better if we do it in a follow up PR as that is not directly connected to migrating to tools module.

Hi @vamossagar12, I'm ok with doing it in a follow up PR. Do we have a Jira for that?

Thanks @fvaleri , here you go: https://issues.apache.org/jira/browse/KAFKA-14734

Copy link
Copy Markdown
Contributor

@fvaleri fvaleri left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@vamossagar12
Copy link
Copy Markdown
Contributor Author

Thanks @fvaleri !

@vamossagar12
Copy link
Copy Markdown
Contributor Author

@cadonna , bumping this one again :)

Copy link
Copy Markdown
Member

@cadonna cadonna left a comment

Choose a reason for hiding this comment

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

Thanks @vamossagar12 !

LGTM!

@cadonna
Copy link
Copy Markdown
Member

cadonna commented Mar 27, 2023

I restarted the build. Once the results are acceptable, I will merge the PR.

@cadonna
Copy link
Copy Markdown
Member

cadonna commented Mar 28, 2023

Test failures are unrelated:

    Build / JDK 17 and Scala 2.13 / kafka.zk.ZkMigrationIntegrationTest.[1] Type=ZK, Name=testDualWrite, MetadataVersion=3.4-IV0, Security=PLAINTEXT
    Build / JDK 17 and Scala 2.13 / kafka.zk.ZkMigrationIntegrationTest.[1] Type=ZK, Name=testDualWrite, MetadataVersion=3.4-IV0, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.mirror.integration.DedicatedMirrorIntegrationTest.testMultiNodeCluster()
    Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.mirror.integration.DedicatedMirrorIntegrationTest.testMultiNodeCluster()
    Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.integration.ExactlyOnceSourceIntegrationTest.testConnectorBoundary
    Build / JDK 11 and Scala 2.13 / kafka.zk.ZkMigrationIntegrationTest.[1] Type=ZK, Name=testDualWrite, MetadataVersion=3.4-IV0, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.zk.ZkMigrationIntegrationTest.[1] Type=ZK, Name=testDualWrite, MetadataVersion=3.4-IV0, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / org.apache.kafka.trogdor.coordinator.CoordinatorTest.testTaskRequestWithOldStartMsGetsUpdated()

@cadonna cadonna merged commit c14f56b into apache:trunk Mar 28, 2023
@fvaleri fvaleri added the tools label Jul 7, 2023
fvaleri added a commit to fvaleri/kafka that referenced this pull request Jul 10, 2023
This PR adds CommandDefaultOptions usage like in the other joptsimple based tools.
It also moves the associated unit test class from streams to tools module as discussed in
apache#13127 (comment).

Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
showuon pushed a commit that referenced this pull request Jul 20, 2023
This PR adds CommandDefaultOptions usage like in the other joptsimple based tools. It also moves the associated unit test class from streams to tools module as discussed in #13127 (comment)

Reviewers:  Luke Chen <showuon@gmail.com>, Bruno Cadonna <cadonna@apache.org>, Sagar Rao <sagarmeansocean@gmail.com>
jeqo pushed a commit to jeqo/kafka that referenced this pull request Jul 21, 2023
This PR adds CommandDefaultOptions usage like in the other joptsimple based tools. It also moves the associated unit test class from streams to tools module as discussed in apache#13127 (comment)

Reviewers:  Luke Chen <showuon@gmail.com>, Bruno Cadonna <cadonna@apache.org>, Sagar Rao <sagarmeansocean@gmail.com>
Cerchie pushed a commit to Cerchie/kafka that referenced this pull request Jul 25, 2023
This PR adds CommandDefaultOptions usage like in the other joptsimple based tools. It also moves the associated unit test class from streams to tools module as discussed in apache#13127 (comment)

Reviewers:  Luke Chen <showuon@gmail.com>, Bruno Cadonna <cadonna@apache.org>, Sagar Rao <sagarmeansocean@gmail.com>
jeqo pushed a commit to aiven/kafka that referenced this pull request Aug 15, 2023
This PR adds CommandDefaultOptions usage like in the other joptsimple based tools. It also moves the associated unit test class from streams to tools module as discussed in apache#13127 (comment)

Reviewers:  Luke Chen <showuon@gmail.com>, Bruno Cadonna <cadonna@apache.org>, Sagar Rao <sagarmeansocean@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants