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(targets): targets can't be removed from dns query queue #14298

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

liverpool8056
Copy link
Contributor

@liverpool8056 liverpool8056 commented Feb 20, 2025

Summary

For the deployment that multiple kong instances in traditional mode share the same database, when there are updates in targets via admin API happening on one of the instances, the related targets can not be removed from the DNS query queue via cluster events notification broadcasted by the initial instance.

This issue is that the payload in the cluster event broadcasted from other instances only contains the upstream ID attached to the target. However, the handler that is eventually supposed to consume the payload expects a target entity.
The issue is not caused by an incorrect payload in the cluster event, because the payload of a cluster event is transmitted via the database. Therefore, passing a smaller and simpler payload is a wise choice, whereas a complete target entity obviously has a more complex data structure.

In this PR, a list of all the related targets is retrieved from cached with the upstream id, and they are all removed from the queue. This is an acceptable approach as the related balancer entity will be reconstructed right away, meanwhile, all dns queries for the valid targets will be rescheduled as well.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

FTI-6469

query queue when they are deleted via admin API.

FTI-6469
@github-actions github-actions bot added core/balancer cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Feb 20, 2025
@chronolaw chronolaw changed the title fit(targets): targets can't be removed from dns query queue fix(targets): targets can't be removed from dns query queue Feb 20, 2025
@@ -0,0 +1,3 @@
message: fixed an issue where targets can't be removed from dns query query if they are deleted or updated via admin API.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two query query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee core/balancer size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants