Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

KafkaChannel subscribers list ends up with duplicate subscribers for the same subscription. This results in duplicate dispatches. #1560

Closed
ntzlqx opened this issue Sep 11, 2020 · 20 comments
Assignees
Labels
area/kafka channel/kafka Kafka channel related issue kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@ntzlqx
Copy link

ntzlqx commented Sep 11, 2020

Describe the bug
Duplicate messages are dispatched to the same knative function

Expected behavior
Events are not duplicated

To Reproduce
I believe the issue occurs upon manual deletion of a subscription, but could be also upon upgrade (not verified)
Another way to replicate: Edit the broker config to add delivery options. This results in recreating all subscriptions and respectively all subscribers are recreated. You will see duplicate subscribers added to the subscribers list of the kafkachannel

Knative release version
0.17.3
Additional context
Editing manually the KafkaChannel subscribers list corrects the issue

@ntzlqx ntzlqx added the kind/bug Categorizes issue or PR as related to a bug. label Sep 11, 2020
@slinkydeveloper
Copy link
Contributor

/assign

@slinkydeveloper
Copy link
Contributor

@ntzlqx I tried to remove and create a sub again using a clean 0.17.3 setup, but i don't see any issue. Can you please provide a reproducer code/reproducer script?

Can you post the log (in debug mode) of kafka-ch-controller & kafka-ch-dispatcher when the issue happens?

@matzew
Copy link
Member

matzew commented Sep 14, 2020

I think knative/eventing#4042 is related here

/cc @pierDipi

@lionelvillard
Copy link
Member

@slinkydeveloper
Copy link
Contributor

@matzew I'm not sure it's related to knative/eventing#4042, it seems more some corner case of the controller logic...

@slinkydeveloper
Copy link
Contributor

Is this issue still relevant?

@ntzlqx
Copy link
Author

ntzlqx commented Nov 6, 2020

I have not tested this...
The issue occurred when editing broker delivery section, I am going to do this today and see if duplicate subscribers appear

@slinkydeveloper
Copy link
Contributor

Thanks!

@ntzlqx
Copy link
Author

ntzlqx commented Nov 6, 2020

Just tested...and did get a duplicate set of subscribers...interestingly not a complete set...
I changed the backoffDelay and backoffPolicy on the broker
All subscriptions got recreated
A new set of subscribers appeared in the kafkaChannel subscribers list (with the new delivery config)
but "stale" subscribers(with the old delivery config) still linger on in the subscribers' list
I suspect this will result in duplicate event delivery as it did when I opened the issue

@slinkydeveloper
Copy link
Contributor

Which version are you testing on?

@ntzlqx
Copy link
Author

ntzlqx commented Nov 6, 2020

0.18

@ntzlqx
Copy link
Author

ntzlqx commented Nov 6, 2020

I just manually deleted the stale ones - I have 20 subscribers - 7 remained as duplicates with the old config

@slinkydeveloper
Copy link
Contributor

slinkydeveloper commented Nov 9, 2020

I'm not sure how i can help you without any reproducer, I'm sorry 😞 Can you try to dig into the logs of the kafka channel controller and of eventing-controller to check if there's anything suspect?

@ntzlqx
Copy link
Author

ntzlqx commented Nov 12, 2020

Sorry for the delay...I will try to capture the log from the controller now

@ntzlqx
Copy link
Author

ntzlqx commented Nov 12, 2020

The steps i am following:

  1. Edit the the event delivery spec on the broker
  2. Check the list of subscribers on the Kafka Channel for duplicates

@ntzlqx
Copy link
Author

ntzlqx commented Nov 12, 2020

I got 8 duplicate subscribers out of 20 this time

@ntzlqx
Copy link
Author

ntzlqx commented Nov 12, 2020

kafkaChController.log

Please find the attached log... I can reproduce the issue at will as described above

@slinkydeveloper
Copy link
Contributor

@devguyio is this related to the status thing you've been working on recently? Can you check it please?

@devguyio
Copy link
Contributor

This might get fixed by knative-extensions/eventing-kafka#182 once it lands.
/assign
/unassign @slinkydeveloper

@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/kafka channel/kafka Kafka channel related issue kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

5 participants