-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multiple directors / HA federations #2023
Open
bbockelm
wants to merge
9
commits into
PelicanPlatform:main
Choose a base branch
from
bbockelm:multi_director
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
d1b7de5
to
9994523
Compare
c4cd075
to
031b8b8
Compare
When `Range` was called on an empty ttlcache object, the older version of ttlcache would trigger a process panic.
We will need version information initialized in the `server_structs` module; having `server_structs` include the `config` module for the version information causes a circular dependency. This factors out the version-related calls (keeping backward API compatibility) into a new module, breaking the dependency.
With this, an empty configuration string indicates to use the default.
The common base includes the name -- but also the version number, a process/instance identifier, and a generation number. The instance ID and generation number provide a total ordering for all ads generated by the name/type of ad. This will allow a process to compare any two ads and determine which one is the "newer" of the two. This will allow the director to keep the right ad in memory even if it receives them out-of-order.
The director ad needs to be able to determine its own name, just like the cache and origin. Pull these into a single location. There's a need for future improvements -- the service should persist its currently registered name -- but this simple refactor should suffice for this line of work.
This provides a helper function to ensure we consistently calculate the audience value for our token configuration.
Provide a framework for any service to detect the presence of multiple director services in a federation, whether from static configuration, from metadata discovery, or from querying known directors. All the sources are merged together to create one set of known directors. Once the directors are known, and advertisements from the service are sent to all directors directly from the service. Additionally, the directors will forward the ads they receive from a service to all other known directors. This prevents a director from missing updates just because the service hadn't discovered it yet. The directors will compare the generation and instance IDs of the incoming ads to remove duplicates and ensure they only keep the latest copy of a given service description. A simple unit test is included.
031b8b8
to
908bcfc
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cache
Issue relating to the cache component
director
Issue relating to the director component
enhancement
New feature or request
origin
Issue relating to the origin component
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.
Add preliminary support for having multiple directors in a single federation.
This PR allows the services in a federation to calculate all the available directors in a federation and advertise to all available ones. If the director knows of more directors than the service, it will also forward received ads to the director.
This way, all available directors - whether configured statically or discovered through advertisement - will eventually receive all ads. It's left as an exercise for the operations to figure out how to allow fallback of the default URLs to a different director if one goes down.