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/sync): report last synced version #14194

Closed
wants to merge 1 commit into from

Conversation

StarlightIbuki
Copy link
Contributor

Summary

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

KAG-6223

@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
@StarlightIbuki StarlightIbuki changed the title fix(sync): report last synced version fix(clustering/sync): report last synced version Jan 20, 2025
@@ -402,7 +402,7 @@ function sync_once_impl(premature, retry_count)
local current_version = get_current_version()
if current_version >= latest_notified_version then
ngx_log(ngx_DEBUG, "version already updated")
return
return sync_handler() -- one more call to report CP the latest version synced
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain the reason? Why we should do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the original behavior, where we rely on an extra call to tell the CP, that DP is on the latest version. Only with a "get_delta" call does CP gets the DP's 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.

I'm kind of impressed with the design, but not all of it, do you know where the documentation is?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that CP don't care about DP's version, what it will cause in CP?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think UI needs this version.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we do need this, could we call get_delta by notification?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chronolaw That's a breaking change. Let's keep it untouched

@chronolaw
Copy link
Contributor

I opened another similar PR for this, could you take a look? #14205

@StarlightIbuki
Copy link
Contributor Author

I opened another similar PR for this, could you take a look? #14205

That should also work. I choose to do it like this because this is what we used to do. If you prefer notification over this, I'm okay with it.
One advantage of your solution is that it does not require holding the lock as the response is ignored and the config is untouched. I would suggest you start a timer to notify CP, so the lock can be released immediately. This would benefit paginated sync (to unblock proxy traffic)

@chronolaw chronolaw deleted the fix/dp-ver-report branch January 21, 2025 08:43
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/XS skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants