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(clustering): report node version in sync #13844

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

Conversation

chronolaw
Copy link
Contributor

@chronolaw chronolaw commented Nov 7, 2024

Summary

May change after KAG-5369 and #13887
KAG-5772

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 7, 2024
@chronolaw chronolaw changed the title feat(clustering): report node version in sync fix(clustering): report node version in sync Nov 7, 2024
@pull-request-size pull-request-size bot added size/S and removed size/XS labels Nov 7, 2024
@chronolaw chronolaw force-pushed the feat/add_kong_version_for_sync branch 2 times, most recently from 9546acb to af1f6b8 Compare November 7, 2024 22:38
@chronolaw chronolaw marked this pull request as ready for review November 14, 2024 02:02
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.

This does not seems to be the right approach, it should ideally be done as part of "RPC handshake method change" work, as node version will not change between calls.

@chronolaw chronolaw marked this pull request as draft November 14, 2024 12:09
@chronolaw chronolaw force-pushed the feat/add_kong_version_for_sync branch from d11e6f5 to 0a9f335 Compare November 16, 2024 00:56
@pull-request-size pull-request-size bot added size/M and removed size/S labels Nov 16, 2024
@chronolaw chronolaw marked this pull request as ready for review November 16, 2024 01:04
@chronolaw
Copy link
Contributor Author

@dndx I have changed the implementation, could you take a look again? thanks.

@StarlightIbuki
Copy link
Contributor

This does not seems to be the right approach, it should ideally be done as part of "RPC handshake method change" work, as node version will not change between calls.

+1. Please consider redesign the solution

kong/clustering/rpc/manager.lua Outdated Show resolved Hide resolved
@@ -79,13 +80,14 @@ function _M:init_cp(manager)

-- { default = { version = 1000, }, }
local default_namespace_version = default_namespace.version
local node_info = assert(kong.rpc:get_peer_info(node_id))
Copy link
Contributor

@chobits chobits Nov 18, 2024

Choose a reason for hiding this comment

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

For other reviewers, if assertion failed, it will break up a single timer runtime, so it's safe for CP.

  • kong/clustering/rpc//socket.lua: callback is runned in a timer
        -- call dispatch
        local res, err = kong.timer:named_at(string_format("JSON-RPC callback for node_id: %s, id: %d, method: %s",
                                                           self.node_id, payload.id, payload.method),
                                                           0, _M._dispatch, self, dispatch_cb, payload)

@chronolaw chronolaw marked this pull request as draft November 18, 2024 09:05
@StarlightIbuki
Copy link
Contributor

This seems to be going to be covered by a new change. Are we going to close this?

@chronolaw chronolaw added this to the 3.9.0 milestone Nov 20, 2024
@chronolaw chronolaw force-pushed the feat/add_kong_version_for_sync branch from 8630f2c to edc253a Compare November 20, 2024 22:39
@chronolaw chronolaw marked this pull request as ready for review November 20, 2024 22:53
@chronolaw
Copy link
Contributor Author

This seems to be going to be covered by a new change. Are we going to close this?

This PR is re-implemented to work with meta rpc call.

@chronolaw
Copy link
Contributor Author

@dndx , could you take a look and approve it? thanks.

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/M skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants