-
Notifications
You must be signed in to change notification settings - Fork 319
feat(Python-client):add dns resolution support #2306
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
base: master
Are you sure you want to change the base?
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 adds DNS resolution support to the Python Pegasus client to improve resilience when meta servers become unavailable. When meta server queries fail, the client now attempts to re-resolve DNS hostnames to obtain potentially updated IP addresses, allowing the client to recover from IP address changes without requiring a restart.
Key changes:
- DNS resolution capability for both IPv4 (A records) and IPv6 (AAAA records) hostnames
- Automatic re-resolution and stale session cleanup when all meta servers fail
- Enhanced host_port type system to distinguish between IPv4, IPv6, and mixed address groups
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| python-client/pypegasus/pgclient.py | Implements DNS resolution logic, adds re-resolution on query failures, refactors meta server initialization to be asynchronous |
| python-client/pypegasus/base/ttypes.py | Updates host_port_types enum to include IPv6 type and reorder Group type |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
0c1a543 to
541fb52
Compare
|
@WJSGDBZ Could you please add some simple tests, and fix the conflicts |
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
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Sure, I've already added the test process above. |
The conflict is still exist :( |
Thanks for the reminder, the conflict has been resolved. |
What problem does this PR solve?
add dns resolution support
What is changed and how does it work?
When the Pegasus operation times out, it will attempt to fetch the topology from meta. If all meta servers fail to respond, it will try to re-resolve the DNS to obtain new IP addresses.
Checklist
Tests
Objective: Validate DNS resolution failover mechanism in
resolve_all_ipsfunction.Steps:
Modify
resolve_all_ipsto force initial DNS resolution to Onebox (127.0.0.1).when client fail to query server after 5 times, dns-resolve will be trigger.
second in resolve_all_ips , it will truly resolve hostname to ip address, and start to query real server.
Real test process as follow