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

refactor(clustering/rpc): dp does not need concentrator #13829

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

Conversation

chronolaw
Copy link
Contributor

Summary

KAG-5730

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

Fix #[issue number]

@github-actions github-actions bot added core/clustering cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Nov 5, 2024
@chronolaw chronolaw marked this pull request as ready for review November 5, 2024 02:09
Copy link
Member

@dndx dndx left a comment

Choose a reason for hiding this comment

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

Does _find_node_and_check_capability needs updating and check as well?

@chronolaw
Copy link
Contributor Author

chronolaw commented Nov 5, 2024

Does _find_node_and_check_capability needs updating and check as well?

No, in DP it should always return local. In CP it will query DB to find DP node.

Adding an assert to ensure it.

Copy link
Contributor

@StarlightIbuki StarlightIbuki left a comment

Choose a reason for hiding this comment

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

not a blocker

self.concentrator = concentrator.new(self, kong.db)
if conf.role == "control_plane" then
self.concentrator = require("kong.clustering.rpc.concentrator").new(self, kong.db)
self.client_ips = {} -- store DP node's ip addr
Copy link
Contributor

Choose a reason for hiding this comment

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

What about make client_ips a part of concerntrator

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure about it, but I think collecting ip addresses is not the responsibility of concentrator.


if self.concentrator then
self.client_ips[node_id] = nil
assert(self.concentrator:_enqueue_unsubscribe(node_id))
Copy link
Contributor

Choose a reason for hiding this comment

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

and so it can be a part of unsubscribe

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/clustering size/S skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants