Copilot commented on code in PR #2712:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/2712#discussion_r3238885311


##########
docs/en/latest/FAQ.md:
##########
@@ -35,8 +35,8 @@ This document provides answers to frequently asked questions 
(FAQ) when using AP
 In APISIX, a higher value indicates a higher route priority.
 
 * **Ingress:** Does not support explicit route priority. Routes created using 
Ingress are assigned a default priority of 0, typically the lowest.
-* **HTTPRoute:** Has a [38-bit 
priority](https://github.com/apache/apisix-ingress-controller/blob/master/internal/adc/translator/httproute.go#L428-L448).
 The priority calculation is dynamic and may change, making exact values 
difficult to predict.
-* **APISIXRoute:** Can be assigned an explicit priority. To have a higher 
priority than an HTTPRoute, the value must exceed 549,755,813,887 (2^39 − 1).
+* **HTTPRoute:** Has a [38-bit 
priority](https://github.com/apache/apisix-ingress-controller/blob/c48e9b3fb8d269b04b440c6fc5ed6880c05456f3/internal/adc/translator/httproute.go#L455-L472).
 The priority calculation is dynamic and may change, making exact values 
difficult to predict.
+* **APISIXRoute:** Can be assigned an explicit priority. To have a higher 
priority than an HTTPRoute, the value must exceed 274,877,906,943 (2^38 − 1).

Review Comment:
   The new threshold for APISIXRoute priority looks incorrect. 
`calculateHTTPRoutePriority` sets `maxNonWildcardLength << 31` with up to 8 
bits of hostname length (bits 31–38), so HTTPRoute priority can exceed 2^38−1 
(e.g., hostname length >= 128 already yields a value >= 2^38). If the intent is 
to document a safe value that always exceeds any HTTPRoute priority, the bound 
should be based on the highest used bit (bit 38), i.e. >= 2^39 (or > 2^39−1), 
and the text '38-bit priority' likely needs to be updated/clarified accordingly.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to