-
Notifications
You must be signed in to change notification settings - Fork 53
spqr-ping #1168
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a fast ping handler that bypasses TLS requirements for quick health checks.
- Added ping detection logic in the router to route “spqr-ping” requests to a dedicated ping handler.
- Introduced a new preRoutePingPong function to assign the ping rule and process ping requests.
- Implemented a Ping method in the client interactor to send back a “pong” response.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
router/rulerouter/rulerouter.go | Added debug logging and ping detection logic along with a dedicated preRoutePingPong function. |
router/instance/instance.go | Extended connection handling to process ping requests and send appropriate backend messages. |
pkg/clientinteractor/interactor.go | Implemented the Ping method to handle ping requests by writing header and data row messages. |
6f75f44
to
8ac1d7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a fast ping handler for connections with "spqr-ping" that bypasses TLS checks. Key changes include:
- Routing logic updates to detect "spqr-ping" in both the RuleRouter and Instance implementations.
- Implementation of a new preRoutePingPong function to assign rules and handle ping-specific authentication.
- An added ReadyForQuery method in the PSQLInteractor for sending backend messages during ping.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
router/rulerouter/rulerouter.go | Adds spqr-ping routing support via preRoutePingPong function. |
router/instance/instance.go | Integrates spqr-ping handling by sending ping messages and processing responses. |
pkg/clientinteractor/interactor.go | Introduces a new ReadyForQuery method for ping response handling. |
893b70d
to
e5c6cfa
Compare
It works
|
Take into account sslmode:
|
The main idea is to add a fast ping handler without tls requirements.