rondagostino commented on pull request #10184:
URL: https://github.com/apache/kafka/pull/10184#issuecomment-789243745
The below, if added as `tests/kafkatest/sanity_checks/test_delete_topic.py`,
fails for the Raft cases on this PR branch as of this moment because the broker
fails to shutdown. The following appears in the controller log:
```
[2021-03-02 21:41:13,354] INFO [Controller 1] Unfenced broker 1 has
requested and been granted a controlled shutdown.
(org.apache.kafka.controller.BrokerHeartbeatManager)
[2021-03-02 21:41:13,355] WARN [Controller 1]
org.apache.kafka.controller.QuorumController@3fa533f1: failed with unknown
server exception RuntimeException at epoch 1 in 802 us. Reverting to last
committed offset 5. (org.apache.kafka.controller.QuorumController)
java.lang.RuntimeException: Topic ID VnD54LHq2t3qq_m1WLasZg existed in
isrMembers, but not in the topics map.
at
org.apache.kafka.controller.ReplicationControlManager.handleNodeDeactivated(ReplicationControlManager.java:752)
at
org.apache.kafka.controller.ReplicationControlManager.processBrokerHeartbeat(ReplicationControlManager.java:931)
at
org.apache.kafka.controller.QuorumController$1.generateRecordsAndResult(QuorumController.java:911)
at
org.apache.kafka.controller.QuorumController$ControllerWriteEvent.run(QuorumController.java:419)
at
org.apache.kafka.queue.KafkaEventQueue$EventContext.run(KafkaEventQueue.java:121)
at
org.apache.kafka.queue.KafkaEventQueue$EventHandler.handleEvents(KafkaEventQueue.java:200)
at
org.apache.kafka.queue.KafkaEventQueue$EventHandler.run(KafkaEventQueue.java:173)
at java.lang.Thread.run(Thread.java:748)
```
Maybe add this system test to this PR as
`tests/kafkatest/sanity_checks/test_delete_topic.py`?
```
# 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 ducktape.mark import matrix
from ducktape.mark.resource import cluster
from ducktape.tests.test import Test
from kafkatest.services.kafka import KafkaService, quorum
from kafkatest.services.zookeeper import ZookeeperService
import time
class TestDeleteTopic(Test):
"""Sanity checks that we can create and delete a topic and then
shutdown."""
def __init__(self, test_context):
super(TestDeleteTopic, self).__init__(test_context)
self.topic = "test_topic"
self.zk = ZookeeperService(test_context, num_nodes=1) if
quorum.for_test(test_context) == quorum.zk else None
self.kafka = KafkaService(test_context, num_nodes=1, zk=self.zk,
topics={self.topic: {"partitions": 1,
"replication-factor": 1}},
controller_num_nodes_override=1)
def setUp(self):
if self.zk:
self.zk.start()
@cluster(num_nodes=2)
@matrix(metadata_quorum=quorum.all)
def test_delete_topic(self, metadata_quorum):
"""
Test that we can create and delete a topic and then shutdown
"""
self.kafka.start()
self.kafka.delete_topic(self.topic)
time.sleep(10) # give it a bit to take effect
self.kafka.stop() # explicit stop so that failure to stop fails the
test
```
----------------------------------------------------------------
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:
[email protected]