New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to delete topic is reversed by Topic Operator #1157
Comments
Hello. How did you create the topic? I did a quick test by applying |
@stanlyDoge The topic was initially created using Kafka Connect with the Debezium MySQL connector. The Connect cluster had been shut down in order to ensure that it was in fact the topic operator which was recreating the topics. As assumed, when the Connect cluster was removed, and the topic was deleted from one of the brokers using the |
Event we are facing the same issue. Deleting topic is recreated with reconciliation. Below is the log for that. Topic is created by our own micro service 019-03-29 11:02:19 INFO K8sTopicWatcher:37 - KafkaTopic watch received event DELETED on resource job.request with labels {strimzi.io/kind=topic} |
I am also facing the same issue. We have a helm chart that creates 45 Here are the steps to reproduce:
In my case one topic is not deleted. I am using helm3. Also, chart I am deploying is an umbrella helm chart, where the topics are created in one of the subchart. The umbrella helm chart is installed in a different namespace than the kafka-topics helm chart. |
@sumitmundhada I think you will need to provide some more details. There are several things which can happen:
But without the full logs it is not clear what happened. |
@scholzj We are currently getting started with Strimzi.
What logs can I provide you with? |
Ok, well ... the logs should confirm it then. I think for this just the logs from the Topic Operator container are needed (it is one of the containers inside the Entity Operator pod). |
@stanlyDoge @tombentley @ppatierno You are the TO experts. Can you have a look? |
@sumitmundhada To me it looks like the client recreates it. If you look at these logs for example:
It IMHO suggests the topic was deleted by the TO but then recreated in Kafka (notice the |
Can you explain this a little more, please? (I am actually new to Kafka) Also, I currently do not have any consumer or producer working with any of these topics. Also, deleting them via |
Kafka by default auto-creates topics when consumers / producers try to use them. Thsi can be disabled in the KAfka configuration (in |
I've tried to create, send/receive, delete multiple topics unsing |
Yes. Have seen the same behaviour. The issue is only when creating them via helm chart. I am using the helm install/uninstall commands to be specific. |
Well, the operator does not know about Helm. It is only watching the custom resources. So I would expect that either your Helm Chart does something special to delete the topics (but there is not really that many way to delete a resource) or it is more about the timing (e.g. some race condition). |
Somehow my previous comment with the logs got deleted. So posting the logs again. |
@sumitmundhada would it be possible to reproduce with the TO logging at |
@tombentley Attaching a slightly bigger log file with log level set to |
One more thing that I noticed was that when the topics were initially created they had 10 partitions. But the 4 topics mentioned above, that were recreated after uninstalling the chart, they had just 1 partition. |
That normally suggests the auto.creation with default settings ... just saying ;-) |
@sumitmundhada thanks for the logs. They do seem to show something going on with
I put "creation" in scare quotes because the logging of how we track creation and deletion is a little weird:
note the lack of We could wait longer in step 2, but we can't wait forever. So a subsequent reconciliation needs to be able to recover. Maybe in step 3 we should hold off processing the event until the Admin client says the topic doesn't exist. That code would need to be resilient to races itself though. |
I would be lying if I say I understand 100% of this, but what would be the next steps in this case? Will this issue be sufficient to track this bug? |
@tombentley @scholzj Do you see this as a prominent issue that needs a fix? |
@sumitmundhada I do not really know enough about the Topic Operator ... so I personally do not dare to touch it :-o |
I do see this as an issue which needs to be addressed, but I don't have the time right now to look at it. It's on my to do list. |
Signed-off-by: Tom Bentley <tbentley@redhat.com>
Try to fix #1157 and possibly other issues where the TO behaves incorrectly wrt creation or deletion. When we observe the deletion of a topic via ZK don't assume the topic deletion has propagated to observations of the topic via the Admin client. Instead wait for the Admin client to confirm that the topic doesn't exist before proceeding with the reconciliation. Using a null result from `Kafka.topicMetadata()` to imply non-existence was prone to a race where we queried a non-controller broker for the metadata and that broker had not yet processed an UPDATE_METADATA request from the controller (e.g. the topic was recently created or deleted). By adding an explicit check for existence (handled by the controller because it's a `createTopics(validateOnly=true)`) we should have more consistent responses. Signed-off-by: Tom Bentley <tbentley@redhat.com>
Try to fix #1157 and possibly other issues where the TO behaves incorrectly wrt creation or deletion. When we observe the deletion of a topic via ZK don't assume the topic deletion has propagated to observations of the topic via the Admin client. Instead wait for the Admin client to confirm that the topic doesn't exist before proceeding with the reconciliation. Using a null result from `Kafka.topicMetadata()` to imply non-existence was prone to a race where we queried a non-controller broker for the metadata and that broker had not yet processed an UPDATE_METADATA request from the controller (e.g. the topic was recently created or deleted). By adding an explicit check for existence (handled by the controller because it's a `createTopics(validateOnly=true)`) we should have more consistent responses. Signed-off-by: Tom Bentley <tbentley@redhat.com>
Strimzi Version:
0.9.0-rc1
I want to delete a topic, but cannot seem to do so using the CLI tools nor deleting the
KafkaTopic
CRD. The topic operator insists on recreating it.When deleting
KafkaTopic
CRD for topic in question:[2018-12-12 12:48:13,612] INFO <opicOperator:559> [oop-thread-0] All three topics are identical [2018-12-12 12:48:13,613] INFO <TopicWatcher:40> [oop-thread-0] Success processing KafkaTopic watch event ADDED on resource nutmeg-sit with labels {strimzi.io/cluster=c} [2018-12-12 12:48:15,831] INFO <TopicWatcher:37> [ault.svc/...] KafkaTopic watch received event DELETED on resource nutmeg-sit with labels {strimzi.io/cluster=c} [2018-12-12 12:48:15,842] INFO <opicOperator:419> [oop-thread-0] Reconciling topic nutmeg-sit, k8sTopic:null, kafkaTopic:nonnull, privateTopic:nonnull [2018-12-12 12:48:15,842] INFO <opicOperator:319> [oop-thread-0] Deleting topic 'nutmeg-sit' [2018-12-12 12:48:15,863] INFO <TopicWatcher:40> [oop-thread-0] Success processing KafkaTopic watch event DELETED on resource nutmeg-sit with labels {strimzi.io/cluster=c} [2018-12-12 12:48:15,891] INFO <opicsWatcher:79> [oop-thread-1] Deleted topics: [nutmeg-sit] [2018-12-12 12:48:15,898] INFO <opicOperator:419> [oop-thread-0] Reconciling topic null, k8sTopic:null, kafkaTopic:null, privateTopic:null [2018-12-12 12:48:15,965] INFO <opicsWatcher:94> [oop-thread-1] Created topics: [nutmeg-sit] [2018-12-12 12:48:16,186] INFO <opicOperator:419> [oop-thread-0] Reconciling topic nutmeg-sit, k8sTopic:null, kafkaTopic:nonnull, privateTopic:null [2018-12-12 12:48:16,194] INFO <TopicWatcher:37> [ault.svc/...] KafkaTopic watch received event ADDED on resource nutmeg-sit with labels {strimzi.io/cluster=c} [2018-12-12 12:48:16,207] INFO <opicOperator:419> [oop-thread-1] Reconciling topic nutmeg-sit, k8sTopic:nonnull, kafkaTopic:nonnull, privateTopic:nonnull [2018-12-12 12:48:16,207] INFO <opicOperator:559> [oop-thread-1] All three topics are identical [2018-12-12 12:48:16,207] INFO <TopicWatcher:40> [oop-thread-1] Success processing KafkaTopic watch event ADDED on resource nutmeg-sit with labels {strimzi.io/cluster=c}
When I use the
kafka-topics.sh
CLI:[2018-12-12 12:49:40,902] INFO <TopicWatcher:37> [ault.svc/...] KafkaTopic watch received event DELETED on resource nutmeg-sit with labels {strimzi.io/cluster=c} [2018-12-12 12:49:40,907] INFO <TopicWatcher:40> [oop-thread-1] Success processing KafkaTopic watch event MODIFIED on resource nutmeg-sit with labels {strimzi.io/cluster=c} [2018-12-12 12:49:40,909] INFO <opicOperator:419> [oop-thread-1] Reconciling topic null, k8sTopic:null, kafkaTopic:null, privateTopic:null [2018-12-12 12:49:40,909] INFO <TopicWatcher:40> [oop-thread-1] Success processing KafkaTopic watch event DELETED on resource nutmeg-sit with labels {strimzi.io/cluster=c} [2018-12-12 12:49:41,327] INFO <opicsWatcher:94> [oop-thread-0] Created topics: [nutmeg-sit] [2018-12-12 12:49:41,371] INFO <opicOperator:955> [oop-thread-1] Starting periodic reconciliation [2018-12-12 12:49:41,387] INFO <opicOperator:419> [oop-thread-1] Reconciling topic _schemas, k8sTopic:nonnull, kafkaTopic:nonnull, privateTopic:nonnull [2018-12-12 12:49:41,388] INFO <opicOperator:559> [oop-thread-1] All three topics are identical [2018-12-12 12:49:41,388] INFO <opicOperator:365> [oop-thread-1] Success reconciling KafkaTopic strimzi/schemas---251ea2dcbbf0dc3858aa5637c32a54d26159edc1 [2018-12-12 12:49:41,397] INFO <opicOperator:419> [oop-thread-0] Reconciling topic _schemas, k8sTopic:nonnull, kafkaTopic:nonnull, privateTopic:nonnull [2018-12-12 12:49:41,397] INFO <opicOperator:559> [oop-thread-0] All three topics are identical [2018-12-12 12:49:41,397] INFO <opicOperator:365> [oop-thread-0] Success reconciling KafkaTopic strimzi/schemas---251ea2dcbbf0dc3858aa5637c32a54d26159edc1 [2018-12-12 12:49:41,546] INFO <opicOperator:419> [oop-thread-1] Reconciling topic nutmeg-sit, k8sTopic:null, kafkaTopic:nonnull, privateTopic:null [2018-12-12 12:49:41,558] INFO <TopicWatcher:37> [ault.svc/...] KafkaTopic watch received event ADDED on resource nutmeg-sit with labels {strimzi.io/cluster=c} [2018-12-12 12:49:41,565] INFO <opicOperator:419> [oop-thread-0] Reconciling topic nutmeg-sit, k8sTopic:null, kafkaTopic:nonnull, privateTopic:nonnull [2018-12-12 12:49:41,565] INFO <opicOperator:319> [oop-thread-0] Deleting topic 'nutmeg-sit' [2018-12-12 12:49:41,586] INFO <opicOperator:365> [oop-thread-0] Success reconciling KafkaTopic null [2018-12-12 12:49:41,592] INFO <opicOperator:419> [oop-thread-0] Reconciling topic nutmeg-sit, k8sTopic:nonnull, kafkaTopic:null, privateTopic:null [2018-12-12 12:49:41,599] ERROR <TopicWatcher:49> [oop-thread-0] Failure processing KafkaTopic watch event ADDED on resource nutmeg-sit with labels {strimzi.io/cluster=c}: Topic 'nutmeg-sit' already exists. org.apache.kafka.common.errors.TopicExistsException: Topic 'nutmeg-sit' already exists. [2018-12-12 12:49:41,602] WARN <opicOperator:96> [oop-thread-0] Failure processing KafkaTopic watch event ADDED on resource nutmeg-sit with labels {strimzi.io/cluster=c}: Topic 'nutmeg-sit' already exists. [2018-12-12 12:49:41,609] INFO <opicsWatcher:79> [oop-thread-0] Deleted topics: [nutmeg-sit] [2018-12-12 12:49:41,616] INFO <opicOperator:419> [oop-thread-1] Reconciling topic nutmeg-sit, k8sTopic:nonnull, kafkaTopic:null, privateTopic:null [2018-12-12 12:49:41,628] INFO <opicsWatcher:94> [oop-thread-0] Created topics: [nutmeg-sit] [2018-12-12 12:49:41,637] INFO <opicOperator:192> [oop-thread-1] Created topic 'nutmeg-sit' for KafkaTopic 'nutmeg-sit' [2018-12-12 12:49:41,651] INFO <opicOperator:419> [oop-thread-0] Reconciling topic nutmeg-sit, k8sTopic:nonnull, kafkaTopic:nonnull, privateTopic:nonnull [2018-12-12 12:49:41,651] INFO <opicOperator:559> [oop-thread-0] All three topics are identical
The topic in question is
nutmeg-sit
- both attempting to delete topic using CLI and CRD fails. Doing both at the same time also fails.The text was updated successfully, but these errors were encountered: