jifyang opened a new issue #1812: The default initial position for synthesizing 
zero hashes should be changed
URL: https://github.com/apache/incubator-trafficcontrol/issues/1812
 
 
   In delivery service steering, the response isn't correct if config two or 
more targets whose types are STEERING_ORDER and values are negative.
   
   Root cause analysis:
   
   In function synthesizeZeroHashes(), if hashableMap is empty, the initial 
position for putting the zero hashable with negative order value will be 0 (the 
variable minHash).
   
   In the following process, 0 will be selected as the hash value for the first 
zero hashable, then the negative values -1, -2, ... in type long will be tried 
to generate the hash value in type double for the other zero hashables. There 
are three issues:
   
   1. The NaN will be generated as the hash value next to the hash value 0. 
This will cause wrong result.
   
   2. There are a large number of negative values -1, -2, ... in type long will 
be mapped to NaN in type double. This will consume much computation and cause 
slow response.
   
   3. The negative values in type long and type double aren't correct in this 
scenario. For the negative values, the value in double type is ascending when 
the value in type long is descending (ref the function getSafeHash).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to