feat(dns): Add configurable DNS SRV priority on a per-service-instance basis. - #23729
Open
drawks wants to merge 1 commit into
Open
feat(dns): Add configurable DNS SRV priority on a per-service-instance basis.#23729drawks wants to merge 1 commit into
drawks wants to merge 1 commit into
Conversation
drawks
marked this pull request as ready for review
July 11, 2026 01:22
Contributor
Author
|
@nitin-sachdev-29 @hashi-derek @srahul3 I see the 3 of you as reviewers and/or code owners in other similar PRs that have been merged. Is there anything I can do to get a reviewer assigned to this? |
Contributor
Author
|
ping... Anyone want to give me a review here? I hate to sound like a broken record, but it is still kind of maddening that hashicorp maintainers are so generally unresponsive to external contributions, while clearly being active in various other PRs. My last, single line PR, took 2 months before it got a review. I'll repeat what I said then, It is ridiculous that hashicorp was very eager to send me a t-shirt that proclaims that I am a "core contributor" while also seeming to have no interest in even commenting on my contributions. |
1. Add optional per-service priority to config, registration, catalog,
transaction, and protobuf service models.
2. Use configured priorities in SRV responses while preserving the
default priority of 1.
Resolves hashicorp#23728
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces an optional priority field (0-65535) for service definitions to natively support RFC 2782 failover routing.
DNS SRV responses use the configured value for node, IP, FQDN, and prepared-query results; A/AAAA responses remain unchanged.
This change only affects SRV record construction. It does not change health filtering, weight calculation or prepared-query result selection.
When priority is unset the default priority is left at
1preserving existing behavior. Explicit priority0remains distinguishable from an unset value.While this feature is quite small it required a lot of mechanical fiddling; the implementation follows the service-definition config checklist and was modeled after #22769 and #16581 which both added a service config field.
The new priority field has been plumbed through the service registration lifecycle, from the API and protobuf layers down to the catalog and peering state.
There is no data migration. Reverting this PR is sufficient to roll back the feature; older code will continue using the existing fixed SRV priority.
Testing & Reproduction steps
go run . agent -devfrom the root directory.prioritysetconsul services register ./myservice.hclcurl localhost:8500/v1/catalog/service/my-servicedig @127.0.0.1 -p 8600 my-service.service.consul. SRVLinks
Resolves #23728
PR Checklist
PCI review checklist