Skip to content

KAFKA-6054: Fix upgrade path from Kafka Streams v0.10.0#4758

Merged
mjsax merged 6 commits intoapache:0.10.2from
mjsax:kafka-6054-fix-upgrade-0102
Mar 26, 2018
Merged

KAFKA-6054: Fix upgrade path from Kafka Streams v0.10.0#4758
mjsax merged 6 commits intoapache:0.10.2from
mjsax:kafka-6054-fix-upgrade-0102

Conversation

@mjsax
Copy link
Copy Markdown
Member

@mjsax mjsax commented Mar 22, 2018

No description provided.

@mjsax mjsax added the streams label Mar 22, 2018
@mjsax mjsax requested review from dguy and guozhangwang March 22, 2018 18:07
@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Mar 22, 2018

\cc @bbejeck @vvcephei

This is a port of #4746 for 0.10.2 branch plus one more commit to extend the system test accordingly. Will to more PRs for all other branches similar to this one. Please comment on #4746 first, and I'll address those comments on all PRs. The existing comments on $4746 are already included in this PR.

@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Mar 22, 2018

@asfgit
Copy link
Copy Markdown

asfgit commented Mar 22, 2018

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

@asfgit
Copy link
Copy Markdown

asfgit commented Mar 22, 2018

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

@asfgit
Copy link
Copy Markdown

asfgit commented Mar 22, 2018

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

@asfgit
Copy link
Copy Markdown

asfgit commented Mar 23, 2018

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

@asfgit
Copy link
Copy Markdown

asfgit commented Mar 23, 2018

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

Comment thread docs/streams.html 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 is a bit verbose as we just mentioned it earlier.

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.

Not clear what does this comment mean?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We have only access to 0.10.1.1 (official release) here but not to 0.10.1 (ie, Github branch that contains the fix for KIP-268) -- thus, we cannot test upgrade from 0.10.0 to 0.10.1 here.

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.

Okay, the misleading part is because you mentioned broker_version, but I guess you meant new_version?

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 this upgrade, we do not need two rolling bounces with upgrade.from config I think?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes. The test does only do one rolling bounce. Not sure what you mean? Is the comment confusing? It does actually no say anything about the number of rolling bounces.

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.

My bad, I'd better leave this comment on line 57 below. I meant that we do not need to specify 0.10.0 for the upgrade.from parameter, but instead we should be able to just write

self.do_rolling_bounce(p, "", new_version, counter)

Is that right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch!

Comment thread tests/kafkatest/version.py 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 comment seems misplaced.

Comment thread tests/kafkatest/version.py 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.

Hmm.. this makes me thinking, that are we effectively adding one more step on release process, that the release manager need to modify this value?

Copy link
Copy Markdown
Member Author

@mjsax mjsax Mar 23, 2018

Choose a reason for hiding this comment

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

That is correct. Thinking about it, I am wondering if we could get the value from gradle.properties file?

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 do not know how to do that.. or if it is even possible. I think adding this extra step is not too bad as in release.py we already wrap some other places where we need to remove -SNAPSHOT anyways, this is just for confirming, that in trunk maybe we'd update release.py as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ack.

@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Mar 23, 2018

Note: Java 9 does not work on old 0.10.2 branch -- Java9 was set up later and we can ignore failing Java9 builds.

@asfgit
Copy link
Copy Markdown

asfgit commented Mar 23, 2018

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

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.

Left some follow-up comments. Overall It LGTM. Please feel free to merge after addressing them.

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.

Okay, the misleading part is because you mentioned broker_version, but I guess you meant new_version?

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.

My bad, I'd better leave this comment on line 57 below. I meant that we do not need to specify 0.10.0 for the upgrade.from parameter, but instead we should be able to just write

self.do_rolling_bounce(p, "", new_version, counter)

Is that right?

Comment thread tests/kafkatest/version.py 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.

I do not know how to do that.. or if it is even possible. I think adding this extra step is not too bad as in release.py we already wrap some other places where we need to remove -SNAPSHOT anyways, this is just for confirming, that in trunk maybe we'd update release.py as well.

@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Mar 23, 2018

Updated this with 0.10.1 comments and follow ups.

System tests passed: https://jenkins.confluent.io/job/system-test-kafka-branch-builder/1589/

@asfgit
Copy link
Copy Markdown

asfgit commented Mar 23, 2018

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

@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Mar 25, 2018

Retest this please

@asfgit
Copy link
Copy Markdown

asfgit commented Mar 25, 2018

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

John's review
Guozhang's follow up
@mjsax mjsax force-pushed the kafka-6054-fix-upgrade-0102 branch from 8fbf6ee to 1cb064a Compare March 26, 2018 00:23
@asfgit
Copy link
Copy Markdown

asfgit commented Mar 26, 2018

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

Copy link
Copy Markdown
Member

@bbejeck bbejeck left a comment

Choose a reason for hiding this comment

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

Thanks @mjsax, LGTM.

@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Mar 26, 2018

Merging this to 0.10.2 now.

@mjsax mjsax merged commit 67b0a94 into apache:0.10.2 Mar 26, 2018
@mjsax mjsax deleted the kafka-6054-fix-upgrade-0102 branch March 26, 2018 23:31
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.

Ah! you win. Well, here's my thoughts anyway ;)

final Properties streamsConfiguration = new Properties();
streamsConfiguration.put(StreamsConfig.APPLICATION_ID_CONFIG, "fanout-integration-test");
streamsConfiguration.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, CLUSTER.bootstrapServers());
streamsConfiguration.setProperty(StreamsConfig.STATE_DIR_CONFIG, TestUtils.tempDirectory().getPath());
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.

});

data.process(SmokeTestUtil.printProcessorSupplier("data"));
data.process(SmokeTestUtil.<String, Integer>printProcessorSupplier("data"));
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 these be data.process(SmokeTestUtil.<>printProcessorSupplier("data")) ?

Copy link
Copy Markdown
Member Author

@mjsax mjsax Mar 27, 2018

Choose a reason for hiding this comment

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

Just double checked. data.process(SmokeTestUtil.printProcessorSupplier("data")) compiles

allData.put(data[i].key, new HashSet<Integer>());
}
Random rand = new Random();
final Random rand = new Random();
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.

Admittedly, this is a random time to bring this up, but a pattern that I like for this is:

final long seed = providedSeed != null ? providedSeed : new Random().nextLong();
System.out.println("Seed is: " + seed);
final Random rand = new Random(seed);

where providedSeed comes from an env variable, command-line arg, whatever...

This way you get the same default behavior (pseudorandomly generated sequence of test values), but you also have the option to deterministically reproduce a previous pseudorandom sequence from a prior run. This can be helpful in diagnosing flaky tests.

Not saying this is needed here; I just wanted to share the pattern.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Basically I agree. So far, we did not have any issues with Random introducing flakiness that we cannot reproduce. However, I am not sure if seed = new Random().nextLong() is a good seed -- isn't this also deterministic? I am used to seed = System.currentTimeMillis() ?

@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Mar 27, 2018

Merged to 0.10.2.

Follow up PR to address missed comments: #4778

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.

5 participants