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

Do not re-create subscription on sequence update #7939

Closed
joke opened this issue May 27, 2024 · 1 comment · Fixed by #7948
Closed

Do not re-create subscription on sequence update #7939

joke opened this issue May 27, 2024 · 1 comment · Fixed by #7948
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Issues which should be fixed (post-triage)

Comments

@joke
Copy link

joke commented May 27, 2024

Describe the bug
If a sequence is updated with a new retry configuration the subscription is re-created.

In case of a KafkaChannel a new consumer group is created. Thus messages might be dropped.

Expected behavior
The subscription is updated in-place rather than re-created.

To Reproduce
Knative Kafka Broker needs to be installed: https://github.com/knative-extensions/eventing-kafka-broker

Create sequence:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: first
spec:
  template:
    spec:
      containers:
        - image: gcr.io/knative-releases/knative.dev/eventing/cmd/appender
          env:
            - name: MESSAGE
              value: " - Handled by 0"

---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: second
spec:
  template:
    spec:
      containers:
        - image: gcr.io/knative-releases/knative.dev/eventing/cmd/appender
          env:
            - name: MESSAGE
              value: " - Handled by 1"
---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: third
spec:
  template:
    spec:
      containers:
        - image: gcr.io/knative-releases/knative.dev/eventing/cmd/appender
          env:
            - name: MESSAGE
              value: " - Handled by 2"
---
apiVersion: flows.knative.dev/v1
kind: Sequence
metadata:
  name: sequence
spec:
  channelTemplate:
    apiVersion: messaging.knative.dev/v1beta1
    kind: KafkaChannel
    spec:
      numPartitions: 1
      replicationFactor: 3
  steps:
    - ref:
        apiVersion: serving.knative.dev/v1
        kind: Service
        name: first
      delivery:
        backoffDelay: PT1S
        backoffPolicy: linear
        retry: 5
    - ref:
        apiVersion: serving.knative.dev/v1
        kind: Service
        name: second
      delivery:
        backoffDelay: PT1S
        backoffPolicy: linear
        retry: 5
    - ref:
        apiVersion: serving.knative.dev/v1
        kind: Service
        name: third
      delivery:
        backoffDelay: PT1S
        backoffPolicy: linear
        retry: 5

The subscriptions should have been created.

$ kubectl get subscription
NAME                     AGE   READY   REASON
sequence-kn-sequence-0   14s   True    
sequence-kn-sequence-1   14s   True    
sequence-kn-sequence-2   14s   True    

Modify the sequence and update the delivery spec on step 2 -> retry: 7 or something

$ kubectl get  subscription     
NAME                     AGE     READY   REASON
sequence-kn-sequence-0   4m9s    True    
sequence-kn-sequence-1   5s         True    
sequence-kn-sequence-2   4m9s    True

The second subscription is re-created.

Knative release version

Knative 1.13 and below. Most likely 1.14 is affected as well.

@joke joke added the kind/bug Categorizes issue or PR as related to a bug. label May 27, 2024
@Cali0707
Copy link
Member

/triage accepted
/assign

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Issues which should be fixed (post-triage)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants