forked from PelicanPlatform/pelican
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify sort algorithm to treat unresolvable IP addresses as random
The underlying issue relates to the "Kansas" problem, where valid IP addresses that don't have a known GeoIP resolution are assigned the default Kansas lat/long. This approach is _slightly_ different when compared to the GH issue, but I think it resolves the issue in a simpler fashion. Rather than incorporate logic that says "if Kansas AND large accuracy radius", this only looks at accuracy radius because a high radius, set to 900 km here, is as good as "I don't know where this IP comes from". When we see such a radius, we set the lat/long to null (0,0) -- and this happens for both client IPs AND server registrations. The sort logic was modified to detect any null lat/long and create a random, negative distance weight for these. The result is we sort these to the end of our list. If the client IP is null, everything gets sorted to the end of the list, so we either follow a load-aware sorting only (if sort method is distanceAndLoad/adaptive) or completely random (if sort method is distance). When this happens with a server IP but not the client IP, that server is sorted behind other servers with a valid distance. Finally, the Director logs errors when either of these situations occur. On startup, a director run in OSDF mode spits out the origins/caches that currently have no GeoIP resolution as a WARNING that mentions the accuracy radius, and does the same for client requests. This is handled differently for IP addresses that are invalid (perhaps because they come from a private IP range), with an error that indicates a true null.
- Loading branch information
1 parent
ca1739f
commit 9491fce
Showing
5 changed files
with
121 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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