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

fix: candidate controllers missing Forget call in workqueue #2308

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

Revolyssup
Copy link
Contributor

@Revolyssup Revolyssup commented Oct 13, 2024

Users encountered the error:

2024-10-02T19:24:30+08:00 [31merror[0m adapter/etcd.go:141 failed to create object, ignore it{error 26 0 rpc error: code = InvalidArgument desc = etcdserver: duplicate key given in txn request} {revision 11 625 <nil>} {key 15 0 /apisix/global_rules/c6bbeaf1 <nil>}

This error only comes for global rule and only comes in candidate controllers.
Reason:
In current logic, the candidate controllers miss the .Forget() call on the successfully processed object and re-add the object in the workqueue. This fix makes sure that event is removed from the queue when object is processed successfully.

How to reproduce the bug:

  1. Run make kind-up
  2. Modify replica to 3 and apply samples/deploy/composite.yaml
  3. Create an ApisixGlobalRule.
  4. Check logs of follower pod and there should be error log as shown above.

Steps To Verify fix:

  1. make build-image with this commit.
  2. Load image in cluster.
  3. Run make kind-up
  4. Modify replica to 3, modify image to the image created in step 1 and apply samples/deploy/composite.yaml
  5. Create an ApisixGlobalRule.
  6. Check logs of follower pod and there should be no error log as shown above.

@Revolyssup Revolyssup merged commit 2458b78 into apache:master Oct 14, 2024
79 checks passed
@Revolyssup Revolyssup deleted the revolyssup/fix-event-readd branch October 14, 2024 15:56
Revolyssup added a commit to Revolyssup/apisix-ingress-controller that referenced this pull request Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants