chia7712 commented on code in PR #17410: URL: https://github.com/apache/kafka/pull/17410#discussion_r1792063278
########## tests/kafkatest/tests/core/zookeeper_migration_test.py: ########## @@ -1,304 +0,0 @@ -# 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. - -from functools import partial -import time - -from ducktape.utils.util import wait_until -from ducktape.mark import parametrize, matrix -from ducktape.mark.resource import cluster -from ducktape.errors import TimeoutError - -from kafkatest.services.console_consumer import ConsoleConsumer -from kafkatest.services.kafka import KafkaService, config_property -from kafkatest.services.kafka.config_property import CLUSTER_ID -from kafkatest.services.kafka.quorum import isolated_kraft, ServiceQuorumInfo, zk -from kafkatest.services.verifiable_producer import VerifiableProducer -from kafkatest.services.zookeeper import ZookeeperService -from kafkatest.tests.produce_consume_validate import ProduceConsumeValidateTest -from kafkatest.utils import is_int -from kafkatest.version import DEV_BRANCH, LATEST_3_4, LATEST_3_7, LATEST_3_8, KafkaVersion - - -class TestMigration(ProduceConsumeValidateTest): - def __init__(self, test_context): - super(TestMigration, self).__init__(test_context=test_context) - - def setUp(self): - self.topic = "test_topic" - self.partitions = 3 - self.replication_factor = 3 - - # Producer and consumer - self.producer_throughput = 1000 - self.num_producers = 1 - self.num_consumers = 1 - - def wait_until_rejoin(self): - for partition in range(0, self.partitions): - wait_until(lambda: len(self.kafka.isr_idx_list(self.topic, partition)) == self.replication_factor, timeout_sec=60, - backoff_sec=1, err_msg="Replicas did not rejoin the ISR in a reasonable amount of time") - - def do_migration(self, roll_controller=False, downgrade_to_zk=False, from_kafka_version=str(DEV_BRANCH)): - # Start up KRaft controller in migration mode - remote_quorum = partial(ServiceQuorumInfo, isolated_kraft) - controller = KafkaService(self.test_context, num_nodes=1, zk=self.zk, version=KafkaVersion(from_kafka_version), - allow_zk_with_kraft=True, - isolated_kafka=self.kafka, - server_prop_overrides=[["zookeeper.connect", self.zk.connect_setting()], - ["zookeeper.metadata.migration.enable", "true"]], - quorum_info_provider=remote_quorum) - controller.start() - - self.logger.info("Restarting ZK brokers in migration mode") - self.kafka.reconfigure_zk_for_migration(controller) Review Comment: agree to @mumrah comment `reconfigure_zk_as_kraft` and `reconfigure_zk_for_migration` should also be removed. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
