RFC Errata
RFC 2782, "A DNS RR for specifying the location of services (DNS SRV)", February 2000
Note: This RFC has been updated by RFC 6335, RFC 8553
Source of RFC: dnsext (int)
Errata ID: 8120
Status: Reported
Type: Technical
Publication Format(s) : TEXT
Reported By: Tomasz Śniatowski
Date Reported: 2024-09-25
Section Fictional example says:
; foobar - use old-slow-box or new-fast-box if either is ; available, make three quarters of the logins go to ; new-fast-box. _foobar._tcp SRV 0 1 9 old-slow-box.example.com. SRV 0 3 9 new-fast-box.example.com.
It should say:
; foobar - use old-slow-box or new-fast-box if either is ; available, make approximately three quarters of the logins ; go to new-fast-box. The actual ratio will be between 3/5 ; and 4/5 due to how the weighing algorithm is specified. _foobar._tcp SRV 0 1 9 old-slow-box.example.com. SRV 0 3 9 new-fast-box.example.com.
Notes:
The comment in the fictional example does not match the weighing algorithm described in the Weight section. Because the running sum is used to generate a random number from 0 to the sum (inclusive), there are (sum + 1) possibilities of the outcome. In the absence of 0-weight records, the first record receives increased pick-chance. A similar concern was brought up in the (rejected) Errata ID: 2984 for RFC2782, which was for the weight section. This errata is for the example only.
The ordering of the records is not specified, for non-zero weight records it is explicitly "any order". Thus, for weights 3 and 1, a conforming implementation may:
1) always sort the 1-weight record first, and obtain 2/5 and 3/5 probabilities for 1 and 3 respectively
2) always sort the 3-weight record first, and obtain 1/5 and 4/5 probabilities for 1 and 3 respectively
3) have an random sorting method, obtaining probabilities anywhere between the two above. If a fair random shuffle is used, the probabilities will be 3/10 and 7/10 (the average of 1 and 2 above).
It is unlikely for the distribution of results for weights 1 and 3 to be 1/4 and 3/4. This quirk of the algorithm is not obvious, and the example could do better at indicating the factual state. As it is, it is misleading. It is significant in that it may lead someone to believe an implementation is incorrect (not achieving the expected 1/4-3/4 split) when it is implementing the weights algorithm exactly as in the Weights section.