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(testing): add reconfiguration completion detection mechanism #11581

Merged
merged 3 commits into from
Nov 6, 2023

Conversation

hanshuebner
Copy link
Contributor

@hanshuebner hanshuebner commented Sep 15, 2023

Summary

Superseded by #11941

This change adds a new response header X-Kong-Transaction-Id to the Admin API. It contains the (ever incrementing) PostgreSQL transaction ID of the change that was made. The value can then be put into the X-If-Kong-Transaction-Id variable in a request to the proxy path. The request will be rejected with a 503 error if the proxy path has not been reconfigured yet with this or a later transaction id.

The mechanism is useful in testing, when changes are made through the Admin API and the effects on the proxy path are then to be verified. Rather than waiting for a static period or retrying the proxy path request until the expected result is received, the proxy path client specifies the last transaction ID received from the Admin API in the X-If-Kong-Transaction-Id header and retries the request if a 503 error
is received.

Docs:

Checklist

  • The Pull Request has tests
  • A changelog file has been added to CHANGELOG/unreleased/kong or adding skip-changelog label on PR if 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-2759

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

This PR is marked as stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Oct 5, 2023
@hanshuebner hanshuebner changed the title feat(testing): add X-Kong-If-Reconfigured-Since header feat(testing): add reconfiguration completion detection mechanism Oct 25, 2023
@hanshuebner hanshuebner mentioned this pull request Oct 25, 2023
3 tasks
@hanshuebner hanshuebner force-pushed the feat/reconfiguration-detection branch 2 times, most recently from 4d2121c to 0ef54bc Compare October 26, 2023 08:56
@hanshuebner hanshuebner marked this pull request as ready for review October 26, 2023 09:27
@hanshuebner hanshuebner removed the stale label Oct 26, 2023
This change adds a new response header X-Kong-Transaction-Id to the
Admin API.  It contains the (ever incrementing) PostgreSQL transaction
ID of the change that was made.  The value can then be put into the
X-If-Kong-Transaction-Id variable in a request to the proxy path.  The
request will be rejected with a 503 error if the proxy path has not
been reconfigured yet with this or a later transaction id.

The mechanism is useful in testing, when changes are made through the
Admin API and the effects on the proxy path are then to be verified.
Rather than waiting for a static period or retrying the proxy path
request until the expected result is received, the proxy path client
specifies the last transaction ID received from the Admin API in the
X-If-Kong-Transaction-Id header and retries the request if a 503 error
is received.
@hanshuebner hanshuebner merged commit 073fcff into master Nov 6, 2023
24 checks passed
@hanshuebner hanshuebner deleted the feat/reconfiguration-detection branch November 6, 2023 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants