-
Notifications
You must be signed in to change notification settings - Fork 67
Implemented methods to compute waiting time at the replicas #171
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
Conversation
This file contains hidden or 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
parameter to complete the integration
meling
reviewed
Jan 20, 2025
meling
reviewed
Jan 20, 2025
meling
reviewed
Jan 20, 2025
This just moves the latency methods out of the main tree.go file and into treelatency.go to keep them separate. Similarly, this also renames the corresponding test file to treelatency_test.go.
meling
reviewed
Jan 21, 2025
meling
reviewed
Jan 21, 2025
meling
reviewed
Jan 21, 2025
It is best to keep the enum in the same place as the selection function. I've updated the test, but not the kauri impl.
This probably better reflects its intended meaning.
This just renames things to be more consistent and trying to reflect better the idea each entity represents.
Just reorganizing the layout of the file to keep TreeConfig away from the Options methods.
This avoids keeping treeConfig in the struct; instead we keep the actual treeWaitDelta and treeDelayType in the struct. We get these from the k.opts.TreeConfig() in the initializationConfiguration() method.
We don't create a lot of trees and passing it as a value should be fine.
Co-authored-by: Leander Jehl <leander.jehl@uis.no>
Co-authored-by: Leander Jehl <leander.jehl@uis.no>
Co-authored-by: Leander Jehl <leander.jehl@uis.no>
If you need a different tree, you should create a new one.
The treeLeader module used the TreePos slice to pick the leader based on the 0 index; this is not ideal, but I also wanted to get rid of the TreeConfig struct, so this serves dual purpose.
This adds a waitTime field to the Tree struct, and two setters to set it based on different computations; the following two are supported: SetAggregationWaitTime and SetTreeHeightWaitTime. Thus, we can now read it back out in the Kauri module without providing the latency matrix, delta and delay type.
This refactors several aspects to prepare for supporting configurable
DelayTypes for trees; we currently support:
// DelayType is the type of delay to use for the wait time.
oneof DelayType {
// AggregationTime computes the wait time based on the latency of links in the tree.
bool AggregationTime = 26;
// TreeHeightTime computes the wait time only based on the height of the tree.
bool TreeHeightTime = 27;
}
This refactoring involves:
- Removed func (srv *Server) LatencyMatrix() latency.Matrix
since we no longer compute the wait time in the Kauri module.
- Create the tree and initialize the wait time based on the
configured delay type (see above); we currently set the default
to TreeHeightTime. This is done in worker.go.
- Added two helpers: func (x *ReplicaOpts) SetAggregationWaitTime()
and func (x *ReplicaOpts) SetTreeHeightWaitTime()
- Kauri now only needs to store the tree.Tree in its struct; I've
removed the treeWaitDelta and treeDelayType. This is since we
create the tree in worker.go, we only need to get the tree from
the opts, instead of the TreeConfig.
- Similarly, in the Kauri module we only need to read the wait time
directly from the tree instance, using the WaitTime() method.
- Removed TreeConfig struct and associated methods from modules/options.go
since we no longer use those to create a tree and compute the
wait time in the Kauri module.
meling
approved these changes
Jan 25, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.