Skip to content
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

[Bug]: Infinite topic sync in topic operator #10380

Closed
padilo opened this issue Jul 24, 2024 · 5 comments · Fixed by #10451
Closed

[Bug]: Infinite topic sync in topic operator #10380

padilo opened this issue Jul 24, 2024 · 5 comments · Fixed by #10451

Comments

@padilo
Copy link
Contributor

padilo commented Jul 24, 2024

Bug Description

When the specs on an unmanaged KafkaTopic resource (annotated with strimzi.io/managed="false") is different from the topic on the cluster, the topic operator enters a loop and continuously tries updates the resourceVersion.

Seems like it's trying to consolidate the state, but as is unmanaged it can't and continues in the loop forever.

Steps to reproduce

You can do the following script:

helm install strimzi-cluster-operator --set replicas=1 --version 0.42.0 oci://quay.io/strimzi-helm/strimzi-kafka-operator

# Create Kafka cluster:
kubectl apply -f - <<EOF 
apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
  name: my-kafka
spec:
  kafka:
    replicas: 1
    listeners:
      - name: plain
        port: 9092
        type: internal
        tls: false
    storage:
      type: persistent-claim
      size: 1Gi
  zookeeper:
    replicas: 1
    storage:
      type: persistent-claim
      size: 1Gi

  entityOperator:
    topicOperator: {}
EOF
kubectl wait --for=condition=ready --timeout=10m kafka/my-kafka

# Create a topic
kubectl apply -f - <<EOF
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
  name: sync-test
  labels:
    strimzi.io/cluster: my-kafka
spec:
  replicas: 1
  partitions: 1
  config:
    retention.ms: 432000000
EOF

sleep 5

# Annotate topic as unmanaged
kubectl annotate kafkatopic sync-test strimzi.io/managed="false"

# Path the topic with updated retention
kubectl patch kafkatopic sync-test --type='merge' -p '{"spec": {"config": {"retention.ms": "432000001"}} }'

Expected behavior

Topic operator should entirely ignore the KafkaTopic resources if it is set to unmanaged

Strimzi version

0.42.0

Kubernetes version

Kubernetes 1.30.0

Installation method

helm chart

Infrastructure

Kind, also confirmed with EKS

Configuration files and logs

all relevant stuff is already in the steps to reproduce

Additional context

I would like to work on this issue :)

@ppatierno
Copy link
Member

@fvaleri FYI this is coming from the related Slack thread.

@fvaleri
Copy link
Contributor

fvaleri commented Jul 24, 2024

@padilo I can confirm the issue, nice catch and report.

I would like to work on this issue :)

Please, go on. I will be happy to review.

@scholzj
Copy link
Member

scholzj commented Aug 8, 2024

Triaged on the Community call on 8.8.2024: This is a valid issue and should be fixed.

@scholzj
Copy link
Member

scholzj commented Aug 8, 2024

@padilo Do you still plan to open a PR for this? It would be great to have this fixed. Thanks.

@padilo
Copy link
Contributor Author

padilo commented Aug 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants