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

feat(clustering/rpc): update dp status after syncing #14205

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

chronolaw
Copy link
Contributor

Summary

KAG-6223

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 Jan 20, 2025
@chronolaw chronolaw marked this pull request as ready for review January 21, 2025 01:29
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.

The solution should work. An improvement is possible


-- version changed, we should update status
if version_before_sync ~= current_version then
update_status(current_version)
Copy link
Contributor

Choose a reason for hiding this comment

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

We could start a timer to call the notification here as it ignores the response , so to release the lock quicker

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The rpc notification is very cheap, I think that we need not to run a new timer here.

Copy link
Contributor

@chobits chobits Jan 21, 2025

Choose a reason for hiding this comment

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

i checked the inside logic of notify, there's no block logic, at last, it will call msg push, is it right ? so i think we do not need to introduce a timer

final logic of notify()

notify
-> fut.start
  -> socket: call
    -> 
-- asynchronously start executing a RPC, _node_id is not
-- needed for this implementation, but it is important
-- for concentrator socket, so we include it just to keep
-- the signature consistent
function _M:call(node_id, method, params, callback)
  assert(node_id == self.node_id)

  local id

  -- notification has no callback or id
  if callback then
    id = self:_get_next_id()
    self.interest[id] = callback
  end

  return self:push_request({
    jsonrpc = jsonrpc.VERSION,
    method = method,
    params = params,
    id = id,
  })
end

@StarlightIbuki
Copy link
Contributor

@chronolaw @ADD-SP Let's move this PR forward and after merging this we can close #14194

@ADD-SP ADD-SP added the incomplete-cherry-pick A cherry-pick was incomplete and needs manual intervention label Jan 21, 2025
@chronolaw chronolaw force-pushed the feat/update_status_after_sync branch from e907f8c to c894e85 Compare January 21, 2025 07:59
@ADD-SP ADD-SP merged commit f657890 into master Jan 22, 2025
26 checks passed
@ADD-SP ADD-SP deleted the feat/update_status_after_sync branch January 22, 2025 01:20
@chronolaw
Copy link
Contributor Author

Cherry-pick is blocked by #14195 .

@chronolaw chronolaw removed the incomplete-cherry-pick A cherry-pick was incomplete and needs manual intervention label Jan 22, 2025
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.

4 participants