vvcephei commented on a change in pull request #8938: URL: https://github.com/apache/kafka/pull/8938#discussion_r448586796
########## File path: tests/kafkatest/tests/streams/streams_application_upgrade_test.py ########## @@ -0,0 +1,297 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import random +from ducktape.mark import matrix +from ducktape.tests.test import Test +from ducktape.utils.util import wait_until +from kafkatest.services.kafka import KafkaService +from kafkatest.services.streams import StreamsSmokeTestDriverService, StreamsSmokeTestJobRunnerService +from kafkatest.services.zookeeper import ZookeeperService +from kafkatest.version import LATEST_2_2, LATEST_2_3, LATEST_2_4, LATEST_2_5, DEV_VERSION, KafkaVersion + +smoke_test_versions = [str(LATEST_2_2), str(LATEST_2_3), str(LATEST_2_4), str(LATEST_2_5)] +dev_version = [str(DEV_VERSION)] + +class StreamsUpgradeTest(Test): + """ + Test upgrading Kafka Streams (all version combination) + If metadata was changes, upgrade is more difficult + Metadata version was bumped in 0.10.1.0 and + subsequently bumped in 2.0.0 + """ + + def __init__(self, test_context): + super(StreamsUpgradeTest, self).__init__(test_context) + self.topics = { + 'echo' : { 'partitions': 5 }, + 'data' : { 'partitions': 5 }, + } + + processed_msg = "processed [0-9]* records" + base_version_number = str(DEV_VERSION).split("-")[0] + + def perform_broker_upgrade(self, to_version): + self.logger.info("First pass bounce - rolling broker upgrade") + for node in self.kafka.nodes: + self.kafka.stop_node(node) + node.version = KafkaVersion(to_version) + self.kafka.start_node(node) + + @matrix(from_version=smoke_test_versions, to_version=dev_version, bounce_type=["full"]) Review comment: When you say "how is this handled", do you mean in the system tests or in "real life"? I'm handling it in the system tests by not doing rolling bounces at all. If we do them, we'll see the test fail nondeterministically, when it just so happens that an old-version node tries to read a new-version record. Once we release 2.6.0, we'll be able to add a downgrade test from trunk to 2.6.0, and once we release 2.5.1, we can add a downgrade test from trunk to 2.5.1, and also one in the 2.6 branch from 2.6.x to 2.5.1. In real life, you would see some of the old-versioned threads get exceptions and crash. But it wouldn't be a _huge_ deal, since you can just continue with the rolling bounce until there are no more old-versioned instances, at which point everything is fine. There would be no data corruption or anything. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org